/* VRL Production Team Leads Dashboard — shared styles.
   Plain CSS, no framework. Light/dark aware. Mobile-first. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e2e6ea;
  --text: #1c2530;
  --muted: #667085;
  --brand: #2f6df6;
  --brand-ink: #ffffff;
  --danger: #d64545;
  --ok: #1f9d6b;
  --warn: #d99400;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
  --radius: 12px;
  --radius-sm: 8px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141a; --surface: #171e26; --surface-2: #1f2833; --border: #2a3542;
    --text: #e6eaef; --muted: #9aa7b5; --brand: #5b8dff; --shadow: none;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.25; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .6em; }
small { color: var(--muted); }

/* Layout ------------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { font-weight: 700; letter-spacing: .2px; }
.topbar .brand small { display: block; font-weight: 400; font-size: .72rem; }
.topbar .spacer { flex: 1; }
.topbar .who { color: var(--muted); font-size: .85rem; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 20px; }
.section { margin: 26px 0; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.section-head .spacer { flex: 1; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 6px; }

/* Buttons ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-weight: 600; cursor: pointer;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 4px 9px; font-size: .82rem; }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
.iconbtn { border: none; background: none; cursor: pointer; color: var(--muted); padding: 4px 7px; border-radius: 6px; font-size: .95rem; }
.iconbtn:hover { background: var(--surface-2); color: var(--text); }

/* Cards & tiles ------------------------------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.tile { padding: 16px; display: flex; flex-direction: column; gap: 8px; min-height: 128px; }
.tile .tile-title { font-weight: 700; font-size: 1.05rem; }
.tile .snippet { color: var(--muted); font-size: .9rem; flex: 1; }
.tile .tile-foot { display: flex; align-items: center; gap: 6px; }
.tile-actions { display: flex; gap: 2px; }

/* Status chips ------------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  padding: 3px 9px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .9; }
.chip.gray   { color: var(--muted);  background: var(--surface-2); }
.chip.blue   { color: var(--brand);  background: color-mix(in srgb, var(--brand) 12%, transparent); }
.chip.green  { color: var(--ok);     background: color-mix(in srgb, var(--ok) 14%, transparent); }
.chip.amber  { color: var(--warn);   background: color-mix(in srgb, var(--warn) 15%, transparent); }
.chip.red    { color: var(--danger); background: color-mix(in srgb, var(--danger) 13%, transparent); }

/* Lists / rows ------------------------------------------------------------- */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: none; }
.row .grow { flex: 1; min-width: 0; }
.row .grow .title { font-weight: 600; }
.row .grow .meta { color: var(--muted); font-size: .82rem; }
.row .reorder { display: flex; flex-direction: column; }
.row .reorder .iconbtn { padding: 0 5px; line-height: 1.1; font-size: .8rem; }
.empty { padding: 22px; text-align: center; color: var(--muted); }

/* Forms -------------------------------------------------------------------- */
label { display: block; font-weight: 600; font-size: .85rem; margin: 12px 0 4px; }
input[type=text], input[type=date], input[type=email], select, textarea {
  width: 100%; font: inherit; color: var(--text);
  padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface);
}
textarea { resize: vertical; min-height: 72px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 0; border-color: var(--brand); }
.inline { display: flex; gap: 8px; align-items: center; }

/* Modal -------------------------------------------------------------------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(12, 18, 26, .5);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 16px; z-index: 50; overflow-y: auto;
}
.modal {
  background: var(--surface); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,.28);
  width: 100%; max-width: 560px; border: 1px solid var(--border);
}
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; flex: 1; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border); }

/* Dropdown ----------------------------------------------------------------- */
.dropdown { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 8px 30px rgba(0,0,0,.18); padding: 6px;
}
.menu button { display: block; width: 100%; text-align: left; background: none; border: none; color: var(--text); font: inherit; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.menu button:hover { background: var(--surface-2); }
.hidden { display: none !important; }

/* Activity strip ----------------------------------------------------------- */
.activity { display: flex; flex-direction: column; }
.activity .act { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: .85rem; }
.activity .act:last-child { border-bottom: none; }
.activity .act .when { color: var(--muted); white-space: nowrap; }

/* Table (audit) ------------------------------------------------------------ */
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data th { color: var(--muted); font-weight: 600; white-space: nowrap; }
code.snap { font-size: .78rem; color: var(--muted); word-break: break-word; }

/* Toast -------------------------------------------------------------------- */
.toast-wrap { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #1c2530; color: #fff; padding: 10px 16px; border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.3); font-size: .88rem; }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* Utility ------------------------------------------------------------------ */
.muted { color: var(--muted); }
.stack > * + * { margin-top: 10px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
@media (max-width: 640px) {
  .wrap { padding: 14px; }
  .topbar { padding: 10px 14px; }
  .who { display: none; }
  .tiles { grid-template-columns: 1fr; }
}
