/* AutoRank — Warm light theme (matches landing page) */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-primary: #FDFCFA;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-hover: #F8F7F4;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --text-primary: #0F172A;
    --text-secondary: #334155;
    --text-muted: #64748B;
    --accent: #D97706;
    --accent-hover: #B45309;
    --accent-light: #FFFBEB;
    --accent-border: #FDE68A;
    --green: #059669;
    --green-bg: #ECFDF5;
    --red: #DC2626;
    --red-bg: #FEF2F2;
    --yellow: #D97706;
    --yellow-bg: #FFFBEB;
    --radius: 10px;
    --font-serif: 'DM Serif Display', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
    --shadow-lg: 0 1px 3px rgba(0,0,0,0.04), 0 8px 32px rgba(0,0,0,0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

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

/* ── Sidebar ────────────────────────────────────── */
.sidebar {
    width: 250px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    box-shadow: 1px 0 8px rgba(0,0,0,0.02);
}
.sidebar-brand {
    padding: 22px 20px;
    border-bottom: 1px solid var(--border);
}
.sidebar-brand h2 {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.sidebar-brand h2 span {
    color: var(--accent);
}
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}
.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
}
.nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    opacity: 0.7;
}
.nav-item.active .nav-icon { opacity: 1; }
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ── Main Content ───────────────────────────────── */
.main-content {
    margin-left: 250px;
    flex: 1;
    padding: 36px;
    max-width: 1200px;
}

/* ── Page Header ────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}
.page-header h1 {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* ── Stats ──────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.15s;
}
.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.stat-number {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.1;
}
.stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Sections ───────────────────────────────────── */
.section { margin-bottom: 32px; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.section-header h2 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--text-primary);
}

/* ── Cards ──────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.site-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}
.site-card:hover {
    border-color: var(--accent-border);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    color: var(--text-primary);
}
.site-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}
.site-card .text-sm { color: var(--text-muted); }

/* ── Badges ─────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.site-badges { display: flex; gap: 8px; margin-top: 10px; }

/* ── Buttons ────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-sans);
    border: 1.5px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.btn:hover {
    background: var(--bg-hover);
    border-color: var(--text-muted);
    color: var(--text-primary);
}
.btn-primary {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--text-secondary);
    border-color: var(--text-secondary);
    color: #fff;
}
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }
.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    font-family: var(--font-sans);
}
.btn-text:hover { color: var(--text-primary); }
.btn-danger {
    background: var(--red-bg);
    border-color: var(--red);
    color: var(--red);
}
.btn-danger:hover { background: #FEE2E2; }

/* ── Forms ──────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}
input, textarea, select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    font-family: var(--font-sans);
    transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.08);
}
input::placeholder, textarea::placeholder {
    color: #94A3B8;
}
textarea { resize: vertical; min-height: 80px; }

/* ── Tables ─────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1.5px solid var(--border);
    background: var(--bg-hover);
}
td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
}
tr:hover td { background: var(--bg-hover); }

/* ── Utilities ──────────────────────────────────── */
.text-sm { font-size: 13px; }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-yellow { color: var(--yellow); }
.error-text { color: var(--red); font-size: 13px; margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ── Login / Signup ─────────────────────────────── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
}
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 44px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}
.login-card h1 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}
.login-card h1 span { color: var(--accent); }
.login-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 28px;
}
.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
}
.login-footer a {
    font-weight: 600;
}

/* ── Tabs ───────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1.5px solid var(--border);
    margin-bottom: 24px;
}
.tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}
.tab:hover { color: var(--text-primary); }
.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

/* ── Site Sub-nav ───────────────────────────────── */
.site-nav {
    display: flex;
    gap: 4px;
    background: var(--bg-hover);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
}
.site-nav a {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.15s;
}
.site-nav a:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.site-nav a.active {
    background: var(--bg-secondary);
    color: var(--accent);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* ── Empty State ────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state h3 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 400;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* ── Toast ──────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 22px;
    font-size: 14px;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s;
}
.toast-success { border-color: var(--green); }
.toast-error { border-color: var(--red); }
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
