/* AAWC Screens dashboard - dark UI modelled on ProDisplay */
:root {
  --bg: #161616; --panel: #1c1c1c; --panel2: #232323; --panel3: #2a2a2a; --hover: #262a31;
  --border: #2f2f2f; --border2: #3a3a3a; --text: #ececec; --text2: #c4c4c4; --muted: #8d8d8d;
  --blue: #1a7cf0; --blue-h: #3a90f5; --blue-bg: #13263d; --blue-line: #275a95;
  --ok: #22c55e; --ok-bg: #0f2e1d; --warn: #eab308; --warn-bg: #2f2709; --bad: #ef4444; --bad-bg: #351515;
  --radius: 8px; --rail: 96px; --sec: 230px; --header: 56px;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; font-size: 13px; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- shell */
.shell { display: grid; grid-template-rows: var(--header) 1fr auto; grid-template-columns: var(--rail) 1fr; height: 100vh; }
header.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 18px; background: var(--panel); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: .2px; text-decoration: none; }
.brand img { width: 30px; height: 30px; }
header.top .spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--border2); border-radius: 6px; background: var(--panel2); color: var(--text2); font-size: 12px; white-space: nowrap; }
.chip svg { width: 14px; height: 14px; }
.seg { display: inline-flex; background: var(--panel2); border: 1px solid var(--border2); border-radius: 6px; padding: 2px; }
.seg button { border: 0; background: transparent; padding: 4px 10px; border-radius: 4px; cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 600; }
.seg button.on { background: var(--blue); color: #fff; }
.usermenu { display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; padding: 4px 6px; border-radius: 6px; font-weight: 600; }
.usermenu:hover { background: var(--panel2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #3b3b3b; border: 1px solid #555; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #ddd; text-transform: uppercase; }

nav.rail { grid-row: 2 / 4; background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: stretch; padding: 12px 0; gap: 4px; }
nav.rail a { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 2px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 500; }
nav.rail a .ic { width: 34px; height: 30px; display: grid; place-items: center; border-radius: 6px; }
nav.rail a .ic svg { width: 18px; height: 18px; }
nav.rail a:hover { color: var(--text); }
nav.rail a.active { color: var(--text); }
nav.rail a.active .ic { background: var(--blue-bg); color: #6fb0ff; box-shadow: inset 0 0 0 1px var(--blue-line); }
nav.rail .grow { flex: 1; }

.content { display: flex; min-height: 0; min-width: 0; }
aside.sec { width: var(--sec); flex: none; background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
aside.sec .sec-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 14px 12px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14px; min-height: 56px; }
aside.sec .sec-h .t { display: flex; align-items: center; gap: 8px; }
aside.sec .sec-list { flex: 1; overflow: auto; padding: 6px 0; }
aside.sec .sec-f { padding: 12px; border-top: 1px solid var(--border); display: flex; justify-content: center; }
.sec-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; cursor: pointer; color: var(--text2); border-left: 2px solid transparent; position: relative; }
.sec-item:hover { background: var(--hover); }
.sec-item.active { background: var(--blue-bg); color: #fff; border-left-color: var(--blue); }
.sec-item.drop-over { outline: 1px dashed var(--blue); outline-offset: -3px; }
.sec-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.sec-item .sub { font-size: 11px; color: var(--muted); }
.sec-item .cnt { font-size: 11px; color: var(--muted); }
.sec-item .act { opacity: 0; }
.sec-item:hover .act, .sec-item.active .act { opacity: 1; }
.sec-item.off .nm { color: var(--muted); }
.sec-item.indent { padding-left: 26px; }

main.main { flex: 1; min-width: 0; overflow: auto; padding: 22px 28px 28px; }
main.main.flush { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
footer.foot { grid-column: 2; display: flex; gap: 28px; align-items: center; padding: 12px 22px; border-top: 1px solid var(--border); background: var(--panel); color: var(--muted); font-size: 11px; }
footer.foot a { color: var(--muted); }

/* ---------- page header / toolbar */
.ph { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--border); min-height: 46px; }
.ph h1 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ph h1 svg { width: 18px; height: 18px; color: var(--text2); }
.ph .spacer, .toolbar .spacer { flex: 1; }
.crumbs { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.crumbs a { text-decoration: none; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.crumbs a:hover { color: var(--text); }
.crumbs .back { color: #6fb0ff; margin-right: 8px; }
.crumbs svg { width: 16px; height: 16px; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.search { position: relative; width: 300px; max-width: 100%; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--muted); }
.search input { width: 100%; padding-left: 30px !important; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; margin: -6px 0 16px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.filters label { margin: 0; }

/* ---------- controls */
input, select, textarea { background: var(--panel2); border: 1px solid var(--border2); border-radius: 6px; padding: 7px 10px; outline: none; min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 2px #1a7cf033; }
input[type=checkbox] { accent-color: var(--blue); width: 15px; height: 15px; padding: 0; }
input[type=color] { padding: 2px; width: 44px; height: 32px; }
label { display: block; font-size: 12px; color: var(--text2); margin: 0 0 5px; font-weight: 500; }
.field { margin-bottom: 14px; }
.field.inline { display: flex; align-items: center; gap: 8px; }
.field.inline label { margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--border2); background: var(--panel2); color: var(--text); cursor: pointer; font-weight: 600; font-size: 12.5px; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--panel3); border-color: #4a4a4a; }
.btn svg { width: 14px; height: 14px; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-h); }
.btn.danger { color: #ff8a8a; }
.btn.danger:hover { background: var(--bad-bg); border-color: #6b2a2a; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel3); }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12px; }
.btn.icon { width: 30px; padding: 0; }
.btn.sm.icon { width: 26px; }
.btn:disabled { opacity: .4; cursor: default; }
.badge-outline { display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: 6px; border: 1px solid #8a6d12; color: #f0c33c; background: #241e08; font-weight: 600; font-size: 12px; }

/* ---------- tables */
.tbl { width: 100%; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--panel); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text2); background: var(--panel2); padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none; }
th.sort { cursor: pointer; }
th.sort:hover { color: #fff; }
th .arr { color: var(--muted); font-size: 11px; margin-left: 4px; }
td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text2); }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .1s; }
tbody tr.click { cursor: pointer; }
tbody tr:hover td { background: var(--hover); }
tbody tr.sel td { background: var(--blue-bg); box-shadow: inset 0 1px 0 var(--blue-line), inset 0 -1px 0 var(--blue-line); }
td.nm { color: var(--text); font-weight: 500; }
td.nm .sub { font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 2px; }
td.w0, th.w0 { width: 1%; white-space: nowrap; }
td.right, th.right { text-align: right; }
.empty { padding: 34px; text-align: center; color: var(--muted); }
.link { text-decoration: underline; text-underline-offset: 3px; color: var(--text); font-weight: 600; cursor: pointer; }
tr.drop-over td { background: var(--blue-bg) !important; }
tr.dragging { opacity: .45; }

.ficon { width: 38px; height: 26px; border-radius: 13px; border: 1px solid var(--border2); background: var(--panel2); display: grid; place-items: center; }
.ficon svg { width: 16px; height: 16px; }
.mthumb { width: 54px; height: 32px; border-radius: 5px; background: #000 center/cover no-repeat; border: 1px solid var(--border2); display: grid; place-items: center; color: var(--muted); }
.mthumb svg { width: 14px; height: 14px; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--panel3); border: 1px solid var(--border2); color: var(--text); font-size: 12px; font-weight: 500; white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.pill svg { width: 13px; height: 13px; flex: none; }
.pill.live svg { color: var(--ok); }
.pill.ok { background: var(--ok-bg); border-color: #1f5a37; color: #7ee2a4; }
.pill.warn { background: var(--warn-bg); border-color: #5e4c0e; color: #f3cf5a; }
.pill.bad { background: var(--bad-bg); border-color: #5f2323; color: #ff9a9a; }
.pill.off { color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 5px; background: #1e2a38; border: 1px solid #2d4560; color: #9ccaff; font-size: 11px; font-weight: 600; margin: 1px 4px 1px 0; }
.tag svg { width: 11px; height: 11px; }
.tag .x { cursor: pointer; opacity: .7; margin-left: 2px; }
.tag .x:hover { opacity: 1; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.cal-ic { width: 14px; height: 14px; border-radius: 3px; display: grid; place-items: center; flex: none; }
.cal-ic svg { width: 14px; height: 14px; }
.type { text-transform: lowercase; color: var(--text2); }

/* ---------- drawer, modal, menu, toast */
.drawer { position: fixed; top: var(--header); right: 0; bottom: 0; width: 380px; background: var(--panel); border-left: 1px solid var(--border); z-index: 40; display: flex; flex-direction: column; box-shadow: -12px 0 30px #0007; animation: slidein .16s ease-out; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.drawer .dh { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; border-bottom: 1px solid var(--border); font-weight: 700; position: relative; }
.drawer .dh .x { position: absolute; right: 10px; top: 9px; color: #6fb0ff; }
.drawer .db { flex: 1; overflow: auto; padding: 14px; }
.drawer .df { padding: 12px 14px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
.acc { background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; }
.acc > .ah { display: flex; align-items: center; gap: 8px; padding: 12px; cursor: pointer; font-weight: 600; font-size: 12.5px; }
.acc > .ah .chev { margin-left: auto; color: var(--muted); transition: transform .15s; }
.acc.open > .ah .chev { transform: rotate(180deg); }
.acc > .ab { display: none; padding: 0 12px 12px; }
.acc.open > .ab { display: block; }
.ro { background: var(--panel3); border: 1px solid var(--border2); border-radius: 6px; padding: 8px 10px; color: var(--text2); min-height: 33px; }
.ro.live { color: #6fb0ff; }
.preview { width: 100%; aspect-ratio: 16/9; border-radius: 6px; background: #000 center/cover no-repeat; margin-top: 10px; border: 1px solid var(--border2); display: grid; place-items: center; color: var(--muted); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 7px 10px; font-size: 12px; }
.kv > span:nth-child(odd) { color: var(--muted); }

.modal-bg { position: fixed; inset: 0; background: #000a; z-index: 60; display: grid; place-items: center; padding: 20px; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--panel); border: 1px solid var(--border2); border-radius: 12px; width: 520px; max-width: 100%; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px #000c; }
.modal.wide { width: 860px; }
.modal .mh { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 14px; }
.modal .mb { padding: 18px; overflow: auto; }
.modal .mf { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); }
.modal .mf .left { margin-right: auto; }
.menu { position: fixed; z-index: 80; min-width: 180px; background: var(--panel2); border: 1px solid var(--border2); border-radius: 8px; padding: 4px; box-shadow: 0 10px 30px #000b; }
.menu button { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; background: none; border: 0; border-radius: 5px; cursor: pointer; text-align: left; font-size: 12.5px; color: var(--text); }
.menu button:hover { background: var(--panel3); }
.menu button.danger { color: #ff8a8a; }
.menu button svg { width: 14px; height: 14px; color: var(--muted); }
.menu hr { border: 0; border-top: 1px solid var(--border2); margin: 4px 0; }
#toast { position: fixed; bottom: 54px; left: 50%; transform: translateX(-50%) translateY(20px); background: #2b2b2b; border: 1px solid #444; color: #fff; padding: 9px 16px; border-radius: 8px; opacity: 0; transition: .2s; z-index: 100; pointer-events: none; }
#toast.show { opacity: 1; transform: translateX(-50%); }
.progress { font-size: 12px; color: var(--muted); margin-left: 6px; }
.dropzone-over main.main::after { content: attr(data-drop); position: fixed; inset: var(--header) 0 0 calc(var(--rail) + var(--sec)); background: #1a7cf022; border: 2px dashed var(--blue); display: grid; place-items: center; font-size: 18px; font-weight: 700; color: #cfe4ff; pointer-events: none; z-index: 30; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 26px; height: 26px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; }
.swatches button.on { border-color: #fff; }
.pcode { font-size: 26px !important; letter-spacing: 8px; text-transform: uppercase; font-weight: 800; text-align: center; font-family: ui-monospace, Menlo, monospace; width: 100%; }
.days { display: flex; gap: 4px; flex-wrap: wrap; }
.days label { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 30px; border-radius: 6px; border: 1px solid var(--border2); background: var(--panel2); cursor: pointer; margin: 0; font-weight: 600; }
.days input { display: none; }
.days label.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.mpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.mpick .mc { border: 1px solid var(--border2); border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--panel2); }
.mpick .mc:hover { border-color: #555; }
.mpick .mc.on { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue); }
.mpick .mc .im { aspect-ratio: 16/9; background: #000 center/cover no-repeat; display: grid; place-items: center; color: var(--muted); }
.mpick .mc .n { padding: 6px 8px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- presentations */
.pmeta { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.pmeta .field { margin: 0; }
.pname { font-size: 15px !important; font-weight: 700; width: 340px; background: transparent !important; border-color: transparent !important; padding-left: 4px !important; }
.pname:hover { border-color: var(--border2) !important; }
.pname:focus { border-color: var(--blue) !important; background: var(--panel2) !important; }
tr.section td { background: var(--panel2); color: var(--text); font-weight: 700; padding: 8px 14px; }
tr.section .chev { display: inline-block; color: var(--muted); margin-right: 6px; transition: transform .15s; }
tr.section.collapsed .chev { transform: rotate(-90deg); }
tr.section input { background: transparent; border-color: transparent; font-weight: 700; padding: 3px 6px; width: 260px; }
tr.section input:hover { border-color: var(--border2); }
.grip { cursor: grab; color: #666; }
.grip svg { width: 14px; height: 14px; }
td input.dur { width: 84px; }
td select.tr { width: 110px; }
td input.td { width: 64px; }
.time { font-variant-numeric: tabular-nums; color: var(--text2); }
.idx { color: var(--muted); font-variant-numeric: tabular-nums; width: 22px; text-align: right; }

/* ---------- calendar */
.cal-top { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--panel); }
.cal-top .title { position: absolute; left: 50%; transform: translateX(-50%); font-size: 16px; font-weight: 700; }
.cal-top { position: relative; }
.cal-wrap { flex: 1; overflow: auto; position: relative; background: var(--bg); }
.wk { display: grid; min-width: 760px; }
.wk .hdr { position: sticky; top: 0; z-index: 5; background: var(--panel); border-bottom: 1px solid var(--border); padding: 8px 8px 6px; border-left: 1px solid var(--border); }
.wk .hdr .dn { font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.wk .hdr .dd { font-size: 22px; font-weight: 700; margin-top: 2px; }
.wk .hdr.today .dd { color: #fff; display: inline-grid; place-items: center; width: 34px; height: 34px; background: var(--blue); border-radius: 50%; font-size: 17px; }
.wk .corner { position: sticky; top: 0; left: 0; z-index: 6; background: var(--panel); border-bottom: 1px solid var(--border); }
.wk .allday-l { font-size: 10px; color: var(--muted); text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--border); background: var(--panel); }
.wk .allday { border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 3px; min-height: 26px; background: var(--panel); }
.wk .hours { position: relative; }
.wk .hours div { height: 48px; font-size: 11px; color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-7px); font-weight: 600; }
.wk .col { position: relative; border-left: 1px solid var(--border); background: repeating-linear-gradient(to bottom, transparent 0, transparent 47px, var(--border) 47px, var(--border) 48px); cursor: cell; }
.wk .col.today { background-color: #1a1d22; }
.ev { position: absolute; border-radius: 4px; padding: 3px 6px; overflow: hidden; font-size: 11px; line-height: 1.25; cursor: pointer; color: #fff; border-left: 3px solid; min-height: 16px; }
.ev:hover { filter: brightness(1.15); z-index: 3; }
.ev .tm { font-weight: 700; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .nm { opacity: .95; }
.ev.off { opacity: .45; background-image: repeating-linear-gradient(45deg, transparent 0 6px, #0003 6px 12px); }
.ev.ad { position: relative; display: block; margin-bottom: 2px; }
.nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 4; pointer-events: none; }
.nowline::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }
.mo { display: grid; grid-template-columns: repeat(7, 1fr); min-width: 760px; }
.mo .mh { background: var(--panel); padding: 8px; font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); position: sticky; top: 0; z-index: 2; }
.mo .cell { min-height: 118px; border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 4px; cursor: cell; }
.mo .cell.other { background: #131313; }
.mo .cell.other .n { color: #555; }
.mo .cell .n { font-weight: 700; font-size: 12px; margin: 2px 4px 4px; display: inline-block; }
.mo .cell.today .n { background: var(--blue); color: #fff; border-radius: 10px; padding: 0 7px; }
.mo .ev { position: relative; display: block; margin-bottom: 2px; padding: 2px 5px; white-space: nowrap; text-overflow: ellipsis; }
.mo .more { font-size: 11px; color: var(--muted); padding: 2px 5px; cursor: pointer; }
.eye { background: none; border: 0; cursor: pointer; color: var(--text2); padding: 2px; display: grid; place-items: center; }
.eye svg { width: 16px; height: 16px; }
.eye.off { color: #555; }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.cal-legend { padding: 10px 14px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--border); }

/* ---------- settings */
.cards { display: grid; gap: 16px; max-width: 920px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
.card h2 { margin: 0 0 4px; font-size: 14px; }
.card .desc { color: var(--muted); margin: 0 0 16px; font-size: 12px; }
.card .row { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.card .row .field { margin: 0; }

/* ---------- login */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(1200px 600px at 50% -10%, #1d2a3d 0%, var(--bg) 60%); }
.login-wrap .center { flex: 1; display: grid; place-items: center; padding: 30px; }
.login { width: 380px; max-width: 100%; background: var(--panel); border: 1px solid var(--border2); border-radius: 14px; padding: 30px 28px; box-shadow: 0 20px 60px #0009; }
.login .lg { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 22px; text-align: center; }
.login .lg img { width: 72px; height: 72px; }
.login .lg h1 { margin: 0; font-size: 20px; }
.login .lg .muted { font-size: 12px; }
.login input { width: 100%; height: 38px; }
.login .btn.primary { width: 100%; height: 38px; margin-top: 6px; font-size: 13.5px; }
.login .err { color: #ff8a8a; margin-top: 10px; min-height: 18px; font-size: 12.5px; }
.login .langs { display: flex; justify-content: center; margin-top: 16px; }
.login-wrap footer.foot { grid-column: auto; justify-content: center; background: transparent; border-top: 1px solid var(--border); }

@media (max-width: 900px) {
  :root { --sec: 190px; --rail: 70px; }
  .search { width: 200px; }
  .drawer { width: 100%; }
}

/* ---------- v2 view helpers */
.chk { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 0; cursor: pointer; }
.pad { padding: 12px 14px; }
.btn.block { display: flex; width: calc(100% - 24px); margin: 6px 12px 10px; }
.btn.pulse { box-shadow: 0 0 0 3px #1a7cf055; }
.small { font-size: 11px; }
.calname { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.tags-ed { display: flex; flex-wrap: wrap; align-items: center; }
.err { color: #ff8a8a; font-size: 12.5px; min-height: 16px; margin-top: 6px; }
.ficon.lg { display: inline-grid; margin-right: 10px; vertical-align: middle; }
.empty.big { padding: 80px 20px; }
.sec-item .eye { opacity: .65; }
.sec-item:hover .eye { opacity: 1; }
.sec-item.cal .eye[data-edit-calendar] { opacity: 0; }
.sec-item.cal:hover .eye[data-edit-calendar] { opacity: .8; }
.ev .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.cont-prev { border-top-left-radius: 0; border-top-right-radius: 0; }
.ev.cont-next { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.wk .allday { position: relative; cursor: cell; }
.wk .hdr { cursor: pointer; }
.cal-top .chip { margin-right: 2px; }
.drawer .field input, .drawer .field select { width: 100%; }
.settings-sys { font-size: 12px; }
.cal-top .title { position: static; transform: none; margin-left: 8px; font-size: 16px; font-weight: 700; white-space: nowrap; }
a.sec-item { text-decoration: none; }
td.nm .mthumb, td.nm .ficon.lg { display: inline-grid; vertical-align: middle; margin-right: 10px; }
td.nm { white-space: nowrap; }
.wk .hdr, .wk .corner { height: 50px; }
.wk .allday, .wk .allday-l { position: sticky; top: 50px; z-index: 5; }
.wk .allday-l { z-index: 6; }
