/* =====================================================================
   Smart IT — "Midnight Ops" design system
   ===================================================================== */
:root, [data-theme="dark"] {
  --bg: #070b18;
  --bg-2: #0c1226;
  --surface: rgba(19, 27, 52, .72);
  --surface-solid: #131b34;
  --surface-2: rgba(255,255,255,.035);
  --border: rgba(148, 163, 214, .14);
  --border-strong: rgba(148, 163, 214, .26);
  --text: #e6ebff;
  --text-2: #9aa6cf;
  --text-3: #6b7699;
  --accent: #22d3ee;
  --accent-2: #8b5cf6;
  --accent-grad: linear-gradient(135deg, #22d3ee 0%, #6366f1 55%, #a855f7 100%);
  --ok: #22c55e;
  --warn: #f59e0b;
  --crit: #f43f5e;
  --down: #ef4444;
  --muted: #64748b;
  --shadow: 0 10px 30px -12px rgba(0,0,0,.6);
  --glow: 0 0 0 1px rgba(34,211,238,.25), 0 8px 30px -8px rgba(34,211,238,.35);
  --radius: 16px;
  --sidebar-w: 264px;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #eef2fb;
  --bg-2: #e4e9f7;
  --surface: rgba(255,255,255,.82);
  --surface-solid: #ffffff;
  --surface-2: rgba(15,23,42,.035);
  --border: rgba(15,23,42,.09);
  --border-strong: rgba(15,23,42,.18);
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #8391ad;
  --accent: #0891b2;
  --accent-2: #7c3aed;
  --shadow: 0 10px 30px -18px rgba(30,41,90,.35);
  --glow: 0 0 0 1px rgba(8,145,178,.25), 0 8px 24px -10px rgba(8,145,178,.35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0; font-family: 'IBM Plex Sans Thai', system-ui, sans-serif; font-size: 14.5px;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
}
.app-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(99,102,241,.18), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(34,211,238,.12), transparent 60%),
    var(--bg);
}
.app-bg::after {
  content: ""; position: absolute; inset: 0; opacity: .35;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%);
}
a { color: var(--accent); text-decoration: none; }
.text-muted { color: var(--text-2) !important; }
.mono { font-family: var(--mono); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); z-index: 1040;
  display: flex; flex-direction: column; padding: 18px 14px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-right: 1px solid var(--border);
  transition: transform .3s ease;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 18px; color: var(--text); }
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; color: #fff;
  background: var(--accent-grad); box-shadow: 0 8px 24px -6px rgba(99,102,241,.6);
}
.brand-text { font-size: 20px; line-height: 1.05; letter-spacing: -.3px; }
.brand-text b { color: var(--accent); font-weight: 700; }
.brand-text small { display: block; font-size: 11px; color: var(--text-3); letter-spacing: .6px; margin-top: 3px; text-transform: uppercase; }
.side-nav { flex: 1; overflow-y: auto; padding-right: 4px; }
.nav-head { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-3); padding: 16px 12px 6px; }
.nav-link-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 2px 0; border-radius: 11px;
  color: var(--text-2); font-weight: 500; position: relative; transition: all .18s;
}
.nav-link-item i { font-size: 17px; width: 20px; text-align: center; }
.nav-link-item:hover { background: var(--surface-2); color: var(--text); }
.nav-link-item.active { color: var(--text); background: linear-gradient(90deg, rgba(34,211,238,.16), rgba(99,102,241,.06)); }
.nav-link-item.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.nav-link-item.active i { color: var(--accent); }
.nav-link-item.is-soon { opacity: .55; }
.nav-link-item em { margin-left: auto; font-style: normal; font-size: 10.5px; padding: 1px 7px; border-radius: 20px; }
.nav-link-item .soon { border: 1px dashed var(--border-strong); color: var(--text-3); }
.nav-badge { background: var(--crit); color: #fff; font-weight: 600; animation: pulse-badge 2s infinite; }
.side-foot { border-top: 1px solid var(--border); padding: 12px 10px 0; display: flex; justify-content: space-between; align-items: center; color: var(--text-3); font-size: 12px; }
.sys-pulse { display: flex; align-items: center; gap: 8px; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse 2s infinite; }
.sidebar-backdrop { display: none; }

/* ---------- Main ---------- */
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: 14px; padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border);
}
.topbar-title h1 { font-size: 20px; font-weight: 600; margin: 0; letter-spacing: -.2px; }
.topbar-title p { margin: 0; color: var(--text-3); font-size: 12.5px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.btn-icon {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); display: inline-grid; place-items: center; font-size: 18px; transition: .18s;
}
.btn-icon:hover { color: var(--accent); border-color: var(--accent); }
.live-clock { align-items: center; gap: 8px; padding: 0 14px; height: 40px; border-radius: 12px; border: 1px solid var(--border); font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.notif-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--crit); color: #fff; font-size: 10.5px; display: grid; place-items: center; padding: 0 4px; font-weight: 600; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.user-chip b { display: block; font-size: 13px; font-weight: 600; line-height: 1.2; }
.user-chip small { display: block; font-size: 11px; color: var(--text-3); }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-grad); color: #fff; font-weight: 700; }
.content { padding: 26px 28px; flex: 1; }
.app-footer { padding: 16px 28px; color: var(--text-3); font-size: 12px; border-top: 1px solid var(--border); }

