/* CIRCUS design tokens — the single source for colors, fonts and spacing.
   Used by the public site, staff dashboards and printed invoices. */
:root {
  /* Core brand */
  --circus-red: #E30E1B;
  --circus-red-dark: #B80A15;
  --star-gold: #FBBC33;
  --star-gold-dark: #E0A11A;
  --cream: #F7EEDC;
  --cream-light: #FFFCF6;
  --ink: #2B2118;
  --ink-soft: #5E5246;
  --ink-muted: #8A7D70;

  /* Supporting pastels (rainbow, pattern, poster) */
  --orange: #F7862C;
  --mint: #7FC4B8;
  --pink: #F7A1C0;
  --coral: #E86F5C;
  --steel-blue: #5B86AE;
  --sage: #B3C08A;

  /* Tints for chips and tiles (text uses the matching dark shade) */
  --gold-tint: #FEF1D2;   --gold-text: #6B4700;
  --pink-tint: #FDE6EE;   --pink-text: #7A2445;
  --orange-tint: #FDE7D4; --orange-text: #7A3A06;
  --mint-tint: #E2F3F0;   --mint-text: #1F5A50;
  --blue-tint: #E3ECF5;   --blue-text: #234766;
  --coral-tint: #FCE5E1;  --coral-text: #7A2A1E;

  /* Semantic (kept separate from the brand red on purpose) */
  --danger: #B42318;   --danger-tint: #FDECEA;
  --success: #2E7D4F;  --success-tint: #E6F4EC;
  --warning: #8A5A00;  --warning-tint: #FFF4D6;

  /* Surfaces and lines */
  --surface: #FFFFFF;
  --line: #E9DFCC;
  --line-strong: #D8CAB0;

  /* Type */
  --font-display: "Baloo Bhaijaan 2", "Tajawal", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Arabic", "Tajawal", "Segoe UI", system-ui, sans-serif;

  /* Shape and spacing */
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 72px;
  --shadow-soft: 0 2px 0 rgba(43, 33, 24, .06), 0 8px 24px rgba(43, 33, 24, .06);
  --focus: 0 0 0 3px rgba(251, 188, 51, .55);
}

