/* Satit VRU — admin */
:root {
  --brand-950: #0B1838; --brand-900: #0E1D45; --brand-800: #14285A; --brand-700: #1C3577; --sapphire: #2547A8;
  --gold: #D6A126; --gold-deep: #A9790C; --gold-soft: #EBCB7A; --gold-wash: #FBF4E2;
  --bg: #F3F5F9; --paper: #fff; --ink: #1A2238; --ink-2: #3A4359; --muted: #667085; --line: #E3E7EF; --line-2: #CFD5E1;
  --ok: #1E7A4F; --ok-bg: #E8F5EE; --err: #B42318; --err-bg: #FEF0EE;
  --r: 10px; --r-lg: 14px;
  --f-display: "Noto Serif Thai", serif;
  --f: "IBM Plex Sans Thai Looped", "IBM Plex Sans Thai", "Sarabun", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--f); font-size: 15px; line-height: 1.6; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.35; color: var(--brand-900); }
button { font: inherit; cursor: pointer; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.ic { width: 18px; height: 18px; flex: none; }
.ic.big { width: 40px; height: 40px; color: var(--gold); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
[hidden] { display: none !important; }
code { font-size: .82rem; background: var(--bg); padding: 1px 6px; border-radius: 4px; color: var(--ink-2); }

/* Layout */
.adm { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--brand-950); color: rgba(255, 255, 255, .8); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 16px 12px 30px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.side-brand { display: flex; gap: 10px; align-items: center; padding: 6px 8px 18px; color: #fff; text-decoration: none !important; border-bottom: 1px solid rgba(255, 255, 255, .08); margin-bottom: 10px; }
.side-brand img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 50%; padding: 2px; }
.side-brand b { display: block; font-family: var(--f-display); font-size: 1rem; }
.side-brand small { color: var(--gold-soft); font-size: .78rem; }
.side-nav { display: flex; flex-direction: column; gap: 1px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; color: rgba(255, 255, 255, .78); font-size: .93rem; text-decoration: none; }
.side-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-nav a.on { background: var(--gold); color: var(--brand-950); font-weight: 600; }
.side-nav a .ic { opacity: .9; }
.side-h { font-size: .75rem; color: rgba(255, 255, 255, .42); padding: 16px 12px 4px; }
.count { margin-left: auto; font-style: normal; background: var(--gold); color: var(--brand-950); font-size: .72rem; font-weight: 700; border-radius: 99px; padding: 0 8px; }
.side-nav a.on .count { background: var(--brand-950); color: #fff; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topnav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 28px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); min-height: 62px; }
.topnav h1 { font-family: var(--f-display); font-size: 1.25rem; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.side-toggle { display: none; }
.content { padding: 24px 28px 60px; max-width: 1400px; width: 100%; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink); font-weight: 500; font-size: .93rem; line-height: 1.3; white-space: nowrap; text-decoration: none !important; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--brand-800); }
.btn-sm { padding: 5px 11px; font-size: .86rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--brand-800); border-color: var(--brand-800); color: #fff; }
.btn-primary:hover { background: var(--brand-700); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--paper); border-color: var(--line); }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-danger:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-danger-ghost { border-color: transparent; background: none; color: var(--err); }
.btn-danger-ghost:hover { background: var(--err-bg); border-color: var(--err-bg); }
.ibtn { display: inline-flex; align-items: center; gap: 6px; height: 38px; min-width: 38px; justify-content: center; padding: 0 10px; border-radius: 8px; border: 0; background: none; color: var(--ink-2); text-decoration: none !important; }
.ibtn:hover { background: var(--bg); color: var(--brand-900); }
.ibtn.sm { height: 32px; min-width: 32px; padding: 0 6px; }
.ibtn.danger:hover { background: var(--err-bg); color: var(--err); }
.link { color: var(--link); cursor: pointer; text-decoration: underline; }

/* User menu */
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: 99px; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: var(--bg); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--gold); color: var(--brand-950); display: grid; place-items: center; font-weight: 700; }
.um-pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 16px 40px -14px rgba(14, 29, 69, .35); min-width: 260px; padding: 6px; }
.um-pop a, .um-pop button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 8px; border: 0; background: none; color: var(--ink); text-align: left; text-decoration: none; }
.um-pop a:hover, .um-pop button:hover { background: var(--bg); }

