/* ==========================================================================
   Event Era Portal — shared dashboard styles
   Palette = official Event Era brand system: #08090f base, champagne gold accent, division colours.
   Change colours in :root only.
   ========================================================================== */
:root {
  /* ---- Official Event Era brand system (same values as /css/brand.css) ---- */
  --bg-primary: #08090f;
  --bg-secondary: #0b0d17;
  --bg-elevated: #111420;
  --bg-card: rgba(255, 255, 255, 0.025);
  --border-subtle: rgba(182, 161, 130, 0.22);
  --brand-gold: #B6A182;
  --brand-gold-light: #C8B496;
  --brand-gold-dark: #6D604C;
  --brand-gold-gradient: linear-gradient(180deg, #C4B091 0%, #6D604C 100%);
  --brand-gold-glow: rgba(182, 161, 130, 0.25);
  --division-production: #007C77;
  --division-production-dark: #004E4A;
  --division-production-gradient: linear-gradient(180deg, #008681 0%, #004E4A 100%);
  --division-media: #FA1035;
  --division-media-dark: #960032;
  --division-media-gradient: linear-gradient(180deg, #FA1035 0%, #960032 100%);
  --division-wedding: #EA5C84;
  --division-wedding-dark: #930339;
  --division-wedding-gradient: linear-gradient(180deg, #EA5C84 0%, #930339 100%);
  --text-main: #F3F4F6;
  --text-muted: #9CA3AF;
  --on-accent: #0b0d17; /* text on gold fills */

  --bg: #08090f;
  --bg-2: #0b0d17;
  --panel: #10121c;
  --panel-2: #151826;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #e9eaee;
  --muted: #8c90a0;
  --accent: var(--brand-gold);
  --accent-soft: rgba(182, 161, 130, 0.14);
  --accent-glow: rgba(182, 161, 130, 0.30);
  --ok: #22c55e;
  --ok-soft: rgba(34, 197, 94, 0.14);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.14);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.14);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.14);
  --radius: 10px;
  --sidebar: 248px;
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Syne', 'Outfit', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; color: #fff; }
h1 { font-family: var(--font-display); font-size: 26px; letter-spacing: 0.5px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* ------------------------------------------------------------ layout shell */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand img { max-height: 34px; width: auto; }
.brand-tag { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 8px;
  color: var(--muted); font-weight: 500; text-decoration: none;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav a .count { margin-left: auto; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 20px; }
.nav-label { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: #5b5f6e; padding: 8px 12px 2px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; }
.me { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-gold-light), var(--brand-gold-dark));
  display: grid; place-items: center; color: var(--on-accent); font-weight: 700; font-size: 14px;
}
.me-name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.me-role { font-size: 12px; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 28px; border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 15, 0.85); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 20;
}
.topbar .title { flex: 1; min-width: 0; }
.topbar .title p { color: var(--muted); font-size: 13px; }
.btn.menu-toggle { display: none; }
.content { padding: 26px 28px 60px; display: flex; flex-direction: column; gap: 22px; }

.live-dot { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.live-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #555; }
.live-dot.on::before { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(34,197,94,0.05); } }

.bell { position: relative; }
.bell .badge-dot {
  position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
}
.notif-panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: 360px; max-height: 460px; overflow: auto;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5); z-index: 50;
}
.notif-panel .item { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.notif-panel .item.unread { background: rgba(182, 161, 130,0.05); }
.notif-panel .item b { display: block; color: #fff; font-weight: 600; }

/* ------------------------------------------------------------ components */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head p { color: var(--muted); font-size: 13px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; align-items: start; }

.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; position: relative; overflow: hidden; }
.stat .label { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); }
.stat .value { font-size: 30px; font-weight: 800; color: #fff; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .value.accent { color: var(--accent); }
.stat .hint { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat::after { content: ''; position: absolute; right: -30px; top: -30px; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(var(--accent-soft), transparent 70%); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
  font: 600 14px var(--font); cursor: pointer; white-space: nowrap;
  transition: transform .1s, background .15s, box-shadow .15s, opacity .15s;
  background: var(--brand-gold-gradient); color: var(--on-accent); text-decoration: none !important;
}
.btn:hover { box-shadow: 0 6px 24px var(--accent-glow); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { background: rgba(255,255,255,0.05); box-shadow: none; }
.btn-ok { background: var(--ok); }
.btn-ok:hover { box-shadow: 0 6px 24px rgba(34,197,94,0.3); }
.btn-wa { background: #25d366; color: #062b14; }
.btn-wa:hover { box-shadow: 0 6px 24px rgba(37,211,102,0.35); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(239,68,68,0.4); }
.btn-danger:hover { background: var(--danger-soft); box-shadow: none; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 6px; }
.btn-icon { padding: 8px; width: 38px; height: 38px; background: transparent; border: 1px solid var(--line-strong); color: var(--text); }
.btn-icon:hover { background: rgba(255,255,255,0.05); box-shadow: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; letter-spacing: .3px; white-space: nowrap; background: rgba(255,255,255,0.07); color: var(--text); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }

/* forms */
.form { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
label.field { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 4px; row-gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
label.field > input, label.field > select, label.field > textarea, label.field > div, label.field > .hint, label.field > p { flex: 1 0 100%; min-width: 0; }
label.field .req { color: var(--accent); }
input, select, textarea {
  width: 100%; padding: 11px 13px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--line-strong); color: var(--text);
  font: 400 14.5px var(--font); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[readonly], textarea[readonly] { opacity: .75; }
textarea { min-height: 96px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); transform: scale(1.15); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 13px; border-radius: 20px; border: 1px solid var(--line-strong); font-size: 13px; cursor: pointer; user-select: none; color: var(--muted); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: #fff; }
.field-error { color: var(--danger); font-size: 12.5px; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 600; padding: 11px 14px; background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
tr.clickable { cursor: pointer; }
.empty { padding: 36px; text-align: center; color: var(--muted); }

/* editable table field */
.tbl-edit td { padding: 4px; }
.tbl-edit input { padding: 7px 9px; font-size: 13.5px; border-radius: 6px; }

/* progress */
.progress { height: 10px; background: rgba(255,255,255,0.06); border-radius: 20px; overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand-gold-dark), var(--brand-gold-light)); border-radius: 20px; transition: width .4s ease; }
.progress.ok > span { background: linear-gradient(90deg, #16a34a, var(--ok)); }
.progress.lg { height: 16px; }
.progress-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }

/* job widget */
.job { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--panel-2); }
.job + .job { margin-top: 10px; }
.job-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; }

/* milestone tracker */
.milestones { display: grid; gap: 0; position: relative; }
.ms { display: grid; grid-template-columns: 28px 1fr; gap: 14px; padding-bottom: 18px; position: relative; }
.ms::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line-strong); }
.ms:last-child::before { display: none; }
.ms.done::before { background: var(--accent); }
.ms-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--bg); display: grid; place-items: center; font-size: 13px; color: var(--muted); z-index: 1; }
.ms.done .ms-dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ms.current .ms-dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.ms-body b { color: #fff; font-weight: 600; }
.ms-body .progress { margin-top: 8px; height: 6px; max-width: 360px; }

/* kanban */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.col { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-height: 200px; }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 12px; font-weight: 600; }
.col.drag-over { border-color: var(--accent); background: rgba(182, 161, 130,0.04); }
.task-card { background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 13px 14px; cursor: pointer; transition: border-color .15s, transform .15s; }
.task-card + .task-card { margin-top: 10px; }
.task-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.task-card .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; font-size: 12.5px; color: var(--muted); }
.prio-1 { box-shadow: inset 3px 0 0 var(--accent); }

