/* =============================================================
   style.css — Hack'Obot Admin v2
   Design system complet : sidebar, tiles, toggles, composants
   ============================================================= */

/* ==================== VARIABLES ==================== */
:root {
  --primary:        #ff6b35;
  --primary-hover:  #ff8c42;
  --primary-dim:    rgba(255, 107, 53, .14);
  --primary-dim2:   rgba(255, 107, 53, .06);

  --bg:             #111214;
  --sidebar-bg:     #1e1f22;
  --surface:        #2b2d31;
  --surface2:       #313338;
  --surface3:       #3a3c43;

  --border:         #3f4147;
  --border-subtle:  #2e3035;

  --txt-1:  #f2f3f5;
  --txt-2:  #b5bac1;
  --txt-3:  #80848e;

  --green:      #23a55a;
  --green-dim:  rgba(35, 165, 90, .14);
  --red:        #f23f43;
  --red-dim:    rgba(242, 63, 67, .12);
  --yellow:     #f0b232;
  --yellow-dim: rgba(240, 178, 50, .12);
  --blue:       #5865f2;
  --blue-dim:   rgba(88, 101, 242, .12);

  --radius:    8px;
  --radius-sm: 5px;
  --radius-lg: 12px;

  --sidebar-w: 240px;
  --topbar-h:  56px;

  --shadow:    0 4px 16px rgba(0, 0, 0, .45);
  --shadow-sm: 0 1px 4px  rgba(0, 0, 0, .4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, .55);
}

/* ==================== RESET ==================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
a    { color: inherit; text-decoration: none; }
img  { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea, button { font-family: inherit; }

/* ==================== BODY ==================== */
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--txt-1);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;    /* scroll géré par .page-content */
}

/* ==================== LAYOUT ==================== */
.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Guild header */
.sidebar-guild {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border-subtle);
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-guild-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface3);
  flex-shrink: 0;
  font-size: 1.4em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-guild-name {
  font-weight: 700;
  font-size: 0.88em;
  color: var(--txt-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Nav */
.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--txt-2);
  font-size: 0.875em;
  font-weight: 500;
  transition: background .14s, color .14s;
  white-space: nowrap;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--surface2);
  color: var(--txt-1);
}

.nav-item.active {
  background: var(--primary-dim);
  color: var(--primary);
  font-weight: 600;
}

.nav-icon {
  font-size: 1em;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* Footer sidebar */
.sidebar-footer {
  padding: 6px 8px 12px;
  border-top: 1px solid var(--border-subtle);
}

.nav-item-logout:hover {
  background: var(--red-dim);
  color: var(--red);
}

/* ==================== MAIN WRAPPER ==================== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ==================== TOPBAR ==================== */
.topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
  position: relative;
}

.topbar-title {
  font-size: 0.95em;
  font-weight: 700;
  color: var(--txt-1);
  letter-spacing: .2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* ── Notification bell ── */
.notif-bell {
  position: relative;
  cursor: pointer;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  transition: background .15s;
  flex-shrink: 0;
}
.notif-bell:hover { background: var(--surface2); }
.notif-icon { font-size: 1.1em; line-height: 1; }
.notif-badge {
  position: absolute;
  top: 3px; right: 3px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  background: var(--red);
  color: #fff;
  font-size: .65em; font-weight: 700;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

.notif-panel {
  display: none;
  position: absolute;
  top: calc(var(--topbar-h) - 4px);
  right: 16px;
  width: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
  z-index: 500;
  overflow: hidden;
}
.notif-panel.open { display: block; }

.notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.notif-panel-title {
  font-size: .78em; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--txt-3);
}
.notif-refresh {
  background: none; border: none; color: var(--txt-3);
  cursor: pointer; font-size: 1em; padding: 2px 6px;
  border-radius: 4px; transition: all .15s;
}
.notif-refresh:hover { color: var(--primary); background: var(--surface3); }

.notif-list { max-height: 340px; overflow-y: auto; }
.notif-loading {
  padding: 20px; text-align: center;
  font-size: .82em; color: var(--txt-3);
}

.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: .82em;
  transition: background .1s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface2); }
.notif-item-icon { font-size: 1em; flex-shrink: 0; margin-top: 1px; }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-label { font-weight: 600; color: var(--txt-1); }
.notif-item-hint  { color: var(--txt-3); font-size: .9em; margin-top: 2px; }
.notif-item.ok .notif-item-icon::before   { content: '✅'; }
.notif-item.critical .notif-item-icon::before { content: '🔴'; }
.notif-item.warning  .notif-item-icon::before { content: '🟡'; }

.notif-all-ok {
  padding: 20px; text-align: center;
  font-size: .84em; color: var(--green);
  font-weight: 500;
}

