/*
  KMar Panel — Royal Operations theme
  Visual layer only. Existing IDs, JS hooks, data flow and permissions remain untouched.
*/

:root {
  --bg: #080a0d;
  --bg-2: #0d1116;
  --panel: #10151b;
  --panel-strong: #131a22;
  --panel-soft: #171f28;
  --line: rgba(255,255,255,.075);
  --line-2: rgba(255,255,255,.13);
  --text: #f4f1ea;
  --muted: #9ea8b4;
  --dim: #6d7884;
  --blue: #f2a31b;
  --cyan: #ffbb3e;
  --green: #51c99a;
  --amber: #f2a31b;
  --danger: #ed6d75;
  --accent: #f2a31b;
  --accent-2: #ffd178;
  --accent-soft: rgba(242,163,27,.12);
  --steel: #aab6c2;
  --shadow: 0 26px 70px rgba(0,0,0,.42);
  --shadow-soft: 0 12px 34px rgba(0,0,0,.28);
  --radius: 18px;
  --radius-sm: 12px;
}

html { background: #080a0d; }
body {
  color: var(--text);
  background: #080a0d;
  letter-spacing: -.012em;
}
::selection { background: rgba(242,163,27,.28); color: #fff; }

/* --- completely new atmosphere: architectural / secure portal --- */
.kmar-bg {
  background:
    radial-gradient(900px 520px at 8% 4%, rgba(242,163,27,.09), transparent 64%),
    radial-gradient(860px 560px at 92% 92%, rgba(255,255,255,.035), transparent 66%),
    linear-gradient(160deg, #090b0e 0%, #0c1015 46%, #07090c 100%);
}
.bg-gradient {
  inset: 0;
  opacity: 1;
  filter: none;
  animation: none;
  background:
    linear-gradient(115deg, transparent 0 15%, rgba(255,255,255,.018) 15.1% 15.25%, transparent 15.35% 100%),
    linear-gradient(115deg, transparent 0 74%, rgba(242,163,27,.035) 74.1% 74.25%, transparent 74.35% 100%);
}
.bg-grid,
.bg-topography,
.bg-radar,
.bg-scan { display: none !important; }
.kmar-bg::before,
.kmar-bg::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.kmar-bg::before {
  left: -8vw;
  top: 8vh;
  width: 54vw;
  height: 72vh;
  border: 1px solid rgba(255,255,255,.045);
  border-left-color: transparent;
  border-bottom-color: transparent;
  transform: skewX(-18deg) rotate(-4deg);
  opacity: .7;
}
.kmar-bg::after {
  right: -12vw;
  bottom: -16vh;
  width: 54vw;
  height: 54vw;
  border-radius: 50%;
  border: 1px solid rgba(242,163,27,.06);
  box-shadow: 0 0 0 90px rgba(255,255,255,.008), 0 0 0 180px rgba(255,255,255,.006);
}

/* --- surfaces --- */
.glass-card {
  position: relative;
  background: linear-gradient(180deg, rgba(18,24,31,.98), rgba(12,17,22,.98));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255,255,255,.025);
  backdrop-filter: none;
  overflow: hidden;
}
.glass-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), rgba(242,163,27,.22) 28%, transparent 64%);
  opacity: .9;
  pointer-events: none;
}
.glass-card::after { display: none !important; }

