/* Web console (manage.html). Builds on the site stylesheet: style.css is
   imported into a cascade layer, so the nav, background and tokens are shared
   while the console rules below always take precedence over it. */
@import url("style.css") layer(site);

:root {
  /* console token names, mapped onto the site palette */
  --cyan: #7fd0f5;
  --green: var(--ok);
  --red: var(--bad);
  --yellow: var(--warn);
  --textSec: var(--muted);
  --textDim: rgba(226, 232, 245, .4);
  --grad-btn: linear-gradient(135deg, #1f7fd6, #1fb58f);
  --grad-btn-hi: linear-gradient(135deg, #2e8fe6, #2cc9a0);
  --field: rgba(0, 0, 0, .28);
  --panel: linear-gradient(145deg, rgba(22, 32, 54, .94), rgba(10, 16, 30, .96));
}

/* ─── Scoped reset (zero specificity, console elements only) ─── */
:where(.cx) *, :where(.cx) *::before, :where(.cx) *::after { margin: 0; padding: 0; }
:where(.cx) button { font: inherit; color: inherit; background: none; border: none; border-radius: 0; box-shadow: none;
  cursor: pointer; transition: transform .15s, opacity .2s, background .2s, border-color .2s, color .2s; }
:where(.cx) button:hover { transform: none; }
:where(.cx) input { font: inherit; color: var(--text); outline: none; }
:where(.cx) a { border-bottom: 0; }

/* ─── Utilities used in the markup ─── */
@keyframes cx-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cx-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes cx-pulse { 50% { opacity: .5; } }
.animate-fadeIn { animation: cx-fade .3s ease both; }
.animate-slideUp { animation: cx-up .35s cubic-bezier(.2, .8, .2, 1) both; }
.animate-pulse { animation: cx-pulse 1.6s ease-in-out infinite; }
.hover\:scale-105:hover { transform: scale(1.05); }
.hover\:scale-110:hover { transform: scale(1.1); }
.hover\:scale-\[1\.02\]:hover { transform: scale(1.02); }
.hover\:scale-\[1\.01\]:hover { transform: scale(1.01); }
.hover\:-translate-y-0\.5:hover { transform: translateY(-2px); }
.active\:scale-95:active { transform: scale(.95); }
@media (prefers-reduced-motion: reduce) { .animate-fadeIn, .animate-slideUp, .animate-pulse { animation: none; } }

/* ─── Shared surfaces (the site's glass cards) ─── */
.login-card, #reset-panel, .stat-card, .device-card, .inv-form-card, .admin-table-wrap, .admin-tab-bar, .danger-card {
  background: linear-gradient(145deg, var(--glass-hi), var(--glass));
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%);
}

/* ─── Page frame ─── */
main.console-main { padding-top: 32px; }
.console-page .links a.active { box-shadow: inset 0 0 0 1px rgba(127, 208, 245, .45); }

/* ─── Login ─── */
#s-login { min-height: calc(100vh - 160px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 12px 0 24px; }
.login-card { width: 100%; max-width: 420px; padding: 36px 32px 28px; border-radius: 24px; text-align: center; }
.login-logo { display: block; width: 72px; height: auto; margin: 0 auto 14px; filter: drop-shadow(0 10px 28px rgba(31, 170, 200, .45)); }
.login-h { font-size: 1.7rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin-bottom: 8px; }
.login-title { font-size: .95rem; color: var(--muted); margin-bottom: 26px; }
.field { margin-bottom: 14px; text-align: left; }
.field label { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input { width: 100%; background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; font-size: .95rem; transition: border-color .2s, box-shadow .2s; }
.field input:focus { border-color: rgba(46, 154, 230, .7); box-shadow: 0 0 0 3px rgba(46, 154, 230, .18); }
.field input::placeholder { color: var(--textDim); }
#btn-login { width: 100%; margin-top: 6px; padding: 13px; border-radius: 13px; font-weight: 600; color: #fff;
  background: var(--grad-btn); box-shadow: 0 12px 30px -10px rgba(31, 160, 190, .85); }
