/* LAMESA Modern CSS Design System - SDO Batanes */
:root {
  --primary: #0f4c3a;
  --primary-hover: #0a382b;
  --primary-light: #e8f5f1;
  --primary-border: #9ad2c1;
  --accent: #d97706;
  --accent-light: #fef3c7;
  --accent-dark: #b45309;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-focus: #0f4c3a;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(15, 76, 58, 0.08);
  --shadow-lg: 0 20px 40px -10px rgba(15, 76, 58, 0.15);
  --shadow-glow: 0 0 20px rgba(15, 76, 58, 0.2);
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

/* Header & Navbar */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.brand-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary) 0%, #15803d 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 4px 10px rgba(15, 76, 58, 0.25);
}

.brand-text h1 {
  font-size: 1.2rem;
  line-height: 1.1;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-text p {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-link {
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-link.active {
  color: white;
  background: var(--primary);
  box-shadow: 0 4px 12px rgba(15, 76, 58, 0.2);
}

.user-nav-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: #f1f5f9;
  border-radius: 9999px;
  border: 1px solid var(--border);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.user-meta {
  line-height: 1.15;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.user-role-tag {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Layout container */
.app-container {
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  outline: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 10px rgba(15, 76, 58, 0.2);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(15, 76, 58, 0.3);
}

.btn-accent {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.25);
}

.btn-accent:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: white;
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

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

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

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: 12px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Forms */
.form-group {
  margin-bottom: 18px;
  position: relative;
}

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

.form-label .required {
  color: var(--danger);
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text-main);
  background: white;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 76, 58, 0.12);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Autocomplete list */
.autocomplete-container {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 220px;
  overflow-y: auto;
  margin-top: 4px;
  display: none;
}

.autocomplete-dropdown.open {
  display: block;
}

.autocomplete-item {
  padding: 10px 14px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s;
  color: var(--text-main);
  border-bottom: 1px solid #f1f5f9;
}

.autocomplete-item:hover, .autocomplete-item.selected {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* Callouts / Notices */
.notice-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 0.875rem;
  color: #1e40af;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.notice-box.warning {
  background: var(--accent-light);
  border-color: #fde68a;
  color: #92400e;
}

/* Planning Wizard Elements */
.wizard-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
  background: white;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.autosave-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 6px 14px;
  border-radius: 9999px;
}

.autosave-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.autosave-dot.saving {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

/* Meal Category Selector Pills */
.category-pills-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.category-pill-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: white;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.category-pill-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.category-pill-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(15, 76, 58, 0.1);
}

.category-pill-btn.special {
  border-style: dashed;
}

/* Date tabs */
.date-tabs-container {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.date-tab {
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -6px;
  transition: var(--transition);
  white-space: nowrap;
}

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

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

/* Meal Section inside Day */
.meal-block {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.meal-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

.meal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.meal-type-badge {
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--primary);
  color: white;
}

.meal-cost-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-dark);
  background: var(--accent-light);
  padding: 4px 10px;
  border-radius: 6px;
}

.dishes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.dish-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.dish-card:hover {
  border-color: var(--primary-border);
  box-shadow: 0 4px 12px rgba(15, 76, 58, 0.08);
}

.dish-role-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.dish-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.dish-ivatan-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  color: var(--accent-dark);
  font-weight: 700;
  margin-top: 4px;
}

.dish-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-overlay.open .modal-box {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Purchase Request Preview Card */
.pr-preview-sheet {
  background: white;
  border: 2px solid #000;
  padding: 32px;
  font-family: Arial, sans-serif;
  color: black;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
}

.pr-appendix {
  text-align: right;
  font-weight: bold;
  font-size: 13px;
  font-style: italic;
  margin-bottom: 8px;
}

.pr-header {
  text-align: center;
  margin-bottom: 20px;
}

.pr-header h2 {
  font-size: 16px;
  font-weight: bold;
}

.pr-header h3 {
  font-size: 14px;
  font-weight: normal;
  margin-bottom: 4px;
}

.pr-header h1 {
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 1px;
}

.pr-info-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  font-size: 12px;
}

.pr-info-table td {
  padding: 4px 6px;
  border: 1px solid black;
}

.pr-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 12px;
}

.pr-items-table th, .pr-items-table td {
  border: 1px solid black;
  padding: 6px 8px;
  vertical-align: top;
}

.pr-items-table th {
  background: #f8fafc;
  text-align: center;
  font-weight: bold;
}

.pr-items-table .text-center { text-align: center; }
.pr-items-table .text-right { text-align: right; }
.pr-items-table .text-bold { font-weight: bold; }

.pr-signatories-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 16px;
}

.pr-signatories-table td {
  border: 1px solid black;
  padding: 6px 10px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #0f172a;
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  background: var(--primary);
  border-left: 4px solid #22c55e;
}

.toast.error {
  background: #991b1b;
  border-left: 4px solid #ef4444;
}

/* Responsive */
@media (max-width: 900px) {
  .navbar { flex-direction: column; gap: 14px; }
  .app-container { padding: 14px; }
  .stats-grid { grid-template-columns: 1fr; }
}