/* Role themes for staff dashboards: the top bar color tells staff which account they're in */
[data-role="admin"]      { --role: var(--ink);        --role-on: var(--cream);  --role-tint: #EFE9E0; }
[data-role="accountant"] { --role: var(--mint);       --role-on: #0F3A33;       --role-tint: var(--mint-tint); }
[data-role="frontdesk"]  { --role: var(--star-gold);  --role-on: #4A2E00;       --role-tint: var(--gold-tint); }
[data-role="marketing"]  { --role: var(--pink);       --role-on: #5A1830;       --role-tint: var(--pink-tint); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); color: var(--ink); line-height: 1.7; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.25; margin: 0 0 var(--space-3); }
.icon { width: 1.25em; height: 1.25em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons shared by site and dashboards */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-5); border-radius: 999px; border: 2px solid transparent;
  font: 600 1rem/1 var(--font-body); text-decoration: none; cursor: pointer; transition: transform .12s ease, background .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-red { background: var(--circus-red); color: #fff; }
.btn-red:hover { background: var(--circus-red-dark); }
.btn-gold { background: var(--star-gold); color: #4A2E00; }
.btn-gold:hover { background: var(--star-gold-dark); }
.btn-ink { background: var(--ink); color: var(--cream); }
.btn-ink:hover { background: #46382B; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--cream); }
.btn-sm { min-height: 34px; padding: 0 var(--space-4); font-size: .875rem; }

/* Bunting band: an original divider drawn from the brand pastels */
.bunting {
  height: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='34' viewBox='0 0 200 34'%3E%3Cpath d='M0 2 Q100 10 200 2' stroke='%23C9B79A' stroke-width='1.5' fill='none'/%3E%3Cpath d='M6 3 L26 3 L16 30 Z' fill='%23E86F5C'/%3E%3Cpath d='M46 6 L66 6 L56 33 Z' fill='%23FBBC33'/%3E%3Cpath d='M86 7 L106 7 L96 34 Z' fill='%237FC4B8'/%3E%3Cpath d='M126 6 L146 6 L136 33 Z' fill='%23F7A1C0'/%3E%3Cpath d='M166 3 L186 3 L176 30 Z' fill='%23F7862C'/%3E%3C/svg%3E");
  background-repeat: repeat-x; background-size: 200px 34px;
}

/* Flash messages */
.flash { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); margin-bottom: var(--space-4); font-weight: 500; }
.flash-success { background: var(--success-tint); color: var(--success); }
.flash-error { background: var(--danger-tint); color: var(--danger); }
.flash-info { background: var(--blue-tint); color: var(--blue-text); }
.flash-warn { background: var(--warning-tint); color: var(--warning); }
.flash ul.tight { margin: 6px 0 0; padding-inline-start: 1.2em; font-weight: 400; }

/* Forms */
.field { display: grid; gap: var(--space-1); margin-bottom: var(--space-4); }
.field label { font-weight: 600; font-size: .9rem; }
.field .hint { font-size: .8rem; color: var(--ink-muted); }
.input, select.input {
  width: 100%; min-height: 44px; padding: 0 var(--space-3); border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm); background: #fff; font: 1rem var(--font-body); color: var(--ink);
}
.input:focus { border-color: var(--star-gold-dark); box-shadow: var(--focus); outline: none; }
.check { display: flex; align-items: center; gap: var(--space-2); font-size: .9rem; }
.check input { width: 18px; height: 18px; accent-color: var(--circus-red); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* Card color tints, shared by the website and the card editor */
.tint-gold   { background: var(--gold-tint);   color: var(--gold-text); }
.tint-pink   { background: var(--pink-tint);   color: var(--pink-text); }
.tint-mint   { background: var(--mint-tint);   color: var(--mint-text); }
.tint-orange { background: var(--orange-tint); color: var(--orange-text); }
.tint-blue   { background: var(--blue-tint);   color: var(--blue-text); }
.tint-coral  { background: var(--coral-tint);  color: var(--coral-text); }
textarea.input { min-height: 88px; padding: 10px 12px; line-height: 1.6; resize: vertical; }
input.input.file { padding: 8px; min-height: 0; background: var(--cream-light); }
.with-breaks { white-space: pre-line; }

/* ---------- activities calendar (website and staff editor) ---------- */
html[dir="ltr"] .flip-ltr { transform: scaleX(-1); }
.cal-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-5); }
.cal-nav { display: flex; align-items: center; justify-content: center; gap: var(--space-4); margin-bottom: var(--space-4); flex-wrap: wrap; }
.cal-label { margin: 0; font-size: 1.35rem; min-width: 9ch; text-align: center; }
.cal-arrow { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line-strong); color: var(--ink); text-decoration: none; }
.cal-arrow:hover { background: var(--cream); }
.cal-today { font-weight: 600; font-size: .9rem; color: var(--ink-soft); }
.cal { display: grid; gap: 4px; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { text-align: center; font-size: .8rem; font-weight: 700; color: var(--ink-muted); padding: 4px 0; }
.cal-day { min-height: 92px; border-radius: 12px; background: var(--cream-light); border: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day.is-out { background: transparent; border-color: transparent; opacity: .45; }
.cal-day.is-today { border: 2px solid var(--circus-red); }
.cal-day.is-today .cal-num { background: var(--circus-red); color: #fff; }
.cal-num { font-weight: 700; font-size: .85rem; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; text-decoration: none; color: var(--ink); }
a.cal-num:hover { background: var(--star-gold); }
.cal-chips { display: grid; gap: 3px; min-width: 0; }
.cal-chip { display: block; font-size: .72rem; line-height: 1.3; padding: 3px 6px; border-radius: 6px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip.is-hidden { opacity: .5; text-decoration: line-through; }
.cal-more { font-size: .72rem; color: var(--ink-muted); font-weight: 600; }
.cal-dots { display: none; gap: 3px; justify-content: center; }
.cal-dots i { width: 7px; height: 7px; border-radius: 50%; display: block; }
.cal-list { display: grid; gap: var(--space-4); }
.cal-list-day h4 { font: 700 1rem var(--font-display); margin: 0 0 8px; }
.cal-list-day.is-past { opacity: .6; }
.cal-list-day:target { scroll-margin-top: 90px; }
.cal-list-day:target h4 { color: var(--circus-red); }
.cal-event { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.cal-event.is-hidden { opacity: .55; }
.cal-bar { width: 6px; border-radius: 6px; flex: none; }
.cal-event-body { flex: 1; min-width: 0; }
.cal-event-time { font-size: .82rem; color: var(--ink-muted); font-weight: 600; display: flex; gap: 8px; align-items: center; }
.cal-event-title { display: block; font-size: 1.02rem; }
.cal-event p { margin: 2px 0 0; color: var(--ink-soft); font-size: .92rem; }
.cal-event-actions { display: flex; flex-wrap: wrap; gap: 4px; align-items: flex-start; }
.cal-event-actions form { margin: 0; }
.btn-danger-ghost:hover { background: var(--danger-tint); color: var(--danger); border-color: var(--danger); }
.cal-empty { text-align: center; margin: var(--space-4) 0; }
.cal-split { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--space-5); align-items: start; }
.public-cal .cal-list { max-height: 640px; overflow-y: auto; padding-inline-end: 4px; }
.settings-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) {
  .cal-split { grid-template-columns: 1fr; }
  .public-cal .cal-list { max-height: none; overflow: visible; }
  .cal-day { min-height: 54px; padding: 4px; align-items: center; }
  .cal-chips { display: none; }
  .cal-dots { display: flex; }
  .cal-panel { padding: var(--space-3); }
  .settings-grid.three { grid-template-columns: 1fr; }
}
