/* Gear House crew portal — same palette as the public site. */
:root {
  --ink: #0a0a0b; --ink-2: #0f0f11; --graphite: #161618; --graphite-2: #1c1c1f;
  --smoke: #2a2a2e; --smoke-2: #3a3a40; --bone: #efe9dc; --bone-2: #d9d2c2;
  --mist: #a7a39b; --mist-2: #80838f; --tungsten: #f2a93b; --tungsten-2: #ffc462; --tungsten-dim: rgba(242,169,59,0.14);
  --signal: #e0352b; --ok: #4ade80;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, monospace;
  --r: 16px;
}
[dir="rtl"] { --font: "Noto Sans Arabic", "Inter", system-ui, sans-serif; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--ink); color: var(--bone); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--tungsten); outline-offset: 2px; }

/* header */
.top { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px clamp(16px, 3vw, 32px); background: rgba(10,10,11,0.86); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255,255,255,0.06); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 30px; width: auto; }
.brand .tag { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tungsten); }
[dir="rtl"] .brand .tag { font-family: var(--font); letter-spacing: 0; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.lang { display: flex; border: 1px solid var(--smoke); border-radius: 999px; padding: 2px; }
.lang button { border: 0; background: none; padding: 5px 10px; border-radius: 999px; font-size: 12px; color: var(--mist); cursor: pointer; }
.lang button.on { background: var(--bone); color: var(--ink); }

/* buttons + fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--smoke-2); background: var(--graphite-2); color: var(--bone); font-weight: 500; cursor: pointer; text-decoration: none; transition: background 0.2s, border-color 0.2s; white-space: nowrap; }
.btn:hover { border-color: var(--bone-2); }
.btn.primary { background: var(--tungsten); border-color: var(--tungsten); color: var(--ink); font-weight: 600; }
.btn.primary:hover { background: var(--tungsten-2); border-color: var(--tungsten-2); }
.btn.ghost { background: none; }
.btn.danger { background: none; border-color: rgba(224,53,43,0.5); color: #ff7b72; }
.btn.sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.link { background: none; border: 0; color: var(--tungsten-2); cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12px; font-weight: 500; color: var(--mist); }
.field input, .field select, .field textarea, .inp { width: 100%; background: var(--ink-2); border: 1px solid var(--smoke); border-radius: 12px; padding: 11px 13px; color: var(--bone); outline: none; transition: border-color 0.2s; min-width: 0; }
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus { border-color: var(--tungsten); }
.field textarea { min-height: 150px; resize: vertical; }
.help { font-size: 12px; color: var(--mist-2); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.muted { color: var(--mist); }
.small { font-size: 13px; }
.err-text { color: #ff7b72; font-size: 13px; }

/* auth */
.auth { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: min(420px, 100%); background: var(--graphite); border: 1px solid var(--smoke); border-radius: 22px; padding: 28px; display: grid; gap: 18px; }
.auth-card h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }

/* app layout */
.app { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(16px, 3vw, 32px); padding: clamp(16px, 3vw, 32px); max-width: 1280px; margin: 0 auto; align-items: start; }
.side { position: sticky; top: 84px; display: grid; gap: 14px; }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 12px; text-decoration: none; color: var(--bone-2); font-weight: 500; }
.nav a:hover { background: var(--graphite); }
.nav a.on { background: var(--graphite-2); color: var(--bone); box-shadow: inset 3px 0 0 var(--tungsten); }
[dir="rtl"] .nav a.on { box-shadow: inset -3px 0 0 var(--tungsten); }
.nav .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tungsten); }
.card { background: var(--graphite); border: 1px solid var(--smoke); border-radius: 22px; padding: clamp(18px, 2.4vw, 26px); display: grid; gap: 18px; }
.card h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.card + .card { margin-top: 16px; }
.content { min-width: 0; }

/* banners */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--smoke); background: var(--graphite); margin-bottom: 16px; font-size: 14px; }
.banner::before { content: ""; width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 6px; background: var(--mist); }
.banner.pending::before { background: var(--tungsten); }
.banner.approved::before { background: var(--ok); }
.banner.hidden-s::before, .banner.review::before { background: var(--signal); }
.banner.review::before { background: var(--tungsten); }
.banner.welcome { border-color: rgba(242,169,59,0.4); background: var(--tungsten-dim); }
.banner a { color: var(--tungsten-2); }

/* preview + completeness */
.preview { background: var(--graphite); border: 1px solid var(--smoke); border-radius: 18px; overflow: hidden; }
.preview .pv-photo { aspect-ratio: 4 / 5; background: radial-gradient(ellipse at 50% 25%, #272b3a, #111218 70%); display: grid; place-items: center; font-size: 44px; font-weight: 700; color: var(--mist-2); }
.preview .pv-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview .pv-body { padding: 12px 14px 14px; display: grid; gap: 2px; }
.preview .pv-k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mist); }
.preview .pv-n { font-weight: 600; font-size: 16px; }
.preview .pv-r { font-weight: 700; font-size: 15px; margin-top: 4px; }
.meter { display: grid; gap: 6px; font-size: 12px; color: var(--mist); }
.meter .bar { height: 6px; background: var(--smoke); border-radius: 999px; overflow: hidden; }
.meter .bar span { display: block; height: 100%; background: var(--tungsten); border-radius: inherit; }