/* event cards */
.event-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; cursor: pointer; transition: border-color .15s; }
.event-card:hover, .event-card.active { border-color: var(--accent); }
.event-card .meta { color: var(--muted); font-size: 13px; margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.list { display: flex; flex-direction: column; gap: 10px; }

/* queue list (IT) */
.queue-item { padding: 14px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; background: var(--panel); }
.queue-item:hover { border-color: var(--line-strong); }
.queue-item.active { border-color: var(--accent); background: rgba(182, 161, 130,0.04); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 10px 16px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; font-weight: 500; white-space: nowrap; background: none; border-top: 0; border-left: 0; border-right: 0; font-family: var(--font); font-size: 14px; }
.tab.active { color: #fff; border-bottom-color: var(--accent); }

/* modal / drawer */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.65); backdrop-filter: blur(3px); z-index: 100; display: flex; justify-content: center; align-items: flex-start; padding: 5vh 16px; overflow-y: auto; }
.modal { width: 100%; max-width: 720px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,0.6); }
.modal.wide { max-width: 980px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); gap: 12px; }
.modal-body { padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--accent); font-weight: 700; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--text); word-break: break-word; }

/* dropzone */
.dropzone { display: block; border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 30px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: rgba(182, 161, 130,0.04); color: var(--text); }
.dropzone strong { color: #fff; }

/* activity feed */
.feed { display: flex; flex-direction: column; max-height: 520px; overflow-y: auto; }
.feed-item { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 13.5px; align-items: start; }
.feed-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 7px; }
.feed-item.new { animation: flash 1.6s ease; }
@keyframes flash { from { background: rgba(182, 161, 130,0.15); } to { background: transparent; } }