.dropdown-menu { background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow); color: var(--text); }
.dropdown-item { color: var(--text-2); border-radius: 8px; }
.dropdown-menu { padding: 6px; }
.dropdown-item:hover { background: var(--surface-2); color: var(--text); }
.dropdown-divider { border-color: var(--border); }
.notif-menu { width: 360px; max-width: 92vw; overflow: hidden; }
.notif-head { display: flex; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 13px; }
.notif-item:hover { background: var(--surface-2); color: var(--text); }
.notif-item.unread { background: rgba(34,211,238,.06); }
.notif-item .ni-ico { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; }
.notif-item small { color: var(--text-3); display: block; }

/* ---------- Glass cards ---------- */
.glass { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); backdrop-filter: blur(12px); box-shadow: var(--shadow); }
.card-x { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); backdrop-filter: blur(12px); box-shadow: var(--shadow); height: 100%; }
.card-x .card-x-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-x .card-x-head h5 { font-size: 15px; font-weight: 600; margin: 0; }
.card-x .card-x-head .sub { color: var(--text-3); font-size: 12px; }
.card-x .card-x-head .tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-x .card-x-body { padding: 18px 20px; }

/* KPI tiles */
.kpi { position: relative; overflow: hidden; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; height: 100%; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--glow); }
.kpi .kpi-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; }
.kpi .kpi-label { color: var(--text-2); font-size: 13px; margin-top: 14px; }
.kpi .kpi-value { font-family: var(--mono); font-size: 30px; font-weight: 600; letter-spacing: -1px; line-height: 1.1; }
.kpi .kpi-foot { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.kpi::after { content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, var(--kpi-c, var(--accent)) 0%, transparent 70%); opacity: .14; }
.c-ok { --kpi-c: var(--ok); } .c-warn { --kpi-c: var(--warn); } .c-crit { --kpi-c: var(--crit); } .c-acc { --kpi-c: var(--accent); } .c-vio { --kpi-c: var(--accent-2); }
.ico-ok { background: rgba(34,197,94,.14); color: var(--ok); }
.ico-warn { background: rgba(245,158,11,.14); color: var(--warn); }
.ico-crit { background: rgba(244,63,94,.14); color: var(--crit); }
.ico-acc { background: rgba(34,211,238,.14); color: var(--accent); }
.ico-vio { background: rgba(139,92,246,.16); color: var(--accent-2); }

