/* ============================================================
   hub.fahadayubseo.com — main.css
   Theme: Deep space dark, gold accent, Space Grotesk display
   ============================================================ */

/* ── Reset & tokens ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Core palette */
  --bg-0:        #09090b;   /* deepest background */
  --bg-1:        #111113;   /* sidebar / card base */
  --bg-2:        #18181b;   /* card surface */
  --bg-3:        #222226;   /* input / hover */
  --bg-4:        #2d2d32;   /* borders */

  /* Gold accent */
  --gold:        #c9a84c;
  --gold-light:  #e2c27a;
  --gold-dim:    #7a601e;
  --gold-glow:   rgba(201,168,76,0.12);

  /* Text */
  --text-0:      #f4f4f5;   /* primary */
  --text-1:      #a1a1aa;   /* secondary */
  --text-2:      #52525b;   /* muted */

  /* Status */
  --green:       #34d399;
  --green-dim:   rgba(52,211,153,0.12);
  --red:         #f87171;
  --red-dim:     rgba(248,113,113,0.12);
  --amber:       #fbbf24;
  --amber-dim:   rgba(251,191,36,0.12);
  --blue:        #60a5fa;
  --blue-dim:    rgba(96,165,250,0.12);
  --purple:      #a78bfa;
  --purple-dim:  rgba(167,139,250,0.12);

  /* Type */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;

  /* Layout */
  --sidebar-w:    240px;
  --topbar-h:     60px;
  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    16px;
  --radius-xl:    24px;

  /* Transitions */
  --ease:         cubic-bezier(0.16, 1, 0.3, 1);
}

html { font-size: 15px; }
body {
  font-family: var(--font-body);
  background: var(--bg-0);
  color: var(--text-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── App shell ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-1);
  border-right: 1px solid var(--bg-4);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s var(--ease);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--bg-4);
}

.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--bg-0);
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; gap: 1px; }
.brand-name  { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--text-0); }
.brand-sub   { font-size: 11px; color: var(--text-2); letter-spacing: 0.04em; }

.sidebar-nav {
  flex: 1;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-1);
  font-size: 13.5px;
  font-weight: 400;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.nav-item:hover { background: var(--bg-3); color: var(--text-0); }
.nav-item.active {
  background: var(--gold-glow);
  color: var(--gold-light);
  font-weight: 500;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--gold);
  border-radius: 0 2px 2px 0;
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--bg-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-role-badge {
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-3);
  color: var(--text-1);
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid var(--bg-4);
}
.sidebar-logout {
  font-size: 12px;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.15s;
}
.sidebar-logout:hover { color: var(--red); }

/* ── Main area ── */
.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-1);
  border-bottom: 1px solid var(--bg-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left  { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 20px; }

.sidebar-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.sidebar-toggle span { display: block; width: 20px; height: 2px; background: var(--text-1); border-radius: 2px; }

.page-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.01em;
}

.topbar-clock {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
}
.user-avatar   { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.user-initials {
  width: 30px; height: 30px;
  background: var(--gold-dim);
  color: var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--gold-dim);
}
.user-name { font-size: 13px; color: var(--text-1); }
.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--bg-2);
  border: 1px solid var(--bg-4);
  border-radius: var(--radius-md);
  min-width: 140px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.user-pill:hover .user-dropdown { display: block; }
.user-dropdown a {
  display: block;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-1);
  text-decoration: none;
  transition: background 0.1s;
}
.user-dropdown a:hover { background: var(--bg-3); color: var(--text-0); }

/* ── Page content ── */
.page-content {
  flex: 1;
  padding: 28px 28px 48px;
}

/* ── Cards ── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--bg-4);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 16px;
}

/* ── Stat tiles ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-tile {
  background: var(--bg-2);
  border: 1px solid var(--bg-4);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s;
}
.stat-tile:hover { border-color: var(--bg-4); }
.stat-tile.gold  { border-color: var(--gold-dim); background: var(--gold-glow); }
.stat-label { font-size: 11px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--text-0); line-height: 1; }
.stat-sub   { font-size: 12px; color: var(--text-2); }
.stat-tile.gold .stat-value { color: var(--gold); }

/* ── Badges & pills ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
}
.badge-green  { background: var(--green-dim);  color: var(--green); }
.badge-red    { background: var(--red-dim);    color: var(--red); }
.badge-amber  { background: var(--amber-dim);  color: var(--amber); }
.badge-blue   { background: var(--blue-dim);   color: var(--blue); }
.badge-purple { background: var(--purple-dim); color: var(--purple); }
.badge-gold   { background: var(--gold-glow);  color: var(--gold); }
.badge-gray   { background: var(--bg-3);       color: var(--text-1); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--bg-4);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--bg-4);
  color: var(--text-1);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-3); }
.data-table td.number { font-variant-numeric: tabular-nums; text-align: right; }
.data-table td.bold   { color: var(--text-0); font-weight: 500; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s;
  font-family: var(--font-body);
}
.btn-gold    { background: var(--gold); color: var(--bg-0); }
.btn-gold:hover { background: var(--gold-light); }
.btn-ghost   { background: var(--bg-3); color: var(--text-1); border: 1px solid var(--bg-4); }
.btn-ghost:hover { color: var(--text-0); border-color: var(--text-2); }
.btn-danger  { background: var(--red-dim); color: var(--red); border: 1px solid transparent; }
.btn-danger:hover { border-color: var(--red); }
.btn-sm { padding: 5px 11px; font-size: 12px; }

/* ── Forms ── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-label { font-size: 12px; font-weight: 500; color: var(--text-1); }
.form-input, .form-select, .form-textarea {
  background: var(--bg-3);
  border: 1px solid var(--bg-4);
  border-radius: var(--radius-sm);
  color: var(--text-0);
  font-family: var(--font-body);
  font-size: 13.5px;
  padding: 9px 12px;
  transition: border-color 0.15s;
  width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-select option { background: var(--bg-2); }

/* ── Section header ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.02em;
}
.section-sub { font-size: 13px; color: var(--text-2); margin-top: 3px; }

/* ── Grid layouts ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.col-span-2 { grid-column: span 2; }

/* ── Progress bar ── */
.progress-bar {
  height: 5px;
  background: var(--bg-4);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  transition: width 0.4s var(--ease);
}
.progress-fill.green { background: var(--green); }
.progress-fill.blue  { background: var(--blue); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-2);
}
.empty-icon { font-size: 36px; margin-bottom: 12px; opacity: 0.4; }
.empty-text { font-size: 14px; }

/* ── Utilities ── */
.text-gold   { color: var(--gold); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-muted  { color: var(--text-2); font-size: 12px; }
.text-mono   { font-variant-numeric: tabular-nums; }
.mt-0  { margin-top: 0; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex  { display: flex; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Login page ── */
.login-page {
  min-height: 100vh;
  background: var(--bg-0);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-1);
  border: 1px solid var(--bg-4);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
}
.login-logo {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  color: var(--bg-0);
  margin-bottom: 24px;
}
.login-heading {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-0);
  margin-bottom: 4px;
}
.login-sub { font-size: 13px; color: var(--text-2); margin-bottom: 28px; }
.login-error {
  background: var(--red-dim);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .col-span-2 { grid-column: span 1; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: 16px; }
}
