/* Red Bull Account Hub — brand system from the RBMH graphic guidelines:
   deep navy, Red Bull crimson, white; bold uppercase headers, high contrast. */

:root {
  --navy: #12274d;
  --navy-900: #0d1b38;
  --navy-800: #16294d;
  --red: #e10a2b;
  --red-600: #c40823;
  --ink: #16181d;
  --muted: #5b6472;
  --faint: #8b93a2;
  --line: #e4e7ee;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --green: #1f9d5b;
  --amber: #e8930c;
  --danger: #e10a2b;
  --gold: #f5b301;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 26, 48, 0.06), 0 6px 20px rgba(16, 26, 48, 0.06);
  --font: "Inter", "Segoe UI", "Helvetica Neue", Tahoma, Arial, "Geeza Pro", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* layout */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px; }
.brand__mark { display: grid; place-items: center; }
.brand__text strong {
  display: block; font-size: 15px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
}
.brand__text small { color: #9db0d6; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; }
.nav a {
  padding: 10px 14px; border-radius: 8px; color: #c3cee6; font-weight: 600;
  letter-spacing: 0.02em; transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav a.active { background: var(--red); color: #fff; }
.sidebar__foot { margin-top: auto; padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.sidebar__foot a { color: #9db0d6; font-size: 12px; }
.sidebar__foot a:hover { color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px; height: 60px; background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
.topbar__spacer { flex: 1; }
.topbar__meta { color: var(--muted); font-size: 12px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { color: var(--faint); }
.content { padding: 28px; max-width: 1180px; width: 100%; }

/* headings */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin: 0 0 22px; flex-wrap: wrap; }
.page-head h1 {
  margin: 0; font-size: 26px; font-weight: 800; letter-spacing: 0.01em; text-transform: uppercase;
}
.page-head .sub { color: var(--muted); margin-top: 4px; font-weight: 500; }
.page-head .spacer { flex: 1; }
.kicker { color: var(--red); font-weight: 800; text-transform: uppercase; letter-spacing: 0.14em; font-size: 11px; }
h2.section { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 26px 0 12px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid transparent; border-radius: 8px; padding: 9px 16px;
  font-weight: 700; font-size: 13px; letter-spacing: 0.02em; transition: all 0.15s;
  background: #eef1f6; color: var(--ink);
}
.btn:hover { background: #e4e8ef; }
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-600); }
.btn--navy { background: var(--navy); color: #fff; }
.btn--navy:hover { background: var(--navy-900); }
.btn--ghost { background: transparent; border-color: var(--line); }
.btn--ghost:hover { background: #f2f4f8; }
.btn--sm { padding: 6px 11px; font-size: 12px; }
.btn--danger { background: transparent; color: var(--danger); border-color: #f3c9cf; }
.btn--danger:hover { background: #fdecef; }

/* cards / grid */
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card__body { padding: 18px; }

.stat { padding: 18px 18px 16px; position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: var(--navy); }
.stat.is-red::before { background: var(--red); }
.stat.is-amber::before { background: var(--amber); }
.stat.is-green::before { background: var(--green); }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.stat .value { font-size: 34px; font-weight: 800; line-height: 1.1; margin-top: 6px; }
.stat .hint { color: var(--faint); font-size: 12px; margin-top: 2px; }

/* health / status pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill--green { background: #e5f6ec; color: #147a45; }
.pill--amber { background: #fdf1dd; color: #a5670a; }
.pill--red { background: #fde4e8; color: #b30820; }
.pill--navy { background: #e7ecf6; color: var(--navy); }
.pill--muted { background: #eef1f6; color: var(--muted); }

/* tables */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--faint); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr.row { cursor: pointer; transition: background 0.12s; }
.table tr.row:hover { background: #f7f9fc; }
.table tr:last-child td { border-bottom: none; }
.tabular { font-variant-numeric: tabular-nums; }

/* list card rows */
.rowline { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.rowline:last-child { border-bottom: none; }
.rowline:hover { background: #f7f9fc; }
.rowline .grow { flex: 1; min-width: 0; }
.rowline .title { font-weight: 700; }
.rowline .meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

.avatar {
  width: 38px; height: 38px; border-radius: 10px; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 800; flex-shrink: 0; letter-spacing: 0.02em;
}
.avatar.sm { width: 30px; height: 30px; border-radius: 8px; font-size: 12px; }

/* empty states */
.empty {
  text-align: center; padding: 54px 20px; border: 1.5px dashed var(--line); border-radius: var(--radius);
  background: #fff; color: var(--muted);
}
.empty h3 { margin: 0 0 6px; color: var(--ink); font-size: 16px; }
.empty p { margin: 0 auto 16px; max-width: 380px; }

/* forms / modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(13, 27, 56, 0.55); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 20px; z-index: 50;
}
.modal {
  width: 100%; max-width: 460px; background: #fff; border-radius: 14px; box-shadow: 0 20px 60px rgba(13,27,56,0.35);
  overflow: hidden; animation: pop 0.14s ease-out;
}
@keyframes pop { from { transform: translateY(6px) scale(0.99); opacity: 0; } to { transform: none; opacity: 1; } }
.modal__head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal__head h3 { margin: 0; font-size: 17px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; }
.modal__head .x { margin-inline-start: auto; cursor: pointer; color: var(--faint); font-size: 20px; line-height: 1; background: none; border: none; }
.modal__body { padding: 20px; display: grid; gap: 14px; }
.modal__foot { padding: 16px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

.field label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; color: var(--ink);
  background: #fff; outline: none; transition: border 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(225, 10, 43, 0.12); }
.field textarea { resize: vertical; min-height: 80px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* task checkbox row */
.task { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: none; }
.task .check {
  width: 20px; height: 20px; border-radius: 6px; border: 2px solid #c7cede; cursor: pointer; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; transition: all 0.12s;
}
.task .check.done { background: var(--green); border-color: var(--green); }
.task .tt { flex: 1; }
.task.is-done .tt { text-decoration: line-through; color: var(--faint); }
.task .due { font-size: 12px; font-weight: 700; }
.task .due.over { color: var(--danger); }

.linkish { color: var(--red); font-weight: 700; cursor: pointer; }
.muted { color: var(--muted); }
.right { text-align: end; }
.hstack { display: flex; align-items: center; gap: 10px; }
.progress { height: 6px; border-radius: 4px; background: #eceff5; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--navy); }

/* toast */
.toast-root { position: fixed; bottom: 22px; inset-inline-end: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 80; }
.toast {
  background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(13,27,56,0.4);
  font-weight: 600; animation: pop 0.14s ease-out; max-width: 340px;
}
.toast.err { background: var(--red); }

.langtoggle {
  background: rgba(255,255,255,0.08); color: #fff; border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px; padding: 7px 12px; font: inherit; font-weight: 700; font-size: 12px; cursor: pointer;
  letter-spacing: 0.02em; transition: background 0.15s;
}
.langtoggle:hover { background: rgba(255,255,255,0.16); }
/* keep the modal close glyph put on the correct side in both directions */
[dir="rtl"] .att__del, [dir="rtl"] .empty .btn { text-align: right; }

/* attachments */
.att-grid { margin-top: 4px; }
.att { overflow: hidden; display: flex; flex-direction: column; }
.att__preview { display: block; aspect-ratio: 16 / 10; background: #eef1f6; overflow: hidden; }
.att__preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att__file { width: 100%; height: 100%; display: grid; place-items: center; font-weight: 800; color: var(--navy); letter-spacing: 0.06em; font-size: 18px; }
.att__meta { padding: 10px 12px; flex: 1; min-width: 0; }
.att__name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att__del { margin: 0 12px 12px; align-self: flex-start; }

/* responsive — mobile turns the sidebar into a top bar and stacks everything */
@media (max-width: 820px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: sticky; top: 0; z-index: 20;
    flex-direction: row; align-items: center;
  }
  .brand { padding: 12px 16px; }
  .nav { flex-direction: row; padding: 0 8px; margin-left: auto; gap: 4px; }
  .nav a { padding: 10px 12px; }
  .sidebar__foot { display: none; }
  .topbar { padding: 0 16px; }
  .content { padding: 18px 16px; max-width: 100%; }
  .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .page-head { align-items: flex-start; }
}
@media (max-width: 520px) {
  .grid.cols-4, .grid.cols-3, .grid.cols-2, .att-grid { grid-template-columns: 1fr; }
  .brand__text small { display: none; }
  .page-head h1 { font-size: 22px; }
  .stat .value { font-size: 28px; }
  .crumbs { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 58vw; }
  .rowline { flex-wrap: wrap; }
  .rowline .progress { display: none; }
}
