*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #080a0f;
  --bg2:     #0d1017;
  --panel:   #111520;
  --panel2:  #171d2d;
  --border:  #1e2540;
  --border2: #28304a;
  --accent:  #00f0a8;
  --blue:    #3d7eff;
  --purple:  #a855f7;
  --warn:    #f59e0b;
  --danger:  #ef4444;
  --text:    #e8edf8;
  --text2:   #6b7a9e;
  --text3:   #2e3a58;
  --sidebar: 220px;
  --radius:  8px;
}

html, body { height: 100%; background: var(--bg); color: var(--text); font-family: 'Syne', sans-serif; font-size: 14px; overflow: hidden; }
.mono { font-family: 'JetBrains Mono', monospace; }

/* ── LAYOUT ── */
#app { display: flex; height: 100vh; }

/* ── SIDEBAR ── */
#sidebar {
  width: var(--sidebar); min-width: var(--sidebar);
  background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
}
.sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .logo-name { font-size: 15px; font-weight: 700; color: var(--accent); letter-spacing: .5px; display: flex; align-items: center; gap: 8px; }
.logo-icon { width: 18px; height: 18px; display: inline-block; }
.logo-icon svg { width: 18px; height: 18px; display: block; }
.sidebar-logo .logo-sub  { font-size: 11px; color: var(--text2); margin-top: 2px; }

.sidebar-section { padding: 16px 0 4px; }
.sidebar-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: 1.5px;
  color: var(--text3); padding: 0 16px 6px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 16px; cursor: pointer; border-radius: 0;
  color: var(--text2); font-size: 13px; font-weight: 500;
  transition: all .15s; user-select: none;
  border-left: 3px solid transparent;
  text-decoration: none;
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: var(--panel); color: var(--accent); border-left-color: var(--accent); }
.nav-item .nav-icon { font-size: 15px; width: 18px; text-align: center; }

/* ── MAIN ── */
#main { flex: 1; overflow-y: auto; background: var(--bg); }
.page { padding: 28px; min-height: 100%; }

/* ── PAGE HEADER ── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-title { font-size: 22px; font-weight: 700; }
.page-subtitle { font-size: 13px; color: var(--text2); margin-top: 2px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius); border: none;
  font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: #00d494; }
.btn-secondary { background: var(--panel2); color: var(--text); border: 1px solid var(--border2); }
.btn-secondary:hover { border-color: var(--text2); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-warning { background: transparent; color: #f59e0b; border: 1px solid #f59e0b; }
.btn-warning:hover { background: #f59e0b; color: #000; }
.btn-success { background: transparent; color: #00f0a8; border: 1px solid #00f0a8; }
.btn-success:hover { background: #00f0a8; color: #000; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── CARDS ── */
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }

/* ── KPI CARDS ── */
.kpi-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.kpi-label { font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 6px; }
.kpi-value { font-size: 28px; font-weight: 800; font-family: 'JetBrains Mono', monospace; }
.kpi-value.green  { color: var(--accent); }
.kpi-value.blue   { color: var(--blue); }
.kpi-value.purple { color: var(--purple); }
.kpi-value.orange { color: var(--warn); }
.kpi-sub { font-size: 12px; color: var(--text2); margin-top: 4px; }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 20px; font-size: 11px; font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}
.badge-active   { background: rgba(0,240,168,.12); color: var(--accent); }
.badge-active::before { content:''; width:6px; height:6px; border-radius:50%; background:var(--accent); animation: pulse 2s infinite; }
.badge-blocked  { background: rgba(239,68,68,.12); color: var(--danger); }
.badge-unassigned{ background: rgba(107,122,158,.12); color: var(--text2); }
.badge-expired  { background: rgba(245,158,11,.12); color: var(--warn); }
.badge-cancelled{ background: rgba(239,68,68,.12); color: var(--danger); }
.badge-perpetual{ background: rgba(61,126,255,.12); color: var(--blue); }
.badge-subscription{ background: rgba(168,85,247,.12); color: var(--purple); }
.badge-to-invoice{ background: rgba(61,126,255,.12); color: var(--blue); }
.badge-invoiced{ background: rgba(0,240,168,.12); color: var(--accent); }
.badge-demo{ background: rgba(107,122,158,.12); color: var(--text2); }
.badge-online{ background: rgba(0,240,168,.12); color: var(--accent); }
.badge-online::before { content:''; width:6px; height:6px; border-radius:50%; background:var(--accent); animation: pulse 2s infinite; }
.badge-offline{ background: rgba(107,122,158,.12); color: var(--text2); }
.badge-offline::before { content:''; width:6px; height:6px; border-radius:50%; background:var(--text2); opacity:.55; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; overflow-y: visible; }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 1px solid var(--border2); }
thead th { padding: 10px 12px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--text2); font-weight: 600; }
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; overflow: visible; }
tbody tr:hover { background: var(--panel2); }
tbody td { padding: 10px 12px; font-size: 13px; overflow: visible; position: relative; }
.key-cell { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text); }
.licence-row { cursor: pointer; }
.link-cell {
  border: none; background: transparent; padding: 0; cursor: pointer;
  color: #fff; font: inherit; text-decoration: none;
}
.link-cell:hover { color: var(--accent); text-decoration: underline; }
.licence-actions-cell { min-width: 112px; white-space: nowrap; }