#btn-login:hover { background: var(--grad-btn-hi); }
.login-footer { display: flex; justify-content: center; margin-top: 14px; }
.link-btn { color: var(--cyan); font-size: .88rem; padding: 4px; }
.link-btn:hover { text-decoration: underline; }
#login-msg { min-height: 20px; font-size: .88rem; margin: 4px 0 6px; color: var(--red); }
#reset-panel { display: none; width: 100%; max-width: 420px; padding: 24px 26px; border-radius: 20px; }
#reset-panel.open { display: block; }
#reset-panel h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
#reset-panel p { font-size: .9rem; color: var(--muted); margin-bottom: 16px; }
.row-btns { display: flex; gap: 8px; }
#reset-msg { font-size: .88rem; margin-top: 10px; min-height: 18px; }
.login-legal { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
.login-legal a { color: #7fd0f5; }
.login-legal a:hover { text-decoration: underline; }
.login-aside { font-size: .9rem; color: var(--muted); }
.login-aside a { color: #7fd0f5; border-bottom: 1px solid rgba(127, 208, 245, .35); }

/* ─── Buttons ─── */
.btn-sec { background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 9px 16px; font-size: .88rem; font-weight: 500; }
.btn-sec:hover { background: rgba(255, 255, 255, .11); }
.btn-pri { background: var(--grad-btn); color: #fff; border-radius: 12px; padding: 9px 16px; font-size: .88rem; font-weight: 600; box-shadow: 0 8px 22px -8px rgba(31, 160, 190, .8); }
.btn-pri:hover { background: var(--grad-btn-hi); }

/* ─── App shell ─── */
#s-app, #s-admin { display: none; flex-direction: column; }
.console-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 8px 0 24px; }
.console-h { font-size: clamp(1.6rem, 3.4vw, 2.2rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.console-sub { color: var(--muted); margin-top: 6px; }
.console-actions { display: flex; align-items: center; gap: 8px; }
#btn-signout, #btn-signout-admin { background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 9px 16px; font-size: .88rem; font-weight: 500; }
#btn-signout:hover, #btn-signout-admin:hover { background: rgba(255, 255, 255, .11); }
.main-content, .admin-content { width: 100%; }

#stats-strip, .admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { border-radius: 18px; padding: 18px 20px; }
.stat-val { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; margin-bottom: 6px; }
.stat-lbl { font-size: .85rem; color: var(--muted); }
.stat-total .stat-val { background: linear-gradient(120deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-online .stat-val { color: var(--ok); }
.stat-offline .stat-val { color: var(--muted); }
.stat-alarm .stat-val { color: var(--bad); }

#toolbar { margin-bottom: 18px; }
#search { width: 100%; max-width: 380px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 12px; padding: 11px 16px; font-size: .95rem;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: border-color .2s, box-shadow .2s; }
#search::placeholder { color: var(--textDim); }
#search:focus { border-color: rgba(46, 154, 230, .7); box-shadow: 0 0 0 3px rgba(46, 154, 230, .18); }

#device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
#empty-state { grid-column: 1 / -1; text-align: center; padding: 56px 20px; color: var(--muted); border: 1px dashed var(--line); border-radius: 20px; }
#empty-state strong { color: var(--text); font-size: 1.05rem; }
#empty-state p { margin-top: 6px; }
#empty-state a { color: #7fd0f5; border-bottom: 1px solid rgba(127, 208, 245, .35); }
.device-card { border-radius: 20px; padding: 20px; transition: transform .2s, border-color .2s; }
.device-card:hover { border-color: rgba(46, 154, 230, .45); }
.device-card.alarming { border-color: rgba(255, 107, 125, .6); box-shadow: 0 0 0 1px rgba(255, 107, 125, .25), 0 20px 50px -20px rgba(255, 107, 125, .35); }
.dc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.dc-name { font-size: 1.02rem; font-weight: 600; margin-bottom: 2px; }
.dc-sub { font-size: .82rem; color: var(--muted); }
.dc-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .7rem; font-weight: 700; letter-spacing: .04em; }
.badge-online { background: rgba(74, 222, 155, .12); color: var(--ok); }
.badge-offline { background: rgba(255, 255, 255, .07); color: var(--muted); }
.badge-alarm { background: rgba(255, 107, 125, .15); color: var(--bad); }
.dc-ids { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dc-ids:empty { display: none; }
.dc-id { display: flex; gap: 8px; font-size: .8rem; }
.dc-id-lbl { color: var(--muted); width: 48px; flex-shrink: 0; }
.dc-id-val { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .76rem; word-break: break-all; }
.dc-lastseen { font-size: .76rem; color: var(--textDim); margin-bottom: 14px; }
.dc-actions { display: flex; gap: 8px; }
.dc-btn { flex: 1; padding: 10px 6px; border-radius: 12px; font-size: .85rem; font-weight: 600; text-align: center; }
.dc-btn-alarm { background: rgba(255, 193, 94, .1); color: var(--warn); border: 1px solid rgba(255, 193, 94, .3); }
.dc-btn-alarm.active { background: var(--warn); color: #231400; border-color: var(--warn); }
.dc-btn-manage { background: var(--grad-btn); color: #fff; box-shadow: 0 8px 22px -8px rgba(31, 160, 190, .8); }
.dc-btn-manage:hover { background: var(--grad-btn-hi); }

/* ─── Modal ─── */
#dev-modal { display: none; position: fixed; inset: 0; z-index: 100; align-items: flex-end; justify-content: center; }
#dev-modal.open { display: flex; }
.modal-backdrop, .wipe-backdrop { position: absolute; inset: 0; background: rgba(3, 6, 14, .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-panel { position: relative; z-index: 1; width: 100%; max-width: 700px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: 24px 24px 0 0;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .08); }
@media (min-width: 720px) { #dev-modal { align-items: center; padding: 24px; } .modal-panel { border-radius: 24px; max-height: 85vh; } }
.modal-hdr { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 16px; flex-shrink: 0; }
.modal-hdr-info { min-width: 0; flex: 1; }
#modal-device-name { font-size: 1.2rem; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#modal-device-sub { font-size: .8rem; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#btn-close-modal { width: 36px; height: 36px; flex-shrink: 0; border-radius: 11px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
#btn-close-modal:hover { color: var(--text); background: rgba(255, 255, 255, .11); }
.tab-bar { display: flex; gap: 6px; overflow-x: auto; padding: 0 22px 14px; border-bottom: 1px solid var(--line); flex-shrink: 0; scrollbar-width: none; }
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn { flex-shrink: 0; padding: 7px 13px; border-radius: 10px; font-size: .84rem; font-weight: 500; color: var(--muted); background: rgba(255, 255, 255, .04); }
.tab-btn:hover { color: var(--text); background: rgba(255, 255, 255, .08); }
.tab-btn.active { color: #fff; background: var(--grad-btn); font-weight: 600; }
.tab-btn.active span { color: #fff !important; }
.tab-body { overflow-y: auto; flex: 1; padding: 20px 22px 24px; }

/* Commands tab */
.cmd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.cmd-btn { display: flex; align-items: center; justify-content: center; padding: 20px 8px; border-radius: 16px; font-size: .9rem; font-weight: 600; }
.cmd-alarm-off { background: rgba(255, 193, 94, .1); color: var(--warn); border: 1px solid rgba(255, 193, 94, .3); }
.cmd-alarm-on { background: var(--warn); color: #231400; }
.cmd-lock { background: rgba(46, 154, 230, .12); color: var(--cyan); border: 1px solid rgba(46, 154, 230, .35); }
.cmd-reboot { background: rgba(47, 211, 154, .1); color: #7fe0d0; border: 1px solid rgba(47, 211, 154, .3); }
.cmd-lockdown { display: flex; align-items: center; gap: 16px; width: 100%; padding: 16px 20px; border-radius: 16px; text-align: left; font-size: .95rem; font-weight: 600;
  background: rgba(255, 107, 125, .1); color: var(--bad); border: 1px solid rgba(255, 107, 125, .35); }
.ld-icon { width: 38px; height: 38px; flex-shrink: 0; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; font-weight: 800; background: rgba(255, 107, 125, .15); }
.ld-sub { display: block; font-size: .78rem; font-weight: 400; color: rgba(255, 180, 190, .75); margin-top: 2px; }

/* Policy toggles — same switch as the home-page mock */
.policy-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.policy-row:last-child { border-bottom: none; }
.policy-info { min-width: 0; flex: 1; }
.policy-label { font-size: .9rem; font-weight: 500; }
.policy-sub { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.toggle { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track { display: block; width: 42px; height: 24px; border-radius: 99px; background: rgba(255, 255, 255, .15); cursor: pointer; transition: background .2s; }
.toggle input:checked + .toggle-track { background: var(--grad-btn); }
.toggle input:focus-visible + .toggle-track { box-shadow: 0 0 0 3px rgba(46, 154, 230, .35); }
.toggle-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; pointer-events: none; transition: transform .2s; }
.toggle input:checked ~ .toggle-thumb { transform: translateX(18px); }

/* Network tab */
.net-section { margin-bottom: 26px; }
.net-section h3 { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--accent2); margin-bottom: 12px; }
.dns-row, .kiosk-add-row { display: flex; gap: 8px; align-items: center; }
.dns-input, .kiosk-add-input { flex: 1; min-width: 0; background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px; font-size: .88rem; transition: border-color .2s; }
.kiosk-add-input { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .82rem; }
.dns-input:focus, .kiosk-add-input:focus { border-color: rgba(46, 154, 230, .7); }
.dns-input::placeholder, .kiosk-add-input::placeholder { color: var(--textDim); }
.btn-small, .btn-add-pkg { padding: 10px 14px; border-radius: 12px; font-size: .82rem; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.btn-lock-dns, .btn-add-pkg { background: var(--grad-btn); color: #fff; }
.btn-lock-dns:hover, .btn-add-pkg:hover { background: var(--grad-btn-hi); }
.btn-clear-dns { background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: var(--muted); }
.btn-clear-dns:hover { color: var(--text); }
.kiosk-pkg-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; min-height: 24px; }
.kiosk-pkg-item { display: flex; align-items: center; justify-content: space-between; background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.kiosk-pkg-name { font-size: .8rem; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; word-break: break-all; }
.kiosk-pkg-remove { color: var(--bad); font-size: 14px; padding: 0 4px; margin-left: 8px; flex-shrink: 0; }
.kiosk-pkg-remove:hover { opacity: .7; }

/* Danger tab */
.danger-card { border-radius: 18px; padding: 22px; background: rgba(255, 107, 125, .07); border-color: rgba(255, 107, 125, .35); }
.danger-title { font-size: 1.05rem; font-weight: 700; color: var(--bad); margin-bottom: 6px; }
.danger-desc { font-size: .9rem; color: var(--muted); margin-bottom: 16px; line-height: 1.55; }
.danger-desc strong { color: var(--text); }
.btn-wipe, .btn-confirm-wipe { background: linear-gradient(135deg, #e5485c, #ff6b7d); color: #fff; border-radius: 12px; padding: 11px 20px; font-size: .92rem; font-weight: 600;
  box-shadow: 0 10px 26px -8px rgba(255, 107, 125, .6); }

/* Wipe confirm */
#wipe-confirm { display: none; position: fixed; inset: 0; z-index: 200; align-items: center; justify-content: center; padding: 24px; }
#wipe-confirm.open { display: flex; }
.wipe-dialog { position: relative; z-index: 1; width: 100%; max-width: 380px; padding: 28px; border-radius: 22px;
  background: var(--panel); border: 1px solid rgba(255, 107, 125, .4); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); }
.wipe-dialog h2 { font-size: 1.25rem; font-weight: 700; color: var(--bad); margin-bottom: 10px; }
.wipe-dialog p { font-size: .92rem; color: var(--muted); margin-bottom: 20px; line-height: 1.55; }
.wipe-btns { display: flex; gap: 10px; }
.btn-cancel { flex: 1; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 11px; font-size: .92rem; font-weight: 500; }
.btn-cancel:hover { background: rgba(255, 255, 255, .11); }
.btn-confirm-wipe { flex: 1; padding: 11px; }

/* Generic confirm dialog (reuses the wipe dialog frame) */
#confirm-dlg { display: none; position: fixed; inset: 0; z-index: 210; align-items: center; justify-content: center; padding: 24px; }
#confirm-dlg.open { display: flex; }
.confirm-dialog { border-color: var(--line); }
.confirm-dialog h2 { color: var(--text); }
.confirm-dialog.danger { border-color: rgba(255, 107, 125, .4); }
.confirm-dialog.danger h2 { color: var(--bad); }
.confirm-input { width: 100%; margin: -6px 0 18px; }
.btn-confirm { flex: 1; padding: 11px; border-radius: 12px; font-size: .92rem; font-weight: 600; color: #fff;
  background: var(--grad-btn); box-shadow: 0 10px 26px -8px rgba(31, 160, 190, .7); }
.btn-confirm:hover { background: var(--grad-btn-hi); }
.confirm-dialog.danger .btn-confirm { background: linear-gradient(135deg, #e5485c, #ff6b7d); box-shadow: 0 10px 26px -8px rgba(255, 107, 125, .6); }

/* Toast */
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 300; transform: translate(-50%, 20px);
  max-width: min(92vw, 460px); padding: 12px 18px; border-radius: 14px; font-size: .9rem; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); box-shadow: 0 20px 50px -16px rgba(0, 0, 0, .8);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.ok { border-color: rgba(74, 222, 155, .5); }
#toast.bad { border-color: rgba(255, 107, 125, .5); }

/* Pending commands */
.cmd-pending { flex-direction: column; gap: 2px; background: rgba(255, 255, 255, .05); color: var(--text);
  border: 1px dashed rgba(127, 208, 245, .55); }
.cmd-pending small, .cmd-lockdown.cmd-pending .ld-sub { font-size: .74rem; font-weight: 500; color: var(--cyan); }
.cmd-pending .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(127, 208, 245, .3);
  border-top-color: var(--cyan); animation: spin .8s linear infinite; display: inline-block; vertical-align: -2px; margin-right: 6px; }
.cmd-lockdown.cmd-pending { color: var(--text); background: rgba(255, 255, 255, .05); border: 1px dashed rgba(127, 208, 245, .55); }
.cmd-note { font-size: .8rem; color: var(--muted); margin: 12px 2px 0; }
.badge-pending { background: rgba(127, 208, 245, .14); color: var(--cyan); }

/* Modal header rename */
.hdr-name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.btn-rename { flex-shrink: 0; font-size: .78rem; font-weight: 600; color: var(--cyan); padding: 4px 10px; border-radius: 9px;
  background: rgba(127, 208, 245, .1); border: 1px solid rgba(127, 208, 245, .3); }
.btn-rename:hover { background: rgba(127, 208, 245, .18); }

/* Installed apps tab */
.apps-meta { font-size: .8rem; color: var(--muted); margin-bottom: 12px; }
.app-search { width: 100%; margin-bottom: 10px; }
.app-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.app-row:last-child { border-bottom: none; }
.app-info { flex: 1; min-width: 0; }
.app-label { font-size: .9rem; font-weight: 500; }
.app-pkg { font: .74rem ui-monospace, "Cascadia Code", Consolas, monospace; color: var(--textDim); word-break: break-all; }
.app-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 6px; font-size: .66rem; font-weight: 700; letter-spacing: .04em; vertical-align: 1px; }
.app-tag-sys { background: rgba(255, 255, 255, .07); color: var(--muted); }
.app-tag-rule { background: rgba(255, 107, 125, .14); color: var(--bad); }
.policy-warn { font-size: .76rem; color: var(--warn); margin-top: 3px; }
.danger-card + .danger-card { margin-top: 14px; }

/* Screen-guard warning + per-app sections */
.guard-warn { margin-bottom: 20px; padding: 13px 16px; border-radius: 14px; font-size: .86rem; line-height: 1.55;
  color: #ffe6bd; background: rgba(255, 193, 94, .1); border: 1px solid rgba(255, 193, 94, .4); }
.guard-warn strong { display: block; color: var(--warn); margin-bottom: 2px; }
.guard-warn em { font-style: normal; color: var(--text); }
.sect-group + .sect-group { margin-top: 16px; }
.sect-app { font-size: .82rem; font-weight: 600; color: var(--text); padding: 6px 0 2px; }
.badge-guard-off { background: rgba(255, 193, 94, .14); color: var(--warn); }

/* ─── Super Admin ─── */
#btn-admin { display: none; background: rgba(47, 211, 154, .1); border: 1px solid rgba(47, 211, 154, .35); color: #7fe0d0; border-radius: 12px; padding: 9px 16px; font-size: .88rem; font-weight: 600; }
#btn-admin:hover { background: rgba(47, 211, 154, .16); }
.sa-badge { display: inline-block; background: var(--grad-btn); color: #fff; font-size: .62rem; font-weight: 700; letter-spacing: .1em; padding: 4px 9px; border-radius: 99px; vertical-align: middle; }
.admin-tab-bar { display: flex; gap: 4px; width: fit-content; max-width: 100%; overflow-x: auto; padding: 5px; border-radius: 14px; margin-bottom: 18px; }
.admin-tab-btn { padding: 8px 18px; border-radius: 10px; font-size: .88rem; font-weight: 500; color: var(--muted); }
.admin-tab-btn:hover:not(.active) { color: var(--text); background: rgba(255, 255, 255, .06); }
.admin-tab-btn.active { background: var(--grad-btn); color: #fff; font-weight: 600; }
.admin-table-wrap { overflow-x: auto; border-radius: 18px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.admin-table th { padding: 13px 16px; text-align: left; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--accent2); white-space: nowrap; border-bottom: 1px solid var(--line); background: rgba(0, 0, 0, .15); }
.admin-table td { padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, .06); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: rgba(255, 255, 255, .03); }
.admin-table .mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .78rem; color: var(--muted); }
.admin-table .action-cell { display: flex; gap: 6px; }
.at-btn { padding: 6px 11px; border-radius: 9px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.at-btn-lock { background: rgba(46, 154, 230, .12); color: var(--cyan); border: 1px solid rgba(46, 154, 230, .35); }
.at-btn-alarm { background: rgba(255, 193, 94, .1); color: var(--warn); border: 1px solid rgba(255, 193, 94, .3); }
.at-btn-alarm.on { background: var(--warn); color: #231400; }
.at-btn-manage { background: rgba(47, 211, 154, .1); color: #7fe0d0; border: 1px solid rgba(47, 211, 154, .3); }
.at-btn-block { background: rgba(255, 107, 125, .1); color: var(--bad); border: 1px solid rgba(255, 107, 125, .3); }
.at-btn-unblock { background: rgba(74, 222, 155, .1); color: var(--ok); border: 1px solid rgba(74, 222, 155, .3); }
.at-btn-del { background: rgba(255, 255, 255, .06); color: var(--muted); border: 1px solid var(--line); }
.audit-tag { display: inline-block; padding: 3px 9px; border-radius: 7px; font-size: .72rem; font-weight: 600; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; background: rgba(255, 255, 255, .07); color: var(--muted); }
.audit-LOCK_SCREEN { background: rgba(46, 154, 230, .14); color: var(--cyan); }
.audit-ALARM_ON { background: rgba(255, 107, 125, .15); color: var(--bad); }
.audit-WIPE { background: #e5485c; color: #fff; }
.audit-FULL_LOCKDOWN { background: rgba(255, 107, 125, .22); color: var(--bad); }
.audit-REBOOT, .audit-POLICY, .audit-LOGIN { background: rgba(47, 211, 154, .12); color: #7fe0d0; }
.admin-empty { text-align: center; padding: 48px 0; color: var(--muted); }

/* Inventory */
.inv-form-card { border-radius: 20px; padding: 22px; margin-bottom: 18px; }
.inv-form-card.inv-info { background: linear-gradient(145deg, rgba(46, 154, 230, .14), rgba(47, 211, 154, .08)); border-color: rgba(46, 154, 230, .3); }
.inv-form-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 14px; }
.inv-form-card.inv-info h3 { margin-bottom: 6px; }
.inv-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inv-field label { display: block; font-size: .78rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.inv-field input { width: 100%; background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px; font-size: .88rem; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; transition: border-color .2s; }
.inv-field input:focus { border-color: rgba(46, 154, 230, .7); }
.inv-field input::placeholder { color: var(--textDim); font-family: "Inter", system-ui, sans-serif; }
.inv-field-sub { font-size: .75rem; color: var(--textDim); margin-top: 5px; }
.inv-form-row { display: flex; gap: 12px; margin-top: 16px; align-items: center; flex-wrap: wrap; }
.btn-register { background: var(--grad-btn); color: #fff; border-radius: 12px; padding: 11px 20px; font-size: .9rem; font-weight: 600; box-shadow: 0 10px 26px -8px rgba(31, 160, 190, .75); }
.btn-register:hover { background: var(--grad-btn-hi); }
.inv-msg { font-size: .88rem; min-height: 18px; }
.token-box { display: none; margin-top: 16px; padding: 16px; border-radius: 14px; background: rgba(74, 222, 155, .08); border: 1px solid rgba(74, 222, 155, .4); }
.token-box.show { display: block; }
.token-box-hdr { font-size: .82rem; font-weight: 600; color: var(--ok); margin-bottom: 8px; }
.token-val { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .85rem; word-break: break-all; background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.token-expiry { font-size: .76rem; color: var(--muted); margin-bottom: 10px; }
.btn-copy { background: var(--ok); color: #062015; border-radius: 10px; padding: 8px 14px; font-size: .82rem; font-weight: 700; }
.inv-badge-PENDING { background: rgba(255, 193, 94, .14); color: var(--warn); }
.inv-badge-ENROLLED { background: rgba(74, 222, 155, .12); color: var(--ok); }
.inv-badge-BLOCKED { background: rgba(255, 107, 125, .15); color: var(--bad); }
.inv-badge-DISENROLLED { background: rgba(255, 255, 255, .07); color: var(--muted); }
.token-peek { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .75rem; color: var(--textDim); }

/* ─── Responsive ─── */
@media (max-width: 900px) { #stats-strip, .admin-stats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .inv-form-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .login-card { padding: 28px 20px 22px; }
  .cmd-grid { grid-template-columns: 1fr; }
  .console-actions { width: 100%; }
  .console-actions button { flex: 1; }
}

/* Time limits */
.limit-edit { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.limit-input { width: 72px; background: var(--field); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; font-size: .86rem; text-align: right; }
.limit-input:focus { border-color: rgba(46, 154, 230, .7); }
.limit-unit { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.limit-used { font-size: .76rem; color: var(--cyan); margin-top: 3px; }

/* Settings search inside the device modal */
.modal-search { padding: 0 22px 12px; flex-shrink: 0; }
.modal-search input { width: 100%; background: var(--field); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; font-size: .9rem; color: var(--text); transition: border-color .2s, box-shadow .2s; }
.modal-search input::placeholder { color: var(--textDim); }
.modal-search input:focus { outline: none; border-color: rgba(46, 154, 230, .7); box-shadow: 0 0 0 3px rgba(46, 154, 230, .18); }
.search-group { font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent2); margin-top: 4px; }

/* At-a-glance chips on each device card */
.dc-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.dc-chips:empty { display: none; }
.chip { font-size: .7rem; font-weight: 600; letter-spacing: .02em; padding: 3px 9px; border-radius: 99px;
  background: rgba(46, 154, 230, .12); color: var(--cyan); border: 1px solid rgba(46, 154, 230, .3); }
.chip-none { background: rgba(255, 255, 255, .05); color: var(--textDim); border-color: var(--line); }

/* Tab bar: fewer, bigger targets now there are six instead of nine */
.tab-btn { padding: 9px 15px; font-size: .88rem; }
