/* ==========================================================================
   DEBVIC SUSU — Styles
   Cream background, deep forest green primary, gold secondary accent.
   ========================================================================== */

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

:root {
  --background: #fbf9f4;
  --card: #ffffff;
  --card-2: #f4f1ea;
  --foreground: #14231a;
  --muted: #6b7568;
  --primary: #1f6b45;
  --primary-dark: #185536;
  --primary-foreground: #fbf9f4;
  --secondary: #e0a930;
  --secondary-foreground: #14231a;
  --border: #e8e2d4;
  --border-strong: #d8d0bc;
  --destructive: #dc2626;
  --success: #1f6b45;
  --warning: #d97706;
  --info: #2563eb;
  --radius: 12px;
  --font-heading: 'Playfair Display', serif;
  --font-body: 'DM Sans', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  min-height: 100vh;
}
h1, h2, h3, h4, .font-heading { font-family: var(--font-heading); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: var(--font-body); cursor: pointer; }
input, select, textarea {
  font-family: var(--font-body);
  background: #fff;
  border: 1px solid var(--border-strong);
  color: var(--foreground);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
::placeholder { color: var(--muted); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.container-sm { max-width: 460px; margin: 0 auto; padding: 0 16px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; border-radius: 10px; padding: 11px 20px; font-weight: 600; font-size: 14px; transition: all .15s ease; white-space: nowrap; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--foreground); }
.btn-outline:hover { background: rgba(0,0,0,0.03); }
.btn-ghost { background: transparent; color: var(--muted); border: none; }
.btn-ghost:hover { color: var(--foreground); }
.btn-destructive { background: var(--destructive); color: #fff; }
.btn-destructive:hover { background: #b91c1c; }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-icon { padding: 8px; border-radius: 8px; background: transparent; border: none; color: var(--muted); display: inline-flex; }
.btn-icon:hover { background: rgba(0,0,0,0.04); color: var(--foreground); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-block { width: 100%; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.card-pad { padding: 22px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-primary { background: rgba(31,107,69,0.1); color: var(--primary); }
.badge-yellow { background: #fef3c7; color: #b45309; }
.badge-green { background: rgba(31,107,69,0.1); color: var(--primary); }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-muted { background: var(--card-2); color: var(--muted); }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--primary); color: var(--primary-foreground); box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.site-header .inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo-text { font-family: var(--font-heading); font-weight: 700; font-size: 19px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a, .nav-links button { display: flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.75); background: none; border: none; transition: all .15s; }
.nav-links a:hover, .nav-links a.active, .nav-links button:hover { color: #fff; background: rgba(255,255,255,0.14); }
.mobile-menu-btn { display: none; color: #fff; }
.mobile-nav { display: none; flex-direction: column; gap: 4px; padding: 12px 16px; border-top: 1px solid rgba(255,255,255,0.15); background: var(--primary); }
.mobile-nav a, .mobile-nav button { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.85); background: none; border: none; text-align: left; }
.mobile-nav a:hover, .mobile-nav button:hover { background: rgba(255,255,255,0.14); }
@media (max-width: 760px) { .nav-links { display: none; } .mobile-menu-btn { display: inline-flex; } }

/* footer */
.site-footer { background: var(--primary); color: rgba(255,255,255,0.8); margin-top: 48px; padding: 32px 0; text-align: center; }
.site-footer .social-row { display: flex; justify-content: center; gap: 12px; margin: 16px 0; }
.site-footer .social-row a { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.12); padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #fff; }
.site-footer .social-row a:hover { background: rgba(255,255,255,0.22); }

/* page */
.py-page { padding: 32px 0 60px; }
.section-eyebrow { color: var(--secondary); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }

/* stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 700px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { padding: 16px; display: flex; align-items: flex-start; justify-content: space-between; }
.stat-card .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
.stat-card .value { font-size: 22px; font-weight: 700; margin-top: 4px; font-family: var(--font-heading); }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* tabs */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; background: var(--card-2); border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin-bottom: 22px; width: fit-content; }
.tab-btn { padding: 9px 15px; border-radius: 7px; border: none; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tab-btn.active { background: var(--primary); color: #fff; }

/* package selector */
.package-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 700px) { .package-grid { grid-template-columns: repeat(2, 1fr); } }
.package-card { padding: 16px; text-align: center; cursor: pointer; border: 2px solid var(--border); position: relative; transition: all .15s; }
.package-card:hover { border-color: rgba(31,107,69,0.3); }
.package-card.selected { border-color: var(--primary); background: rgba(31,107,69,0.04); }
.package-card .tag { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.package-card .amount { font-size: 24px; font-weight: 700; font-family: var(--font-heading); margin-top: 4px; }
.package-card .per-day { font-size: 11px; color: var(--muted); margin-top: 2px; }
.package-card .monthly { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; font-size: 12px; color: var(--primary); font-weight: 700; }
.package-card .check-badge { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 999px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; }

/* active plan card */
.plan-header { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; padding: 24px; position: relative; overflow: hidden; }
.plan-stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.plan-stat { text-align: center; padding: 12px; border-radius: 10px; background: var(--card-2); }
.plan-stat .value { font-size: 17px; font-weight: 700; font-family: var(--font-heading); }
.plan-stat .label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-top: 2px; }

/* calendar */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day-name { text-align: center; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--muted); padding: 4px 0; }
.cal-cell { aspect-ratio: 1/1; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; background: var(--card-2); color: var(--muted); }
.cal-cell.approved { background: rgba(31,107,69,0.14); color: var(--primary); }
.cal-cell.pending { background: #fef3c7; color: #b45309; }
.cal-cell.rejected { background: #fee2e2; color: #b91c1c; }
.cal-cell.today { box-shadow: 0 0 0 2px var(--primary); }

/* history rows */
.history-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 4px; border-bottom: 1px solid var(--border); }
.history-row:last-child { border-bottom: none; }
.history-icon { width: 34px; height: 34px; border-radius: 999px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* forms */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .form-grid-2 { grid-template-columns: 1fr; } }

/* payment method radio */
.method-option { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 12px; border: 2px solid var(--border); cursor: pointer; margin-bottom: 10px; }
.method-option.selected { border-color: var(--primary); background: rgba(31,107,69,0.04); }

/* modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(20,35,26,0.5); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 16px; }
.modal { background: var(--card); border-radius: 16px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; padding: 24px; }
.modal-wide { max-width: 640px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h3 { margin: 0; font-size: 18px; }

/* table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 13px; font-size: 13px; border-bottom: 1px solid var(--border); }
th { color: var(--primary); font-weight: 700; text-transform: uppercase; font-size: 10px; letter-spacing: 0.04em; }

/* chat */
.chat-thread { display: flex; flex-direction: column; gap: 10px; padding: 16px; overflow-y: auto; }
.chat-bubble { max-width: 75%; padding: 9px 14px; border-radius: 16px; font-size: 13px; line-height: 1.4; }
.chat-bubble.mine { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.chat-bubble.theirs { background: var(--card-2); border-bottom-left-radius: 4px; align-self: flex-start; }

/* utility */
.muted { color: var(--muted); }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-2 { display: flex; gap: 8px; align-items: center; }
.flex-gap-3 { display: flex; gap: 12px; align-items: center; }
.flex-col { display: flex; flex-direction: column; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.empty-state { text-align: center; padding: 56px 16px; }
.empty-state svg { color: var(--muted); opacity: 0.35; margin-bottom: 14px; }
.spinner { width: 30px; height: 30px; border: 3px solid rgba(31,107,69,0.15); border-top-color: var(--primary); border-radius: 999px; animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.divider { height: 1px; background: var(--border); border: none; margin: 14px 0; }
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--card); border: 1px solid var(--border-strong); border-left: 3px solid var(--primary); border-radius: 10px; padding: 12px 16px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); min-width: 220px; }
.toast.error { border-left-color: var(--destructive); }
.checkbox-row { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.checkbox-row input { width: 16px; height: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }
