:root {
  --primary: #FFCE44; /* Pineapple Yellow */
  --primary-rgb: 255, 206, 68;
  --primary-hover: #F9A825;
  --secondary: #82C4E3; /* Sky Blue */
  --bg: #0B243B; /* Dark Tropical Blue */
  --card-bg: rgba(15, 48, 87, 0.4);
  --glass: rgba(255, 255, 255, 0.05);
  --border: rgba(130, 196, 227, 0.2); /* Soft blue border */
  --text: #F8FAFC;
  --text-muted: #94A3B8;
  --success: #799D3C; /* Palm Green */
  --danger: #E54134; /* Hibiscus Red */
  --surface: #DFB77C; /* Sandy Beige */
}

/* Text Logo Styles: Custom branded logo using fonts and colors */
.text-logo {
  font-weight: 800;
  letter-spacing: -0.05em;
  display: inline-block;
  user-select: none; /* Prevents text selection for a more UI-like feel */
}
/* Brand colors: y=Yellow, Inv=White, Deli=Yellow */
.text-logo .y { color: var(--primary); }
.text-logo .inv { color: var(--text); }
.text-logo .deli { color: var(--primary); }

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(130, 196, 227, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(255, 206, 68, 0.1) 0%, transparent 40%);
  overflow-x: hidden;
  padding: 1rem;
}

#app {
  width: 100%;
  max-width: 100%;
  padding: 0;
  transition: all 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  body { padding: 1rem 0.5rem; }
  
  .header {
    flex-direction: column;
    align-items: center !important;
    text-align: center;
    gap: 1.5rem;
    padding: 1.5rem 1rem !important;
  }
  
  .header-info {
    flex-direction: column;
    align-items: center !important;
    gap: 1.5rem !important;
    width: 100%;
  }

  .header-info > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: center !important;
    gap: 0.5rem !important;
    width: 100%;
  }

  .text-logo { 
    font-size: 2.5rem !important; 
    margin-right: 0 !important;
    margin-bottom: 0.5rem;
  }
  
  .summary-grid { 
    grid-template-columns: 1fr; 
    gap: 1rem;
  }

  .summary-card {
    padding: 1.25rem !important;
  }

  .glass-card {
    padding: 1.5rem !important;
    border-radius: 1rem !important;
  }

  .date-status-bar {
    flex-direction: column;
    gap: 0.5rem !important;
    align-items: center !important;
    padding: 1rem !important;
    text-align: center;
  }

  .date-status-bar .separator { display: none; }

  .controls { 
    flex-direction: column;
    gap: 1.5rem !important;
    width: 100%;
    align-items: center !important;
  }

  .input-group {
    width: 100%;
    justify-content: center !important;
  }

  .btn { 
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    flex: 1;
    min-width: 100px;
    justify-content: center;
  }

  #download-pdf, #download-excel {
    min-width: 48px;
    flex: 0;
  }

  .table-container {
    margin: 0;
    border-radius: 0.75rem;
  }

  table {
    display: block;
    overflow-x: auto;
  }
}

/* Glass Card */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
}

/* Login Screen */
.login-container {
  max-width: 400px;
  margin: 0 auto;
  text-align: center;
}

.login-container h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-container p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.pin-inputs {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.pin-inputs input {
  width: 3.5rem;
  height: 4rem;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  text-align: center;
  font-size: 1.5rem;
  color: var(--text);
  font-weight: bold;
  transition: all 0.2s;
}

.pin-inputs input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
  transform: translateY(-2px);
}

/* Dashboard */
.dashboard {
  display: none; /* Shown after login */
  animation: fadeIn 0.5s ease-out;
  width: 100%;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

.header-info h2 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.header-info p {
  color: var(--text-muted);
}

.controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Form Styles */
.input-group {
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.styled-input {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text);
  width: 100%;
  transition: all 0.2s;
}

.styled-input:focus {
  outline: none;
  border-color: var(--primary);
}

select.styled-input option {
  background-color: #0F3057; /* Matches --card-bg without transparency */
  color: var(--text);
}

/* Button Styles */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--glass);
}

/* Table Styles */
.table-container {
  overflow-x: auto;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.3);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 1rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.profit-positive { color: var(--success); }
.profit-negative { color: var(--danger); }

tr.subtotal-row td {
  background: rgba(var(--primary-rgb), 0.1);
  font-weight: bold;
  border-top: 2px solid var(--border);
  color: var(--primary);
}

.group-header {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 700;
  color: var(--secondary);
}

/* Upload Area */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: 1rem;
  padding: 3rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-area:hover, .upload-area.active {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.05);
}

.upload-icon-container {
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.upload-area:hover .upload-icon-container {
  transform: translateY(-8px) scale(1.1);
}

/* Summary Cards */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
  width: 100%;
}

.summary-card {
  background: var(--glass);
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.summary-card h3 {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.summary-card .value {
  font-size: 1.5rem;
  font-weight: bold;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Calendar Styles */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
}

.calendar-day-head {
  text-align: center;
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--secondary);
  padding: 0.5rem 0;
  text-transform: uppercase;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.calendar-day:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.calendar-day.empty {
  background: transparent;
  border: none;
  cursor: default;
}

.calendar-day.has-data {
  font-weight: bold;
  color: var(--primary);
}

.calendar-day.has-data::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 5px;
  height: 5px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 5px var(--primary);
}

.calendar-day.selected {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
}

.calendar-day.selected::after {
  background: #000;
}