/* message preview */
.wa-bubble { background: #005c4b; color: #e9edef; border-radius: 10px 10px 10px 2px; padding: 12px 14px; white-space: pre-wrap; font-size: 13.5px; max-width: 460px; line-height: 1.45; word-break: break-word; }
.wa-frame { background: #0b141a; border-radius: var(--radius); padding: 18px; border: 1px solid var(--line); }

/* toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; max-width: 380px; }
.toast { background: var(--panel-2); border: 1px solid var(--line-strong); border-left: 3px solid var(--accent); padding: 12px 16px; border-radius: 8px; font-size: 14px; box-shadow: 0 12px 40px rgba(0,0,0,0.5); animation: slidein .25s ease; }
.toast.ok { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--danger); }
.toast b { display: block; color: #fff; }
@keyframes slidein { from { transform: translateY(10px); opacity: 0; } }

/* auth pages */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { position: relative; background: url('../../img/MOH_7151.jpg') center/cover; display: flex; align-items: flex-end; padding: 48px; }
.auth-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,9,15,0.3), rgba(8,9,15,0.95)); }
.auth-hero > div { position: relative; }
.auth-hero h1 { font-size: 40px; text-transform: uppercase; letter-spacing: 2px; text-shadow: 0 0 35px var(--accent-glow); line-height: 1.1; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 22px; }
.auth-card .brand img { max-height: 42px; }
.alert { padding: 12px 14px; border-radius: 8px; font-size: 14px; border: 1px solid; }
.alert.error { background: var(--danger-soft); border-color: rgba(239,68,68,0.35); color: #fca5a5; }
.alert.ok { background: var(--ok-soft); border-color: rgba(34,197,94,0.35); color: #86efac; }
.alert.warn { background: var(--warn-soft); border-color: rgba(245,158,11,0.35); color: #fcd34d; }
.alert:not(.ok):not(.warn):not(.error) { background: var(--info-soft); border-color: rgba(96,165,250,0.3); color: #bfdbfe; }
.alert b { color: #fff; }
.alert.info { background: var(--info-soft); border-color: rgba(96,165,250,0.35); color: #bfdbfe; }

/* scanner */
.scan-result { padding: 18px; border-radius: var(--radius); text-align: center; font-weight: 700; font-size: 18px; }
.scan-result.ok { background: var(--ok-soft); color: var(--ok); }
.scan-result.bad { background: var(--danger-soft); color: var(--danger); }
.scan-result.warn { background: var(--warn-soft); color: var(--warn); }
video.scanner { width: 100%; max-width: 420px; border-radius: var(--radius); background: #000; }

.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.2); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-screen { position: fixed; inset: 0; background: var(--bg); display: grid; place-items: center; z-index: 300; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 90; width: 270px; transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: none; box-shadow: 0 0 80px rgba(0,0,0,0.8); }
  .btn.menu-toggle { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .content { padding: 18px 16px 50px; }
  .grid-2, .grid-3, .kanban { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .notif-panel { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; }
}
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat .value { font-size: 24px; }
  h1 { font-size: 21px; }
}

/* ------------------------------------------------------------ ticket studio */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.studio-stage { position: sticky; top: 16px; display: grid; gap: 10px; }
.studio-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.studio-toolbar .st-inline { flex-direction: row; align-items: center; gap: 8px; margin-right: auto; }
.studio-toolbar .st-inline select { width: auto; max-width: 260px; }
.studio-canvas-wrap {
  display: grid; place-items: center; padding: 18px; border-radius: var(--radius); border: 1px solid var(--line);
  background-color: #05060a;
  background-image: linear-gradient(45deg, rgba(255,255,255,.03) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.03) 75%),
                    linear-gradient(45deg, rgba(255,255,255,.03) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.03) 75%);
  background-size: 22px 22px; background-position: 0 0, 11px 11px;
}
#stCanvas { display: block; max-width: 100%; max-height: 72vh; width: auto; height: auto; box-shadow: 0 20px 60px rgba(0,0,0,.6); border-radius: 6px; touch-action: none; outline: none; }
#stCanvas:focus-visible { box-shadow: 0 0 0 2px var(--accent), 0 20px 60px rgba(0,0,0,.6); }
.studio-panel { display: grid; gap: 12px; }
.st-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.st-stats > div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; }
.st-stats b { display: block; font-size: 18px; color: #fff; }
.st-stats span { font-size: 11px; color: var(--muted); }
.st-sec { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.st-sec > summary { cursor: pointer; padding: 11px 14px; font-weight: 600; color: #fff; list-style: none; user-select: none; }
.st-sec > summary::-webkit-details-marker { display: none; }
.st-sec > summary::after { content: '+'; float: right; color: var(--muted); }
.st-sec[open] > summary::after { content: '–'; }
.st-sec > div { padding: 2px 14px 14px; }
.st-layers { display: grid; gap: 2px; }
.st-layer { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; cursor: pointer; color: var(--text); font-size: 13.5px; }
.st-layer:hover { background: rgba(255,255,255,.04); }
.st-layer.on { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); color: #fff; }
.st-layer.off span { color: var(--muted); text-decoration: line-through; }
.st-layer i { color: var(--muted); }
.st-eye { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px 6px; }
.st-eye:hover { color: #fff; }
.st-row { display: flex; gap: 14px; align-items: flex-end; }
.st-xy { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: 1; }
.st-grid { display: grid; grid-template-columns: repeat(3, 22px); gap: 3px; flex: none; }
.st-grid button { width: 22px; height: 22px; padding: 0; border-radius: 4px; border: 1px solid var(--line-strong); background: var(--panel); cursor: pointer; display: grid; place-items: center; }
.st-grid button span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.st-grid button:hover { border-color: var(--accent); }
.st-grid button:hover span { background: var(--accent); }
.st-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.st-check input { width: auto; accent-color: var(--accent); }
.st-color-row { display: flex; gap: 6px; }
.st-color-row input[type=color] { width: 42px; min-width: 42px; height: 38px; padding: 3px; cursor: pointer; }
.st-range { display: flex; align-items: center; gap: 10px; }
.st-range input { flex: 1; padding: 0; accent-color: var(--accent); }
.st-range output { min-width: 44px; text-align: right; font-size: 12.5px; color: var(--text); font-variant-numeric: tabular-nums; }
.st-upload { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px; border: 1px dashed var(--line-strong); border-radius: 8px; }
.st-upload b { color: #fff; font-size: 13.5px; }
.st-validate { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 20px; align-items: start; }
.st-validate img { width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.pass-thumb { height: 52px; width: auto; border-radius: 4px; cursor: zoom-in; border: 1px solid var(--line); background: #000; }
@media (max-width: 1250px) {
  .studio { grid-template-columns: 1fr; }
  .studio-stage { position: static; }
}
@media (max-width: 700px) { .st-validate { grid-template-columns: 1fr; } .st-stats { grid-template-columns: repeat(2, 1fr); } }

/* ------------------------------------------------------------ settings & profiles */
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.provider-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.provider-card { border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px; cursor: pointer; font-size: 13px; color: var(--muted); }
.provider-card b { display: block; color: #fff; font-size: 14px; }
.provider-card.on { border-color: var(--accent); background: var(--accent-soft); }
.provider-card input { display: none; }
.secret-hint { font-size: 12px; color: var(--muted); }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
@media (max-width: 1000px) { .settings-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ brand balance
   Gold is reserved for primary actions and highlights; secondary chrome stays neutral glass. */
.btn:hover { filter: brightness(1.07); }
.btn-ghost:hover, .btn-danger:hover { filter: none; }
.nav a.active { background: rgba(182, 161, 130, 0.10); box-shadow: inset 3px 0 0 var(--brand-gold); }
.tab.active { border-bottom-color: var(--brand-gold); }
.badge.accent { background: rgba(182, 161, 130, 0.14); color: var(--brand-gold-light); }
/* department identity colours */
.dept-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* ------------------------------------------------------------ Google Drive setup wizard */
.dw { font-size: 14.5px; line-height: 1.7; }
.dw[dir="rtl"] { font-family: 'Cairo', var(--font); }
.dw-progress { display: flex; gap: 6px; margin-bottom: 10px; }
.dw-progress span { flex: 1; height: 4px; border-radius: 4px; background: rgba(255,255,255,0.08); }
.dw-progress span.done { background: var(--brand-gold-dark); }
.dw-progress span.on { background: var(--brand-gold); }
.dw-list { margin: 0; padding-inline-start: 22px; display: grid; gap: 10px; }
.dw-list b { color: #fff; }
.dw-copy { display: flex; gap: 6px; align-items: center; margin: 6px 0; }
.dw-copy code { flex: 1; min-width: 0; padding: 7px 10px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); color: #fff; font-size: 12.5px; word-break: break-all; direction: ltr; unicode-bidi: isolate; user-select: all; }
.dw-warn { color: var(--warn); font-weight: 600; }
.dw-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.dw-methods .provider-card { line-height: 1.6; }
.dw-checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.dw-checks li { padding: 8px 12px; border-radius: 8px; background: rgba(255,255,255,0.03); }
.dw-checks li.ok i { color: var(--ok); }
.dw-checks li.bad { background: var(--danger-soft); }
.dw-checks li.bad i { color: var(--danger); }
.dw code { direction: ltr; unicode-bidi: isolate; }

/* ------------------------------------------------------------ fluid layout (all dashboards)
   Grid/flex children default to min-width:auto, so one long button row or table could push the whole
   page wider than the phone. min-width:0 lets every column shrink; wide tables scroll inside .table-wrap. */
.shell > *, .main, .content > *, .grid > *, .split > *, .studio > *, .kanban > *, .form-grid > *, .card-head > * { min-width: 0; }
.card { max-width: 100%; }
.card-head > div:first-child { flex: 1 1 220px; }
h1, h2, h3 { overflow-wrap: anywhere; }
.split { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); }

/* The studio adapts to the space it actually gets (container query), not the screen width:
   with the event list beside it on a laptop, the settings panel moves under the canvas. */
#tabBody { container-type: inline-size; }
@container (max-width: 980px) {
  .studio { grid-template-columns: minmax(0, 1fr); }
  .studio-stage { position: static; }
  #stCanvas { max-height: 62vh; }
}
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .card { padding: 16px; }
  .card-head .btn-row { width: 100%; }
  .studio-canvas-wrap { padding: 10px; }
}
@media (max-width: 520px) {
  .btn { padding: 9px 14px; }
  .card-head .btn-row .btn { flex: 1 1 auto; }
  .tabs .tab { padding-inline: 10px; }
  .st-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1920px) { .content { max-width: 1760px; } }

/* attachment gallery (decor references, design deliverables) */
.att-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 12px; }
.att-gallery:empty { display: none; }
.att-thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--panel-2); cursor: zoom-in; padding: 0; display: grid; place-items: center; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-thumb small { position: absolute; inset: auto 0 0 0; padding: 4px 6px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.75)); text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- autocomplete (organizer directory) */
.ac-wrap { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; margin-top: 4px; background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.45); max-height: 260px; overflow-y: auto; }
.ac-item { display: block; width: 100%; text-align: start; background: none; border: 0; color: inherit; padding: 9px 12px; cursor: pointer; font: inherit; border-bottom: 1px solid var(--line); }
.ac-item:last-child { border-bottom: 0; }
.ac-item:hover, .ac-item:focus { background: rgba(182,161,130,.14); outline: none; }
.ac-item b { display: block; color: #fff; font-weight: 600; }
.ac-item span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.ac-item[disabled] { opacity: .45; cursor: not-allowed; }
