/* ==========================================================================
   SEO Dashboard - Complete Dark Theme CSS
   Backgrounds: #0f1117, #1a1d27, #252830
   Text: #e4e6eb, #9ca3af
   Primary: #6366f1 (Indigo)
   ========================================================================== */

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

:root {
    --bg-body: #0f1117;
    --bg-surface: #1a1d27;
    --bg-elevated: #252830;
    --bg-hover: #2e313b;
    --bg-input: #1e2130;
    --border: #2e313b;
    --border-light: #383b47;
    --text-primary: #e4e6eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --primary-bg: rgba(99, 102, 241, 0.15);
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.15);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --info: #22d3ee;
    --info-bg: rgba(34, 211, 238, 0.15);
    --sidebar-width: 260px;
    --radius: 8px;
    --radius-sm: 6px;
}

html { font-size: 15px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

code {
    background: var(--bg-elevated);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.88em;
    color: var(--info);
}

img { max-width: 100%; }
hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

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

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.sidebar-header {
    padding: 1.2rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 600;
}
.sidebar-logo:hover { color: var(--text-primary); }
.sidebar-logo svg { flex-shrink: 0; color: var(--primary); }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    flex: 1;
}

.nav-section { padding: 1rem 1rem 0.3rem; }
.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}
.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}
.nav-item.active {
    color: var(--primary);
    background: var(--primary-bg);
    border-left-color: var(--primary);
}
.nav-item svg { flex-shrink: 0; opacity: 0.7; }
.nav-item.active svg { opacity: 1; }

.nav-logout-btn {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
    width: 100%;
    text-align: left;
}

.nav-site-group { }
.nav-site { padding-left: 1rem; }
.star { color: var(--warning); margin-right: 0.2rem; }
.site-url-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav-sub { padding: 0 0 0.3rem; }
.nav-sub-item {
    display: block;
    padding: 0.3rem 1rem 0.3rem 2.4rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    transition: color 0.15s;
}
.nav-sub-item:hover { color: var(--text-primary); }
.nav-sub-item.active { color: var(--primary); font-weight: 500; }

/* ---------- Main Content ---------- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 2rem;
    min-width: 0;
}

/* ---------- Mobile Header ---------- */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    align-items: center;
    padding: 0 1rem;
    gap: 0.8rem;
    z-index: 90;
}
.mobile-title { font-weight: 600; font-size: 0.95rem; }

.hamburger {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: 0.2s;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

/* ---------- Page Header ---------- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}
.page-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ---------- Grid System ---------- */
.grid {
    display: grid;
    gap: 1rem;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Cards ---------- */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.card-hover { transition: border-color 0.2s, transform 0.2s; }
.card-hover:hover { border-color: var(--border-light); transform: translateY(-2px); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.2rem;
    border-bottom: 1px solid var(--border);
}
.card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}
.card-body {
    padding: 1.2rem;
}
.card-body.no-padding { padding: 0; }
.card-footer {
    padding: 0.8rem 1.2rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---------- Stat Cards ---------- */
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
}
.stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-top: 0.2rem;
}
.stat-trend {
    font-size: 0.82rem;
    margin-top: 0.3rem;
}
.trend-up, .stat-trend.trend-up { color: var(--success); }
.trend-down, .stat-trend.trend-down { color: var(--danger); }
.trend { font-size: 0.85rem; font-weight: 500; }

.stat-inline {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.stat-inline span { font-size: 0.9rem; color: var(--text-secondary); }
.stat-inline strong { color: var(--text-primary); }

.stat-grid-mini {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.8rem;
    margin-top: 0.6rem;
}
.stat-mini-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
}
.stat-mini-value {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}
.stat-mini-change {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    margin-top: 0.1rem;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    font-size: 0.88rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.3;
    color: var(--text-primary);
    background: var(--bg-elevated);
}
.btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.82rem; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }

.btn-secondary {
    background: var(--bg-elevated);
    border-color: var(--border-light);
    color: var(--text-primary);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--text-muted); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger-ghost {
    background: transparent;
    color: var(--danger);
    border-color: transparent;
}
.btn-danger-ghost:hover { background: var(--danger-bg); color: var(--danger); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.form-control {
    width: 100%;
    padding: 0.55rem 0.8rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.form-control::placeholder { color: var(--text-muted); }

.form-control-sm { padding: 0.35rem 0.6rem; font-size: 0.82rem; }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    padding-right: 2rem;
}

textarea.form-control { resize: vertical; min-height: 60px; }

input[type="date"].form-control { color-scheme: dark; }

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.form-row .form-group { flex: 1; min-width: 0; }
.form-row .flex-1 { flex: 1; }
.form-row .flex-2 { flex: 2; }

.form-hint {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.form-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.checkbox-label input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.input-row {
    display: flex;
    gap: 0.5rem;
}
.input-row input { flex: 1; min-width: 0; }

/* ---------- Filter Forms ---------- */
.filters-bar {
    margin-bottom: 1.2rem;
}
.filter-form {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}
.filter-form-inline {
    display: flex;
    align-items: flex-end;
    gap: 0.8rem;
    flex-wrap: wrap;
}
.filter-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.8rem;
    align-items: end;
}
.filter-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}
.filter-group input,
.filter-group select {
    width: 100%;
    padding: 0.45rem 0.7rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
}
.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
}
.filter-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 1.8rem;
}

.filter-input {
    width: 200px;
    padding: 0.45rem 0.7rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
}
.filter-input:focus { outline: none; border-color: var(--primary); }
.filter-select {
    padding: 0.45rem 0.7rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    appearance: none;
}
.filter-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
}
.filter-checkbox input { accent-color: var(--primary); }

.filter-actions {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding-bottom: 0;
}

