/* Royal Salary Tracker - Warm Culinary Aesthetic */

:root {
  /* Warm Culinary Palette */
  --bg-deep: #FDFBF7; /* Warm cream */
  --bg-panel: #FFFFFF; /* Crisp white for cards */
  --border-light: #EAE6DF;
  --border-highlight: #D8D2C9;
  
  --text-primary: #2B2624; /* Deep Charcoal */
  --text-secondary: #6E6763; /* Muted Ink */
  --text-muted: #948C88;
  
  --accent-primary: #D96A4B; /* Soft Terracotta */
  --accent-hover: #BF5335;
  --accent-secondary: #E3B482; /* Warm Sand */
  
  /* Status Colors (Soft & Organic) */
  --status-present: #5B8A64; /* Sage Green */
  --status-half: #D69E40; /* Golden Mustard */
  --status-absent: #C05850; /* Muted Brick */
  
  /* Typography */
  --font-sans: 'Inter', 'Segoe UI', 'Roboto', Helvetica, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Consolas', 'Courier New', monospace;
  
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(at 10% 20%, rgba(217, 106, 75, 0.12) 0px, transparent 50%),
    radial-gradient(at 90% 80%, rgba(227, 180, 130, 0.18) 0px, transparent 50%),
    radial-gradient(at 80% 10%, rgba(91, 138, 100, 0.08) 0px, transparent 50%),
    radial-gradient(at 20% 90%, rgba(217, 106, 75, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Typography Classes */
.font-display { font-family: var(--font-sans); font-weight: 700; letter-spacing: -0.01em; }
.font-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent-primary); }

/* Layout */
.app-header {
  background-color: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
  padding: 1rem 2rem 0 2rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 30px rgba(43, 38, 36, 0.03);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  width: 92%;
  margin: 0 auto 1rem auto;
}

.header-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.header-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.nav-tabs {
  max-width: 1400px;
  width: 92%;
  margin: 0 auto;
  display: flex;
  gap: 2.5rem;
}

.nav-tab {
  padding: 0.75rem 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: var(--text-primary);
}

.nav-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

.main-content {
  max-width: 1400px;
  width: 92%;
  margin: 0 auto;
  padding: 0 1rem 4rem 1rem;
}

/* Panels (Cards) */
.panel {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(43, 38, 36, 0.06), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  margin-bottom: 1rem;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s ease;
}

.panel:hover {
  box-shadow: 0 12px 48px rgba(43, 38, 36, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.65);
}

.panel-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  background: #FFFFFF;
}

.panel-body {
  padding: 1rem 1.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid var(--border-highlight);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: #FFFFFF;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(43, 38, 36, 0.05);
}

.btn:hover:not(:disabled) {
  background: #FDFBF7;
  border-color: #C2BBB3;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(43, 38, 36, 0.06);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
  background: #F2ECE3;
  box-shadow: none;
}

