:root {
  --bg: #F4F6FA;
  --surface: #FFFFFF;
  --ink: #0E1A2B;
  --muted: #4A5870;
  --line: #D9DFEA;
  --line-soft: #E6EAF1;
  --field: #A9B3C5;
  --accent: #093951;
  --accent-dark: #052433;
  --accent-soft: #E2ECF1;
  --wait: #5B2A94;
  --wait-soft: #F6F0FC;
  --danger: #B3261E;
  --navy: #093951;
  --orange: #F08A24;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1, h2, p { margin: 0; }
input, textarea, select, button { font: inherit; color: inherit; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: 'IBM Plex Mono', monospace; font-size: 13px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 32px; }

/* Header and footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); overflow: hidden; }
/* The logo tab hugs the left edge of the page; the menu lines up with the page content on the right. */
.header-row { display: flex; flex-wrap: wrap; align-items: center; column-gap: 40px; padding-right: max(32px, calc((100% - 1200px) / 2 + 32px)); }

/* Logo in an angled navy tab: straight left side, flat top, 45-degree slant on the right.
   The navy runs out to the left edge of the page. */
.logo-tab-wrap { position: relative; flex: none; display: block; text-decoration: none; }
.logo-tab-wrap::before { content: ''; position: absolute; top: 0; bottom: 0; right: 100%; width: 2000px; background: var(--navy); }
.logo-tab { position: relative; display: flex; align-items: center; gap: 16px; height: 84px; padding: 0 104px 0 24px; background: var(--navy); color: #fff; clip-path: polygon(0 0, calc(100% - 84px) 0, 100% 100%, 0 100%); }
.logo-tab img { display: block; height: 52px; width: auto; }
.logo-tab .rule { width: 1px; height: 34px; background: rgba(255, 255, 255, 0.35); }
.logo-tab .word { font-weight: 800; font-size: 15px; letter-spacing: 0.14em; text-transform: uppercase; }
.nav { margin-left: auto; padding: 16px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 24px; font-weight: 600; font-size: 15px; }
.nav a { color: var(--muted); text-decoration: none; padding: 8px 0; border-bottom: 2px solid transparent; }
.nav a.active { color: var(--ink); border-bottom-color: var(--orange); }
.nav a.btn { color: #fff; padding: 0 20px; min-height: 44px; border-bottom: 3px solid var(--orange); }
.card.spaced { margin-top: 32px; }
.card.spaced .btn { margin-right: 12px; }
.nav .user { display: inline-flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.avatar.staff { background: var(--ink); color: #fff; }
.link-btn { background: none; border: 0; padding: 8px 0; color: var(--muted); font-weight: 600; font-size: 15px; cursor: pointer; }
.link-btn:hover { color: var(--ink); }
.site-footer { margin-top: auto; border-top: 1px solid var(--line); background: var(--surface); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 20px; padding-bottom: 20px; font-size: 14px; color: var(--muted); }

main.page { width: 100%; max-width: 1200px; margin: 0 auto; padding: 48px 32px 72px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
h1.title { font-size: 40px; line-height: 1.1; letter-spacing: -0.03em; font-weight: 800; }
.lede { font-size: 18px; color: var(--muted); max-width: 680px; margin-top: 12px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 26px; border: 0; border-bottom: 3px solid var(--orange); border-radius: 12px; background: var(--navy); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn[disabled] { opacity: 0.6; cursor: wait; }
.btn-lg { min-height: 52px; padding: 0 28px; }

/* Cards and layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.card h2 { font-size: 17px; font-weight: 800; margin-bottom: 16px; }
.two-col { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.col-main { flex: 999 1 620px; min-width: 0; }
.col-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* Alerts */
.alert { padding: 14px 18px; border-radius: 12px; font-weight: 600; margin-bottom: 20px; border: 1px solid; }
.alert.error { background: #FDECEA; border-color: #F2B8B5; color: #8A1C14; }
.alert.ok { background: #D8F0E0; border-color: #A8D9B8; color: #14633A; }

/* Forms */
.form-card { padding: 32px; display: flex; flex-direction: column; gap: 28px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend, .group-title { padding: 0; margin-bottom: 12px; font-weight: 700; font-size: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 20px; }
.field { flex: 1 1 240px; display: flex; flex-direction: column; gap: 6px; }
.stack > .field { flex: none; }
.field label { font-weight: 600; font-size: 14px; }
.field input, .field textarea, .field select, .toolbar input, .toolbar select, .inline-select {
  width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--field); border-radius: 10px; background: #fff;
}
.field textarea { padding: 12px 14px; resize: vertical; }
.field input[readonly] { background: #F4F6FA; color: var(--muted); }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); }
.field-error { color: #8A1C14; font-size: 13px; font-weight: 600; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }

.tiles { display: flex; flex-wrap: wrap; gap: 12px; }
.tile { flex: 1 1 170px; display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 2px solid var(--line); background: #fff; border-radius: 12px; cursor: pointer; }
.tile .tile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile .tile-name { font-weight: 700; }
.tile .tile-hint { font-size: 14px; color: var(--muted); }
.tile input, .chip input { margin: 0; accent-color: var(--accent); }
.tile input { width: 18px; height: 18px; }
.tile:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; min-height: 44px; border: 2px solid var(--line); border-radius: 999px; font-weight: 600; cursor: pointer; background: #fff; }
.chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.chip.urgent input { accent-color: var(--danger); }
.chip.urgent:has(input:checked) { border-color: var(--danger); background: #FDECEA; }

/* Pills */
.pill { display: inline-block; padding: 3px 12px; border-radius: 999px; font-weight: 700; font-size: 12px; white-space: nowrap; }
.pill-open { background: #DCEBFA; color: #0B4F8A; }
.pill-in_progress { background: #FDEBC8; color: #7A4A00; }
.pill-waiting { background: #EADFF8; color: #5B2A94; }
.pill-resolved { background: #D8F0E0; color: #14633A; }
.pill-urgent { background: var(--danger); color: #fff; }
.pill-high { background: #FBD9D5; color: #8A1C14; }
.pill-normal { background: #E6EAF1; color: #2B3A52; }
.pill-low { border: 1px solid var(--field); color: var(--muted); padding: 2px 11px; }

.guide-row { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.guide-row .pill { flex: none; width: 72px; text-align: center; padding-left: 0; padding-right: 0; }
.guide { display: flex; flex-direction: column; gap: 14px; }
.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 16px; font-size: 14px; color: var(--muted); }
.steps li { display: flex; gap: 12px; }
.steps .num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.steps strong { color: var(--ink); }
.card.dark { background: var(--navy); color: #fff; border-color: var(--navy); }
.card.dark .rows { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: #D3DAE6; }
.card.dark .rows div { display: flex; justify-content: space-between; }
.card.dark strong { color: #fff; }

/* Stats */
.stats { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.stat { flex: 1 1 180px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; text-align: left; cursor: pointer; }
.stat:hover { border-color: var(--accent); }
.stat .label { font-size: 14px; color: var(--muted); font-weight: 600; }
.stat .num { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; display: block; }
.stat.attn { border: 2px solid var(--wait); padding: 17px 19px; }
.stat.attn .label { color: var(--wait); font-weight: 700; }
.stat.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

/* Table */
.table-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.toolbar input { flex: 1 1 260px; width: auto; min-height: 44px; }
.toolbar select { flex: 0 1 170px; width: auto; min-height: 44px; padding: 0 12px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-size: 13px; color: var(--muted); background: #F9FAFC; padding: 12px; font-weight: 700; }
td { padding: 16px 12px; border-top: 1px solid var(--line-soft); vertical-align: top; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
tr.attn td { background: var(--wait-soft); }
td a.subject { font-weight: 700; color: var(--ink); text-decoration: none; }
td a.subject:hover { text-decoration: underline; }
td .sub { font-size: 13px; color: var(--wait); font-weight: 600; }
td.nowrap { white-space: nowrap; color: var(--muted); }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.table-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.pager { display: inline-flex; gap: 8px; }
.pager button { padding: 8px 14px; border: 1px solid var(--field); border-radius: 8px; background: #fff; font-weight: 600; cursor: pointer; }
.pager button[disabled] { opacity: 0.45; cursor: default; }

/* Request detail */
.back { display: inline-block; margin-bottom: 20px; font-weight: 600; text-decoration: none; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 8px; }
.detail-title { font-size: 36px; line-height: 1.15; letter-spacing: -0.03em; font-weight: 800; margin-bottom: 32px; }
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.msg.staff { background: var(--wait-soft); border-color: #D9C7F0; margin-left: 32px; }
.msg-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.msg-head .who { font-weight: 700; }
.msg-head .when { font-size: 13px; color: var(--muted); }
.msg-head .role { font-weight: 500; font-size: 13px; color: var(--wait); }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; color: #1F2D44; }
.reply { border: 2px solid var(--line); }
.reply.needs { border-color: var(--wait); }
.reply h2 { margin-bottom: 4px; }
.reply .note { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.reply textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--field); border-radius: 10px; resize: vertical; background: #fff; }
.reply-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.reply-foot label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.reply-foot select { min-height: 44px; padding: 0 12px; border: 1px solid var(--field); border-radius: 10px; background: #fff; }
dl.details { margin: 0; display: flex; flex-direction: column; gap: 14px; font-size: 14px; }
dl.details > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
dl.details dt { color: var(--muted); }
dl.details dd { margin: 0; font-weight: 600; text-align: right; }
dl.details select { min-height: 40px; padding: 0 10px; border: 1px solid var(--field); border-radius: 8px; background: #fff; max-width: 190px; }
.progress { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 16px; font-size: 14px; }
.progress li { display: flex; gap: 12px; align-items: flex-start; }
.progress .dot { flex: none; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.progress .done .dot { background: #14633A; }
.progress .now .dot { border: 3px solid var(--accent); background: #fff; }
.progress .todo .dot { border: 2px solid var(--field); background: #fff; }
.progress .todo { color: var(--muted); }
.progress .now strong { color: var(--accent); }
.progress .when { color: var(--muted); }

/* Sign in (matches the WiFi portal's owner sign-in page) */
.login-shell { flex: 1; display: flex; min-height: 100vh; }
.login-main { flex: 1 1 520px; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 48px 32px; background: var(--surface); }
.login-art { flex: 0 0 46%; display: flex; align-items: center; justify-content: center; padding: 48px 40px; background: linear-gradient(180deg, #093951 0%, #093951 55%, #0C4561 100%); overflow: hidden; }
.art-inner { width: 100%; max-width: 440px; color: #fff; }
.art-kicker { font-size: 13px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--orange); margin-bottom: 10px; }
.art-title { font-size: 28px; line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 28px; max-width: 380px; }
.mock { position: relative; background: #fff; color: var(--ink); border-radius: 18px; padding: 22px; box-shadow: 0 24px 48px rgba(0, 0, 0, .35); pointer-events: none; user-select: none; }
.m-head { font-size: 17px; font-weight: 800; margin-bottom: 14px; }
.m-step { font-size: 12px; font-weight: 800; margin: 14px 0 8px; }
.m-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.m-tile { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 10px; border: 1.5px solid var(--line); border-radius: 10px; }
.m-tile strong { font-size: 12px; padding-right: 16px; }
.m-tile small { font-size: 10.5px; color: var(--muted); line-height: 1.3; }
.m-tile.on { border-color: var(--navy); background: var(--accent-soft); }
.m-radio { position: absolute; top: 10px; right: 9px; width: 11px; height: 11px; border: 1.5px solid var(--field); border-radius: 50%; }
.m-tile.on .m-radio { border-color: var(--navy); background: radial-gradient(var(--navy) 40%, #fff 45%); }
.m-prios { display: flex; gap: 8px; }
.m-prio { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 600; }
.m-prio.on { border-color: var(--navy); background: var(--accent-soft); }
.m-dot { width: 9px; height: 9px; border: 1.5px solid var(--field); border-radius: 50%; }
.m-prio.on .m-dot { border-color: var(--navy); background: radial-gradient(var(--navy) 40%, #fff 45%); }
.m-input { padding: 10px 12px; border: 1px solid var(--field); border-radius: 9px; font-size: 12.5px; }
.m-area { margin-top: 8px; padding: 12px; border: 1px solid var(--field); border-radius: 9px; display: flex; flex-direction: column; gap: 7px; }
.m-area i { display: block; height: 6px; border-radius: 3px; background: var(--line); }
.m-area i.short { width: 55%; }
.m-send { margin-top: 14px; text-align: center; padding: 11px; background: var(--navy); color: #fff; border-radius: 10px; border-bottom: 3px solid var(--orange); font-size: 13px; font-weight: 700; }
.m-ticket { display: flex; align-items: center; gap: 12px; margin: -18px 0 0 36px; position: relative; background: #fff; color: var(--ink); border-radius: 14px; padding: 12px 16px; box-shadow: 0 16px 32px rgba(0, 0, 0, .35); pointer-events: none; user-select: none; }
.m-ticket strong { display: block; font-size: 13px; }
.m-ticket small { display: block; font-size: 11.5px; color: var(--muted); }
.m-check { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #DDF3E4; color: #1B6B3A; display: grid; place-items: center; font-weight: 800; }
.m-pill { margin-left: auto; padding: 3px 10px; border-radius: 999px; background: var(--wait-soft); color: var(--wait); font-size: 11px; font-weight: 700; white-space: nowrap; }
.auth { width: 100%; max-width: 340px; }
.auth-logo { display: flex; align-items: center; justify-content: center; height: 128px; margin-bottom: 36px; background: var(--navy); border-radius: 20px; border-bottom: 4px solid var(--orange); box-shadow: 0 10px 24px rgba(9, 57, 81, 0.28); }
.auth-logo img { display: block; height: 100px; width: auto; }
.auth-title { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 4px; }
.auth-lede { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.tabs { display: flex; gap: 8px; margin-bottom: 20px; background: #E6EAF1; padding: 4px; border-radius: 12px; }
.tabs button { flex: 1; min-height: 44px; border: 0; border-radius: 9px; background: transparent; font-weight: 700; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(14, 26, 43, 0.12); }
.auth form { display: flex; flex-direction: column; gap: 16px; }
.auth .field { flex: none; }
.auth .field label { font-size: 13px; }
.auth .field input { border-radius: 12px; }
.auth form .btn, .auth > .btn { width: 100%; margin-top: 4px; }
.auth .forgot { align-self: center; margin-top: 12px; font-size: 13px; font-weight: 500; color: var(--navy); }

@media (max-width: 1100px) {
  .login-art { display: none; }
}
@media (max-width: 820px) {
  .login-art { display: none; }
  .nav { margin-left: 0; width: 100%; }
}
@media (max-width: 640px) {
  .logo-tab { padding-right: 96px; }
  .header-row { padding-right: 16px; }
  .wrap, main.page { padding-left: 16px; padding-right: 16px; }
  h1.title { font-size: 32px; }
  .detail-title { font-size: 28px; }
  .form-card { padding: 20px; }
  .msg.staff { margin-left: 0; }
}

/* ---------- Agent desk ---------- */
.btn-ghost { background: var(--surface); color: var(--navy); border: 1px solid var(--navy); border-bottom: 3px solid var(--navy); }
.btn-ghost:hover { background: var(--accent-soft); }
.pill-none { background: #fff; color: var(--muted); border: 1px dashed var(--field); }
.desk { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 24px; align-items: start; }
.desk-side { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; position: sticky; top: 16px; }
.desk-tabs { display: flex; border-bottom: 1px solid var(--line); }
.desk-tab { flex: 1; min-height: 48px; padding: 0 6px; background: none; border: 0; border-bottom: 3px solid transparent; font: inherit; font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.desk-tab:hover { color: var(--navy); }
.desk-tab.active { color: var(--navy); border-bottom-color: var(--orange); }
.desk-tab .count { background: var(--accent-soft); color: var(--navy); border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.desk-search { padding: 12px; border-bottom: 1px solid var(--line); }
.desk-search input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--field); border-radius: 10px; background: #fff; }
.desk-list { max-height: calc(100vh - 260px); min-height: 160px; overflow-y: auto; }
.desk-item { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; padding: 14px 16px; background: none; border: 0; border-bottom: 1px solid var(--line-soft); border-left: 4px solid transparent; font: inherit; color: inherit; cursor: pointer; }
.desk-item:hover { background: #F4F7FA; }
.desk-item.selected { background: var(--accent-soft); border-left-color: var(--orange); }
.desk-item .row1 { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.desk-item .subj { font-weight: 700; overflow-wrap: anywhere; }
.desk-item .who { font-size: 13px; color: var(--muted); }
.desk-item .pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.desk-empty { padding: 24px 16px; color: var(--muted); }
.desk-pane { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.desk-blank { background: var(--surface); border: 1px dashed var(--field); border-radius: 16px; padding: 64px 24px; text-align: center; }
.desk-head { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.desk-title { font-size: 22px; font-weight: 800; margin: 8px 0 6px; overflow-wrap: anywhere; }
.desk-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.desk-controls .pick { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.desk-controls select { min-height: 44px; padding: 0 12px; border: 1px solid var(--field); border-radius: 10px; background: #fff; font: inherit; font-weight: 500; color: var(--ink); }
.desk-controls .btn { min-height: 44px; }
.desk-thread { display: flex; flex-direction: column; gap: 16px; }
.msg.internal { background: #FFF8E6; border: 1px dashed #D9A93B; margin-left: 32px; }
.msg.internal .role { color: #8A5A00; }
.desk-compose { border: 2px solid var(--line); }
.desk-compose.note { border-color: #D9A93B; background: #FFFBF0; }
.desk-compose textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--field); border-radius: 10px; resize: vertical; background: #fff; font: inherit; }
.modes { display: inline-flex; gap: 4px; padding: 4px; background: var(--line-soft); border-radius: 12px; margin-bottom: 14px; }
.mode { min-height: 40px; padding: 0 16px; border: 0; border-radius: 9px; background: none; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; }
.mode.active { background: var(--surface); color: var(--navy); box-shadow: 0 1px 3px rgba(9, 57, 81, .2); }
.note-hint { font-size: 14px; color: #8A5A00; margin-bottom: 12px; }
.desk-compose .foot-left, .desk-compose .foot-right { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.desk-compose .foot-left select { min-height: 44px; padding: 0 12px; border: 1px solid var(--field); border-radius: 10px; background: #fff; font: inherit; }
.desk-compose .hint { font-size: 13px; margin-top: 10px; }
@media (max-width: 900px) {
  .desk { grid-template-columns: minmax(0, 1fr); }
  .desk-side { position: static; }
  .desk-list { max-height: 320px; }
  .msg.internal { margin-left: 0; }
}
.btn-ghost:hover { color: var(--navy); }
.desk-tab { white-space: nowrap; font-size: 13px; }


/* ---------- Admin ---------- */
.admin-tabs { max-width: 520px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 24px; }
.admin-body { display: flex; flex-direction: column; gap: 24px; }
.admin-lede { max-width: 720px; }
.admin-add h2 { margin-bottom: 6px; }
.admin-add .note { font-size: 14px; color: var(--muted); margin-bottom: 16px; max-width: 720px; }
.admin-add { display: flex; flex-direction: column; gap: 16px; }
.admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.admin-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-grid .field { flex: none; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.check input { width: 18px; height: 18px; }
.pill-admin { background: var(--navy); color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.danger { color: var(--danger); border-color: var(--danger); border-bottom-color: var(--danger); }
.btn.danger:hover { background: #FCEDEC; color: var(--danger); }
.btn.danger.armed { background: var(--danger); color: #fff; }
.pw-box { display: inline-flex; gap: 8px; align-items: center; }
.inline-pw { min-height: 36px; padding: 0 10px; border: 1px solid var(--field); border-radius: 10px; width: 160px; }
.cat-list { display: flex; flex-direction: column; gap: 12px; }
.cat-row { display: flex; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; }
.cat-row.off { background: #F4F6FA; }
.cat-row.off .cat-fields input { color: var(--muted); }
.cat-move { display: flex; flex-direction: column; gap: 4px; }
.icon-btn { width: 36px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-size: 16px; color: var(--navy); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.cat-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cat-fields input { width: 100%; min-height: 40px; padding: 0 12px; border: 1px solid var(--field); border-radius: 10px; background: #fff; }
.cat-fields input:first-child { font-weight: 700; }
.cat-meta { font-size: 13px; }
.cat-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
@media (max-width: 900px) {
  .admin-grid, .admin-grid.two { grid-template-columns: minmax(0, 1fr); }
  .cat-row { flex-wrap: wrap; }
  .cat-move { flex-direction: row; }
  .cat-fields { flex-basis: 100%; order: 3; }
}