/* ── ACTIONS MENU ── */
.actions-wrap { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.actions-btn {
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: var(--panel2);
  color: var(--text);
  font-size: 12px;
  font-family: 'Syne', sans-serif;
  cursor: pointer;
}
.actions-btn:hover { border-color: var(--text2); }
.actions-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 210px;
  background: var(--panel);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 6px;
  display: none;
  z-index: 50;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  font-family: 'Syne', sans-serif;
}
.actions-menu.floating { position: fixed; right: auto; }
.actions-menu.open { display: block; }
.actions-item {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 12px;
  font-family: 'Syne', sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.actions-item:hover { background: var(--panel2); }
.actions-item.danger { color: var(--danger); }

/* ── RESELLER CARDS ── */
.reseller-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 14px;
}
.reseller-card-header { display: flex; align-items: center; gap: 12px; }
.reseller-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
}
.reseller-name  { font-weight: 700; font-size: 15px; }
.reseller-code  { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text2); margin-top: 2px; }
.reseller-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rs-stat { background: var(--bg2); border-radius: 6px; padding: 8px 10px; text-align: center; }
.rs-stat-val { font-family: 'JetBrains Mono', monospace; font-size: 16px; font-weight: 700; }
.rs-stat-lbl { font-size: 10px; color: var(--text2); margin-top: 2px; }
.pool-bar-wrap { background: var(--bg2); border-radius: 4px; height: 5px; overflow: hidden; }
.pool-bar { height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s; }

/* ── CLIENTS ── */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.client-card {
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  cursor: pointer;
  color: var(--text);
  font-family: 'Syne', sans-serif;
  transition: border-color .15s, transform .15s, background .15s;
}
.client-card:hover {
  border-color: var(--accent);
  background: var(--panel2);
  transform: translateY(-1px);
}
.client-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.client-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,240,168,.12);
  color: var(--accent);
  font-weight: 800;
  border: 1px solid rgba(0,240,168,.28);
}
.client-name { font-size: 15px; font-weight: 800; }
.client-address { color: var(--text2); font-size: 12px; margin-top: 3px; line-height: 1.35; }
.client-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.client-stats div {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 8px;
}
.client-stats strong {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 17px;
}
.client-stats span {
  display: block;
  color: var(--text2);
  font-size: 10px;
  margin-top: 2px;
}
.client-resellers {
  color: var(--text2);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mask-usage { display: grid; gap: 4px; min-width: 170px; }
.mask-usage-line { display: flex; flex-direction: column; gap: 1px; }
.mask-usage-line strong { font-size: 12px; color: var(--text); font-weight: 700; }
.mask-usage-line span { font-size: 11px; color: var(--text2); font-family: 'JetBrains Mono', monospace; }

/* ── EVENTS ── */
.event-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.event-icon { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.event-activated  { background: rgba(0,240,168,.1); }
.event-blocked    { background: rgba(239,68,68,.1); }
.event-checked    { background: rgba(61,126,255,.1); }
.event-reassigned { background: rgba(168,85,247,.1); }
.event-expired    { background: rgba(245,158,11,.1); }
.event-cancelled  { background: rgba(239,68,68,.1); }
.event-body { flex: 1; }
.event-key  { font-family:'JetBrains Mono',monospace; font-size:12px; color:var(--text); }
.event-meta { font-size:11px; color:var(--text2); margin-top:2px; }
.event-time { font-family:'JetBrains Mono',monospace; font-size:11px; color:var(--text3); flex-shrink:0; }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; color: var(--text2); margin-bottom: 6px; font-weight: 500; }
.form-input, .form-select {
  width: 100%; padding: 9px 12px; background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--radius); color: var(--text); font-family: 'Syne', sans-serif; font-size: 13px;
  outline: none; transition: border-color .15s;
}
.form-input:focus, .form-select:focus { border-color: var(--accent); }
.form-select option { background: var(--bg2); }

/* ── PERMISSIONS ── */
.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 12px;
}
.perm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text2);
}

