/* ================================================
   GMA Stock — Main Stylesheet
   Colours: #8A8635 olive, #AA2B1D dark-red,
            #CC561E orange, #F3CF7A gold
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;700&family=Nunito:wght@400;500;600;700&display=swap');

/* ── CSS Variables ─────────────────────────────── */
:root {
  --olive:        #8A8635;
  --olive-dark:   #6b6828;
  --olive-light:  #b5b04a;
  --red:          #AA2B1D;
  --red-dark:     #8a1f14;
  --orange:       #CC561E;
  --orange-dark:  #a8431a;
  --gold:         #F3CF7A;
  --gold-light:   #fae4a7;
  --gold-dark:    #d4a840;
  --cream:        #FFF8EC;
  --cream-mid:    #F5EDD8;
  --dark:         #1A1A08;
  --dark-card:    #2a2a12;
  --text:         #2D2D10;
  --text-muted:   #7a7a4a;
  --white:        #ffffff;
  --border:       rgba(138,134,53,0.25);
  --shadow:       0 4px 20px rgba(26,26,8,0.12);
  --shadow-lg:    0 8px 40px rgba(26,26,8,0.18);

  --header-h-desktop: 70px;
  --header-h-mobile:  60px;
  --bottom-nav-h:     65px;
  --radius:           12px;
  --radius-sm:        8px;

  /* Alert colours */
  --alert-red:    #AA2B1D;
  --alert-yellow: #CC8800;
  --alert-red-bg: #ffe8e6;
  --alert-yel-bg: #fff8db;
}

/* ── Reset & Base ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: var(--header-h-desktop);
  padding-bottom: 40px;
}

@media (max-width: 991px) {
  body {
    padding-top: var(--header-h-mobile);
    padding-bottom: calc(var(--bottom-nav-h) + 20px);
  }
}

h1, h2, h3, h4 { font-family: 'Playfair Display', serif; }

a { text-decoration: none; color: inherit; }

/* ── Scrollbar ─────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--cream-mid); }
::-webkit-scrollbar-thumb { background: var(--olive-light); border-radius: 3px; }

/* ════════════════════════════════════════════════
   DESKTOP HEADER
   ════════════════════════════════════════════════ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h-desktop);
  background: var(--dark);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 2px solid var(--olive);
  gap: 16px;
}

/* Logo */
.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 240px;
  width: 240px;
  overflow: hidden;
}
.header-logo .logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--olive), var(--gold-dark));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.header-logo .logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.2;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-logo .logo-sub {
  font-size: 0.65rem;
  color: var(--olive-light);
  font-family: 'Nunito', sans-serif;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Desktop Nav (center) */
.desktop-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-width: 0;
}

.desktop-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  position: relative;
  z-index: 1;
  width: max-content;
}

.desktop-nav .nav-links li a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 122px;
  flex: 0 0 122px;
  padding: 8px 16px;
  border-radius: 18px;
  text-align: center;
  color: #ccc;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  position: relative;
  z-index: 1;
  transition: color 0.2s;
}

.desktop-nav .nav-links li a:hover { 
  color: var(--white); 
    height: 36px;
  background: var(--olive);
  border-radius: 18px;
  transition: left 0.25s cubic-bezier(.4,0,.2,1),
              width 0.25s cubic-bezier(.4,0,.2,1),
              opacity 0.2s;
}

.desktop-nav .nav-links li a.active {
  color: var(--white);
}
.desktop-nav .nav-links li a.active::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background: var(--olive-dark);
  z-index: -1;
}

/* Profile button */
.header-profile {
  flex: 0 0 220px;
  width: 220px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  overflow: hidden;
}

.profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(243,207,122,0.12);
  border: 1px solid var(--gold-dark);
  border-radius: 30px;
  padding: 5px 14px 5px 5px;
  cursor: pointer;
  transition: background 0.2s;
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
}
.profile-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-btn:hover { background: rgba(243,207,122,0.22); }
.profile-btn img, .profile-btn .profile-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--olive);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: white;
  flex-shrink: 0;
}

/* Mobile header — shown on mobile only */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h-mobile);
  background: var(--dark);
  z-index: 1000;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 2px solid var(--olive);
}
.mobile-header .logo-text { font-size: 1rem; width: 200px; }
.mobile-header .profile-btn { padding: 4px 10px 4px 4px; font-size: 0.8rem; }
.mobile-header .profile-btn img,
.mobile-header .profile-btn .profile-avatar { width: 28px; height: 28px; font-size: 12px; }

@media (max-width: 991px) {
  .site-header { display: none !important; }
  .mobile-header { display: flex !important; }
}

/* ════════════════════════════════════════════════
   DESKTOP FOOTER
   ════════════════════════════════════════════════ */