/* --- controls --- */
.field,
textarea,
select {
  min-height: 50px;
  padding: 13px 15px;
  color: var(--text);
  background: #0c1117;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.018);
  outline: none;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.field::placeholder,
textarea::placeholder { color: #697580; opacity: 1; }
.field:hover,
textarea:hover,
select:hover { border-color: rgba(255,255,255,.16); }
.field:focus,
textarea:focus,
select:focus {
  border-color: rgba(242,163,27,.7);
  background: #10161d;
  box-shadow: 0 0 0 3px rgba(242,163,27,.10);
  transform: none;
}

.primary-btn,
.ghost-btn,
.file-btn {
  min-height: 46px;
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: -.01em;
  transition: transform .14s ease, background .14s ease, color .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.primary-btn {
  color: #17120a;
  border: 1px solid #f3aa2d;
  background: linear-gradient(180deg, #ffc153 0%, #ee9b12 100%);
  box-shadow: 0 10px 26px rgba(225,144,15,.18), inset 0 1px 0 rgba(255,255,255,.38);
}
.primary-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #ffd172 0%, #f2a31b 100%);
  box-shadow: 0 14px 32px rgba(225,144,15,.22);
}
.ghost-btn,
.file-btn {
  color: #e2e7eb;
  background: #121920;
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: none;
}
.ghost-btn:hover,
.file-btn:hover {
  transform: translateY(-1px);
  color: #fff;
  background: #18212a;
  border-color: rgba(242,163,27,.28);
  box-shadow: none;
}
.primary-btn:active,
.ghost-btn:active,
.file-btn:active { transform: scale(.99); }
.danger-action {
  color: #ffb6bc !important;
  border-color: rgba(237,109,117,.24) !important;
  background: rgba(85,25,31,.26) !important;
}
.danger-action:hover { background: rgba(112,31,38,.34) !important; border-color: rgba(237,109,117,.42) !important; }

/* --- top bar / global brand --- */
.topbar {
  min-height: 76px;
  padding: 18px clamp(18px, 3.4vw, 48px);
}
.topbar.solid {
  background: rgba(8,10,13,.94);
  border-bottom: 1px solid rgba(255,255,255,.07);
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 38px rgba(0,0,0,.20);
}
.brand-mini { gap: 12px; text-transform: none; letter-spacing: -.012em; }
.brand-mini img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  filter: none;
  background: #111820;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 8px 22px rgba(0,0,0,.25);
}
.brand-mini span { font-size: .95rem; font-weight: 850; color: #f5f3ed; }

/* --- home: premium secure-entry composition --- */
.home-shell {
  min-height: calc(100vh - 76px);
  min-height: calc(100dvh - 76px);
  padding: 30px 20px 112px;
}
.command-layout { width: min(560px, 100%); }
.portal-menu {
  width: 100%;
  padding: clamp(28px, 5vw, 46px);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(20,27,35,.98), rgba(11,15,20,.98));
  box-shadow: 0 34px 90px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.025);
  animation: portalIn .42s cubic-bezier(.2,.75,.25,1) both;
}
.portal-menu::before { height: 3px; background: var(--accent); }
.portal-menu::after {
  content: "";
  display: block !important;
  position: absolute;
  width: 220px;
  height: 220px;
  right: -86px;
  top: -98px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242,163,27,.12), transparent 68%);
  pointer-events: none;
}
.portal-logo-mark {
  width: 88px;
  height: 88px;
  margin: 0 0 26px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: #0d1319;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 18px 42px rgba(0,0,0,.28);
}
.portal-logo-mark img { width: 72px; height: 72px; filter: none; }
.portal-menu .eyebrow,
.eyebrow {
  margin: 0 0 9px;
  color: var(--accent-2);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.portal-menu h1 {
  margin: 0 0 30px;
  font-size: clamp(2.5rem, 9vw, 4.25rem);
  line-height: .94;
  letter-spacing: -.055em;
  color: #f7f4ed;
}
.mode-buttons { display: grid; gap: 11px; }
.mode-buttons .primary-btn,
.mode-buttons .ghost-btn { min-height: 56px; font-size: 1rem; }
.access-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.065); }
#ticketHint { margin-top: 10px; }