/* status */
.st { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; border: 1px solid transparent; white-space: nowrap; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-up { color: var(--ok); background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.25); }
.st-warning { color: var(--warn); background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.25); }
.st-critical { color: var(--crit); background: rgba(244,63,94,.1); border-color: rgba(244,63,94,.3); }
.st-down { color: #fff; background: var(--down); }
.st-down::before { animation: blink 1s infinite; background: #fff; }
.st-unknown, .st-maintenance { color: var(--text-3); background: var(--surface-2); border-color: var(--border); }
.st-critical::before, .st-warning::before { animation: blink 1.6s infinite; }
.sev { font-size: 11.5px; padding: 2px 9px; border-radius: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.sev-critical { background: rgba(244,63,94,.15); color: var(--crit); }
.sev-warning { background: rgba(245,158,11,.15); color: var(--warn); }
.sev-info { background: rgba(34,211,238,.13); color: var(--accent); }

/* progress mini bars */
.mbar { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.mbar .track { flex: 1; height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.mbar .fill { height: 100%; border-radius: 6px; background: var(--ok); transition: width .6s ease; }
.mbar .fill.warn { background: var(--warn); } .mbar .fill.crit { background: var(--crit); }
.mbar span { font-family: var(--mono); font-size: 12px; width: 44px; text-align: right; color: var(--text-2); }

/* NOC tiles */
.noc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.noc-tile { position: relative; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); cursor: pointer; transition: .2s; overflow: hidden; }
.noc-tile:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.noc-tile::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--tile-c, var(--muted)); box-shadow: 0 0 18px var(--tile-c, transparent); }
.noc-tile.s-up { --tile-c: var(--ok); } .noc-tile.s-warning { --tile-c: var(--warn); } .noc-tile.s-critical { --tile-c: var(--crit); }
.noc-tile.s-down { --tile-c: var(--down); animation: down-glow 1.6s infinite; }
.noc-tile .t-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.noc-tile .t-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--tile-c, var(--text-2)); font-size: 17px; }
.noc-tile .t-name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.noc-tile .t-addr { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.noc-tile .t-metrics { display: grid; gap: 7px; }
.noc-tile .t-metrics label { font-size: 11px; color: var(--text-3); width: 34px; }
.noc-tile .t-foot { display: flex; justify-content: space-between; margin-top: 12px; font-size: 11.5px; color: var(--text-3); }
.health-ring { position: absolute; right: 14px; top: 14px; width: 42px; height: 42px; }
.health-ring svg { transform: rotate(-90deg); }
.health-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-family: var(--mono); }

/* gauges */
.gauge-wrap { position: relative; text-align: center; }
.gauge-wrap .g-val { position: absolute; left: 0; right: 0; bottom: 8px; font-family: var(--mono); font-size: 26px; font-weight: 600; }
.gauge-wrap .g-label { color: var(--text-2); font-size: 13px; margin-top: 4px; }