/* ── MODAL ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: none; align-items: center; justify-content: center; z-index: 1000;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--panel); border: 1px solid var(--border2); border-radius: 12px;
  padding: 28px; width: 480px; max-width: 95vw; max-height: 90vh; overflow-y: auto;
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.modal-wide { width: min(860px, 96vw); }
.modal-mask-editor { width: min(1180px, 96vw); }
.detail-header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:18px; }
.detail-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:10px; }
.detail-card {
  background: var(--bg2); border:1px solid var(--border); border-radius:10px;
  padding:12px 14px; min-height:68px;
}
.detail-card span { display:block; color:var(--text2); font-size:11px; text-transform:uppercase; letter-spacing:.6px; margin-bottom:6px; }
.detail-card strong { display:block; color:var(--text); font-size:13px; line-height:1.35; word-break:break-word; }
.detail-wide { grid-column: 1 / -1; }
/* ── DETAIL SECTIONS ── */
.detail-section { margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.detail-section:last-of-type { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.detail-section-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.3px; color: #fff; margin-bottom: 12px; }
.detail-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 20px; }
.detail-field { }
.detail-field-wide { grid-column: 1 / -1; }
.detail-label { font-size: 11px; color: var(--text2); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .5px; font-weight: 500; }
.detail-value { font-size: 13px; color: var(--text); font-weight: 500; word-break: break-word; }

.detail-actions { display:grid; gap:14px; margin-top:18px; padding-top:16px; border-top:1px solid var(--border); }
.detail-action-section { display:grid; gap:8px; }
.detail-action-title { color:var(--text2); font-size:11px; text-transform:uppercase; letter-spacing:.7px; font-weight:700; }
.detail-action-row { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.text-muted { color: var(--text2); }

/* ── TABS ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 9px 16px; background: none; border: none; cursor: pointer;
  color: var(--text2); font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .15s;
}
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* â”€â”€ MASK VISUAL EDITOR â”€â”€ */
.mask-visual-topbar { display:flex; gap:8px; margin-bottom:12px; flex-wrap:wrap; }
.mask-view-pick.active { border-color: var(--accent); color: var(--accent); }
.mask-visual-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; align-items: start; }
.mask-editor-stage {
  position: relative; min-height: 320px; max-height: 65vh; overflow: auto;
  background: #050810; border: 1px solid var(--border2); border-radius: 12px;
  cursor: grab;
}
.mask-editor-stage:active { cursor: grabbing; }
#mask-editor-image {
  display: block;
  width: auto;
  max-width: none;
  height: auto;
  user-select: none;
  pointer-events: none;
}
#mask-editor-layer { position: absolute; left: 0; top: 0; pointer-events: none; }
.mask-editor-empty {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  text-align: center; padding: 24px; color: var(--text2); font-size: 13px; line-height: 1.5;
}
.mask-editor-stage.is-empty #mask-editor-image,
.mask-editor-stage.is-empty #mask-editor-layer { display: none; }
.mask-editor-stage.is-empty .mask-editor-empty { display: flex; }
.mask-zone {
  position: absolute; border: 2px solid var(--accent); border-radius: 8px;
  background: rgba(0, 240, 168, .10); box-shadow: 0 0 0 1px rgba(0,0,0,.45);
  cursor: move; pointer-events: auto; min-width: 14px; min-height: 14px;
}
.mask-zone::before {
  content: attr(data-label); position: absolute; left: -2px; top: -24px;
  padding: 3px 7px; border-radius: 6px 6px 6px 0; background: var(--accent);
  color: #00130d; font-size: 11px; font-weight: 800; white-space: nowrap;
}
.mask-zone.active { border-color: var(--warn); background: rgba(245, 158, 11, .14); z-index: 3; }
.mask-zone.active::before { background: var(--warn); color: #120900; }
.mask-zone-handle {
  position: absolute; width: 14px; height: 14px; right: -7px; bottom: -7px;
  border-radius: 50%; background: var(--accent); border: 2px solid #06100c;
  cursor: nwse-resize;
}
.mask-zone.active .mask-zone-handle { background: var(--warn); }
.mask-editor-side {
  display: flex; flex-direction: column; gap: 8px; padding: 12px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 12px;
}
.mask-zone-pick { justify-content: flex-start; }
.mask-zone-pick.active { border-color: var(--accent); color: var(--accent); }
.mask-editor-help { margin-top: 8px; font-size: 12px; line-height: 1.45; color: var(--text2); }

/* ── SEARCH / FILTER BAR ── */
.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; }
.search-input {
  flex: 1; padding: 8px 12px; background: var(--panel); border: 1px solid var(--border2);
  border-radius: var(--radius); color: var(--text); font-family: 'Syne',sans-serif; font-size: 13px; outline: none;
}
.search-input:focus { border-color: var(--accent); }