.site-footer {
  background: var(--dark-card);
  border-top: 2px solid var(--olive);
  padding: 20px 24px;
  margin-top: 40px;
  flex-shrink: 0;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: center;
  list-style: none;
}
.footer-links a {
  color: var(--olive-light);
  font-size: 0.85rem;
  display: flex; align-items: center; gap: 5px;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--gold); }
.footer-copy {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 10px;
}

@media (max-width: 991px) {
  .site-footer .footer-links li.desktop-only { display: none; }
}

/* ════════════════════════════════════════════════
   MOBILE BOTTOM NAV
   ════════════════════════════════════════════════ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: var(--dark);
  border-top: 2px solid var(--olive);
  z-index: 1000;
  align-items: center;
  justify-content: space-around;
  padding: 0 10px;
}

.bottom-nav .bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  color: #888;
  transition: color 0.2s;
  padding: 8px 0;
}

.bottom-nav .bn-item .bn-icon {
  font-size: 1.3rem;
  line-height: 1;
  transition: transform 0.2s;
}
.bottom-nav .bn-item .bn-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Active state — circle */
.bottom-nav .bn-item.active {
  color: var(--white);
}
.bottom-nav .bn-item.active .bn-icon {
  background: var(--olive);
  color: var(--white);
  border-radius: 50%;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 2px 12px rgba(138,134,53,0.5);
  transform: translateY(-6px);
}
.bottom-nav .bn-item.active .bn-label { color: var(--gold); }

/* Home item (middle) - slightly larger */
.bottom-nav .bn-item.home-item .bn-icon { font-size: 1.5rem; }
.bottom-nav .bn-item.home-item.active .bn-icon {
  background: linear-gradient(135deg, var(--orange), var(--red));
  width: 50px; height: 50px;
  font-size: 1.3rem;
  transform: translateY(-10px);
  box-shadow: 0 4px 20px rgba(204,86,30,0.5);
}

@media (max-width: 991px) {
  .bottom-nav { display: flex !important; }
}

/* ════════════════════════════════════════════════
   PAGE WRAPPER / CONTAINER
   ════════════════════════════════════════════════ */
.page-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
  flex: 1 0 auto;
}

@media (max-width: 575px) { .page-wrapper { padding: 16px 12px; } }

.page-title {
  font-size: 1.8rem;
  color: var(--text);
  margin-bottom: 6px;
}
.page-title span { color: var(--olive); }

/* ════════════════════════════════════════════════
   CARDS
   ════════════════════════════════════════════════ */
.card-gma {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-gma .card-header-gma {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-card) 100%);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--olive);
}
.card-gma .card-header-gma h5 {
  color: var(--gold);
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  margin: 0;
  display: flex; align-items: center; gap: 8px;
}
.card-gma .card-body-gma { padding: 18px; }

/* ════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════ */
.btn-gma {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-gma:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary-gma {
  background: linear-gradient(135deg, var(--orange), var(--red));
  color: white;
  box-shadow: 0 3px 12px rgba(204,86,30,0.35);
}
.btn-primary-gma:hover { 
  background: linear-gradient(135deg, var(--orange-dark), var(--red-dark));
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(204,86,30,0.45);
}

.btn-olive-gma {
  background: var(--olive);
  color: white;
  box-shadow: 0 3px 12px rgba(138,134,53,0.35);
}
.btn-olive-gma:hover {
  background: var(--olive-dark);
  transform: translateY(-1px);
}

.btn-gold-gma {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--dark);
  box-shadow: 0 3px 12px rgba(243,207,122,0.35);
}
.btn-gold-gma:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}

.btn-danger-gma {
  background: var(--red);
  color: white;
  box-shadow: 0 3px 12px rgba(170,43,29,0.35);
}
.btn-danger-gma:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
}

.btn-outline-gma {
  background: transparent;
  border: 2px solid var(--olive);
  color: var(--olive);
}
.btn-outline-gma:hover {
  background: var(--olive);
  color: white;
}

.btn-sm-gma { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg-gma { padding: 12px 28px; font-size: 1rem; }
.btn-icon-gma { padding: 8px 10px; }
.btn-block-gma { width: 100%; justify-content: center; }

/* ════════════════════════════════════════════════
   FORM ELEMENTS
   ════════════════════════════════════════════════ */
.form-gma label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 5px;
}
.form-gma .input-gma,
.form-gma select,
.input-gma {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-gma .input-gma:focus,
.input-gma:focus {
  border-color: var(--olive);
  box-shadow: 0 0 0 3px rgba(138,134,53,0.15);
}
.form-gma .form-group { margin-bottom: 14px; }

.password-field-wrap {
  position: relative;
}

.password-field-wrap .password-input {
  padding-right: 72px;
}

.password-toggle-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--olive);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 6px;
}