/* Bot status */
.bot-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82em;
  color: var(--txt-2);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--txt-3);
  flex-shrink: 0;
}
.status-dot.online  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.offline { background: var(--red); }

/* ==================== PAGE CONTENT ==================== */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  min-width: 0;
}

/* ==================== FEATURE TILES ==================== */
.feature-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 10px;
  transition: border-color .2s;
}

.feature-tile:hover { border-color: var(--surface3); }
.feature-tile.is-open { border-color: var(--primary); }

.feature-tile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  gap: 16px;
}

.feature-tile-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.feature-tile-icon {
  font-size: 1.25em;
  width: 38px;
  height: 38px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s;
}

.feature-tile.is-open .feature-tile-icon {
  background: var(--primary-dim);
}

.feature-tile-title {
  font-weight: 600;
  font-size: 0.92em;
  color: var(--txt-1);
  margin-bottom: 2px;
}

.feature-tile-desc {
  font-size: 0.79em;
  color: var(--txt-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Slide-down body */
.feature-tile-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .26s ease;
}

.feature-tile.is-open .feature-tile-body {
  grid-template-rows: 1fr;
}

.feature-tile.is-open .feature-tile-chevron {
  transform: rotate(180deg);
}

.feature-tile-body-inner {
  overflow: hidden;
}

.feature-tile-content {
  padding: 20px;
  border-top: 1px solid var(--border);
}

/* ==================== TOGGLE SWITCH ==================== */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface3);
  border-radius: 24px;
  transition: background .2s;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--txt-3);
  transition: left .2s, background .2s, box-shadow .2s;
}

.toggle input:checked ~ .toggle-slider {
  background: var(--primary);
}
.toggle input:checked ~ .toggle-slider::after {
  left: calc(100% - 21px);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}

/* ==================== STAT CARDS ==================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color .2s, transform .15s;
}

.stat-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.stat-card-icon { font-size: 1.4em; margin-bottom: 2px; }

.stat-card-value {
  font-size: 1.75em;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-card-label {
  font-size: 0.72em;
  color: var(--txt-3);
  text-transform: uppercase;
  letter-spacing: .6px;
  font-weight: 600;
}

/* ==================== PANELS ==================== */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  font-size: 0.85em;
  font-weight: 700;
  color: var(--txt-2);
  text-transform: uppercase;
  letter-spacing: .7px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

/* ==================== FORMS & INPUTS ==================== */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.field-group label,
label.field-label {
  font-size: 0.76em;
  font-weight: 600;
  color: var(--txt-2);
  text-transform: uppercase;
  letter-spacing: .5px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="url"],
select,
textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--txt-1);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88em;
  line-height: 1.5;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

input::placeholder,
textarea::placeholder { color: var(--txt-3); }

textarea {
  resize: vertical;
  min-height: 90px;
}

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2380848e' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
}

/* Compat ancien .form-group */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 0.76em;
  font-weight: 600;
  color: var(--txt-2);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}

/* ==================== BUTTONS ==================== */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.84em;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
  line-height: 1;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-secondary {
  background: var(--surface2);
  color: var(--txt-1);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface3); border-color: var(--primary); color: var(--primary); }

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border-color: var(--red);
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-success {
  background: var(--green-dim);
  color: var(--green);
  border-color: var(--green);
}
.btn-success:hover { background: var(--green); color: #fff; }

.btn-full { width: 100%; }

.editor-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ==================== ALERTS ==================== */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875em;
  font-weight: 500;
  margin-bottom: 12px;
  border-left: 3px solid;
}
.alert-error   { background: var(--red-dim);    color: var(--red);     border-left-color: var(--red); }
.alert-success { background: var(--green-dim);  color: var(--green);   border-left-color: var(--green); }
.alert-warning { background: var(--yellow-dim); color: var(--yellow);  border-left-color: var(--yellow); }
.alert-info    { background: var(--primary-dim);color: var(--primary); border-left-color: var(--primary); }

/* ==================== TOAST ==================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  padding: 11px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875em;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: toast-in .22s ease;
  max-width: 320px;
  pointer-events: auto;
  transition: opacity .3s, transform .3s;
}
.toast.success { border-left: 3px solid var(--green);   color: var(--green); }
.toast.error   { border-left: 3px solid var(--red);     color: var(--red); }
.toast.info    { border-left: 3px solid var(--primary); color: var(--primary); }
.toast.warning { border-left: 3px solid var(--yellow);  color: var(--yellow); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ==================== BADGES ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  white-space: nowrap;
}
.badge-success { background: var(--green-dim);  color: var(--green); }
.badge-danger  { background: var(--red-dim);    color: var(--red); }
.badge-warning { background: var(--yellow-dim); color: var(--yellow); }
.badge-info    { background: var(--primary-dim);color: var(--primary); }
.badge-neutral { background: var(--surface3);   color: var(--txt-2); }

/* ==================== TABLES ==================== */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875em;
  background: transparent;
  border: none;
  margin: 0;
}

