/* =============================================================================
   AIME Design System
   Clean B2B SaaS aesthetic — navy/indigo primary, slate neutrals
   ============================================================================= */

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --navy:          #0F172A;
  --navy-80:       #1E293B;
  --indigo:        #4F46E5;
  --indigo-hover:  #4338CA;
  --indigo-light:  #EEF2FF;
  --amber:         #F59E0B;
  --emerald:       #10B981;
  --emerald-light: #ECFDF5;
  --red:           #EF4444;
  --red-light:     #FEF2F2;
  --yellow-light:  #FFFBEB;

  --bg:            #F1F5F9;
  --card:          #FFFFFF;
  --sidebar-bg:    #0F172A;
  --sidebar-text:  #CBD5E1;
  --sidebar-active:#FFFFFF;
  --sidebar-hover: #1E293B;

  --text:          #0F172A;
  --text-secondary:#475569;
  --text-muted:    #94A3B8;
  --border:        #E2E8F0;
  --border-focus:  #4F46E5;
  --placeholder:   #94A3B8;

  --radius-sm:     4px;
  --radius:        8px;
  --radius-lg:     12px;
  --shadow-sm:     0 1px 2px rgba(0,0,0,.06);
  --shadow:        0 1px 4px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg:     0 10px 30px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.06);

  --sidebar-w:     240px;
  --topbar-h:      56px;
}

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

html { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Typography ────────────────────────────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 600; line-height: 1.25; color: var(--text); }
h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }

p { color: var(--text-secondary); }

/* ── Auth layout ───────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.auth-header {
  background: var(--navy);
  padding: 28px 32px 24px;
}

.auth-logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
}

.auth-logo span {
  color: var(--amber);
}

.auth-tagline {
  font-size: 12px;
  color: var(--sidebar-text);
  margin-top: 4px;
  letter-spacing: 0.02em;
}

.auth-body {
  padding: 32px;
}

.auth-body h2 {
  font-size: 18px;
  margin-bottom: 6px;
}

.auth-body .auth-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 24px;
}

.auth-footer {
  padding: 16px 32px;
  border-top: 1px solid var(--border);
  background: #FAFAFA;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ── Info pages (verify / pending / checkout) ──────────────────────────────── */
.info-card {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  text-align: center;
}

.info-header {
  background: var(--navy);
  padding: 24px 32px;
}

.info-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.info-body {
  padding: 36px 40px;
}

.info-body h2 {
  margin-bottom: 12px;
}

.info-body p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.info-body .sub-note {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

.form-control::placeholder { color: var(--placeholder); }

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.form-control.error {
  border-color: var(--red);
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}

.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--indigo);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-group label {
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .15s, box-shadow .15s, opacity .15s;
  white-space: nowrap;
}

.btn:disabled, .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--indigo);
  color: #fff;
  box-shadow: 0 1px 2px rgba(79,70,229,.3);
}

.btn-primary:hover { background: var(--indigo-hover); text-decoration: none; }

.btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--bg); text-decoration: none; }

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-danger:hover { background: #DC2626; text-decoration: none; }

.btn-success {
  background: var(--emerald);
  color: #fff;
}

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-full { width: 100%; }

/* ── Alerts ────────────────────────────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 18px;
  line-height: 1.5;
}

.alert-error   { background: var(--red-light);    color: #B91C1C;  border: 1px solid #FECACA; }
.alert-success { background: var(--emerald-light); color: #047857; border: 1px solid #A7F3D0; }
.alert-info    { background: var(--indigo-light);  color: #3730A3; border: 1px solid #C7D2FE; }
.alert-warning { background: var(--yellow-light);  color: #92400E; border: 1px solid #FDE68A; }

/* ── Dashboard layout ──────────────────────────────────────────────────────── */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.sidebar-logo span { color: var(--amber); }

.sidebar-version {
  font-size: 11px;
  color: #475569;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.nav-section {
  padding: 0 12px;
  margin-bottom: 24px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
  padding: 0 8px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 450;
  text-decoration: none;
  transition: background .12s, color .12s;
  margin-bottom: 2px;
}

.nav-item:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--indigo); color: #fff; }

.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 500; color: #E2E8F0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: #64748B; }

.sidebar-logout {
  display: block;
  margin-top: 8px;
  padding: 6px 8px;
  font-size: 12px;
  color: #64748B;
  border-radius: var(--radius-sm);
  text-align: center;
  transition: color .12s, background .12s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
}

.sidebar-logout:hover { color: var(--red); background: rgba(239,68,68,.08); }

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

.topbar {
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.topbar-spacer { flex: 1; }

.topbar-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-active  { background: var(--emerald-light); color: #065F46; }
.badge-trial   { background: var(--yellow-light);  color: #92400E; }
.badge-past-due{ background: var(--red-light);     color: #B91C1C; }

.page-content {
  padding: 28px;
  flex: 1;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title { font-size: 14px; font-weight: 600; }
.card-body  { padding: 24px; }

/* ── Stat grid ─────────────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}

.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-sub   { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Tables ────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #FAFBFC; }

/* ── Status badges ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.badge-green  { background: var(--emerald-light); color: #065F46; }
.badge-red    { background: var(--red-light);     color: #B91C1C; }
.badge-yellow { background: var(--yellow-light);  color: #92400E; }
.badge-blue   { background: var(--indigo-light);  color: #3730A3; }
.badge-gray   { background: #F1F5F9;              color: #64748B; }

/* ── Utilities ─────────────────────────────────────────────────────────────── */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.text-muted   { color: var(--text-muted); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-sm      { font-size: 12px; }
.text-bold    { font-weight: 600; }
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.gap-2        { gap: 8px; }
.gap-3        { gap: 12px; }
.w-full       { width: 100%; }
.divider      { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