/* Flash */
.flash-wrap { position: fixed; top: 72px; right: 24px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--paper); border: 1px solid var(--line); box-shadow: 0 12px 30px -12px rgba(14, 29, 69, .3); transition: opacity .5s, transform .5s; }
.flash.ok { border-left: 4px solid var(--ok); } .flash.ok .ic { color: var(--ok); }
.flash.err { border-left: 4px solid var(--err); } .flash.err .ic { color: var(--err); }
.flash span { flex: 1; }
.flash .x { border: 0; background: none; padding: 0; color: var(--muted); }
.flash.fade { opacity: 0; transform: translateX(20px); pointer-events: none; }
.login-card .flash { box-shadow: none; margin-bottom: 14px; background: var(--err-bg); }

/* Cards */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 620px; }
.card.pad-lg { padding: 48px 30px; margin: 40px auto; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-h h3, h3.card-h { font-size: 1.05rem; margin: 0 0 12px; font-family: var(--f); font-weight: 700; }
.card-h h3 { margin: 0; }
.sub-h { font-size: 1.05rem; margin: 22px 0 4px; font-family: var(--f); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-2 .card { margin: 0; }

/* Dashboard */
.welcome { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--brand-900); color: #fff; border-radius: var(--r-lg); padding: 22px 26px; margin-bottom: 18px; position: relative; overflow: hidden; }
.welcome::before { content: ""; position: absolute; inset: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23D6A126' stroke-width='1'%3E%3Cpath d='M28 14c4 6 4 8 0 14-4-6-4-8 0-14zM28 42c4-6 4-8 0-14-4 6-4 8 0 14zM14 28c6-4 8-4 14 0-6 4-8 4-14 0zM42 28c-6-4-8-4-14 0 6 4 8 4 14 0z'/%3E%3C/g%3E%3C/svg%3E"); opacity: .1; }
.welcome > * { position: relative; }
.welcome h2 { color: #fff; font-family: var(--f-display); font-size: 1.35rem; margin: 0; }
.welcome p { margin: 2px 0 0; color: var(--gold-soft); }
.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.welcome .btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .25); color: #fff; }
.welcome .btn-primary { background: var(--gold); border-color: var(--gold); color: var(--brand-950); }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { display: grid; grid-template-columns: 44px 1fr; column-gap: 12px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; color: var(--ink); text-decoration: none !important; }
.stat:hover { border-color: var(--gold); }
.st-ic { grid-row: span 2; width: 44px; height: 44px; border-radius: 12px; background: var(--gold-wash); color: var(--gold-deep); display: grid; place-items: center; }
.stat b { font-size: 1.5rem; line-height: 1.1; color: var(--brand-900); }
.stat > span:last-child { color: var(--muted); font-size: .88rem; }
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.todo li:first-child { border-top: 0; }
.todo .ic { color: var(--gold-deep); margin-top: 3px; }
.rank { margin: 0; padding-left: 1.3em; }
.rank li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.rank li span:last-child { float: right; color: var(--muted); font-size: .85rem; margin-left: 10px; }

/* Toolbar / filters */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar p { margin: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select, .search { height: 38px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--paper); }
.filters select { padding: 0 30px 0 10px; max-width: 260px; }
.search { display: flex; align-items: center; gap: 6px; padding: 0 10px; min-width: 240px; }
.search input { border: 0; outline: 0; background: none; flex: 1; min-width: 0; }
.search .ic { color: var(--muted); }

/* Tables */
.list-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list-meta .ic { width: 14px; height: 14px; vertical-align: -2px; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: .8rem; font-weight: 600; color: var(--muted); padding: 10px 12px; background: #FAFBFD; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #FAFBFD; }
.tbl .c { text-align: center; } .tbl .r { text-align: right; }
.tbl .chk { width: 36px; } .tbl .grip-col { width: 30px; padding-right: 0; }
.td-title a { font-weight: 600; color: var(--brand-900); }
.tbl.compact td { padding: 8px 4px; }
.tbl tr.unread td { background: var(--gold-wash); } .tbl tr.unread a { font-weight: 700; }
.tbl tr.sel td { background: #EEF2FB; }
.tbl tr.warn td { background: var(--err-bg); }
.actions { white-space: nowrap; }
.th { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; background: var(--bg); }
.th.thumb-wide { width: 96px; height: 48px; } .th.thumb-tall { width: 40px; height: 54px; object-position: top; }
.th-empty { display: grid; place-items: center; color: var(--line-2); }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .76rem; font-weight: 600; padding: 1px 9px; border-radius: 99px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.gold { background: var(--gold-wash); color: var(--gold-deep); margin-left: 6px; }
.badge .ic { width: 14px; height: 14px; }
.swatch { display: inline-block; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); }
.grip { cursor: grab; color: var(--muted); display: inline-flex; }
.dragging { opacity: .5; background: var(--gold-wash); }
.ft-mini { display: inline-grid; place-items: center; min-width: 40px; height: 24px; padding: 0 6px; border-radius: 4px; font-size: .7rem; font-weight: 800; color: #fff; background: var(--muted); text-decoration: none !important; }
.ft-doc { background: #2B5797; } .ft-xls { background: #1E7145; } .ft-pdf { background: #C0392B; } .ft-ppt { background: #D2502A; } .ft-cloud { background: var(--link); }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty > .ic { width: 40px; height: 40px; color: var(--gold); margin: 0 auto 8px; }
.pager { display: flex; justify-content: center; gap: 4px; margin-top: 18px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 36px; height: 36px; padding: 0 10px; display: grid; place-items: center; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.pager .cur { background: var(--brand-800); color: #fff; border-color: var(--brand-800); }

/* Forms */
.crud-form.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.form-side .sticky { position: sticky; top: 80px; }
.save-box { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.after { display: flex; gap: 14px; margin-top: 8px; font-size: .85rem; color: var(--muted); }
.form-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.fld { margin-bottom: 16px; }
.fld > label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 5px; color: var(--ink-2); }
.req { color: var(--err); font-style: normal; }
.fld input[type=text], .fld input[type=email], .fld input[type=password], .fld input[type=number], .fld input[type=date], .fld input[type=datetime-local], .fld input:not([type]), .fld select, .fld textarea, .login .fld input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--paper); transition: border-color .15s, box-shadow .15s;
}
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: 0; border-color: var(--link); box-shadow: 0 0 0 3px rgba(37, 71, 168, .14); }
.fld input:disabled { background: var(--bg); color: var(--muted); }
.fld textarea { resize: vertical; }
.fld .w-sm { max-width: 120px; } .fld .w-md { max-width: 260px; }
.fld input[type=color] { width: 60px; height: 38px; padding: 2px; border: 1px solid var(--line-2); border-radius: 8px; }
.help { display: block; color: var(--muted); font-size: .8rem; margin-top: 4px; }
.err { display: block; color: var(--err); font-size: .84rem; margin-top: 4px; }
.has-err input, .has-err select, .has-err textarea { border-color: var(--err) !important; }
.fld-title input, #f_title { font-size: 1.15rem; font-weight: 600; padding: 11px 14px !important; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; }
.sw { width: 40px; height: 22px; border-radius: 99px; background: var(--line-2); position: relative; flex: none; transition: background .2s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .sw { background: var(--ok); }
.switch input:checked + .sw::after { transform: translateX(18px); }
.switch input:focus-visible + .sw { outline: 3px solid var(--gold); outline-offset: 2px; }
.img-field { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: start; }
.form-side .img-field { grid-template-columns: 1fr; }
.img-prev { aspect-ratio: 4 / 3; border: 1px dashed var(--line-2); border-radius: 8px; background: var(--bg) repeating-conic-gradient(#eef1f6 0 25%, #f7f8fb 0 50%) 0 0 / 16px 16px; display: grid; place-items: center; overflow: hidden; }
.img-prev img { width: 100%; height: 100%; object-fit: contain; }
.img-prev span { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-size: .8rem; }
.img-ctrl { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.img-path { font-size: .82rem !important; color: var(--muted); }
.row-btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row-btns form { display: inline; }
.file-field { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.file-field input[type=text] { flex: 1 1 280px; }
.file-name { flex-basis: 100%; }
.slug-field { display: flex; flex-direction: column; gap: 4px; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 4px; }
.icon-pick button { width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); display: grid; place-items: center; color: var(--ink-2); }
.icon-pick button.on { border-color: var(--gold); background: var(--gold-wash); color: var(--gold-deep); box-shadow: 0 0 0 2px var(--gold-soft); }
.danger-zone { margin-top: 10px; }
.tox-tinymce { border-radius: 8px !important; border-color: var(--line-2) !important; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 16px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--brand-900); border-bottom-color: var(--gold); font-weight: 700; }
.settings .card { max-width: 860px; }
.levels-tbl input, .levels-tbl select { width: 100%; padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 6px; }

/* Menu tree */
.mtree { list-style: none; margin: 0; padding: 0; }
.mtree.sub { margin-left: 28px; border-left: 2px solid var(--gold-wash); padding-left: 10px; }
.mrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin: 5px 0; background: var(--paper); }
.mrow:hover { border-color: var(--line-2); }
.mrow.warn { border-left: 3px solid var(--gold); }
.mlabel { font-weight: 600; color: var(--brand-900); }
.mdest { color: var(--muted); font-size: .82rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mact { display: flex; }

/* Media */
.dropzone { border: 2px dashed var(--line-2); border-radius: var(--r-lg); background: var(--paper); padding: 26px; text-align: center; margin-bottom: 16px; transition: border-color .2s, background .2s; }
.dropzone.over { border-color: var(--gold); background: var(--gold-wash); }
.dropzone .ic.big { margin: 0 auto 6px; }
.dropzone p { margin: 0 0 4px; }
.up-progress { text-align: left; max-width: 560px; margin: 10px auto 0; font-size: .86rem; }
.up-progress .ok { color: var(--ok); } .up-progress .err { color: var(--err); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 12px; }
.media-item { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; position: relative; }
.mi-chk { position: absolute; top: 6px; left: 6px; z-index: 1; background: rgba(255,255,255,.9); border-radius: 4px; padding: 2px 4px; }
.mi-thumb { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; border: 0; padding: 0; background: var(--bg); }
.mi-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mi-meta { padding: 8px 10px; font-size: .78rem; line-height: 1.4; }
.mi-meta b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mi-meta span { color: var(--muted); }
.modal { position: fixed; inset: 0; z-index: 80; background: rgba(11, 24, 56, .55); display: grid; place-items: center; padding: 20px; }
.modal-box { background: var(--paper); border-radius: var(--r-lg); width: min(960px, 100%); max-height: 86vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.modal-head b { flex: 1; }
.mm-q { padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 8px; min-width: 200px; }
.mm-grid { padding: 14px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.mm-grid button { border: 2px solid transparent; border-radius: 8px; padding: 0; background: var(--bg); overflow: hidden; text-align: left; }
.mm-grid button:hover { border-color: var(--gold); }
.mm-grid img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; }
.mm-grid span { display: block; font-size: .72rem; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.pad { padding: 20px; }

/* Messages */
.grid-msg.has-view { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 18px; align-items: start; }
.msg-view { position: sticky; top: 80px; }
.msg-meta { display: grid; grid-template-columns: 70px 1fr; gap: 4px 10px; margin: 0 0 14px; font-size: .9rem; }
.msg-meta dt { color: var(--muted); }
.msg-meta dd { margin: 0; }
.msg-body { background: var(--bg); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; white-space: normal; }

/* Login */
.login-body { background: var(--brand-950); }
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr minmax(360px, 480px); }
.login-art { background: var(--brand-900) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23D6A126' stroke-width='1' opacity='.35'%3E%3Cpath d='M28 14c4 6 4 8 0 14-4-6-4-8 0-14zM28 42c4-6 4-8 0-14-4 6-4 8 0 14zM14 28c6-4 8-4 14 0-6 4-8 4-14 0zM42 28c-6-4-8-4-14 0 6 4 8 4 14 0z'/%3E%3Ccircle cx='28' cy='28' r='2'/%3E%3C/g%3E%3C/svg%3E"); }
.login-card { background: var(--paper); padding: 56px 44px; display: flex; flex-direction: column; justify-content: center; }
.login-logo { width: 76px; height: 76px; object-fit: contain; margin-bottom: 16px; }
.login-card h1 { font-family: var(--f-display); font-size: 1.5rem; margin-bottom: 2px; }
.login-card > .muted { margin: 0 0 24px; }
.login .fld span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 5px; color: var(--ink-2); }
.login .btn-primary { padding: 12px; font-size: 1rem; margin-top: 6px; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-top: 22px; color: var(--muted); font-size: .9rem; }

.hide-sm { }
@media (max-width: 1100px) {
  .crud-form.two-col, .grid-msg.has-view { grid-template-columns: 1fr; }
  .form-side .sticky, .msg-view { position: static; }
  .stat-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .adm { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform .25s; }
  .side-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(11, 24, 56, .45); }
  .side-toggle { display: inline-flex; }
  .topnav { padding: 8px 14px; }
  .content { padding: 16px 14px 50px; }
  .grid-2 { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-card { padding: 40px 24px; }
  .hide-sm { display: none; }
  .search { min-width: 0; flex: 1; }
  .img-field { grid-template-columns: 1fr; }
  .flash-wrap { left: 14px; right: 14px; max-width: none; }
}
.rank li { display: list-item; }
.rank li > a, .rank li > .t { display: inline; }
.rank li span:last-child { float: none; display: block; color: var(--muted); font-size: .8rem; margin: 0; }
.switch input { width: 1px; height: 1px; margin: 0; pointer-events: none; }
.switch { position: relative; }
.badge.st-new { background: #FEF3C7; color: #92400E; } .badge.st-contacted { background: #E0EAFF; color: #1E40AF; }
.badge.st-done { background: var(--ok-bg); color: var(--ok); } .badge.st-cancelled { background: var(--bg); color: var(--muted); }
.theme-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.theme-pick label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 14px; cursor: pointer; }
.theme-pick label:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.sw-c { width: 22px; height: 22px; border-radius: 6px; }
