:root{
  --bg: #0b0f17;
  --panel: rgba(255,255,255,.06);
  --panel2: rgba(255,255,255,.04);
  --border: rgba(255,255,255,.10);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.65);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 20% 10%, rgba(88,101,242,.25), transparent 60%),
    radial-gradient(900px 600px at 80% 20%, rgba(0,209,255,.18), transparent 55%),
    radial-gradient(900px 600px at 40% 90%, rgba(255,255,255,.06), transparent 60%),
    var(--bg);
}

a{ color: inherit; text-decoration:none; }
a:hover{ text-decoration:none; }

.layout{
  display:grid;
  grid-template-columns: 320px 1fr;
  min-height:100vh;
}

/* Sidebar */
.sidebar{
  padding: 22px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  position: sticky;
  top:0;
  height:100vh;
  display:flex;
  flex-direction:column;
  gap:18px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding: 14px;
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel2);
  box-shadow: var(--shadow);
}

.logo{
  width: 44px !important;
  height: 60px !important;
  min-width: 44px !important;
  min-height: 60px !important;
  max-width: 44px !important;
  max-height: 60px !important;

  border-radius: 12px;
  overflow: hidden;

  display: grid;
  place-items: center;

  flex: 0 0 44px; /* prevents flex stretching */

  background: linear-gradient(135deg, rgba(88,101,242,.9), rgba(0,209,255,.7));
}

.logo-img{
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: contain;
}


.brand-title{ font-weight:750; letter-spacing:.2px; }
.brand-subtitle{ color: var(--muted); font-size: 13px; margin-top:2px; }

.nav{ display:flex; flex-direction:column; gap:10px; }
.nav-section-title{
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin: 6px 2px 2px;
}
.nav-divider{
  height:1px;
  background: var(--border);
  margin: 8px 0;
}

.nav-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 12px 12px;
  border:1px solid var(--border);
  border-radius: 14px;
  background: var(--panel2);
  transition: transform .08s ease, background .08s ease, border-color .08s ease;
}
.nav-item:hover{
  transform: translateY(-1px);
  background: var(--panel);
  border-color: rgba(255,255,255,.18);
}
.nav-item-icon{ width: 26px; text-align:center; }
.nav-item-label{ font-weight: 650; }
.nav-item-meta{
  margin-left:auto;
  font-size: 12px;
  color: var(--muted);
  border:1px solid rgba(255,255,255,.14);
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.12);
}

.disabled{
  opacity:.7;
  cursor: not-allowed;
}

.sidebar-footer{
  margin-top:auto;
  display:flex;
  flex-direction:column;
  gap:10px;
  padding-top: 10px;
}

.auth-buttons{
  display:flex;
  gap:10px;
}

/* Main */
.main{
  padding: 26px;
}

.topbar{
  display:flex;
  gap:16px;
  align-items:flex-start;
  justify-content:space-between;
  padding: 18px;
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel2);
  box-shadow: var(--shadow);
}

.topbar h1{ margin:0; font-size: 26px; }
.topbar p{ margin:6px 0 0; }

.grid{
  margin-top: 18px;
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.card{
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel2);
  box-shadow: var(--shadow);
  padding: 16px;
  display:flex;
  flex-direction:column;
  gap: 12px;
}

.card-head{
  display:flex;
  gap:12px;
  align-items:center;
}
.card-icon{
  width: 42px; height:42px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
}
.card h2{ margin:0; font-size: 18px; }
.card .muted{ margin: 2px 0 0; }

.card-actions{
  display:flex;
  gap:10px;
  margin-top:auto;
}

.panel{
  margin-top: 16px;
  padding: 18px;
  border:1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel2);
  box-shadow: var(--shadow);
}
.panel h2{ margin:0 0 6px; font-size: 18px; }

.callout{
  margin-top: 10px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(255,255,255,.18);
  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.8);
}

.list{
  margin: 8px 0 0;
  padding-left: 18px;
  color: rgba(255,255,255,.78);
}
.list li{ margin: 6px 0; }

