/* 1310 Home — portal styles. Dark theme, 1310 blue with green accents. */

@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("../fonts/poppins-400.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("../fonts/poppins-500.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("../fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url("../fonts/poppins-700.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --bg: #08101d;
  --bg-2: #0c1626;
  --surface: #111c2e;
  --surface-2: #16243a;
  --surface-3: #1c2d47;
  --border: #213350;
  --border-2: #2c4266;
  --text: #e7eef8;
  --text-2: #b8c5d9;
  --muted: #8396b2;

  --blue: #33aae2;          /* 1310 brand blue */
  --blue-bright: #3399ff;   /* 1310 accent */
  --green: #3ddc97;
  --teal: #2dd4bf;
  --purple: #a78bfa;
  --amber: #f5b544;
  --red: #f2647a;
  --slate: #94a3b8;

  --grad: linear-gradient(135deg, var(--blue-bright) 0%, var(--blue) 45%, var(--green) 100%);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px -12px rgba(0,0,0,.6);
  --font: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --page-w: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text);
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(51,153,255,.13), transparent 60%),
    radial-gradient(700px 420px at 95% 0%, rgba(61,220,151,.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
img { max-width: 100%; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: #6cc4ee; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(1.45rem, 1.1rem + 1.2vw, 1.9rem); }
h2, .h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
code { font-family: var(--mono); font-size: .85em; background: var(--surface-2); padding: .1em .4em; border-radius: 5px; color: var(--text-2); }
kbd { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.strong { font-weight: 600; color: var(--text); }
.block { display: block; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 34ch; }
.accent-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.icon { width: 1.25em; height: 1.25em; flex: none; }

/* --- Top bar ---------------------------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(8,16,29,.82); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar__inner { max-width: var(--page-w); margin: 0 auto; padding: .65rem 1.25rem; display: flex; align-items: center; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 600; font-size: 1.05rem; }
.brand:hover { color: var(--text); }
.brand__name span { color: var(--muted); font-weight: 500; }
.topnav { display: flex; gap: .25rem; margin-right: auto; }
.topnav a { color: var(--text-2); padding: .45rem .8rem; border-radius: 8px; font-size: .92rem; font-weight: 500; }
.topnav a:hover { background: var(--surface); color: var(--text); }
.topnav a.is-active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--blue); }

.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: .55rem; cursor: pointer; padding: .25rem .4rem .25rem .25rem; border-radius: 99px; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: var(--surface); }
.usermenu__name { font-size: .9rem; color: var(--text-2); }
.usermenu__panel { position: absolute; right: 0; top: calc(100% + .5rem); width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem; box-shadow: var(--shadow); }
.usermenu__who { display: flex; flex-direction: column; margin-bottom: .75rem; }
.usermenu__who small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .8rem; font-weight: 600; color: #04121f; background: var(--grad); flex: none; }
.avatar--sm { width: 28px; height: 28px; font-size: .7rem; }

/* --- Layout ------------------------------------------------------------------ */
.page { flex: 1; width: 100%; max-width: var(--page-w); margin: 0 auto; padding: 1.75rem 1.25rem 3rem; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 1.5rem; border-top: 1px solid var(--border); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.link-more { font-size: .88rem; font-weight: 500; }

/* --- Welcome ------------------------------------------------------------------ */
.welcome { margin-bottom: 1.75rem; }
.welcome__eyebrow { margin: 0 0 .2rem; color: var(--green); font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; min-height: 1.2em; }
.welcome h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); }
.welcome p { margin: .3rem 0 0; }

/* --- Bulletins ------------------------------------------------------------------ */
.bulletins { margin-bottom: 2.25rem; }
.bulletins__list { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); }
.bulletins__list--stack { grid-template-columns: 1fr; max-width: 820px; }
.bulletin { --lvl: var(--blue); position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem 1.05rem; box-shadow: var(--shadow); overflow: hidden; }
.bulletin::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--lvl); }
.bulletin--success { --lvl: var(--green); }
.bulletin--warning { --lvl: var(--amber); }
.bulletin--critical { --lvl: var(--red); background: linear-gradient(180deg, rgba(242,100,122,.08), transparent 60%), var(--surface); }
.bulletin.is-pinned { border-color: color-mix(in srgb, var(--lvl) 45%, var(--border)); }
.bulletin__head { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: .5rem; }
.bulletin__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--lvl); background: color-mix(in srgb, var(--lvl) 14%, transparent); flex: none; }
.bulletin__icon .icon { width: 18px; height: 18px; }
.bulletin__meta h3 { font-size: 1rem; }
.bulletin__meta small { color: var(--muted); font-size: .78rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.bulletin__body { color: var(--text-2); font-size: .92rem; }
.bulletin__body.is-collapsed { max-height: 7.2em; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent); mask-image: linear-gradient(180deg, #000 55%, transparent); }
.bulletin__more { background: none; border: 0; padding: .3rem 0 0; color: var(--blue); font: inherit; font-size: .85rem; font-weight: 500; cursor: pointer; }

.richtext > :first-child { margin-top: 0; }
.richtext > :last-child { margin-bottom: 0; }
.richtext p { margin: 0 0 .6em; }
.richtext h3, .richtext h4 { margin: .9em 0 .35em; color: var(--text); }
.richtext ul, .richtext ol { margin: 0 0 .6em; padding-left: 1.3em; }
.richtext blockquote { margin: .6em 0; padding: .3em .9em; border-left: 3px solid var(--border-2); color: var(--muted); }
.richtext a { text-decoration: underline; text-underline-offset: 2px; }

/* --- Search & chips ------------------------------------------------------------- */
.search { position: relative; flex: 1 1 280px; max-width: 420px; }
.search .icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; pointer-events: none; }
.search input[type=search] { width: 100%; padding: .7rem 2.6rem .7rem 2.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); font: inherit; }
.search input[type=search]:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(51,170,226,.18); }
.search__kbd { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); font-size: .75rem; color: var(--muted); border: 1px solid var(--border-2); border-radius: 5px; padding: 0 .4rem; }
.chips { display: flex; gap: .45rem; flex-wrap: wrap; margin: -.25rem 0 1.4rem; }
.chip { font: inherit; font-size: .84rem; font-weight: 500; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); padding: .35rem .85rem; border-radius: 99px; cursor: pointer; }
.chip:hover { border-color: var(--border-2); color: var(--text); }
.chip.is-active { color: #04121f; background: var(--grad); border-color: transparent; }

/* --- Apps --------------------------------------------------------------------- */
.app-group { margin-bottom: 1.6rem; }
.app-group__title { font-size: .78rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: .7rem; }
.app-grid { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.app-card { position: relative; display: flex; align-items: center; gap: .9rem; padding: .95rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease, background .15s ease; min-width: 0; }
.app-card:hover { color: var(--text); transform: translateY(-2px); border-color: var(--border-2); background: var(--surface-2); }
.app-card:hover .app-card__ext { opacity: 1; }
.app-card__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.app-card__name { font-weight: 600; font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-card__desc { color: var(--muted); font-size: .83rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.app-card__ext { position: absolute; top: .6rem; right: .6rem; color: var(--muted); opacity: 0; transition: opacity .15s; }
.app-card__ext .icon { width: 14px; height: 14px; }
.app-card--preview { pointer-events: none; margin: .25rem 0 1rem; }

.app-logo { --c: var(--blue); display: grid; place-items: center; flex: none; border-radius: 12px; color: var(--c); background: color-mix(in srgb, var(--c) 15%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); overflow: hidden; }
.app-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 4px; }
.app-logo--md { width: 48px; height: 48px; }
.app-logo--md .icon { width: 24px; height: 24px; }
.app-logo--sm { width: 36px; height: 36px; border-radius: 9px; }
.app-logo--sm .icon { width: 18px; height: 18px; }
.app-logo--xs { width: 26px; height: 26px; border-radius: 7px; }
.app-logo--xs .icon { width: 14px; height: 14px; }
.accent-blue { --c: var(--blue); }
.accent-green { --c: var(--green); }
.accent-teal { --c: var(--teal); }
.accent-purple { --c: var(--purple); }
.accent-amber { --c: var(--amber); }
.accent-red { --c: var(--red); }
.accent-slate { --c: var(--slate); }

.empty { text-align: center; padding: 3rem 1rem; color: var(--text-2); background: var(--surface); border: 1px dashed var(--border-2); border-radius: var(--radius); }
.empty > .icon { width: 36px; height: 36px; color: var(--muted); margin-bottom: .5rem; }
.empty h3 { margin-bottom: .3rem; }
.empty--page { margin: 4rem auto; max-width: 520px; border-style: solid; }
.empty--page h1 { margin-bottom: .5rem; }
.empty--page .btn { margin-top: 1rem; }
.error-code { font-size: 3rem; font-weight: 700; margin: 0; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* --- Buttons, tags, pills ---------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font: inherit; font-size: .9rem; font-weight: 500; padding: .6rem 1.05rem; border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-decoration: none; line-height: 1.2; transition: background .15s, border-color .15s, filter .15s; }
.btn .icon { width: 16px; height: 16px; }
.btn--primary { color: #04121f; background: var(--grad); }
.btn--primary:hover { color: #04121f; filter: brightness(1.08); }
.btn--ghost { color: var(--text-2); background: var(--surface-2); border-color: var(--border); }
.btn--ghost:hover { color: var(--text); border-color: var(--border-2); background: var(--surface-3); }
.btn--danger { color: #ffd9df; background: rgba(242,100,122,.12); border-color: rgba(242,100,122,.35); }
.btn--danger:hover { color: #fff; background: rgba(242,100,122,.25); }
.btn--ms { color: var(--text); background: #1b2433; border-color: var(--border-2); }
.btn--ms:hover { color: var(--text); background: #232f42; }
.btn--sm { padding: .32rem .65rem; font-size: .8rem; border-radius: 8px; }
.btn--block { width: 100%; }
form.inline { display: inline; }
.actions { display: flex; gap: .35rem; justify-content: flex-end; flex-wrap: wrap; }

.tag { display: inline-flex; align-items: center; gap: .25rem; font-size: .74rem; font-weight: 500; padding: .1rem .5rem; border-radius: 6px; background: var(--surface-3); color: var(--text-2); margin: .1rem .25rem .1rem 0; white-space: nowrap; }
.tag .icon { width: 12px; height: 12px; }
.tag--green { background: rgba(61,220,151,.14); color: var(--green); }
.tag--blue { background: rgba(51,170,226,.15); color: var(--blue); }
.tag--amber { background: rgba(245,181,68,.15); color: var(--amber); }
.tag--pin { background: rgba(51,153,255,.15); color: var(--blue-bright); }
.pill { display: inline-block; font-size: .74rem; font-weight: 600; padding: .15rem .6rem; border-radius: 99px; }
.pill--live { background: rgba(61,220,151,.14); color: var(--green); }
.pill--scheduled { background: rgba(51,170,226,.15); color: var(--blue); }
.pill--draft, .pill--expired { background: var(--surface-3); color: var(--muted); }
.pill--admin { background: rgba(245,181,68,.15); color: var(--amber); }
.level-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .4rem; background: var(--blue); vertical-align: middle; }
.level-dot--success { background: var(--green); } .level-dot--warning { background: var(--amber); } .level-dot--critical { background: var(--red); }

/* --- Flash messages -------------------------------------------------------------- */
.flash { position: relative; padding: .75rem 2.5rem .75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .9rem; border: 1px solid; }
.flash ul { margin: .35rem 0 0; padding-left: 1.2rem; }
.flash--success { background: rgba(61,220,151,.1); border-color: rgba(61,220,151,.3); color: #b7f5d9; }
.flash--info { background: rgba(51,170,226,.1); border-color: rgba(51,170,226,.3); color: #c5e9fa; }
.flash--warning { background: rgba(245,181,68,.1); border-color: rgba(245,181,68,.3); color: #fde6bb; }
.flash--error { background: rgba(242,100,122,.1); border-color: rgba(242,100,122,.35); color: #ffd0d8; }
.flash__close { position: absolute; right: .5rem; top: .45rem; background: none; border: 0; color: inherit; font-size: 1.2rem; cursor: pointer; opacity: .7; }

/* --- Forms ----------------------------------------------------------------------- */
.form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field > span { font-size: .85rem; font-weight: 500; color: var(--text-2); }
.field > span em, .hint { font-style: normal; font-weight: 400; color: var(--muted); font-size: .8rem; }
.hint { margin: 0; }
.form-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=search], input[type=datetime-local], input[type=file], select, .input {
  width: 100%; font: inherit; font-size: .92rem; color: var(--text); background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .6rem .75rem;
}
input:focus, select:focus, .input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(51,170,226,.18); }
input[type=file] { padding: .45rem; }
input[type=file]::file-selector-button { font: inherit; font-size: .8rem; color: var(--text); background: var(--surface-3); border: 1px solid var(--border-2); border-radius: 7px; padding: .3rem .7rem; margin-right: .6rem; cursor: pointer; }
.input--sm { padding: .42rem .65rem; font-size: .85rem; }
.input--num { width: 6.5rem; flex: none; }
.check { display: flex; align-items: center; gap: .5rem; font-size: .9rem; cursor: pointer; padding: .2rem 0; }
.check input { accent-color: var(--blue); width: 16px; height: 16px; flex: none; }
.checklist { display: flex; flex-direction: column; gap: .1rem; max-height: 260px; overflow: auto; padding: .5rem .75rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.checklist--tall { max-height: 320px; }
.checklist--cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); column-gap: 1rem; }
.switch { display: flex; align-items: center; gap: .65rem; cursor: pointer; font-size: .92rem; flex-wrap: wrap; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch > span { width: 38px; height: 22px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-2); position: relative; flex: none; transition: background .15s; }
.switch > span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: transform .15s, background .15s; }
.switch input:checked + span { background: var(--green); border-color: var(--green); }
.switch input:checked + span::after { transform: translateX(16px); background: #04121f; }
.switch input:focus-visible + span { outline: 2px solid var(--blue-bright); outline-offset: 2px; }
.form-inline { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.form-inline .input { flex: 1 1 180px; width: auto; }
.form-actions { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
.access-pickers { display: flex; flex-direction: column; gap: 1rem; margin-top: .4rem; }
.access-pickers.is-hidden { display: none; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); margin: 0 0 1rem; }
fieldset.panel { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.panel legend { float: left; width: 100%; padding: 0; font-weight: 600; font-size: 1rem; margin-bottom: .1rem; }
.panel legend + * { clear: both; }
.panel__head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .8rem; }
.panel__title { font-size: .95rem; margin-bottom: .6rem; }
.panel--danger { border-color: rgba(242,100,122,.3); }
.panel--danger .actions { justify-content: flex-start; }
.form-grid { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.sticky { position: sticky; top: 80px; }

.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: .35rem; max-height: 196px; overflow: auto; padding: .5rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.icon-picker__item { position: relative; cursor: pointer; }
.icon-picker__item input { position: absolute; opacity: 0; }
.icon-picker__item span { display: grid; place-items: center; height: 42px; border-radius: 9px; color: var(--text-2); border: 1px solid transparent; }
.icon-picker__item span .icon { width: 20px; height: 20px; }
.icon-picker__item:hover span { background: var(--surface-2); color: var(--text); }
.icon-picker__item input:checked + span { background: rgba(51,170,226,.16); border-color: var(--blue); color: var(--blue); }
.icon-picker__item input:focus-visible + span { outline: 2px solid var(--blue-bright); }
.swatches { display: flex; gap: .5rem; flex-wrap: wrap; }
.swatch { cursor: pointer; position: relative; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--c); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border-2); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--text); }
.swatch input:focus-visible + span { outline: 2px solid var(--blue-bright); outline-offset: 2px; }

/* Rich text editor */
.rte { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); overflow: hidden; }
.rte:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(51,170,226,.18); }
.rte__toolbar { display: flex; flex-wrap: wrap; gap: .2rem; padding: .4rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.rte__toolbar button { font: inherit; font-size: .82rem; color: var(--text-2); background: transparent; border: 1px solid transparent; border-radius: 6px; padding: .25rem .55rem; cursor: pointer; min-width: 32px; }
.rte__toolbar button:hover { background: var(--surface-3); color: var(--text); }
.rte__sep { width: 1px; background: var(--border-2); margin: .2rem .25rem; }
.rte__editor { min-height: 220px; padding: .8rem 1rem; outline: none; color: var(--text); }
.rte__editor:empty::before { content: "Write your announcement…"; color: var(--muted); }
.rte__link { display: flex; gap: .4rem; padding: .5rem; border-top: 1px solid var(--border); background: var(--surface-2); }

/* --- Tables -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel .table-wrap { box-shadow: none; border: 0; background: transparent; margin: 0 -1.2rem -1.1rem; border-radius: 0; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .75rem 1rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .7rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(255,255,255,.015); }
.table th.right, .table td.right { text-align: right; }
tr.is-dim > td, .is-dim { opacity: .55; }
.cell-app, .cell-user { display: flex; align-items: center; gap: .65rem; color: var(--text); }
.toolbar { margin-bottom: 1rem; max-width: 420px; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 1rem; }
.tree-indent { display: inline-flex; align-items: center; gap: .35rem; }
.tree-branch { color: var(--border-2); }
.d-1 { padding-left: 1.4rem; } .d-2 { padding-left: 2.8rem; } .d-3 { padding-left: 4.2rem; } .d-4 { padding-left: 5.6rem; } .d-5 { padding-left: 7rem; }
.tree-desc.d-0 { padding-left: 0; }
.tree-desc.d-1, .tree-desc.d-2, .tree-desc.d-3, .tree-desc.d-4, .tree-desc.d-5 { margin-left: 1rem; }
.access-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.access-list li { display: flex; gap: .55rem; align-items: center; font-size: .88rem; }

/* --- Admin shell ------------------------------------------------------------------------ */
.admin { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 1.75rem; align-items: start; }
.admin__nav { position: sticky; top: 80px; display: flex; flex-direction: column; gap: .15rem; }
.admin__nav a { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border-radius: 9px; color: var(--text-2); font-size: .9rem; font-weight: 500; }
.admin__nav a .icon { width: 18px; height: 18px; color: var(--muted); }
.admin__nav a:hover { background: var(--surface); color: var(--text); }
.admin__nav a.is-active { background: var(--surface-2); color: var(--text); box-shadow: inset 2px 0 0 var(--blue); }
.admin__nav a.is-active .icon { color: var(--blue); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: .85rem; margin-bottom: 1.25rem; }
.stat { display: flex; flex-direction: column; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); box-shadow: var(--shadow); }
.stat:hover { color: var(--text); border-color: var(--border-2); }
.stat__num { font-size: 1.8rem; font-weight: 600; line-height: 1.1; }
.stat__label { color: var(--text-2); font-size: .88rem; }
.stat small { color: var(--muted); font-size: .76rem; }
.quick { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.25rem; }

/* --- Auth pages ----------------------------------------------------------------------- */
.auth { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth__card { width: 100%; max-width: 400px; background: rgba(17,28,46,.88); border: 1px solid var(--border); border-radius: 18px; padding: 2rem 1.75rem; box-shadow: 0 30px 80px -30px rgba(0,0,0,.8); }
.auth__card--wide { max-width: 560px; }
.auth__brand { text-align: center; margin-bottom: 1.5rem; }
.auth__brand h1 { margin: .9rem 0 .3rem; }
.auth__brand p { margin: .5rem 0 0; font-size: .9rem; }
.auth__logo { height: auto; width: 170px; }
.auth__foot { color: var(--muted); font-size: .78rem; margin-top: 1.25rem; }
.divider { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .8rem; margin: 1.1rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* --- Responsive ----------------------------------------------------------------------- */
@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .admin { grid-template-columns: 1fr; gap: 1rem; }
  .admin__nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: thin; }
  .admin__nav a { white-space: nowrap; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .topbar__inner { gap: .75rem; padding: .55rem .9rem; }
  .brand__name { display: none; }
  .usermenu__name { display: none; }
  .topnav { margin-right: auto; }
  .topnav a { padding: .4rem .55rem; }
  .page { padding: 1.25rem .9rem 2.5rem; }
  .search { max-width: none; flex-basis: 100%; }
  .search__kbd { display: none; }
  .app-grid { grid-template-columns: 1fr; }
  .table th, .table td { padding: .6rem .7rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.table td.actions { display: table-cell; white-space: nowrap; }
.table td.actions > * { margin-left: .2rem; }
[hidden] { display: none !important; }
.form-side .panel { display: flex; flex-direction: column; gap: .9rem; }
.form-side .panel .panel__title { margin-bottom: 0; }
.form-side .form-actions { margin-top: .25rem; }
