:root {
  --bg-main: #0B0E14;
  --bg-glass: rgba(22, 27, 34, 0.85);
  --border-glass: rgba(255, 255, 255, 0.1);
  --accent: #0078d4;
  --accent-hover: #00f2fe;
  --text-primary: #E6EDF3;
  --text-secondary: #8B949E;
  --success: #3FB950;
  --warning: #D29922;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', system-ui, -apple-system, sans-serif; }

body {
  background-color: var(--bg-main);
  background-image:
    radial-gradient(circle at top right, rgba(0,120,212,0.12), transparent 40%),
    radial-gradient(circle at bottom left, rgba(0,242,254,0.08), transparent 40%);
  color: var(--text-primary);
  min-height: 100vh;
}

/* ── Hamburger: hidden on desktop, shown on mobile via media query ── */
.hamburger {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  background: rgba(13,17,23,0.95);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: #E6EDF3;
  font-size: 20px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ── Sidebar X close button: hidden on desktop ── */
.sidebar-close {
  display: none;
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: #E6EDF3;
  font-size: 16px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ── Dark overlay ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 98;
}
.sidebar-overlay.active { display: block; }

/* ── Utilities ── */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 30px;
}
.glass-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  overflow: hidden;
}

/* ── Login page ── */
.centered {
  margin: auto;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
  text-align: center;
}
.centered h2 { margin-bottom: 8px; font-weight: 600; }
.centered p  { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; }

input {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  color: white;
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 16px;
  transition: all 0.2s;
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0,120,212,0.25); }

/* ── Buttons ── */
.btn {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn.primary { background: var(--accent); color: white; }
.btn.primary:hover { background: var(--accent-hover); color: #000; }
.btn.outline { background: transparent; border: 1px solid var(--text-secondary); color: var(--text-primary); }
.btn.outline:hover { background: rgba(255,255,255,0.05); }
.btn.small   { width: auto; padding: 6px 12px; font-size: 12px; border-radius: 4px; }
.btn.success { background: var(--success); color: white; }
.btn.danger  { background: #da3633; color: white; }
.mt-auto { margin-top: auto; }

.error-msg {
  color: #F85149;
  background: rgba(248,81,73,0.1);
  border: 1px solid rgba(248,81,73,0.3);
  border-radius: 6px;
  padding: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

/* ══════════════════════════════════════
   DESKTOP LAYOUT
   ══════════════════════════════════════ */
.dashboard {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--bg-glass);
  border-right: 1px solid var(--border-glass);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: transform 0.28s ease;
  position: relative;
}

.brand h2 { font-size: 20px; color: var(--text-primary); letter-spacing: -0.5px; }
.brand p   { font-size: 12px; color: var(--accent); margin-bottom: 30px; }

.nav { list-style: none; }
.nav li {
  padding: 12px 16px;
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 4px;
}
.nav li.active, .nav li:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

.main-content {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  min-width: 0;
}

.header { margin-bottom: 30px; }
.header h1 { font-size: 24px; font-weight: 600; margin-bottom: 4px; }
.header p  { color: var(--text-secondary); font-size: 14px; }

/* ── Table ── */
.users-table { width: 100%; border-collapse: collapse; }
.users-table th {
  text-align: left;
  padding: 14px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-glass);
  background: rgba(0,0,0,0.2);
}
.users-table td {
  padding: 14px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-glass);
}
.users-table tr:last-child td { border-bottom: none; }
.users-table tr:hover { background: rgba(255,255,255,0.02); }

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.badge.active  { background: rgba(63,185,80,0.15);  color: var(--success); border: 1px solid rgba(63,185,80,0.3); }
.badge.pending { background: rgba(210,153,34,0.15); color: var(--warning); border: 1px solid rgba(210,153,34,0.3); }

.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.limit-input  { width: 55px; padding: 4px 6px; text-align: center; margin: 0; display: inline-block; }

/* ══════════════════════════════════════
   MOBILE  ≤ 768px
   ══════════════════════════════════════ */
@media (max-width: 768px) {

  /* Show hamburger and X button */
  .hamburger     { display: flex; }
  .sidebar-close { display: flex; }

  /* Dashboard stacks vertically */
  .dashboard { display: block; }

  /* Sidebar: slides off screen to the left by default */
  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 99;
    transform: translateX(-110%);
    overflow-y: auto;
    box-shadow: 6px 0 24px rgba(0,0,0,0.6);
    background: #0d1117;
  }

  /* Open state: slide in */
  .sidebar.open { transform: translateX(0); }

  /* Main content: full width, leave room for hamburger at top */
  .main-content {
    width: 100%;
    padding: 60px 14px 30px 14px;
  }

  .header h1 { font-size: 18px; }
  .header p  { font-size: 12px; }

  /* Search bar */
  #inpSearch { width: 100% !important; }

  /* Settings layout: stack vertically */
  #settingsView > div > div { flex-direction: column !important; }
  #settingsView > div > div > div:last-child {
    border-left: none !important;
    padding-left: 0 !important;
    border-top: 1px solid #30363d;
    padding-top: 16px;
  }

  /* ── TABLE → CARD LAYOUT ── */
  .users-table thead { display: none; }
  .users-table,
  .users-table tbody,
  .users-table tr,
  .users-table td { display: block; width: 100%; }

  .users-table tr {
    background: rgba(22,27,34,0.9);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    margin-bottom: 12px;
    padding: 10px 12px;
  }

  .users-table td {
    padding: 5px 2px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }
  .users-table td:last-child { border-bottom: none; }

  .users-table td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    min-width: 65px;
    flex-shrink: 0;
  }

  .actions-cell { 
    flex-direction: row !important; 
    gap: 8px; 
    justify-content: flex-start;
    margin-top: 5px;
  }
  .btn.small { 
    width: auto !important; 
    min-width: 80px;
    text-align: center; 
    padding: 6px 10px; 
  }
  #inpAnnouncement { max-width: 100% !important; width: 100% !important; }
}