/* --- creator badge --- */
.creator-credit {
  position: fixed;
  right: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  border-radius: 999px;
  background: rgba(11,15,19,.88);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 10px 32px rgba(0,0,0,.30);
  backdrop-filter: blur(12px);
}
.creator-credit img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; filter: saturate(.85) contrast(1.03); }
.creator-credit div { display: grid; line-height: 1.02; }
.creator-credit span { color: #77838e; font-size: .62rem; letter-spacing: .04em; }
.creator-credit strong { color: #e6e1d7; font-size: .78rem; font-weight: 700; }

/* --- modal --- */
.modal { background: rgba(3,5,7,.80); backdrop-filter: blur(9px); }
.modal-card {
  width: min(460px, calc(100vw - 30px));
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 36px 100px rgba(0,0,0,.58);
}
.modal-card h2 { margin: 0 0 22px; letter-spacing: -.035em; font-size: 1.7rem; }
.close-btn {
  width: 36px; height: 36px;
  color: #aeb7c0;
  background: #141b22;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
}
.close-btn:hover { color: #fff; background: #1c252e; }

/* --- exam --- */
.exam-shell { width: min(980px, calc(100% - 30px)); padding: 30px 0 110px; }
.exam-head {
  padding: 28px 30px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  border-radius: 18px;
}
.exam-head h2 { margin: 0; font-size: clamp(1.35rem, 3vw, 2rem); letter-spacing: -.035em; }
.progress-wrap { min-width: 190px; }
.progress-wrap > span { color: var(--accent-2); font-weight: 900; }
.progress-track { height: 7px; background: #070b0f; border: 1px solid rgba(255,255,255,.06); border-radius: 99px; overflow: hidden; }
.progress-track span { background: linear-gradient(90deg, #d78808, #ffc85f); box-shadow: 0 0 16px rgba(242,163,27,.22); }
.question-list { display: grid; gap: 14px; margin-top: 16px; }
.question-card {
  padding: 24px 26px;
  background: linear-gradient(180deg, #11171e, #0d1217);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0,0,0,.20);
  animation: questionIn .28s ease both;
}
.question-card label {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  color: #f0ede6;
  font-weight: 800;
  line-height: 1.42;
}
.q-number {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  border-radius: 8px;
  color: #17120a;
  background: #f2a31b;
  font-size: .78rem;
  font-weight: 950;
}
.question-card textarea { margin-top: 16px; min-height: 150px; resize: vertical; }
.exam-actions { margin-top: 16px; padding: 16px; display: flex; justify-content: space-between; gap: 12px; border-radius: 16px; }
.exam-meta { display: flex; align-items: center; gap: 12px; color: #aab3bd; }

/* --- submitted result --- */
.result-view.active { display: grid; place-items: center; padding: 24px; }
.result-card { width: min(510px, 100%); padding: 38px; text-align: left; }
.result-card h2 { font-size: 2rem; margin: 0 0 10px; letter-spacing: -.045em; }
.result-card p { color: var(--muted); margin: 0 0 24px; }

/* --- admin shell --- */
.admin-view.active { display: grid; grid-template-columns: 258px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 14px;
  background: #0a0e12;
  border-right: 1px solid rgba(255,255,255,.07);
  box-shadow: 16px 0 42px rgba(0,0,0,.18);
  overflow-y: auto;
}
.side-brand {
  padding: 5px 9px 22px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.065);
}
.side-brand img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  filter: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08);
}
.side-brand strong { color: #f5f2eb; letter-spacing: -.02em; }
.side-brand small { color: #737f8a; }
.nav-btn {
  position: relative;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  margin: 3px 0;
  color: #909ba6;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 760;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.nav-btn::before { display: none !important; content: none !important; }
.nav-btn:hover { color: #e7e3dc; background: rgba(255,255,255,.035); }
.nav-btn.active {
  color: #fff5df;
  background: rgba(242,163,27,.10);
  border-color: rgba(242,163,27,.16);
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-btn.exit { margin-top: 12px; color: #c98f95; border-top: 1px solid rgba(255,255,255,.05); }

.admin-main {
  min-width: 0;
  padding: clamp(24px, 3.5vw, 48px);
  background:
    radial-gradient(900px 420px at 100% 0%, rgba(242,163,27,.035), transparent 70%),
    transparent;
}
.admin-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,.065);
}
.admin-header h2 {
  margin: 0;
  font-size: clamp(2.15rem, 4.5vw, 4rem);
  line-height: .98;
  letter-spacing: -.06em;
  color: #f5f3ed;
}
.admin-stats { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.admin-stats span {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  color: #9ca7b2;
  background: #0d1319;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 700;
}
.admin-stats b { color: var(--accent-2); font-size: 1rem; }

.tab { animation: tabIn .22s ease both; }
.admin-grid { gap: 18px; }
.admin-grid.two { grid-template-columns: minmax(310px, .62fr) minmax(0, 1.38fr); }
.admin-grid.split { grid-template-columns: minmax(330px, .72fr) minmax(0, 1.28fr); }
.admin-card { padding: 22px; border-radius: 16px; }
.admin-card h3 { margin: 0 0 17px; color: #f2efe8; letter-spacing: -.03em; font-size: 1.14rem; }
.admin-card h4 { color: #d8dde0; }
.card-row { gap: 14px; }
.form-grid { gap: 11px; }
.inline-field { gap: 10px; }
.created-link { margin-top: 16px; padding: 14px; border: 1px solid rgba(242,163,27,.16); background: rgba(242,163,27,.045); border-radius: 12px; }
.created-link label { color: #c9b687; }

/* --- lists / cards --- */
.list { display: grid; gap: 10px; }
.item-card {
  padding: 15px;
  background: #0d1319;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  box-shadow: none;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.item-card:hover { background: #111820; border-color: rgba(242,163,27,.16); transform: translateY(-1px); }
.item-title { color: #f0ede7; font-weight: 850; letter-spacing: -.015em; }
.item-sub { color: #7e8994; }
.item-actions { gap: 7px; }
.item-actions .ghost-btn { min-height: 38px; padding: 8px 10px; border-radius: 9px; font-size: .78rem; }
.ticket-meta-grid { color: #8f9aa5; }
.badge {
  color: #cbd1d6;
  background: #171f27;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 999px;
  box-shadow: none;
}
.badge.off { color: #b9a0a2; background: rgba(90,38,42,.22); border-color: rgba(237,109,117,.18); }
.badge.result-passed { color: #92dfc0; background: rgba(52,120,91,.18); border-color: rgba(81,201,154,.18); }
.badge.result-failed { color: #ffadb4; background: rgba(112,42,49,.20); border-color: rgba(237,109,117,.18); }
.badge.result-pending { color: #e9c787; background: rgba(141,100,30,.18); border-color: rgba(242,163,27,.18); }
.empty {
  padding: 20px;
  color: #75818c;
  background: #0b1015;
  border: 1px dashed rgba(255,255,255,.09);
  border-radius: 12px;
}
.empty::before { display: none !important; content: none !important; }

/* --- transcript / stats --- */
.kader-tools-card { margin-bottom: 18px; }
.kader-stats { gap: 10px; }
.kader-stat {
  min-height: 84px;
  padding: 16px;
  background: #0d1319;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
}
.kader-stat b { color: var(--accent-2); font-size: 1.7rem; letter-spacing: -.04em; }
.kader-stat span { color: #7f8a95; }
.review-panel { min-height: 470px; }
.review-answers { display: grid; gap: 12px; }
.answer-block {
  padding: 17px;
  background: #0c1217;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
}
.answer-block h4 { margin: 0 0 8px; color: #d9d5cd; }
.answer-text { color: #aab3bc; line-height: 1.62; white-space: pre-wrap; }
.result-strip {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
  background: #0d1319;
}
.result-strip.result-passed { border-color: rgba(81,201,154,.20); }
.result-strip.result-failed { border-color: rgba(237,109,117,.20); }
.result-strip.result-pending { border-color: rgba(242,163,27,.20); }
.archive-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.065); }

/* --- logs --- */
.logs-list { gap: 8px; }
.log-entry {
  display: grid;
  grid-template-columns: 150px minmax(0,1fr) 160px;
  gap: 14px;
  align-items: center;
  padding: 13px 14px;
  background: #0c1217;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
}
.log-entry::before { display: none !important; content: none !important; }
.log-time { color: #697580; font-variant-numeric: tabular-nums; }
.log-action { color: #e8e4dc; font-weight: 800; }
.log-detail { color: #838e99; }
.log-actor { color: #c8aa70; text-align: right; }

/* --- account / backup --- */
.account-summary { gap: 10px; }
.account-summary span {
  background: #0d1319;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  padding: 14px;
}
.account-summary b { color: #757f89; }
.account-summary em { color: #ece8e0; font-style: normal; }
.backup-card,
.account-settings-card { max-width: 980px; }
.account-edit-row { gap: 9px; }

/* --- toast --- */
.toast {
  right: 20px;
  bottom: 82px;
  max-width: min(420px, calc(100vw - 40px));
  color: #f0ede7;
  background: #151c23;
  border: 1px solid rgba(242,163,27,.18);
  border-radius: 12px;
  box-shadow: 0 18px 46px rgba(0,0,0,.40);
  backdrop-filter: blur(12px);
}

/* --- scrollbar --- */
* { scrollbar-width: thin; scrollbar-color: #3a4148 #0b0f13; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0b0f13; }
::-webkit-scrollbar-thumb { background: #343c44; border: 2px solid #0b0f13; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #49535c; }

/* --- motion --- */
@keyframes portalIn { from { opacity: 0; transform: translateY(14px) scale(.992); } to { opacity: 1; transform: none; } }
@keyframes questionIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes tabIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* --- tablet --- */
@media (max-width: 1050px) {
  .admin-view.active { grid-template-columns: 218px minmax(0,1fr); }
  .admin-grid.two,
  .admin-grid.split { grid-template-columns: 1fr; }
  .review-panel { min-height: 360px; }
  .log-entry { grid-template-columns: 130px minmax(0,1fr); }
  .log-actor { grid-column: 2; text-align: left; }
}

/* --- mobile: app-like shell --- */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .topbar { min-height: 66px; padding: 12px 14px; }
  .brand-mini img { width: 38px; height: 38px; }
  .brand-mini span { font-size: .88rem; }
  .home-shell { min-height: calc(100dvh - 66px); padding: 18px 14px 100px; }
  .portal-menu { padding: 26px 20px 22px; border-radius: 18px; }
  .portal-logo-mark { width: 72px; height: 72px; border-radius: 16px; margin-bottom: 21px; }
  .portal-logo-mark img { width: 58px; height: 58px; }
  .portal-menu h1 { font-size: clamp(2.45rem, 16vw, 3.6rem); margin-bottom: 24px; }
  .mode-buttons .primary-btn,
  .mode-buttons .ghost-btn { min-height: 54px; }
  .creator-credit { right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); padding: 6px 10px 6px 6px; }
  .creator-credit img { width: 30px; height: 30px; }
  .creator-credit span { display: none; }

  .exam-shell { width: calc(100% - 22px); padding-top: 14px; }
  .exam-head { padding: 20px; align-items: stretch; flex-direction: column; gap: 16px; }
  .progress-wrap { min-width: 0; width: 100%; }
  .question-card { padding: 18px 16px; border-radius: 14px; }
  .question-card label { gap: 10px; }
  .q-number { min-width: 28px; height: 28px; }
  .question-card textarea { min-height: 170px; font-size: 16px; }
  .exam-actions { position: sticky; bottom: 8px; z-index: 10; background: rgba(16,21,27,.96); }
  .exam-actions > * { flex: 1; }
  .exam-meta { max-width: 56%; }
  #examCandidateName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .admin-view.active { display: block; min-height: 100dvh; }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    height: auto;
    padding: 8px 8px 7px;
    display: flex;
    gap: 5px;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    background: rgba(9,12,16,.96);
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.07);
    box-shadow: 0 12px 30px rgba(0,0,0,.20);
    scrollbar-width: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .side-brand { flex: 0 0 auto; padding: 0 7px 0 0; margin: 0 4px 0 0; border: 0; border-right: 1px solid rgba(255,255,255,.07); }
  .side-brand img { width: 35px; height: 35px; }
  .side-brand div { display: none; }
  .nav-btn {
    flex: 0 0 auto;
    width: auto;
    min-height: 38px;
    margin: 0;
    padding: 0 12px;
    border-radius: 9px;
    font-size: .79rem;
    white-space: nowrap;
  }
  .nav-btn.active { box-shadow: inset 0 -2px 0 var(--accent); }
  .nav-btn.exit { margin-top: 0; border-top: 0; }

  .admin-main { padding: 18px 12px 90px; }
  .admin-header { align-items: flex-start; flex-direction: column; gap: 14px; margin-bottom: 18px; padding-bottom: 17px; }
  .admin-header h2 { font-size: clamp(2rem, 12vw, 3rem); }
  .admin-stats { justify-content: flex-start; }
  .admin-card { padding: 16px; border-radius: 14px; }
  .card-row { align-items: flex-start; flex-direction: column; }
  .card-row .row-actions { width: 100%; }
  .card-row .row-actions > * { flex: 1 1 auto; }
  .inline-field { grid-template-columns: 1fr; }
  .inline-field .ghost-btn { width: 100%; }
  .item-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .item-actions .ghost-btn { width: 100%; }
  .ticket-meta-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kader-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .log-entry { grid-template-columns: 1fr; gap: 5px; }
  .log-actor { grid-column: auto; text-align: left; }
  .account-summary { grid-template-columns: 1fr; }
  .account-edit-row { grid-template-columns: 1fr; }
  .modal-card { padding: 24px 18px; }
  input, textarea, select { font-size: 16px; }
}

@media (max-width: 430px) {
  .portal-menu { padding-inline: 17px; }
  .mode-buttons { gap: 9px; }
  .item-actions { grid-template-columns: 1fr; }
  .ticket-meta-grid { grid-template-columns: 1fr; }
  .kader-stats { grid-template-columns: 1fr 1fr; }
  .admin-stats span { min-height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