.footer{
  margin-top: 16px;
  display:flex;
  justify-content:space-between;
  gap: 12px;
  padding: 10px 2px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-weight: 650;
  transition: transform .08s ease, background .08s ease, border-color .08s ease;
}
.btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.22);
}
.btn:active{ transform: translateY(0px); }

.btn-primary{
  border-color: rgba(88,101,242,.55);
  background: linear-gradient(135deg, rgba(88,101,242,.75), rgba(0,209,255,.35));
}
.btn-primary:hover{
  border-color: rgba(88,101,242,.75);
}

.btn-ghost{
  background: rgba(255,255,255,.04);
}

.muted{ color: var(--muted); }
.tiny{ font-size: 12px; }
.mono{ font-family: var(--mono); }

/* Responsive */
@media (max-width: 960px){
  .layout{ grid-template-columns: 1fr; }
  .sidebar{
    position: relative;
    height:auto;
    border-right:none;
    border-bottom:1px solid var(--border);
  }
  .topbar-right{ display:none; }
  .grid{ grid-template-columns: 1fr; }
}


/* ---------- Mobile polish overrides (replace whole section) ---------- */

/* Helps form controls / scrollbars match dark theme */
:root { color-scheme: dark; }

/* Desktop: keep your nice aurora background, just slightly tamed */
body{
  background:
    radial-gradient(1100px 650px at 18% 8%, rgba(88,101,242,.20), transparent 60%),
    radial-gradient(900px 600px at 82% 18%, rgba(0,209,255,.14), transparent 55%),
    radial-gradient(900px 600px at 50% 92%, rgba(255,255,255,.05), transparent 60%),
    var(--bg);
}

/* Global: a touch more “solid” so content reads well */
:root{
  --panel: rgba(255,255,255,.07);
  --panel2: rgba(255,255,255,.055);
  --border: rgba(255,255,255,.11);
  --shadow: 0 10px 26px rgba(0,0,0,.30);
}

/* Glass effect (works great on desktop; mobile is adjusted below) */
.card, .topbar, .brand, .nav-item, .panel{
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Better touch target */
.btn{ min-height: 44px; }

/* --- Mobile specific changes --- */
@media (max-width: 960px){

  /* iOS notch / safe area padding */
  .main, .sidebar{
    padding-left: calc(18px + env(safe-area-inset-left));
    padding-right: calc(18px + env(safe-area-inset-right));
  }

  /* BIG FIX:
     Replace mobile radials with a stable vertical background
     so you don't get the sharp blue shift behind translucent cards. */
  body{
    background:
      radial-gradient(520px 320px at 50% 18%, rgba(88,101,242,.10), transparent 60%),
      linear-gradient(180deg, #0b0f17 0%, #0c1324 55%, #0b0f17 100%);
  }

  /* Make panels more opaque on mobile so background can’t “bleed” through */
  :root{
    --panel: rgba(15, 23, 42, 0.72);
    --panel2: rgba(15, 23, 42, 0.62);
    --border: rgba(255,255,255,.12);
    --shadow: 0 8px 18px rgba(0,0,0,.28);
    --radius: 14px;
  }

  /* Ensure key surfaces actually use the stronger panel colors */
  .card, .topbar, .brand, .nav-item, .panel{
    background: var(--panel2);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  /* Sidebar reads better as a “header block” on mobile */
  .sidebar{ gap: 14px; }

  /* Make topbar stack nicely */
  .topbar{
    flex-direction: column;
    align-items: flex-start;
  }
  .topbar h1{ font-size: 24px; }
  .topbar p{ line-height: 1.35; }

  /* Slightly tighter rhythm */
  .grid{ gap: 14px; margin-top: 14px; }
  .card{ padding: 14px; }
}

/* Optional: reduce motion for people who prefer it */
@media (prefers-reduced-motion: reduce){
  .nav-item, .btn{ transition: none; }
  .nav-item:hover, .btn:hover{ transform: none; }
}