/* ---------- Date Range Picker ---------- */
.date-range-picker {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.custom-range-toggle { position: relative; }
.custom-range-form {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.3rem;
    z-index: 20;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
.custom-range-form input[type="date"] {
    padding: 0.35rem 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.82rem;
    color-scheme: dark;
}
.custom-range-form span { color: var(--text-muted); font-size: 0.82rem; }

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.data-table thead th {
    padding: 0.7rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table tbody td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-hover); }

.data-table.compact thead th { padding: 0.5rem 0.8rem; }
.data-table.compact tbody td { padding: 0.45rem 0.8rem; font-size: 0.85rem; }

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-nowrap { white-space: nowrap; }

.sort-link {
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
}
.sort-link:hover { color: var(--text-primary); }

.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--text-primary); }

.truncate {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Expandable rows (cannibalization) */
.expandable-row { cursor: pointer; }
.expandable-row:hover { background: var(--bg-hover); }
.expand-icon {
    display: inline-block;
    margin-right: 0.4rem;
    font-size: 0.7rem;
    transition: transform 0.15s;
    color: var(--text-muted);
}
.detail-row td { padding: 0 !important; background: var(--bg-body); }
.nested-table { margin: 0; }
.nested-table thead th { background: rgba(37, 40, 48, 0.6); font-size: 0.72rem; }
.nested-table tbody td { font-size: 0.82rem; }

/* Clickable row (dashboard) */
.clickable-row { cursor: pointer; }
.clickable-row:hover { background: var(--bg-hover); }

.property-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Row states */
.row-expired { opacity: 0.5; }

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 1.2rem;
}
.pagination-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 0.15em 0.55em;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 99px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: nowrap;
}
.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }

/* Position badges (striking distance) */
.position-badge {
    display: inline-block;
    padding: 0.15em 0.5em;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 4px;
}
.position-good { background: var(--success-bg); color: var(--success); }
.position-ok { background: var(--warning-bg); color: var(--warning); }
.position-poor { background: var(--danger-bg); color: var(--danger); }

/* ---------- Alerts ---------- */
.alert {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    border: 1px solid;
}
.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: rgba(34, 197, 94, 0.3);
}
.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

/* ---------- Toasts ---------- */
.toast {
    position: fixed;
    top: 1.2rem;
    right: 1.5rem;
    padding: 0.8rem 1.2rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 200;
    animation: slideIn 0.3s ease;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    max-width: 400px;
}
.toast-success {
    background: #166534;
    color: #bbf7d0;
    border: 1px solid rgba(34, 197, 94, 0.4);
}
.toast-error {
    background: #7f1d1d;
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, 0.4);
}
.toast.fade-out { animation: fadeOut 0.3s ease forwards; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}
.empty-state svg { margin-bottom: 1rem; opacity: 0.4; }
.empty-state h2 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}
.empty-state p {
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
}

/* ---------- Text Utilities ---------- */
.text-muted { color: var(--text-muted); }
.text-small { font-size: 0.82rem; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }

/* ---------- Chart ---------- */
.chart-container {
    position: relative;
    width: 100%;
    height: 320px;
}

/* ---------- Share URL ---------- */
.share-url-group {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}
.share-url-input {
    flex: 1;
    min-width: 180px;
}

/* ---------- Page Link (striking) ---------- */
.page-link-small {
    color: var(--text-secondary);
    font-size: 0.8rem;
    display: inline-block;
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.page-link-small:hover { color: var(--primary); }

/* ---------- Info Rows (settings) ---------- */
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}
.info-value {
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* ---------- Hidden Utility ---------- */
.hidden { display: none !important; }

/* ---------- Auth Pages ---------- */
.auth-wrapper,
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: var(--bg-body);
}
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    width: 100%;
}
.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 420px;
    padding: 2rem;
}
.auth-logo {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary);
}
.auth-logo svg { margin-bottom: 0.5rem; }
.auth-logo h1 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin: 0;
}
.auth-card h2 {
    font-size: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 1.5rem;
}
.auth-card .auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}
.auth-form .form-group { margin-bottom: 1rem; }
.auth-form label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}
.auth-form input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
}
.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}
.btn-block { width: 100%; }
.auth-card .btn { margin-top: 0.5rem; }
.auth-footer {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.auth-footer a { color: var(--primary); }

/* ---------- Public View ---------- */
.public-view {
    background: var(--bg-body);
}
.public-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}
.public-header {
    text-align: center;
    margin-bottom: 2rem;
}
.public-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 0.5rem;
}
.public-logo {
    max-height: 48px;
    margin-bottom: 0.5rem;
}
.public-footer {
    text-align: center;
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

/* ---------- Profile Page ---------- */
.profile-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.danger-zone {
    border-color: rgba(239, 68, 68, 0.3);
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }

    .mobile-header { display: flex; }
    .main-content { margin-left: 0; padding: 1rem; padding-top: calc(52px + 1rem); }

    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .page-actions { width: 100%; }

    .stat-value { font-size: 1.4rem; }

    .form-row { flex-direction: column; gap: 0; }
    .filter-form-inline { flex-direction: column; align-items: stretch; }
    .filter-form-grid { grid-template-columns: 1fr 1fr; }
    .filter-form { flex-direction: column; align-items: stretch; }

    .date-range-picker { flex-wrap: wrap; }

    .truncate { max-width: 180px; }

    .toast { right: 0.5rem; left: 0.5rem; max-width: none; }

    .chart-container { height: 240px; }
}

@media (max-width: 480px) {
    .grid-4 { grid-template-columns: 1fr; }
    .filter-form-grid { grid-template-columns: 1fr; }
    .stat-inline { flex-direction: column; gap: 0.3rem; }
}
