:root {
  color-scheme: dark;
  --ink: #eaf2f7;
  --muted: #91a5b2;
  --panel: #0b1b27;
  --panel-2: #102532;
  --line: rgba(159, 190, 207, .16);
  --accent: #56e0b2;
  --accent-strong: #23bd8d;
  --blue: #65b8ff;
  --amber: #f6bd60;
  --danger: #ff6f75;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: #06121b; color: var(--ink); min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 6px; color: var(--accent); text-transform: uppercase; letter-spacing: .16em; font-size: 11px; font-weight: 800; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 720px) minmax(320px, 1fr); background: radial-gradient(circle at 20% 0%, #123849 0, transparent 38%), #06121b; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(40px, 8vw, 110px); }
.brand-lockup { display: flex; align-items: center; gap: 16px; margin-bottom: 56px; font-size: 18px; font-weight: 800; }
.brand-logo { width: 152px; height: auto; }
.brand-lockup span { border-left: 1px solid var(--line); padding-left: 16px; }
.auth-panel h1 { font-size: clamp(38px, 5vw, 68px); line-height: .98; max-width: 760px; letter-spacing: -.045em; margin: 0; }
.auth-copy { color: var(--muted); line-height: 1.7; font-size: 17px; max-width: 620px; }
.login-form { width: min(100%, 460px); display: grid; gap: 12px; margin-top: 20px; }
label { color: #bfd0da; font-size: 13px; font-weight: 700; display: grid; gap: 7px; }
input, select, textarea { width: 100%; background: #071721; border: 1px solid var(--line); color: var(--ink); border-radius: 10px; padding: 12px 13px; outline: none; }
textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(86, 224, 178, .12); }
.button { border: 0; border-radius: 10px; padding: 12px 17px; font-weight: 800; cursor: pointer; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.primary { color: #03241a; background: var(--accent); }
.button.primary:hover { background: #72ebc4; }
.button.secondary { background: #102532; border: 1px solid var(--line); }
.button.danger { background: var(--danger); color: #2b0709; }
.button.small { padding: 8px 11px; font-size: 12px; }
.text-button, .icon-button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.text-button { text-align: left; padding: 7px 0; }
.day-chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.day-chip { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer; font-weight: 700; font-size: 13px; }
.day-chip input { width: auto; }
.icon-button { width: 38px; height: 38px; border-radius: 10px; font-size: 20px; }
.icon-button:hover { background: var(--panel-2); color: var(--ink); }
.form-error { min-height: 22px; color: var(--danger); }
.security-note { color: #637985; font-size: 12px; margin-top: 32px; }
.auth-aside { position: relative; overflow: hidden; margin: 24px; border-radius: 24px; padding: clamp(40px, 6vw, 90px) clamp(40px, 6vw, 90px) clamp(28px, 4vw, 44px); display: flex; flex-direction: column; justify-content: flex-end; gap: 22px; background: linear-gradient(155deg, rgba(74, 211, 170, .13), rgba(18, 54, 71, .86)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cpath d='M90 0H0v90' fill='none' stroke='%239ed8ca' stroke-opacity='.08'/%3E%3C/svg%3E"); border: 1px solid var(--line); }
.aside-watermark { position: absolute; top: -70px; right: -60px; width: min(60%, 420px); height: auto; opacity: .08; z-index: 0; pointer-events: none; }
.aside-badge { position: absolute; top: 28px; right: 28px; z-index: 2; display: flex; align-items: center; gap: 9px; padding: 9px 16px; border-radius: 999px; background: rgba(5, 18, 27, .6); border: 1px solid var(--line); backdrop-filter: blur(6px); }
.aside-badge img { width: 17px; height: 17px; border-radius: 5px; }
.aside-badge span { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.signal-card { position: relative; z-index: 1; padding: 20px; border-radius: 16px; background: rgba(5, 18, 27, .72); display: grid; grid-template-columns: 12px 1fr; gap: 7px 12px; }
.signal-card small { color: var(--muted); grid-column: 2; }
.signal-dot { width: 10px; height: 10px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 16px var(--accent); margin-top: 5px; }
.auth-stat { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 14px; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.auth-stat strong { font-size: 34px; letter-spacing: -.04em; }
.auth-stat span { color: var(--muted); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 15px; background: #071721; border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 20; }
.sidebar-brand { display: flex; gap: 11px; align-items: center; padding: 4px 10px 22px; }
.brand-icon { width: 38px; height: 38px; border-radius: 10px; }
.sidebar-brand div { display: grid; }
.sidebar-brand small { color: var(--muted); font-size: 11px; }
#main-nav { display: grid; gap: 3px; overflow-y: auto; }
.nav-item { border: 0; background: transparent; color: #9bb0bc; border-radius: 9px; padding: 10px 11px; display: flex; gap: 11px; align-items: center; text-align: left; cursor: pointer; font-size: 13px; font-weight: 700; }
.nav-item span { width: 20px; text-align: center; font-size: 16px; }
.nav-item:hover, .nav-item.active { background: #102b37; color: var(--ink); }
.nav-item.active { box-shadow: inset 3px 0 var(--accent); }
.danger-nav { color: #e8878c; }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--line); padding: 16px 10px 0; display: grid; font-size: 12px; color: var(--muted); }
.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 10; min-height: 86px; background: rgba(6, 18, 27, .88); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); padding: 16px 28px; display: flex; align-items: center; gap: 14px; }
.topbar h1 { margin: 0; font-size: 24px; letter-spacing: -.025em; }
.topbar-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.role-badge, .badge { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 10px; color: #b7cad4; font-size: 11px; font-weight: 800; }
.page-content { padding: 28px; max-width: 1680px; margin: auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.page-head h2 { margin: 0; font-size: 25px; }
.page-head p { color: var(--muted); margin: 6px 0 0; }
.action-row { display: flex; flex-wrap: wrap; gap: 9px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 14px; }
.metric { background: linear-gradient(145deg, var(--panel), #0a202b); border: 1px solid var(--line); border-radius: 14px; padding: 18px; min-height: 126px; display: flex; flex-direction: column; justify-content: space-between; }
.current-plan { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.metric span { color: var(--muted); font-size: 12px; font-weight: 700; }
.metric strong { font-size: 33px; letter-spacing: -.04em; }
.metric small { color: #708894; }
.grid-2 { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; margin-top: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.card-pad { padding: 18px; }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.card p { color: var(--muted); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 11px 13px; white-space: nowrap; }
th { color: #6f8996; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
td { color: #c8d7df; }
tr:last-child td { border-bottom: 0; }
.status { display: inline-flex; gap: 6px; align-items: center; font-weight: 800; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.good { color: var(--accent); }
.status.warn { color: var(--amber); }
.status.bad { color: var(--danger); }
.empty { padding: 38px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }
.warning-banner { margin: 16px 28px 0; padding: 12px 14px; border: 1px solid rgba(246, 189, 96, .34); background: rgba(246, 189, 96, .09); border-radius: 10px; color: #f7d28e; font-size: 13px; }
.loading { min-height: 50vh; display: grid; place-content: center; text-align: center; color: var(--muted); }
.loading span { width: 38px; height: 38px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; justify-self: center; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; background: #163342; border: 1px solid var(--line); border-radius: 11px; padding: 12px 16px; box-shadow: var(--shadow); transform: translateY(30px); opacity: 0; pointer-events: none; transition: .2s; max-width: 380px; }
.toast.show { transform: translateY(0); opacity: 1; }
.modal { border: 0; padding: 0; background: transparent; color: var(--ink); width: min(680px, calc(100% - 28px)); }
.modal::backdrop { background: rgba(1, 9, 14, .78); backdrop-filter: blur(5px); }
.modal-card { background: #0b1b27; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.modal-card header, .modal-card footer { padding: 16px 19px; display: flex; align-items: center; gap: 10px; }
.modal-card header { border-bottom: 1px solid var(--line); justify-content: space-between; }
.modal-card h2 { margin: 0; }
.modal-body { padding: 20px; display: grid; gap: 13px; max-height: 65vh; overflow: auto; }
.modal-card footer { border-top: 1px solid var(--line); justify-content: flex-end; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid .wide { grid-column: 1 / -1; }
.danger-zone { border-color: rgba(255, 111, 117, .35); background: linear-gradient(145deg, rgba(255, 111, 117, .08), var(--panel)); }
.qr-frame { width: min(360px, 100%); margin: 10px auto; padding: 12px; background: white; border-radius: 12px; }
.qr-frame img { display: block; width: 100%; }
.search { max-width: 300px; }
#menu-toggle { display: none; }
@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; transform: translateX(-105%); transition: .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  #menu-toggle { display: block; }
  .page-content { padding: 18px; }
  .topbar { padding: 13px 16px; }
  .warning-banner { margin: 12px 16px 0; }
  .metric-grid { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .role-badge { display: none; }
  .auth-panel { padding: 30px 22px; }
  .brand-lockup { margin-bottom: 42px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