/* chips (languages) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--smoke-2); border-radius: 999px; padding: 6px 13px; font-size: 13px; cursor: pointer; background: none; color: var(--bone-2); }
.chip.on { background: var(--bone); color: var(--ink); border-color: var(--bone); }

/* photo */
.photo-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.photo-row .ph { width: 112px; height: 112px; border-radius: 50%; overflow: hidden; background: var(--smoke); display: grid; place-items: center; font-size: 32px; font-weight: 700; color: var(--mist-2); flex: none; }
.photo-row .ph img { width: 100%; height: 100%; object-fit: cover; }
.photo-row .ph.pending { outline: 2px dashed var(--tungsten); outline-offset: 3px; }

/* repeatable rows */
.rep { display: grid; gap: 10px; }
.rep-row { display: grid; gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--smoke); border-radius: 14px; background: var(--ink-2); }
.rep-row.roles { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto auto; }
.rep-row.credit { grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) 90px minmax(0, 1.4fr) auto; }
.rep-row.reel { grid-template-columns: minmax(0, 3fr) minmax(0, 1.4fr) auto; }
.rep-row.gear { grid-template-columns: minmax(0, 1fr) auto; }
.rep-row .x { min-height: 42px; }
.radio { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--mist); white-space: nowrap; min-height: 42px; cursor: pointer; }
.pending-tag { font-size: 11px; color: var(--tungsten-2); }

/* gallery */
.gal { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.gal .g { position: relative; aspect-ratio: 3 / 2; border-radius: 12px; overflow: hidden; border: 1px solid var(--smoke); }
.gal .g img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal .g button { position: absolute; top: 6px; inset-inline-end: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(10,10,11,0.8); color: #fff; cursor: pointer; }
.gal .add { display: grid; place-items: center; aspect-ratio: 3 / 2; border: 1px dashed var(--smoke-2); border-radius: 12px; color: var(--mist); cursor: pointer; font-size: 13px; text-align: center; padding: 8px; }
.gal .add:hover { border-color: var(--tungsten); color: var(--bone); }

/* calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cal-head h3 { font-size: 17px; font-weight: 600; text-transform: capitalize; }
.cals { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .wd { text-align: center; font-size: 11px; color: var(--mist-2); padding: 4px 0; }
.cal button { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--smoke); background: var(--ink-2); color: var(--bone-2); cursor: pointer; font-size: 13px; }
.cal button:hover { border-color: var(--bone-2); }
.cal button.off { background: var(--signal); border-color: var(--signal); color: #fff; }
.cal button.past { opacity: 0.25; pointer-events: none; }
.cal button.today { box-shadow: inset 0 0 0 2px var(--tungsten); }
.cal .sp { aspect-ratio: 1; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--mist); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; vertical-align: -2px; margin-inline-end: 6px; }

/* bookings + stats */
.bk { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--smoke); }
.bk:last-child { border-bottom: 0; }
.bk .ref { font-family: var(--mono); font-size: 12px; color: var(--mist); }
.bk .st { font-size: 12px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--smoke-2); }
.bk .st.confirmed, .bk .st.ready, .bk .st.out { border-color: var(--ok); color: var(--ok); }
.bk .st.cancelled { color: var(--mist-2); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { border: 1px solid var(--smoke); border-radius: 14px; padding: 14px; }
.kpi .v { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.kpi .l { font-size: 12px; color: var(--mist); }

/* toasts */
.toasts { position: fixed; bottom: 20px; inset-inline-start: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; }
[dir="rtl"] .toasts { transform: translateX(50%); }
.toast { background: var(--bone); color: var(--ink); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
.toast.err { background: var(--signal); color: #fff; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; }
  .side .preview, .side .meter { display: none; }
  .nav { display: flex; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  .nav a { white-space: nowrap; border: 1px solid var(--smoke); padding: 8px 14px; border-radius: 999px; }
  .nav a.on { box-shadow: none; background: var(--bone); color: var(--ink); }
  .cals { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .rep-row.roles, .rep-row.credit, .rep-row.reel { grid-template-columns: 1fr 1fr; }
  .rep-row.roles > :first-child, .rep-row.credit > :first-child, .rep-row.credit > :nth-child(2), .rep-row.reel > :first-child { grid-column: 1 / -1; }
  .gal { grid-template-columns: repeat(2, 1fr); }
  .kpis { grid-template-columns: 1fr; }
  .brand img { height: 24px; }
  .brand .tag { display: none; }
  .bk { grid-template-columns: 1fr auto; }
  .bk .ref { grid-column: 1 / -1; }
}