table thead { background: var(--surface2); }

table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.74em;
  font-weight: 700;
  color: var(--txt-3);
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--txt-2);
  vertical-align: middle;
}

table tr:last-child td { border-bottom: none; }
table tbody tr:hover   { background: var(--surface2); }

/* ==================== PROGRESS BAR ==================== */
.progress-bar {
  height: 6px;
  background: var(--surface3);
  border-radius: 99px;
  overflow: hidden;
  min-width: 60px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-hover));
  border-radius: 99px;
  transition: width .5s ease;
}

/* ==================== LOGS ==================== */
.log-entry {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.8em;
  color: var(--txt-2);
  background: var(--surface2);
  border-left: 3px solid var(--border);
  line-height: 1.5;
}
.log-entry.error   { border-left-color: var(--red);     background: var(--red-dim);    color: var(--red); }
.log-entry.warning { border-left-color: var(--yellow);  background: var(--yellow-dim); color: var(--yellow); }
.log-entry.info    { border-left-color: var(--primary); background: var(--primary-dim2); color: var(--txt-2); }

/* ==================== DOCUMENTS ==================== */
.document-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background .14s;
}
.document-item:last-child { border-bottom: none; }
.document-item:hover { background: var(--surface2); }
.document-icon { font-size: 1.5em; flex-shrink: 0; }
.document-info { flex: 1; min-width: 0; }
.document-name { font-weight: 600; font-size: 0.88em; color: var(--txt-1); margin-bottom: 2px; }
.document-meta { font-size: 0.76em; color: var(--txt-3); }
.document-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ==================== LOADING ==================== */
.spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--surface3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .75s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 24px;
  color: var(--txt-3);
  font-size: 0.875em;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--txt-3);
}
.empty-state-icon { font-size: 2.5em; margin-bottom: 12px; }
.empty-state-text { font-size: 0.875em; }

/* ==================== LOGIN PAGE ==================== */
body.login-body {
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 40%, rgba(255,107,53,.07) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 60%, rgba(255,140,66,.05) 0%, transparent 55%);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 390px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 22px;
}
.login-logo img {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  margin: 0 auto 10px;
  object-fit: cover;
  border: 2px solid var(--border);
}
.login-logo-fallback {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--primary-dim);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8em;
  margin: 0 auto 10px;
}
.login-title {
  text-align: center;
  font-size: 1.1em;
  font-weight: 700;
  color: var(--txt-1);
  margin-bottom: 4px;
}
.login-sub {
  text-align: center;
  font-size: 0.8em;
  color: var(--txt-3);
  margin-bottom: 26px;
}

/* ==================== DISCORD EMBED PREVIEW ==================== */
.discord-embed {
  background: var(--surface2);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 16px;
  font-size: 0.85em;
  margin-top: 8px;
}
.embed-title   { font-weight: 700; color: var(--txt-1); margin-bottom: 6px; font-size: 1em; }
.embed-description { color: var(--txt-2); white-space: pre-line; font-size: 0.92em; line-height: 1.5; }

/* ==================== TABS ==================== */
.tabs-bar {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 8px 16px;
  background: none;
  color: var(--txt-3);
  font-size: 0.84em;
  font-weight: 500;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: 1px solid transparent;
  border-bottom: none;
  margin-bottom: -1px;
  transition: color .15s, background .15s;
  cursor: pointer;
}
.tab-btn:hover  { color: var(--txt-1); background: var(--surface2); }
.tab-btn.active { color: var(--primary); background: var(--surface); border-color: var(--border); font-weight: 600; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar        { width: 5px; height: 5px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--surface3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ==================== SELECTION ==================== */
::selection { background: var(--primary); color: #fff; }

/* ==================== UTILITIES ==================== */
.hidden  { display: none !important; }
.flex    { display: flex; }
.flex-center  { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col     { display: flex; flex-direction: column; }
.flex-wrap    { flex-wrap: wrap; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.mb-8   { margin-bottom: 8px; }
.mb-12  { margin-bottom: 12px; }
.mb-16  { margin-bottom: 16px; }
.text-muted   { color: var(--txt-3); }
.text-primary { color: var(--primary); }
.text-center  { text-align: center; }
.text-sm      { font-size: 0.8em; }
.font-mono    { font-family: 'Courier New', monospace; }
.truncate     { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.w-full       { width: 100%; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
  .two-col   { grid-template-columns: 1fr; }
  .three-col { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  :root { --sidebar-w: 200px; }
  .stat-grid    { grid-template-columns: 1fr 1fr; }
  .three-col    { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
}

@media (max-width: 480px) {
  .sidebar { display: none; }
}