/* ── CHECKBOX ── */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border2);
  border-radius: 4px;
  background: var(--bg2);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
  transition: all .12s ease;
}
input[type="checkbox"]::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  transform: scale(0);
  transition: transform .12s ease;
  background: var(--accent);
}
input[type="checkbox"]:checked {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,240,168,.12);
}
input[type="checkbox"]:checked::before { transform: scale(1); }
input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,240,168,.18);
}

/* ── UTILS ── */
.text-muted { color: var(--text2); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-warn   { color: var(--warn); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.empty-state { text-align: center; padding: 48px 0; color: var(--text2); }
.empty-state .empty-icon { font-size: 36px; margin-bottom: 10px; }
.chip {
  display: inline-flex; align-items: center; padding: 3px 8px;
  border-radius: 4px; font-size: 11px; font-weight: 600;
  background: var(--panel2); color: var(--text2);
  font-family: 'JetBrains Mono', monospace;
}

/* ── RESPONSIVE ── */
@media (max-width: 1200px) {
  :root { --sidebar: 200px; }
  .page { padding: 22px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (max-width: 980px) {
  html, body { overflow-x: hidden; overflow-y: auto; }
  #app { height: auto; min-height: 100vh; }
  #sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 250px; min-width: 250px;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 1200;
    pointer-events: none;
  }
  body.sidebar-open #sidebar { transform: translateX(0); pointer-events: auto; }
  #main { width: 100%; overflow: visible; }
  .page { padding: 20px 18px 28px; padding-top: 76px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 14px; }
  .page-header .flex { width: 100%; flex-wrap: wrap; gap: 10px; }
  .page-header .btn { flex: 1 1 140px; justify-content: center; }
  .filter-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .table-wrap { overflow-x: auto; }
  .sidebar-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.6);
    opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 1100;
  }
  body.sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
  .menu-toggle {
    position: fixed; top: 14px; left: 14px; z-index: 1300;
    width: 40px; height: 40px; border-radius: 10px;
    border: 1px solid var(--border2); background: var(--panel);
    color: var(--text); display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px; cursor: pointer;
  }
  .sidebar-logo { padding: 16px; }
  .sidebar-section { padding: 8px 0 4px; }
  .nav-item { font-size: 14px; padding: 10px 16px; }
  .nav-item .nav-icon { width: 20px; }
  .card { padding: 16px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
  .kpi-value { font-size: 24px; }
  .filter-bar .form-select { width: 100%; }
  .mask-visual-layout { grid-template-columns: 1fr; }
  .mask-editor-side { order: -1; }
}

/* ── NOTIFICATIONS ── */
.notif-bell {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 9px 16px; background: none; border: none; cursor: pointer;
  color: var(--text2); font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 500;
  border-left: 3px solid transparent; transition: all .15s;
}
.notif-bell:hover { background: var(--panel); color: var(--text); }
.notif-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace; margin-left: auto;
}
.notif-panel {
  display: none; position: fixed;
  left: var(--sidebar); top: 0; bottom: 0; width: 300px;
  background: var(--panel); border-right: 1px solid var(--border2);
  z-index: 900; flex-direction: column;
  box-shadow: 4px 0 24px rgba(0,0,0,.5);
}
.notif-panel.open { display: flex; }
.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.notif-push-wrap { padding: 10px 12px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.notif-pref-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 12px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .8px; }
.notif-pref-list { display: flex; flex-direction: column; gap: 4px; }
.notif-pref-row { display: flex; align-items: center; gap: 8px; padding: 5px 2px; cursor: pointer; font-size: 13px; color: var(--text); }
.notif-pref-row input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; }
.notif-pref-icon { width: 22px; height: 22px; border-radius: 5px; display: flex; align-items: center; justify-content: center; background: rgba(0,240,168,.1); flex-shrink: 0; color: var(--accent); }
.notif-pref-icon svg { width: 12px; height: 12px; }
.notif-panel-section-title { padding: 8px 14px 4px; font-size: 10px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--border); flex-shrink: 0; }

@media (max-width: 980px) {
  .notif-panel { left: 0; width: 100vw; }
}

@media (max-width: 640px) {
  .page { padding: 16px 14px 24px; padding-top: 72px; }
  .btn { width: 100%; justify-content: center; padding: 7px 12px; font-size: 12px; }
  .btn-sm { padding: 5px 10px; font-size: 11px; }
  .modal { width: 94vw; padding: 20px; }
  .modal-footer { flex-direction: column; }
  .reseller-stats { grid-template-columns: 1fr; }
  .event-item { flex-direction: column; align-items: flex-start; gap: 6px; }
  thead th { font-size: 10px; }
  tbody td { font-size: 12px; }
  .page-title { font-size: 20px; }
  .page-subtitle { font-size: 12px; }
  .sidebar-logo .logo-name { font-size: 14px; }
  .sidebar-logo .logo-sub { font-size: 10px; }
}
