/* =============== */
/* Base + Tokens   */
/* =============== */
:root{
  --bg: #0b1020;
  --panel: rgba(255,255,255,0.06);
  --panel-strong: rgba(255,255,255,0.10);
  --border: rgba(255,255,255,0.12);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.65);

  --primary: #7c3aed;   /* purple */
  --primary-2: #5b21b6;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info:    #38bdf8;

  --radius: 16px;
  --shadow: 0 20px 60px rgba(0,0,0,0.35);
  --shadow-soft: 0 10px 30px rgba(0,0,0,0.25);
}

*{ box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1000px circle at 15% -10%, rgba(124,58,237,0.35), transparent 55%),
    radial-gradient(900px circle at 85% 0%, rgba(56,189,248,0.20), transparent 60%),
    radial-gradient(900px circle at 50% 110%, rgba(34,197,94,0.16), transparent 55%),
    var(--bg);
  line-height: 1.4;
}

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

/* Layout container */
.container{
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

/* =============== */
/* Top bar / Nav   */
/* =============== */
.topbar{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(11,16,32,0.65);
  border-bottom: 1px solid var(--border);
}

.topbar-inner{
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
}

.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand-mark{
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(124,58,237,0.9), rgba(56,189,248,0.6));
  box-shadow: var(--shadow-soft);
}

.brand-name{ font-size: 16px; }

.nav{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link{
  padding: 8px 10px;
  border-radius: 12px;
  color: var(--muted);
}
.nav-link:hover{
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.nav-divider{
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 2px;
}

.nav-user{
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
}

.avatar{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: white;
  background: rgba(124,58,237,0.7);
}

.nav-user-name{
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =============== */
/* Buttons         */
/* =============== */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.btn:hover{ transform: translateY(-1px); }

.btn-primary{
  background: linear-gradient(135deg, var(--primary), rgba(56,189,248,0.45));
  border-color: rgba(124,58,237,0.65);
  color: white;
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover{
  background: linear-gradient(135deg, var(--primary-2), rgba(56,189,248,0.55));
}

.btn-secondary{
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.10);
  color: var(--text);
}
.btn-secondary:hover{
  background: rgba(255,255,255,0.10);
}

.btn-small{
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 10px;
}

/* =============== */
/* Cards / Panels  */
/* =============== */
.card{
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
}

.card-body{
  padding: 18px;
}

.card-title{
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 10px;
}

.card-subtitle{
  color: var(--muted);
  margin: -6px 0 14px;
  font-size: 14px;
}

/* Simple grid helpers */
.grid{
  display: grid;
  gap: 14px;
}
.grid-2{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3{ grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 900px){
  .grid-2, .grid-3{ grid-template-columns: 1fr; }
}

/* =============== */
/* Forms           */
/* =============== */
form{ margin: 0; }
label{
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

input, select, textarea{
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.18);
  color: var(--text);
  outline: none;
}

input:focus, select:focus, textarea:focus{
  border-color: rgba(124,58,237,0.75);
  box-shadow: 0 0 0 4px rgba(124,58,237,0.18);
}

.form-row{ display: grid; gap: 12px; }
.form-actions{ display: flex; gap: 10px; margin-top: 14px; }
.form-actions .btn{ flex: 0 0 auto; }

/* =============== */
/* Flash messages  */
/* =============== */
.flash-wrap{
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.flash{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
}

.flash-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 5px;
  background: var(--info);
}

.flash-success{ border-color: rgba(34,197,94,0.35); }
.flash-success .flash-dot{ background: var(--success); }

.flash-warning{ border-color: rgba(245,158,11,0.35); }
.flash-warning .flash-dot{ background: var(--warning); }

.flash-danger, .flash-error{ border-color: rgba(239,68,68,0.35); }
.flash-danger .flash-dot, .flash-error .flash-dot{ background: var(--danger); }

.flash-info{ border-color: rgba(56,189,248,0.35); }
.flash-info .flash-dot{ background: var(--info); }

/* =============== */
/* Tables (if any) */
/* =============== */
table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
}
th, td{
  padding: 12px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: left;
  font-size: 14px;
}
th{ color: var(--muted); font-weight: 600; }
tr:last-child td{ border-bottom: none; }

/* =============== */
/* Footer          */
/* =============== */
.footer{
  border-top: 1px solid var(--border);
  background: rgba(11,16,32,0.55);
}
.footer-inner{
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