/* forms / buttons */
.form-control, .form-select { background-color: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text); border-radius: 10px; padding: .55rem .8rem; }
.form-control:focus, .form-select:focus { background-color: var(--surface-2); color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 .2rem rgba(34,211,238,.15); }
.form-control::placeholder { color: var(--text-3); }
.form-select option { background: var(--surface-solid); color: var(--text); }
.form-label { color: var(--text-2); font-size: 13px; margin-bottom: 5px; }
.form-text { color: var(--text-3); }
.input-group-text { background: var(--surface-2); border-color: var(--border-strong); color: var(--text-2); }
.form-check-input { background-color: var(--surface-2); border-color: var(--border-strong); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.btn { border-radius: 10px; font-weight: 500; padding: .5rem 1rem; }
.btn-sm { padding: .3rem .7rem; border-radius: 8px; }
.btn-accent { background: var(--accent-grad); color: #fff; border: 0; box-shadow: 0 6px 18px -6px rgba(99,102,241,.6); }
.btn-accent:hover { color: #fff; filter: brightness(1.1); transform: translateY(-1px); }
.btn-ghost { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.btn-ghost.active { color: var(--accent); border-color: var(--accent); }
.btn-act { width: 32px; height: 32px; padding: 0; display: inline-grid; place-items: center; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.btn-act:hover { color: var(--accent); border-color: var(--accent); }
.btn-act.danger:hover { color: var(--crit); border-color: var(--crit); }

/* modal */
.modal-content { background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: 18px; color: var(--text); }
.modal-header, .modal-footer { border-color: var(--border); }
.modal-title { font-weight: 600; }
[data-theme="dark"] .btn-close { filter: invert(1) grayscale(1) brightness(2); }
.nav-tabs { border-color: var(--border); }
.nav-tabs .nav-link { color: var(--text-2); border: 0; border-bottom: 2px solid transparent; }
.nav-tabs .nav-link.active { color: var(--accent); background: transparent; border-bottom-color: var(--accent); }

/* DataTables */
table.dataTable { color: var(--text); border-collapse: separate !important; border-spacing: 0; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--border); --bs-table-hover-bg: var(--surface-2); --bs-table-hover-color: var(--text); --bs-table-striped-bg: transparent; }
.table > thead th { color: var(--text-3); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border-strong) !important; white-space: nowrap; }
.table td { vertical-align: middle; border-color: var(--border); }
.dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter, .dataTables_wrapper .dataTables_info { color: var(--text-2); font-size: 13px; }
.dataTables_wrapper .dataTables_filter input, .dataTables_wrapper .dataTables_length select { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); border-radius: 10px; }
.page-link { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }
.page-item.active .page-link { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-item.disabled .page-link { background: transparent; color: var(--text-3); border-color: var(--border); }
div.dataTables_processing { background: var(--surface-solid) !important; color: var(--text) !important; border: 1px solid var(--border-strong); border-radius: 12px; }
div.dataTables_processing > div:last-child > div { background: var(--accent) !important; }
table.dataTable > tbody > tr.child ul.dtr-details > li { border-color: var(--border); }

/* select2 */
.select2-container--default .select2-selection--single { background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 10px; height: 40px; }
.select2-container--default .select2-selection--single .select2-selection__rendered { color: var(--text); line-height: 38px; }
.select2-dropdown { background: var(--surface-solid); border-color: var(--border-strong); color: var(--text); }
.select2-search__field { background: var(--surface-2); color: var(--text); }

/* SweetAlert2 theme */
.swal2-popup { background: var(--surface-solid) !important; color: var(--text) !important; border: 1px solid var(--border-strong); border-radius: 20px !important; font-family: inherit; }
.swal2-title { color: var(--text) !important; font-size: 1.35rem !important; }
.swal2-html-container { color: var(--text-2) !important; }
.swal2-styled.swal2-confirm { background: var(--accent-grad) !important; border-radius: 10px !important; }
.swal2-styled.swal2-cancel { background: var(--surface-2) !important; color: var(--text) !important; border: 1px solid var(--border-strong) !important; border-radius: 10px !important; }
.swal2-input, .swal2-textarea { background: var(--surface-2) !important; color: var(--text) !important; border-color: var(--border-strong) !important; }
.swal2-toast { box-shadow: var(--shadow) !important; }

/* AI */
.ai-card { position: relative; padding: 16px 18px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 12px; transition: .2s; }
.ai-card:hover { border-color: var(--border-strong); }
.ai-card .ai-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; flex: none; }
.ai-card h6 { font-weight: 600; margin: 0 0 4px; font-size: 14.5px; }
.ai-card .ai-detail { color: var(--text-2); font-size: 13px; }
.ai-card .ai-reco { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(139,92,246,.08); border: 1px dashed rgba(139,92,246,.35); font-size: 13px; white-space: pre-line; }
.ai-orb { width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(from 0deg, #22d3ee, #6366f1, #a855f7, #22d3ee); animation: spin 6s linear infinite; position: relative; flex: none; }
.ai-orb::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--surface-solid); }
.ai-orb i { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; font-size: 24px; color: var(--accent); }
.ai-orb.busy { animation-duration: 1s; }
.chat-box { height: 380px; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; font-size: 13.5px; white-space: pre-line; line-height: 1.55; }
.chat-msg.me { align-self: flex-end; background: var(--accent-grad); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.ai { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.typing span { display: inline-block; width: 6px; height: 6px; margin: 0 2px; border-radius: 50%; background: var(--text-3); animation: typing 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }

/* timeline */
.tl { list-style: none; padding: 0; margin: 0; }
.tl li { position: relative; padding: 0 0 14px 22px; font-size: 13px; }
.tl li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--tl-c, var(--accent)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tl-c, var(--accent)) 20%, transparent); }
.tl li::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 1px; background: var(--border); }
.tl li:last-child::after { display: none; }
.tl small { color: var(--text-3); display: block; }

