:root {
  --bg: #ffffff;
  --bg-2: #eceef2;
  --panel: #f6f7f9;
  --ink: #1f2430;
  --muted: #6b7280;
  --line: #e8eaee;
  --brand: #E5342A;
  --brand-dark: #c5271e;
  --brand-soft: #fdeceb;
  --sidebar: #1b1e25;
  --accent: #4f5bd5;
  --green: #1f8a4c;
  --amber: #d98521;
  --danger: #c5271e;
  --radius: 16px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(20, 24, 31, .05), 0 1px 3px rgba(20, 24, 31, .04);
  --shadow: 0 8px 24px rgba(20, 24, 31, .07);
  --shadow-lg: 0 22px 50px rgba(20, 24, 31, .14);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Montserrat, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
}
h1, h2, h3 { letter-spacing: -.01em; font-weight: 600; }
strong, b { font-weight: 600; }

button, input, textarea, select { font: inherit; }
button {
  border: 0;
  border-radius: var(--radius-sm);
  min-height: 40px;
  padding: 0 16px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: background .15s ease, box-shadow .15s ease, transform .05s ease, color .15s ease;
}
button:hover { background: var(--brand-dark); }
button:active { transform: translateY(1px); }
button.secondary { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
button.secondary:hover { background: var(--bg-2); }
button.ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px var(--line); }
button.ghost:hover { background: #fff; }
button.danger { background: var(--danger); }
button.danger:hover { background: #5c050f; }
button:disabled { opacity: .5; cursor: not-allowed; }
button:disabled:hover { background: var(--brand); transform: none; }
button.secondary:disabled:hover { background: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--brand); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  min-height: 40px;
  padding: 9px 11px;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(73, 79, 118, .12); outline: none; }
textarea { min-height: 96px; resize: vertical; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.login-visual {
  background:
    linear-gradient(rgba(20, 12, 34, .64), rgba(20, 12, 34, .74)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 900'%3E%3Crect fill='%23E6E1D4' width='1200' height='900'/%3E%3Cpath fill='%23E42314' d='M0 0h420L0 420zM1200 0v330L870 0zM1200 900H760l440-440z'/%3E%3Cpath fill='%23140C22' d='M420 0h360L600 180zM0 900V520l330 380zM510 390h360v360H510z'/%3E%3Cpath fill='%23494F76' d='M330 180h360L510 360zM760 0h220L870 220zM0 420l230-230 230 230z'/%3E%3Cpath fill='%23790713' d='M870 220h330v240zM230 190l280 200H0zM510 750h360L690 900z'/%3E%3C/svg%3E") center/cover;
  color: #fff;
  padding: clamp(32px, 7vw, 88px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.login-visual h1 { font-size: clamp(2.1rem, 5vw, 4.5rem); line-height: 1; margin: 0 0 18px; }
.login-visual p { max-width: 620px; font-size: 1.05rem; line-height: 1.55; margin: 0; }
.login-panel { display: grid; place-items: center; padding: 28px; }
.login-box {
  width: min(100%, 430px);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
  padding: 32px;
}
.login-box h2 { margin: 0 0 6px; font-size: 1.5rem; }
.login-box p { margin: 0 0 22px; color: var(--muted); }
.login-logo { width: 52px; height: 52px; display: block; margin: 0 0 16px; }
.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field label, .field > span { color: var(--ink); font-size: .86rem; font-weight: 500; }
.language-select { width: auto; min-width: 70px; background: #fff; font-weight: 600; }
.login-lang { display: flex; justify-content: center; margin-top: 16px; }

/* ---------- App shell ---------- */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 256px 1fr; }
.sidebar {
  background: var(--sidebar);
  color: #cdd1d9;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 600; }
.brand-logo { width: 40px; height: 40px; display: block; flex: 0 0 auto; }
.nav { display: grid; gap: 4px; }
.nav button {
  width: 100%;
  justify-content: flex-start;
  gap: 11px;
  background: transparent;
  text-align: left;
  color: #aeb4c0;
  border-radius: 10px;
  font-weight: 400;
}
.nav button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav button.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav button.active:hover { background: var(--brand-soft); }
.nav button.active .nav-ic { color: var(--brand); }
.nav button.sub { padding-left: 45px; min-height: 36px; font-size: .92rem; }
.nav-ic { width: 18px; height: 18px; flex: 0 0 auto; color: #8b91a0; }
.nav button:hover .nav-ic { color: #fff; }
.nav-label { color: #6b7180; font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; padding: 14px 10px 2px; }
.userbox { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 16px; font-size: .9rem; color: #aeb4c0; }
.userbox strong { color: #fff; }

.content { padding: 26px clamp(16px, 3vw, 34px); min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h1 { margin: 0; font-size: 1.7rem; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.top-actions { display: inline-flex; align-items: center; gap: 10px; }
.session-pill {
  min-height: 40px; display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px 4px 5px; background: #fff; cursor: pointer;
}
.session-pill:hover { border-color: var(--accent); }
.profile-card { display: flex; align-items: center; gap: 18px; }
.profile-meta { display: grid; gap: 4px; }
.avatar-editor { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.avatar-editor .field { gap: 7px; }
.admin-row.is-inactive { opacity: .6; }
.admin-row.is-inactive summary > strong { text-decoration: line-through; }
.session-meta { display: flex; flex-direction: column; justify-content: center; }
.session-pill span { font-weight: 600; line-height: 1.15; font-size: .9rem; }
.session-pill small { color: var(--muted); line-height: 1.15; font-size: .78rem; }
.logout-button { background: var(--ink); }
.logout-button:hover { background: #000; }
.notice-button { position: relative; background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.notice-button:hover { background: var(--bg-2); }
.notice-button.has-notice { box-shadow: inset 0 0 0 2px var(--brand); }
.notice-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 4px;
  border-radius: 999px; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 600; padding: 0 5px;
}

/* ---------- Panels & lists ---------- */
.grid { display: grid; grid-template-columns: minmax(340px, 1fr) minmax(380px, .9fr); gap: 20px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-head { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h2 { margin: 0; font-size: 1.05rem; }
.panel-body { padding: 18px; }
.panel-body h2 { margin: 0 0 6px; font-size: 1.05rem; }
.panel-body h3 { margin: 16px 0 6px; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.filters > input { flex: 2 1 220px; }
.filters > select, .filters .rich-select { flex: 1 1 150px; }
.filters > button { flex: 0 0 auto; }
.request-list { display: grid; gap: 10px; padding: 14px; max-height: calc(100vh - 230px); overflow: auto; }
.request-item {
  width: 100%; text-align: left; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px;
  display: grid; gap: 6px; box-shadow: var(--shadow-sm); transition: box-shadow .15s ease, transform .08s ease, border-color .15s ease;
  justify-items: stretch; justify-content: start;
}
.request-item:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.request-item.active { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand), var(--shadow); }
.item-head { display: flex; align-items: center; justify-content: flex-start; gap: 9px; }
.item-head .item-title { flex: 1 1 auto; min-width: 0; text-align: left; }
.item-title { font-weight: 600; line-height: 1.25; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-start; color: var(--muted); font-size: .82rem; }

/* ---------- Requests table ---------- */
.title-block h1 { margin: 0; }
.subtitle { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.req-table { width: 100%; border-collapse: collapse; }
.req-table thead th { text-align: left; padding: 12px 16px; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; }
.req-table tbody td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: .9rem; }
.req-table tbody tr:last-child td { border-bottom: 0; }
.req-row { cursor: pointer; transition: background .12s ease; }
.req-row:hover { background: var(--bg-2); }
.req-row.is-overdue { background: #fdf3f2; }
.req-row.is-overdue:hover { background: #fbeae8; }
.cell-title { display: flex; align-items: center; gap: 8px; }
.cell-title .item-title { font-weight: 600; }
.cell-country { display: inline-flex; align-items: center; gap: 8px; }
.prio-cell { display: inline-flex; align-items: center; gap: 8px; }
.row-chev { color: var(--muted); font-size: 1.2rem; text-align: right; width: 28px; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; flex-wrap: wrap; }
.pager { display: flex; align-items: center; gap: 8px; }
.pager button { min-height: 34px; padding: 0 12px; }
.pager-num { font-weight: 600; min-width: 56px; text-align: center; }
.page-size { width: auto; min-width: 120px; min-height: 34px; }
.back-btn { padding-left: 8px; }

/* ---------- Badges & avatars ---------- */
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 999px; background: #efeade; color: var(--ink); font-size: .76rem; font-weight: 600; }
.badge.draft, .badge.submitted { background: #e5e7eb; color: #4b5563; }
.badge.in_review { background: #fef3c7; color: #92400e; }
.badge.changes_requested { background: #ffedd5; color: #9a3412; }
.badge.assets_ready { background: #dbeafe; color: #1d4ed8; }
.badge.approved { background: #dcfce7; color: #166534; }
.badge.urgent, .badge.overdue { background: #fee2e2; color: #b91c1c; }
.badge.blocked { background: #fecaca; color: #7f1d1d; }
.badge.archived { background: #111827; color: #fff; }
.badge.prio-high { background: #faeccf; color: #8a5208; text-transform: capitalize; }
.badge.prio-urgent { background: var(--brand); color: #fff; text-transform: capitalize; }

.avatar {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  color: #fff; font-weight: 500; font-size: .72rem; flex: 0 0 auto; box-shadow: 0 0 0 2px var(--panel);
  background: var(--accent);
}
.avatar.sm { width: 24px; height: 24px; font-size: .62rem; }
.avatar.xl { width: 84px; height: 84px; font-size: 1.7rem; }
.avatar-img { object-fit: cover; background: var(--bg-2); }
.avatar-group { display: inline-flex; align-items: center; }
.avatar-group .avatar { margin-left: -8px; }
.avatar-group .avatar:first-child { margin-left: 0; }
.avatar.ac0 { background: #E4572E; }
.avatar.ac1 { background: #D1495B; }
.avatar.ac2 { background: #C9184A; }
.avatar.ac3 { background: #9D4EDD; }
.avatar.ac4 { background: #5A189A; }
.avatar.ac5 { background: #3F37C9; }
.avatar.ac6 { background: #4361EE; }
.avatar.ac7 { background: #0077B6; }
.avatar.ac8 { background: #2A9D8F; }
.avatar.ac9 { background: #1F8A4C; }
.avatar.ac10 { background: #B4690E; }
.avatar.ac11 { background: #6D597A; }
.flag { border-radius: 2px; flex: 0 0 auto; object-fit: cover; display: inline-block; vertical-align: middle; }
.sep-top { border-top: 1px solid var(--line); }

/* ---------- Forms / detail ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span2 { grid-column: 1 / -1; }
.format-select { min-height: 116px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; gap: 7px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: #fff; }
.check input { width: auto; min-height: auto; }
.asset-list { display: grid; gap: 8px; margin-top: 10px; }
.asset { display: flex; justify-content: space-between; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px; background: var(--bg-2); }
.asset small { color: var(--muted); display: block; }
.activity { display: grid; gap: 10px; padding-left: 0; list-style: none; margin: 6px 0 0; }
.activity li { border-left: 3px solid var(--line); padding-left: 12px; color: var(--ink); font-size: .9rem; }
.error { color: var(--danger); font-weight: 500; margin-top: 10px; }
.ok { color: var(--accent); font-weight: 500; margin-top: 10px; }
.empty { color: var(--muted); padding: 18px; text-align: center; }

.detail-layout { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.detail-head { padding-bottom: 0; border-bottom: 0; }
.detail-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-title h2 { margin: 0; }
.tabs { display: flex; gap: 4px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.tab { background: transparent; color: var(--muted); box-shadow: none; border-radius: 0; min-height: 44px; padding: 0 14px; font-weight: 500; border-bottom: 2px solid transparent; }
.tab:hover { background: transparent; color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.detail-rail { position: sticky; top: 18px; }
.assignee-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.muted-label { color: var(--muted); font-weight: 500; }
.assign-panel h2 { margin-bottom: 4px; }
.assign-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.assign-chip {
  display: inline-flex; align-items: center; gap: 8px; background: var(--bg-2); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line); border-radius: 999px; padding: 4px 14px 4px 4px; min-height: 36px; font-weight: 500;
}
.assign-chip:hover { background: #fff; }
.assign-chip.on { background: var(--accent); color: #fff; box-shadow: none; }
.assign-chip.on .avatar { box-shadow: 0 0 0 2px var(--accent); }

.search-preview { border-bottom: 1px solid var(--line); background: #fff; padding: 12px 16px; display: grid; gap: 10px; }
.preview-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .82rem; }
.preview-list { display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr)); gap: 8px; overflow-x: auto; }
.preview-item { display: grid; gap: 4px; min-height: 74px; align-content: start; text-align: left; background: var(--panel); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); padding: 10px; }
.preview-item:hover { background: var(--bg-2); }
.preview-item .meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tasks-panel { display: grid; gap: 14px; }
.task-form, .task-row { display: grid; grid-template-columns: minmax(180px, 1fr) 180px auto; gap: 8px; align-items: center; }
.task-row { grid-template-columns: minmax(180px, 1fr) 180px 40px 40px; }
.task-title-input { min-height: 54px; max-height: 150px; }
.task-list, .subtasks { display: grid; gap: 10px; }
.task-item { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; background: #fff; }
.task-item.depth-1 { margin-left: 22px; background: var(--panel); }
.task-item.depth-2, .task-item.depth-3 { margin-left: 22px; background: var(--bg-2); }
.subtask-box[hidden] { display: none; }
.subtask-box { border-top: 1px dashed var(--line); padding-top: 10px; }
.task-status { font-weight: 600; }
.task-status.status-submitted { background: #e5e7eb; color: #4b5563; }
.task-status.status-in_review { background: #fef3c7; color: #92400e; }
.task-status.status-changes_requested { background: #ffedd5; color: #9a3412; }
.task-status.status-assets_ready { background: #dbeafe; color: #1d4ed8; }
.task-status.status-approved { background: #dcfce7; color: #166534; }
.task-status.status-urgent, .task-status.status-overdue { background: #fee2e2; color: #b91c1c; }
.task-status.status-blocked { background: #fecaca; color: #7f1d1d; }
.task-status.status-archived { background: #111827; color: #fff; }

/* ---------- Admin ---------- */
.users { display: grid; gap: 10px; }
.user-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; border: 1px solid var(--line); padding: 11px; border-radius: var(--radius-sm); }
.admin-grid { display: grid; gap: 18px; }
.admin-grid.single { max-width: 980px; }
.admin-row { border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; overflow: hidden; box-shadow: var(--shadow-sm); }
.admin-row summary { min-height: 50px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 40px 12px 14px; cursor: pointer; position: relative; }
.admin-row summary > strong { flex: 1 1 auto; }
.admin-row summary::-webkit-details-marker { display: none; }
.admin-row summary::after { content: "\203A"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 1.35rem; line-height: 1; color: var(--muted); transition: transform .15s ease; }
.admin-row[open] summary::after { transform: translateY(-50%) rotate(90deg); }
.admin-row[open] summary { border-bottom: 1px solid var(--line); background: var(--bg-2); }
.admin-row:hover { border-color: #d8d2c4; }
.compact-form { border-top: 1px solid var(--line); background: var(--bg-2); }
.create-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px 0; font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }

/* ---------- Board ---------- */
.board-controls { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.board-controls select { width: auto; min-width: 160px; background: #fff; font-weight: 600; }
.board-controls .sort-select { margin-left: auto; }
.rich-select { position: relative; display: inline-block; min-width: 150px; }
.rich-btn { width: 100%; display: flex; align-items: center; gap: 8px; background: #fff; color: var(--ink); font-weight: 600; text-align: left; padding: 9px 12px; box-shadow: inset 0 0 0 1px var(--line); }
.rich-btn:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.rich-caret { flex: 0 0 auto; color: var(--muted); font-size: .8rem; }
.rich-btn .rich-label { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rich-menu { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; min-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 5px; max-height: 280px; overflow: auto; }
.rich-opt { width: 100%; display: flex; align-items: center; gap: 8px; background: transparent; color: var(--ink); box-shadow: none; min-height: auto; text-align: left; padding: 8px 10px; border-radius: 7px; font-weight: 500; white-space: nowrap; }
.rich-opt:hover { background: var(--bg-2); }
.rich-opt.on { background: var(--bg-2); font-weight: 700; }
.rich-dot { width: 12px; height: 12px; border-radius: 999px; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); background: #cbd5e1; }
.rich-dot.dot-neutral { background: #cbd5e1; }
.rich-dot.s-draft, .rich-dot.s-submitted { background: #9ca3af; }
.rich-dot.s-in_review { background: #E2B007; }
.rich-dot.s-changes_requested { background: #E8730C; }
.rich-dot.s-assets_ready { background: #2563eb; }
.rich-dot.s-approved { background: #1F8A4C; }
.rich-dot.s-overdue { background: #B91C1C; }
.rich-dot.s-blocked { background: #7F1D1D; }
.rich-dot.s-archived { background: #111827; }
.rich-dot.n-facebook { background: #1877f2; }
.rich-dot.n-instagram { background: #f97316; }
.rich-dot.n-linkedin { background: #38bdf8; }
.rich-dot.n-youtube { background: #dc2626; }
.rich-dot.n-website { background: #4b5563; }
.rich-prio-blank { opacity: .4; }
.rich-select .flag { border-radius: 2px; flex: 0 0 auto; }
.rich-select .prio-mark { width: 12px; font-size: 1rem; }
.view-legend { display: grid; gap: 6px; margin: -4px 0 12px; opacity: .74; }
.legend-group { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; color: var(--muted); font-size: .7rem; }
.legend-title { color: var(--muted); font-weight: 600; margin-right: 1px; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend-swatch { width: 8px; height: 8px; border-radius: 999px; flex: 0 0 auto; background: #6b7280; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); opacity: .86; }
.legend-swatch.social-facebook { background: #1877f2; }
.legend-swatch.social-linkedin { background: #38bdf8; }
.legend-swatch.social-instagram { background: #f97316; }
.legend-swatch.social-youtube { background: #dc2626; }
.legend-swatch.social-website { background: #4b5563; }
.board-hint { color: var(--muted); margin: 0 0 14px; font-size: .92rem; }
.mode-toggle { display: inline-flex; background: var(--bg-2); border-radius: var(--radius-sm); padding: 3px; gap: 3px; }
.toggle-btn { background: transparent; color: var(--muted); box-shadow: none; min-height: 32px; padding: 0 14px; border-radius: 7px; font-weight: 500; }
.toggle-btn:hover { background: transparent; color: var(--ink); }
.toggle-btn.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.week-nav { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.week-nav button { min-height: 34px; padding: 0 12px; }
.week-label { font-weight: 600; min-width: 120px; text-align: center; }

/* weekly planner */
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.week-col { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); min-height: 160px; display: flex; flex-direction: column; }
.week-col.today { box-shadow: inset 0 0 0 2px var(--brand); }
.week-col-head { display: flex; align-items: baseline; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.week-wd { text-transform: uppercase; font-size: .72rem; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.week-daynum { font-size: 1.1rem; font-weight: 600; }
.week-col.today .week-daynum { color: var(--brand); }
.week-cards { display: grid; gap: 10px; padding: 12px; }
.week-empty { min-height: 30px; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.week-card { display: grid; gap: 8px; text-align: left; background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); border-radius: var(--radius-md); padding: 11px; min-height: auto; }
.week-card:hover { box-shadow: var(--shadow); }
.week-card.is-overdue { background: #fdf3f2; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 12px; align-items: start; cursor: grab; overscroll-behavior-x: contain; }
.board.is-panning { cursor: grabbing; user-select: none; }
.board-col { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); min-height: 150px; display: flex; flex-direction: column; }
.board-col.drop { outline: 2px dashed var(--brand); outline-offset: -4px; background: #fff; }
.board-col-head { display: flex; align-items: center; gap: 9px; padding: 13px 15px; font-weight: 600; }
.board-col-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count-pill { background: #fff; box-shadow: inset 0 0 0 1px var(--line); border-radius: 999px; min-width: 24px; height: 22px; display: inline-grid; place-items: center; font-size: .74rem; font-weight: 600; padding: 0 7px; }
.board-cards { display: grid; gap: 10px; padding: 12px; }
.board-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px; cursor: grab; box-shadow: var(--shadow-sm); display: grid; gap: 9px; transition: box-shadow .15s ease, transform .08s ease; }
.board-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.board-card:active { cursor: grabbing; }
.card-top { display: flex; align-items: center; gap: 8px; }
.card-top .item-title { flex: 1 1 auto; min-width: 0; font-size: .95rem; }
.board-card.status-bd { border-left-width: 4px; }
.board-card.draft, .board-card.submitted { border-left-color: #9ca3af; }
.board-card.in_review { border-left-color: #E2B007; }
.board-card.changes_requested { border-left-color: #E8730C; }
.board-card.assets_ready { border-left-color: #2563eb; }
.board-card.approved { border-left-color: #1F8A4C; }
.board-card.overdue { border-left-color: #B91C1C; }
.board-card.blocked { border-left-color: #7F1D1D; }
.board-card.archived { border-left-color: #111827; }
.chip-x { background: transparent; color: var(--muted); box-shadow: none; min-height: auto; height: 24px; width: 24px; padding: 0; border-radius: 50%; font-size: 1.15rem; flex: 0 0 auto; }
.chip-x:hover { background: var(--brand); color: #fff; }

/* ---------- Calendar ---------- */
.cal-label { font-weight: 600; min-width: 160px; text-align: center; display: inline-grid; place-items: center; font-size: 1.02rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-weekday { background: var(--bg-2); padding: 9px; text-align: center; font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cal-cell { background: #fff; min-height: 108px; padding: 7px; display: flex; flex-direction: column; gap: 5px; }
.cal-cell.empty { background: var(--bg-2); }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--brand); }
.cal-daynum { font-size: .78rem; font-weight: 600; color: var(--muted); }
.cal-cell.today .cal-daynum { color: var(--brand); }
.cal-events { display: grid; gap: 4px; }
.cal-chip { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; background: var(--bg-2); color: var(--ink); min-height: auto; padding: 5px 7px; border-radius: 7px; font-size: .74rem; font-weight: 500; border-left: 3px solid var(--accent); box-shadow: none; }
.cal-chip:hover { background: #fff; box-shadow: var(--shadow-sm); }
.cal-chip.draft, .cal-chip.submitted { border-left-color: #9ca3af; }
.cal-chip.in_review { border-left-color: #E2B007; }
.cal-chip.changes_requested { border-left-color: #E8730C; }
.cal-chip.assets_ready { border-left-color: #2563eb; }
.cal-chip.approved { border-left-color: #1F8A4C; }
.cal-chip.overdue { border-left-color: #B91C1C; }
.cal-chip.blocked { border-left-color: #7F1D1D; }
.cal-chip.archived { border-left-color: #111827; }
.cal-chip .prio-mark { font-size: .95rem; width: 11px; }
.cal-chip-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-dots { display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto; }
.social-dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; flex: 0 0 auto; background: #6b7280; }
.social-dot.social-facebook { background: #1877f2; }
.social-dot.social-linkedin { background: #38bdf8; }
.social-dot.social-instagram { background: #f97316; }
.social-dot.social-youtube { background: #dc2626; }
.social-dot.social-website { background: #4b5563; }

/* ---------- Priority & overdue ---------- */
.prio-mark { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 14px; font-weight: 900; font-size: 1.25rem; line-height: 1; text-shadow: 0 1px 1px rgba(0, 0, 0, .12); }
.prio-mark.prio-urgent { color: #E42314; }
.prio-mark.prio-high { color: #E8730C; }
.prio-mark.prio-normal { color: #E2B007; }
.prio-mark.prio-low { color: #1F8A4C; }
.legend-group .prio-mark { font-size: .9rem; width: 9px; }
.overdue-flag {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--brand); color: #fff; font-weight: 600; font-size: .74rem; flex: 0 0 auto;
}
.request-item.is-overdue { background: #fdf3f2; }
.board-card.is-overdue { background: #fdf3f2; }
.due-late { color: var(--brand); font-weight: 600; }

/* ---------- Reports ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.kpi-value { font-size: 2.1rem; font-weight: 600; line-height: 1; }
.kpi-label { color: var(--muted); font-weight: 500; font-size: .84rem; margin-top: 6px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-icon-wrap { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--bg-2); color: var(--accent); }
.kpi-active .kpi-value { color: var(--amber); }
.kpi-active .kpi-icon-wrap { background: #faeccf; color: var(--amber); }
.kpi-ok .kpi-value { color: var(--green); }
.kpi-ok .kpi-icon-wrap { background: #d8ecdd; color: var(--green); }
.kpi-alert { border-color: #f0a8a0; background: #fdf3f2; }
.kpi-alert .kpi-value { color: var(--brand); }
.kpi-alert .kpi-icon-wrap { background: #f8d9d5; color: var(--brand); }

/* charts */
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 140px; height: 140px; flex: 0 0 auto; }
.donut-value { fill: var(--ink); font-size: 26px; font-weight: 600; }
.donut-label { fill: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.donut-legend { display: grid; gap: 8px; flex: 1 1 160px; }
.legend-row { display: flex; align-items: center; gap: 9px; }
.legend-dot { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto; background: #999; }
.legend-draft, .legend-submitted { background: #9ca3af; } .legend-in_review { background: #E2B007; }
.legend-changes_requested { background: #E8730C; } .legend-assets_ready { background: #2563eb; } .legend-approved { background: #1F8A4C; }
.legend-urgent { background: #E42314; } .legend-overdue { background: #B91C1C; } .legend-blocked { background: #7F1D1D; } .legend-archived { background: #111827; }
.barchart { width: 100%; max-width: 360px; max-height: 230px; height: auto; display: block; margin: 0 auto; }
.bar-val { fill: var(--ink); font-size: 12px; font-weight: 600; }
.bar-lbl { fill: var(--muted); font-size: 11px; }
.grid-line { stroke: #edeff3; stroke-width: 1; }
.axis-line { stroke: #d8dbe1; stroke-width: 1; }
.axis-lbl { fill: #9aa0ac; font-size: 9px; }
.report-status { margin-bottom: 18px; }
.report-status .donut-wrap { justify-content: center; gap: 32px; }
.report-status .donut-legend { flex: 0 0 auto; min-width: 200px; }
.country-bars { display: grid; gap: 12px; }
.country-bar-row { display: grid; grid-template-columns: 22px 90px 1fr 24px; align-items: center; gap: 10px; }
.country-name { font-weight: 500; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar { width: 100%; }
.hbar-svg { width: 100%; height: 10px; display: block; }
.country-count { font-weight: 600; text-align: right; }
.report-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; align-items: start; }
.report-card.card-alert { border-color: #f0a8a0; }
.report-body { display: grid; gap: 10px; }
.stat-line { display: flex; align-items: center; gap: 9px; }
.stat-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.stat-bar-row { display: grid; gap: 5px; }
.stat-bar-head { display: flex; align-items: center; gap: 9px; }
.stat-bar-head .stat-name { font-weight: 600; }
.stat-progress { width: 100%; height: 9px; border: 0; border-radius: 999px; background: var(--bg-2); appearance: none; -webkit-appearance: none; overflow: hidden; }
.stat-progress::-webkit-progress-bar { background: var(--bg-2); border-radius: 999px; }
.stat-progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.stat-progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.report-row { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--radius-sm); padding: 10px 12px; min-height: auto; }
.report-row:hover { background: var(--bg-2); }
.report-row.is-overdue { background: #fdf3f2; }
.report-due { color: var(--muted); font-weight: 500; font-size: .82rem; flex: 0 0 auto; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .login { grid-template-columns: 1fr; }
  .login-visual { min-height: 260px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 5; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .brand { flex: 0 0 auto; }
  .nav { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; gap: 6px; }
  .nav button { white-space: nowrap; }
  .nav button.sub { padding-left: 14px; }
  .nav-label { display: none; }
  .userbox { margin: 0 0 0 auto; border-top: 0; padding-top: 0; text-align: right; }
  .grid { grid-template-columns: 1fr; }
  .request-list { max-height: 460px; }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .preview-list { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
  .board { grid-auto-columns: minmax(220px, 82%); }
  .cal-cell { min-height: 86px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .report-grid { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-rail { position: static; }
}

@media (max-width: 640px) {
  .content { padding: 16px; }
  .topbar { align-items: stretch; }
  .top-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .session-pill { flex: 1; }
  .filters, .form-grid { grid-template-columns: 1fr; }
  .task-form, .task-row { grid-template-columns: 1fr; }
  .preview-list { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .user-row { grid-template-columns: 1fr; }
  .cal-chip-title { display: none; }
  .cal-cell { min-height: 64px; }
}