.btn-primary {
  background: var(--accent-primary);
  color: #fff;
  border: 1px solid var(--accent-primary);
  box-shadow: 0 4px 12px rgba(217, 106, 75, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 6px 16px rgba(217, 106, 75, 0.3);
}

.btn-outline-rust {
  border: 1px solid var(--status-absent);
  color: var(--status-absent);
  background: transparent;
  box-shadow: none;
}
.btn-outline-rust:hover {
  background: #FFF5F4;
  border-color: var(--status-absent);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Forms & Inputs */
.form-control {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  background: #FDFBF7; /* Slightly tinted input background */
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
}

.form-control:focus {
  border-color: var(--accent-primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(217, 106, 75, 0.1);
}

.form-control::placeholder {
  color: #A39B97;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  display: block;
}

/* Ledger / Row Lists */
.ledger-list {
  display: flex;
  flex-direction: column;
}

.ledger-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s ease;
}
.ledger-row:last-child {
  border-bottom: none;
}
.ledger-row:hover {
  background: #FDFBF7;
}

.employee-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.employee-name {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.employee-rate {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Standard Flat Attendance Stamp */
.stamp-container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.stamp-label {
  font-size: 0.85rem;
  font-weight: 600;
  width: 75px;
  text-align: right;
  color: var(--text-secondary);
}

.attendance-stamp {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  background: #F2ECE3;
  border: 1px solid var(--border-highlight);
  color: var(--text-secondary);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.attendance-stamp:hover {
  background: #E8E3DA;
  transform: scale(1.05);
}

.attendance-stamp[data-status="present"] {
  border-color: var(--status-present);
  background: #F0F6F1;
  color: var(--status-present);
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(91, 138, 100, 0.15);
}
.attendance-stamp[data-status="half_day"] {
  border-color: var(--status-half);
  background: #FDF8F0;
  color: var(--status-half);
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(214, 158, 64, 0.15);
}
.attendance-stamp[data-status="absent"] {
  border-color: var(--status-absent);
  background: #FEF3F2;
  color: var(--status-absent);
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(192, 88, 80, 0.15);
}

/* Legend */
.legend {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.legend-dot.present { background: var(--status-present); }
.legend-dot.half { background: var(--status-half); }
.legend-dot.absent { background: var(--status-absent); }

/* Report Banner */
.report-banner {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  padding: 1.75rem 2rem;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 8px 32px rgba(43, 38, 36, 0.06), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.banner-meta {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.banner-total {
  text-align: right;
}

/* Density Table */
.density-table {
  width: 100%;
  border-collapse: collapse;
}
.density-table th, .density-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}
.density-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 700;
  background: #FDFBF7;
  text-align: left;
}
.density-table th:not(:first-child),
.density-table td:not(:first-child) {
  text-align: right;
  font-family: var(--font-mono);
}
.density-table tbody tr {
  transition: background 0.15s ease;
}
.density-table tbody tr:hover td {
  background: #FDFBF7;
}
.density-table td:first-child {
  font-weight: 600;
}

/* Empty & Loading States */
.empty-state {
  border: 2px dashed var(--border-highlight);
  background: #FDFBF7;
  padding: 4rem 2rem;
  text-align: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Toasts */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 9999;
}
.toast {
  background: #FFFFFF;
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(43, 38, 36, 0.1);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--accent-primary);
  animation: slideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.success { border-left-color: var(--status-present); }
.toast.error { border-left-color: var(--status-absent); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Bento Box Dashboard Utilities */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.bento-col-2 {
  grid-column: span 2;
}

.bento-col-full {
  grid-column: span 4;
}

.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1.5rem 1rem;
}

/* Colored Shadows for Glassmorphism - Vibrant */
.shadow-accent { box-shadow: 0 10px 40px rgba(234, 88, 12, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.5) !important; }
.shadow-accent:hover { box-shadow: 0 15px 50px rgba(234, 88, 12, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.8) !important; transform: translateY(-4px); }

.shadow-present { box-shadow: 0 10px 40px rgba(34, 197, 94, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.5) !important; }
.shadow-present:hover { box-shadow: 0 15px 50px rgba(34, 197, 94, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.8) !important; transform: translateY(-4px); }

.shadow-half { box-shadow: 0 10px 40px rgba(234, 179, 8, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.5) !important; }
.shadow-half:hover { box-shadow: 0 15px 50px rgba(234, 179, 8, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.8) !important; transform: translateY(-4px); }

.shadow-absent { box-shadow: 0 10px 40px rgba(239, 68, 68, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.5) !important; }
.shadow-absent:hover { box-shadow: 0 15px 50px rgba(239, 68, 68, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.8) !important; transform: translateY(-4px); }

.stat-icon {
  margin-bottom: 0.5rem;
  padding: 0.75rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #FDFBF7;
  color: var(--text-secondary);
}

.stat-value {
  font-family: var(--font-sans);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(43, 38, 36, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-content {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 16px 48px rgba(43, 38, 36, 0.15);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.active .modal-content {
  transform: translateY(0);
}
.modal-content h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  color: var(--text-primary);
}
.modal-content p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

/* ========================================= */
/* Mobile Responsive Adjustments            */
/* ========================================= */

@media (max-width: 768px) {
  /* Header */
  .header-top {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  #mobile-menu-btn {
    display: flex !important;
  }

  .nav-tabs {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding-bottom: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-light);
  }
  
  .nav-tabs.mobile-active {
    display: flex !important;
  }

  .nav-tab {
    white-space: nowrap;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border-left: 4px solid transparent;
    border-bottom: none;
  }
  
  .nav-tab:hover {
    background: #FDFBF7;
  }
  
  .nav-tab.active {
    border-bottom: none;
    border-left-color: var(--accent-primary);
    background: #FFFFFF;
    font-weight: 700;
  }

  /* Bento Grid */
  .bento-grid {
    grid-template-columns: 1fr;
  }
  
  .bento-col-2, .bento-col-full {
    grid-column: span 1;
  }

  /* Ledger Rows */
  .ledger-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .ledger-row > div:nth-child(2) {
    width: 100%;
    justify-content: space-between;
  }

  /* Attendance Stamps */
  .stamp-container {
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
    margin-top: 0.5rem;
  }
  
  .stamp-label {
    display: none;
  }

  /* Tables */
  .density-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  /* Forms */
  #employee-form {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  
  #employee-form > div {
    flex: none !important;
    width: 100% !important;
  }
  
  #employee-form button {
    width: 100%;
  }

  /* Report Banner */
  .report-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .banner-total {
    text-align: left;
  }
}