/* login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-hero { position: relative; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.login-hero h2 { font-size: 40px; font-weight: 700; letter-spacing: -1px; line-height: 1.15; }
.login-hero .grad { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-feat { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 560px; }
.login-feat div { padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; color: var(--text-2); }
.login-feat i { color: var(--accent); font-size: 20px; display: block; margin-bottom: 6px; }
.login-panel { display: grid; place-items: center; padding: 32px; }
.login-card { width: 100%; max-width: 420px; padding: 38px; }
.btn-ms { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 11px 16px; border-radius: 12px; font-weight: 600;
  background: #fff; color: #1f1f1f; border: 1px solid #c8ccd4; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.btn-ms:hover { color: #1f1f1f; box-shadow: 0 6px 22px rgba(0, 120, 212, .28); transform: translateY(-1px); }
.btn-ms.busy { opacity: .7; pointer-events: none; }
[data-theme="dark"] .btn-ms { background: #2f2f2f; color: #fff; border-color: #5e5e5e; }
[data-theme="dark"] .btn-ms:hover { color: #fff; }
.login-or { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; color: var(--text-3); font-size: 12.5px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-or a { color: var(--text-2); }
.badge-ms { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: rgba(0, 120, 212, .14); color: #3a96dd; border: 1px solid rgba(0, 120, 212, .3); vertical-align: middle; }
.orbit { position: absolute; right: -160px; top: 50%; width: 520px; height: 520px; transform: translateY(-50%); border-radius: 50%; border: 1px dashed var(--border-strong); animation: spin 60s linear infinite; }
.orbit::before, .orbit::after { content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 20px var(--accent); top: -7px; left: 50%; }
.orbit::after { background: var(--accent-2); box-shadow: 0 0 20px var(--accent-2); top: auto; bottom: -7px; }

/* misc */
.empty { text-align: center; padding: 40px 10px; color: var(--text-3); }
.empty i { font-size: 40px; display: block; margin-bottom: 8px; opacity: .6; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 8px; font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.code-box { font-family: var(--mono); font-size: 12px; background: #050814; color: #a5f3fc; border-radius: 12px; padding: 14px; border: 1px solid var(--border); white-space: pre-wrap; word-break: break-all; max-height: 320px; overflow: auto; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.section-gap { margin-top: 22px; }
hr { border-color: var(--border); opacity: 1; }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 70% { box-shadow: 0 0 0 9px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
@keyframes pulse-badge { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes blink { 50% { opacity: .25; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes down-glow { 50% { box-shadow: 0 0 0 1px rgba(239,68,68,.5), 0 0 28px -4px rgba(239,68,68,.5); } }
@keyframes typing { 0%,100% { transform: translateY(0); opacity: .4; } 50% { transform: translateY(-4px); opacity: 1; } }
.fade-up { animation: fadeUp .5s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1035; }
  .main { margin-left: 0; }
  .content { padding: 18px 16px; }
  .topbar { padding: 12px 16px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 575.98px) { .topbar-title p { display: none; } .topbar-title h1 { font-size: 17px; } .kpi .kpi-value { font-size: 24px; } }
.kpi-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; flex: none; }
.task-row { transition: opacity .3s, transform .3s; }
.swal2-styled.swal2-deny { background: var(--surface-2) !important; color: var(--text) !important; border: 1px solid var(--border-strong) !important; border-radius: 10px !important; }
