/* PurpleRocket Dashboard — Stylesheet */

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

:root {
  --pr-900: #1E1B4B;
  --pr-800: #312E81;
  --pr-700: #3730A3;
  --pr-600: #4F46E5;
  --pr-500: #6366F1;
  --pr-200: #C7D2FE;
  --pr-100: #E0E7FF;
  --pr-50:  #EEF2FF;

  --cs-color: #B45309;   /* Curesmith amber */
  --atl-color: #0369A1;  /* ATL blue        */

  --gray-900: #111827;
  --gray-700: #374151;
  --gray-500: #6B7280;
  --gray-400: #9CA3AF;
  --gray-200: #E5E7EB;
  --gray-100: #F3F4F6;
  --gray-50:  #F9FAFB;
  --white:    #FFFFFF;

  --green:  #059669;
  --red:    #DC2626;

  --sidebar: 240px;
  --header:  56px;

  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
}

html, body { height: 100%; }
body { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 15px; color: var(--gray-900); }
a { text-decoration: none; }

/* ── Login Page ───────────────────────────────────────────────────────────── */
.login-body {
  background: var(--pr-900);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.login-wrap { width: 100%; max-width: 380px; }

.login-card {
  background: var(--white);
  border-radius: 12px;
  padding: 2.5rem 2rem;
}

.login-logo { text-align: center; margin-bottom: 2rem; }

.login-logo-mark {
  width: 52px; height: 52px;
  background: var(--pr-600);
  color: var(--white);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.login-title { font-size: 1.25rem; font-weight: 700; color: var(--gray-900); }
.login-sub   { font-size: 0.8rem; color: var(--gray-500); margin-top: 0.2rem; }

.login-error {
  background: #FEF2F2; color: var(--red);
  border: 1px solid #FECACA;
  border-radius: var(--radius);
  padding: 0.6rem 0.875rem;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

.login-form .form-group { margin-bottom: 1rem; }

.login-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.3rem;
}

.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--gray-900);
  background: var(--white);
  outline: none;
  transition: border-color 0.12s;
}

.login-form input:focus { border-color: var(--pr-500); }

.login-btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.65rem;
  background: var(--pr-600);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s;
}

.login-btn:hover { background: var(--pr-700); }

/* ── Dashboard Layout ─────────────────────────────────────────────────────── */
.dash-body { background: var(--gray-100); }

.dash-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar);
  background: var(--pr-900);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.22s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 1.1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-logo {
  width: 32px; height: 32px;
  background: var(--pr-600);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.sidebar-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
  flex: 1;
}

.sidebar-close { display: none; cursor: pointer; color: rgba(255,255,255,0.5); font-size: 1rem; }

.sidebar-nav { flex: 1; padding: 0.75rem 0; }

.nav-section {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.35);
  padding: 1rem 1rem 0.35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  transition: color 0.12s, background 0.12s;
  border-right: 3px solid transparent;
}

.nav-item:hover { color: var(--white); background: rgba(255,255,255,0.07); }

.nav-item.active {
  color: var(--white);
  background: rgba(255,255,255,0.1);
  border-right-color: var(--pr-500);
}

.nav-item.soon { opacity: 0.55; pointer-events: none; }
.nav-item.soon::after {
  content: 'soon';
  margin-left: auto;
  font-size: 0.6rem;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.45);
  padding: 1px 5px;
  border-radius: 3px;
}

.nav-icon { font-size: 1rem; width: 16px; text-align: center; }

.sidebar-footer {
  padding: 0.875rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.sidebar-user { font-size: 0.8rem; color: rgba(255,255,255,0.5); }

.sidebar-logout {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  transition: color 0.12s;
}

.sidebar-logout:hover { color: rgba(255,255,255,0.8); }

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

.dash-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  height: var(--header);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left { display: flex; align-items: center; gap: 0.75rem; }

.hamburger {
  display: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--gray-500);
  line-height: 1;
}

.header-title { font-size: 0.95rem; font-weight: 600; color: var(--gray-900); }
.header-date  { font-size: 0.8rem; color: var(--gray-500); }

.dash-content { padding: 1.5rem; flex: 1; }

/* ── Shared button components ─────────────────────────────────────────────── */
.btn-generate         { background: var(--pr-600); color: var(--white); border: none; padding: 0.6rem 1.25rem; border-radius: var(--radius); font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: background .12s; font-family: inherit; }
.btn-generate:hover   { background: var(--pr-700); }
.btn-generate:disabled { opacity: .5; cursor: not-allowed; }
.btn-regen            { background: transparent; color: var(--gray-500); border: 1px solid var(--gray-300); padding: 0.5rem 1rem; border-radius: var(--radius); font-size: 0.8rem; cursor: pointer; transition: all .12s; font-family: inherit; }
.btn-regen:hover      { color: var(--gray-800); border-color: var(--gray-500); }
.btn-regen:disabled   { opacity: .5; cursor: not-allowed; }

/* ── Home page ────────────────────────────────────────────────────────────── */
.home-greeting {
  font-size: 1rem;
  color: var(--gray-700);
  margin-bottom: 1.5rem;
}

.brand-block { margin-bottom: 1.5rem; }

.brand-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}

.curesmith-label { color: var(--cs-color); }
.atl-label       { color: var(--atl-color); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem 1.125rem;
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-500);
  margin-bottom: 0.35rem;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1;
}

.stat-sub {
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 0.3rem;
}

.db-error {
  background: #FEF2F2;
  color: var(--red);
  border: 1px solid #FECACA;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
}

.coming-soon-note {
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-top: 2rem;
}

/* ── Mobile sidebar toggle ────────────────────────────────────────────────── */
.sidebar-toggle-input { display: none; }

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar)));
  }

  .sidebar-toggle-input:checked ~ .dash-layout .sidebar {
    transform: translateX(0);
  }

  .dash-main { margin-left: 0; }
  .hamburger { display: block; }
  .sidebar-close { display: block; }

  .stat-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .dash-content { padding: 1rem; }
}
