/* =============================================================================
   Dilsho — Brand & design tokens (§6). Shared by website, admin & customer PWA.
   Light theme by default. Warm, rounded, coral-on-cream. Mobile-first.
   ========================================================================== */
:root {
  /* --- Brand colors (exact, §6.1) --- */
  --coral:        #D85A30;   /* primary: buttons, links, highlights, the heart */
  --coral-600:    #C44E28;   /* pressed / darker accent */
  --coral-grad-a: #E66D3D;   /* gradient start (app-icon style) */
  --coral-grad-b: #DA5D32;   /* gradient end */
  --cream:        #FFFBF8;   /* light text on coral, lightest surface */
  --blush:        #FAECE7;   /* soft page background, cards, tiles */
  --espresso:     #2B201A;   /* primary text — warm near-black, NOT pure #000 */

  /* --- Warm neutral scale derived around espresso (borders/muted text) --- */
  --warm-50:  #FBF7F4;
  --warm-100: #F3EBE6;
  --warm-200: #E7DBD3;
  --warm-300: #D6C5BA;
  --warm-400: #B3A096;
  --warm-500: #8A7A70;
  --warm-600: #5F534C;
  --warm-700: #3D342E;

  /* --- Semantic --- */
  --bg:           var(--cream);
  --surface:      #FFFFFF;
  --surface-soft: var(--blush);
  --text:         var(--espresso);
  --text-muted:   var(--warm-500);
  --border:       var(--warm-200);
  --link:         var(--coral);
  --success:      #2E9E6B;
  --success-bg:   #E6F4EC;
  --danger:       #D6453B;
  --danger-bg:    #FBE9E7;
  --warning:      #C9851F;

  --coral-gradient: linear-gradient(135deg, var(--coral-grad-a), var(--coral-grad-b));

  /* --- Typography (self-hosted; see fonts.css, §6.3) --- */
  --font-display: "Fredoka", "Quicksand", system-ui, sans-serif; /* rounded geometric */
  --font-body:    "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700;

  /* --- Radius / spacing / shadow (rounded, generous, soft — §6.4) --- */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --r-pill: 999px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-8: 48px;
  --shadow-sm: 0 2px 8px rgba(43,32,26,.06);
  --shadow-md: 0 6px 20px rgba(43,32,26,.08);
  --shadow-lg: 0 14px 40px rgba(43,32,26,.12);
  --container: 1120px;
}

@media (prefers-color-scheme: dark) {
  /* Optional dark theme keeps coral as the accent on warm-dark surfaces (§6.1). */
  :root[data-theme="dark"] {
    --bg: #1C1511; --surface: #251C16; --surface-soft: #2E231C;
    --text: #F6EEE8; --text-muted: #B3A096; --border: #3D342E;
  }
}

/* --- Base reset & elements --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: var(--fw-bold); line-height: 1.15; margin: 0 0 .4em; color: var(--text); }
h1 { font-size: clamp(28px, 5vw, 44px); }
h2 { font-size: clamp(22px, 3.5vw, 30px); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* --- Layout helpers --- */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--sp-5); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-5); box-shadow: var(--shadow-sm); }
.muted { color: var(--text-muted); }
.stack > * + * { margin-top: var(--sp-4); }
.row { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; }

/* --- Buttons (pill, coral, §6.4) --- */
.btn { display: inline-flex; align-items: center; gap: var(--sp-2); font-family: var(--font-body);
  font-weight: var(--fw-bold); font-size: 16px; padding: 12px 22px; border-radius: var(--r-pill);
  border: 1px solid transparent; cursor: pointer; transition: transform .06s ease, background .15s ease; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--coral); color: var(--cream); }
.btn-primary:hover { background: var(--coral-600); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--coral); border-color: var(--warm-200); }
.btn-block { width: 100%; justify-content: center; }

/* --- Badges --- */
.badge { padding: 2px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: var(--fw-semibold); }
.badge-in { background: var(--success-bg); color: var(--success); }
.badge-out { background: var(--danger-bg); color: var(--danger); }

/* --- Forms --- */
label { font-weight: var(--fw-semibold); font-size: 14px; display: block; margin-bottom: 6px; }
input, select, textarea { font-family: var(--font-body); font-size: 16px; width: 100%;
  padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--coral) 35%, transparent); outline-offset: 1px; border-color: var(--coral); }

/* --- Accessibility (§12): visible focus, reduced motion --- */
:focus-visible { outline: 3px solid color-mix(in srgb, var(--coral) 45%, transparent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* --- The heart mark as a coral accent (uses heart asset elsewhere) --- */
.brand-o { color: var(--coral); }