.password-toggle-btn:hover {
  opacity: 0.8;
}

/* Checkbox toggle */
.check-gma {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.check-gma input[type="checkbox"] { display: none; }
.check-gma .check-box {
  width: 20px; height: 20px;
  border: 2px solid var(--olive);
  border-radius: 5px;
  background: white;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.check-gma input:checked + .check-box {
  background: var(--olive);
  border-color: var(--olive);
}
.check-gma input:checked + .check-box::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: 900;
}

/* ════════════════════════════════════════════════
   TABLE
   ════════════════════════════════════════════════ */
.table-gma-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.table-gma {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.table-gma thead tr {
  background: var(--dark);
  color: var(--gold);
}
.table-gma thead th {
  padding: 12px 14px;
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid var(--olive);
}
.table-gma thead th.sortable {
  cursor: pointer;
  user-select: none;
}
.table-gma thead th.sortable:hover { color: var(--gold-light); }
.table-gma thead th .sort-icon { font-size: 0.7rem; margin-left: 4px; }

.table-gma tbody tr {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.table-gma tbody tr:nth-child(even) { background: var(--cream); }
.table-gma tbody tr:hover { background: rgba(138,134,53,0.07); }

.table-gma tbody td {
  padding: 10px 14px;
  vertical-align: middle;
}

/* Low stock row colours */
.table-gma tbody tr.row-red   { background: var(--alert-red-bg) !important; }
.table-gma tbody tr.row-yellow { background: var(--alert-yel-bg) !important; }

/* Inline editable cell */
.editable-cell {
  padding: 4px 8px;
  border-radius: 6px;
  border: 2px solid transparent;
  background: transparent;
  font-family: 'Nunito', sans-serif;
  font-size: 0.875rem;
  color: var(--text);
  width: 100%;
  min-width: 80px;
  transition: border-color 0.2s, background 0.2s;
}
.editable-cell:focus {
  outline: none;
  border-color: var(--olive);
  background: white;
  box-shadow: 0 0 0 3px rgba(138,134,53,0.15);
}

/* ════════════════════════════════════════════════
   ALERT BADGE (low stock)
   ════════════════════════════════════════════════ */
.alert-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.alert-item.red   { background: var(--alert-red-bg); color: var(--alert-red); border-left: 4px solid var(--alert-red); }
.alert-item.yellow { background: var(--alert-yel-bg); color: var(--alert-yellow); border-left: 4px solid var(--alert-yellow); }
.alert-item .ai-qty {
  margin-left: auto;
  font-size: 1rem;
  font-weight: 800;
}

/* ════════════════════════════════════════════════
   LOGIN MODAL
   ════════════════════════════════════════════════ */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,26,8,0.75);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.login-overlay.show { opacity: 1; visibility: visible; }

.login-box {
  background: var(--white);
  border-radius: 16px;
  padding: 36px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--olive);
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s;
}
.login-overlay.show .login-box { transform: translateY(0); }

.login-box .close-btn {
  position: absolute;
  top: 14px; right: 14px;
  background: var(--cream-mid);
  border: none;
  border-radius: 50%;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: background 0.2s;
}
.login-box .close-btn:hover { background: var(--border); color: var(--text); }

.login-logo {
  text-align: center;
  margin-bottom: 24px;
}
.login-logo .logo-circle {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--olive), var(--gold-dark));
  border-radius: 16px;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 30px;
  margin-bottom: 10px;
}
.login-logo h3 {
  font-family: 'Playfair Display', serif;
  color: var(--text);
  font-size: 1.4rem;
}
.login-logo p { color: var(--text-muted); font-size: 0.85rem; }

.login-divider {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 16px 0;
  position: relative;
}
.login-divider::before, .login-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--border);
}
.login-divider::before { left: 0; }
.login-divider::after  { right: 0; }

/* ════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
@media (max-width: 991px) { .toast-container { bottom: calc(var(--bottom-nav-h) + 10px); } }

.toast-msg {
  background: var(--dark-card);
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  border-left: 4px solid var(--olive);
  box-shadow: var(--shadow);
  pointer-events: all;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  display: flex; align-items: center; gap: 8px;
  min-width: 200px; max-width: 320px;
}
.toast-msg.success { border-color: var(--olive); }
.toast-msg.error   { border-color: var(--red); }
.toast-msg.warning { border-color: var(--gold-dark); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(20px); }
}

/* ════════════════════════════════════════════════
   CONFIRM DIALOG
   ════════════════════════════════════════════════ */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,26,8,0.6);
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.confirm-overlay.show { opacity: 1; visibility: visible; }
.confirm-box {
  background: white;
  border-radius: 14px;
  padding: 28px 24px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  border-top: 4px solid var(--red);
  box-shadow: var(--shadow-lg);
}
.confirm-box h4 { font-family: 'Playfair Display', serif; margin-bottom: 10px; }
.confirm-box p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }
.confirm-btns { display: flex; gap: 10px; justify-content: center; }

/* ════════════════════════════════════════════════
   BADGE
   ════════════════════════════════════════════════ */
.badge-gma {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-credit  { background: rgba(138,134,53,0.15); color: var(--olive-dark); }
.badge-debit   { background: rgba(170,43,29,0.15);  color: var(--red-dark); }
.badge-red     { background: var(--alert-red-bg); color: var(--alert-red); }
.badge-yellow  { background: var(--alert-yel-bg); color: var(--alert-yellow); }

/* ════════════════════════════════════════════════
   RECEIPT CARD
   ════════════════════════════════════════════════ */
.receipt-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.receipt-card:hover { box-shadow: var(--shadow-lg); }
.receipt-card .rc-header {
  background: var(--dark);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 2px solid var(--olive);
}
.receipt-card .rc-title {
  color: var(--gold);
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
}
.receipt-card .rc-meta { color: var(--text-muted); font-size: 0.8rem; }
.receipt-card .rc-body { padding: 14px 16px; }
.receipt-card .rc-items { list-style: none; }
.receipt-card .rc-items li {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.875rem;
}
.receipt-card .rc-note {
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--cream);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ════════════════════════════════════════════════
   FIXED FILTER BAR
   ════════════════════════════════════════════════ */
.filter-bar-fixed {
  position: sticky;
  top: var(--header-h-desktop);
  background: var(--cream-mid);
  z-index: 500;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
@media (max-width: 991px) { 
  .filter-bar-fixed { top: var(--header-h-mobile); padding: 10px 12px; }
}

.filter-bar-fixed select.filter-select {
  padding: 7px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  background: white;
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}
.filter-bar-fixed select.filter-select:focus { border-color: var(--olive); }

/* Date filter dropdown */
.date-filter-wrap { position: relative; }
.date-filter-btn {
  padding: 7px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: white;
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  color: var(--text);
  transition: border-color 0.2s;
}
.date-filter-btn:hover { border-color: var(--olive); }
.date-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: white;
  border: 2px solid var(--olive);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow);
  width: 250px;
  z-index: 600;
  display: none;
}
.date-panel.open { display: block; }
.date-panel label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}
.date-panel input[type="date"] {
  width: 100%;
  padding: 7px 10px;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-family: 'Nunito', sans-serif;
  outline: none;
  margin-bottom: 10px;
}
.date-panel input[type="date"]:focus { border-color: var(--olive); }

/* ════════════════════════════════════════════════
   ITEM FORM ROW (multi-add)
   ════════════════════════════════════════════════ */
.item-row {
  display: grid;
  grid-template-columns: 1fr 100px auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
  background: var(--cream);
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
@media (max-width: 480px) {
  .item-row { grid-template-columns: 1fr 80px auto; gap: 6px; }
}

.item-row .remove-row-btn {
  background: var(--red);
  border: none;
  color: white;
  border-radius: 8px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
  flex-shrink: 0;
}
.item-row .remove-row-btn:hover { background: var(--red-dark); }
.item-row:first-child .remove-row-btn { visibility: hidden; }

/* ════════════════════════════════════════════════
   HOME PAGE — TAB PREVIEWS
   ════════════════════════════════════════════════ */
.page-preview-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
}
.page-preview-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.ppc-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 14px;
}
.ppc-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  margin-bottom: 6px;
  color: var(--text);
}
.ppc-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

/* ════════════════════════════════════════════════
   MISC HELPERS
   ════════════════════════════════════════════════ */
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.text-olive  { color: var(--olive); }
.text-gold   { color: var(--gold-dark); }
.text-red    { color: var(--red); }
.text-muted  { color: var(--text-muted); }
.fw-bold     { font-weight: 700; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-2 { gap: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* Loading spinner */
.spinner {
  width: 22px; height: 22px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Search bar */
.search-bar-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}
.search-bar-wrap .input-gma {
  flex: 1;
}

/* ════════════════════════════════════════════════
   PRINT / PDF STYLES
   ════════════════════════════════════════════════ */
@media print {
  .site-header, .mobile-header, .bottom-nav, .site-footer,
  .btn-gma, .no-print, .filter-bar-fixed { display: none !important; }
  body { padding: 0; background: white; }
  .print-area { display: block !important; }
}
