/* CreatADV Tools - Dashboard Styles */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a2035;
    --bg-card-hover: #1e2642;
    --border: #2a3350;
    --text-primary: #e8eaf0;
    --text-secondary: #8892a8;
    --text-muted: #5a6478;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

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

/* ========= SIDEBAR ========= */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 24px 16px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
}

.sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.sidebar-logo h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-logo span {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
}

.sidebar-nav { flex: 1; }

.nav-section {
    margin-bottom: 14px;
}

.nav-section-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 1px;
}

.nav-link:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--accent-glow);
    color: var(--accent-hover);
}

.nav-link .icon { font-size: 18px; width: 24px; text-align: center; }

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
}

.user-info .name { font-size: 13px; font-weight: 600; }
.user-info .role { font-size: 11px; color: var(--text-muted); }

/* ========= MAIN CONTENT ========= */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ========= CARDS ========= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
}

/* ========= STATS GRID ========= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
}

.stat-card .stat-change {
    font-size: 12px;
    margin-top: 4px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ========= SCORE DISPLAY ========= */
.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 700;
    margin: 0 auto 16px;
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    padding: 4px;
    background: conic-gradient(var(--score-color) calc(var(--score) * 3.6deg), var(--border) 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.score-poor { --score-color: var(--danger); color: var(--danger); }
.score-fair { --score-color: var(--warning); color: var(--warning); }
.score-good { --score-color: var(--success); color: var(--success); }

/* ========= FORMS ========= */
.form-group {
    margin-bottom: 16px;
}

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

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

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

select.form-control {
    cursor: pointer;
}
select option {
    background: #1a2332;
    color: #ccc;
}
select option:checked {
    background: #2563eb;
    color: #fff;
}
select option:disabled {
    color: #666;
}

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

/* ========= URL INPUT ========= */
.url-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.url-input-group .form-control {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    padding: 14px 18px;
}

/* ========= BUTTONS ========= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 16px var(--accent-glow);
}

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

.btn-secondary:hover {
    border-color: var(--accent);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

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

/* ========= TABLES ========= */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(42, 51, 80, 0.5);
}

table tr:hover td {
    background: rgba(99, 102, 241, 0.03);
}

/* ========= BADGES ========= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }

/* ========= ISSUE LIST ========= */
.issue-list { list-style: none; }

.issue-item {
    display: flex;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.issue-item:hover {
    border-color: var(--accent);
}

.issue-item .issue-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.issue-critical .issue-icon { background: var(--danger-bg); color: var(--danger); }
.issue-warning .issue-icon { background: var(--warning-bg); color: var(--warning); }
.issue-passed .issue-icon { background: var(--success-bg); color: var(--success); }

.issue-item .issue-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.issue-item .issue-fix { font-size: 13px; color: var(--text-secondary); }
.issue-item code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent-hover);
}

/* ========= COPY BUTTON ========= */
.copy-block {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin: 12px 0;
}

.copy-block pre {
    padding: 16px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-primary);
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.copy-block:hover .copy-btn { opacity: 1; }
.copy-btn.copied { background: var(--success); }

/* ========= LOADING ========= */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 26, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}

.loading-overlay.active { display: flex; }

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ========= TABS ========= */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px 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.2s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
}

.tab:hover { color: var(--text-primary); }
.tab.active {
    color: var(--accent-hover);
    border-bottom-color: var(--accent);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ========= LOGIN PAGE ========= */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow);
}

.login-card h1 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 8px;
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 32px;
}

.login-card .btn {
    width: 100%;
    justify-content: center;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* ========= LANGUAGE TOGGLE ========= */
.lang-toggle {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.lang-toggle:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ========= HAMBURGER BUTTON (mobile only) ========= */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
}
.hamburger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ========= MOBILE SIDEBAR BACKDROP ========= */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sidebar-backdrop.open {
    display: block;
    opacity: 1;
}

/* ========= RESPONSIVE ========= */
@media (max-width: 768px) {
    /* Admin sidebar: slide-in overlay */
    #admin-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        width: 260px;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    #admin-sidebar.open { left: 0; }

    /* Client sidebar: slide-in overlay */
    #client-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        width: 260px;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    #client-sidebar.open { left: 0; }

    .hamburger-btn { display: flex; }
    .main-content { margin-left: 0; padding: 16px; padding-top: 60px; }
    .url-input-group { flex-direction: column; }
    .stats-grid { grid-template-columns: 1fr; }

    /* Responsive tables */
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 500px; }

    /* Cards grid */
    .page-header h2 { font-size: 18px; }
}

/* ========= DOWNLOAD BUTTONS ========= */
.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.download-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-card:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.download-card .file-icon { font-size: 32px; margin-bottom: 8px; }
.download-card .file-name { font-size: 13px; font-weight: 600; }
.download-card .file-desc { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ========= PROGRESS BAR ========= */
.progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-fill.poor { background: var(--danger); }
.progress-fill.fair { background: var(--warning); }
.progress-fill.good { background: var(--success); }

/* ========= GRID LAYOUTS ========= */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

@media (max-width: 768px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ========= PHASE 8: CLIENT DASHBOARD ========= */

/* Locked feature card */
.feature-locked-card {
    padding: 48px 24px;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: var(--card-bg);
}
.feature-locked-card .lock-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.6;
}
.feature-locked-card .lock-text {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    max-width: 320px;
    margin: 0 auto;
    line-height: 1.5;
}
.feature-locked-card .lock-cta {
    margin-top: 12px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
}
.feature-locked-card-sm {
    padding: 20px;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: var(--card-bg);
}
.feature-locked-card-sm .lock-icon {
    font-size: 20px;
    margin-bottom: 4px;
    opacity: 0.5;
}
.feature-locked-card-sm .lock-text {
    color: var(--text-muted);
    font-size: 12px;
}

/* Locked nav items */
.nav-locked {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}
.nav-locked:hover {
    background: transparent !important;
}

/* Subscription expired banner */
.subscription-banner {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.subscription-banner .banner-icon { font-size: 24px; }
.subscription-banner .banner-text { font-size: 14px; color: #f59e0b; }
.subscription-banner .banner-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Hosting required message */
.hosting-required {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.hosting-required .hr-icon { font-size: 48px; margin-bottom: 16px; }
.hosting-required .hr-title { font-size: 16px; color: var(--text-secondary); margin-bottom: 8px; }
.hosting-required .hr-text { font-size: 13px; max-width: 400px; margin: 0 auto; line-height: 1.6; }

/* Visibility toggle (admin) */
.btn-vis-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.btn-vis-toggle:hover { border-color: var(--accent); }
.btn-vis-toggle.is-visible { border-color: var(--success); background: rgba(34, 197, 94, 0.1); }

/* Plan badge */
.plan-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: white;
}
.plan-badge-basic { background: #3b82f6; }
.plan-badge-seo { background: #22c55e; }
.plan-badge-ai { background: #8b5cf6; }
.plan-badge-full { background: #f59e0b; }
.plan-badge-none { background: #6b7280; }

/* ========= ALT TEXT VERIFICATION ========= */
.alt-section { margin-bottom: 16px; border-radius: var(--radius-sm); overflow: hidden; }
.alt-category-red { border-left: 3px solid var(--danger); }
.alt-category-yellow { border-left: 3px solid var(--warning); }
.alt-category-orange { border-left: 3px solid #f97316; }
.alt-header {
    padding: 10px 14px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: var(--bg-secondary);
    user-select: none;
}
.alt-category-red .alt-header { color: var(--danger); }
.alt-category-yellow .alt-header { color: var(--warning); }
.alt-category-orange .alt-header { color: #f97316; }
.alt-header .alt-count {
    background: var(--bg-tertiary);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
}
.alt-image-list { list-style: none; padding: 0; margin: 0; }
.alt-image-list li {
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.alt-image-list li:last-child { border-bottom: none; }
.alt-src {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    word-break: break-all;
}
.alt-db-value {
    color: var(--warning);
    font-size: 12px;
    margin-top: 4px;
}
.alt-reason {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}
.alt-builder-notice {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}
.alt-managed-notice {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--success);
}
@media print {
    .alt-category-red { border-left-color: #dc2626 !important; }
    .alt-category-yellow { border-left-color: #d97706 !important; }
    .alt-category-orange { border-left-color: #ea580c !important; }
}

/* Legal pages (privacy, terms) */
.legal-page { background: var(--bg-primary); min-height: 100vh; }
.legal-container { max-width: 800px; margin: 0 auto; padding: 40px 24px; }
.legal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; padding-bottom: 20px; border-bottom: 2px solid var(--accent); }
.legal-logo { height: 40px; border-radius: 8px; }
.legal-header .lang-toggle a { color: var(--text-muted); text-decoration: none; padding: 4px 8px; border-radius: 4px; font-size: 14px; font-weight: 600; }
.legal-header .lang-toggle a.active { color: var(--accent); background: rgba(139,92,246,0.1); }
.legal-container h1 { font-size: 28px; margin-bottom: 8px; color: var(--text-primary); }
.legal-container .legal-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 32px; }
.legal-container h2 { font-size: 18px; margin-top: 32px; margin-bottom: 12px; color: var(--accent); }
.legal-container h3 { font-size: 15px; margin-top: 20px; margin-bottom: 8px; color: var(--text-primary); }
.legal-container p, .legal-container li { font-size: 14px; line-height: 1.7; color: var(--text-secondary); }
.legal-container ul { padding-left: 20px; }
.legal-container li { margin-bottom: 4px; }
.legal-container a { color: var(--accent); }
.legal-footer { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); text-align: center; font-size: 13px; color: var(--text-muted); }

/* Login footer */
.login-footer { text-align: center; padding: 20px; margin-top: 40px; font-size: 13px; color: #888; }
.login-footer a { color: #8b5cf6; text-decoration: none; }
.login-footer a:hover { text-decoration: underline; }
.login-footer .footer-brand { margin-bottom: 8px; font-size: 14px; }
.login-footer .footer-links { margin-bottom: 8px; }
.login-footer .footer-info { font-size: 12px; color: #666; }

/* ═══ Data Tables ═══ */
.data-table { border-collapse: collapse; }
.data-table th, .data-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { font-weight: 600; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.data-table tbody tr:hover { background: var(--bg-primary); }

/* ═══ Badge variants ═══ */
.badge-secondary { background: var(--bg-primary); color: var(--text-secondary); border: 1px solid var(--border); }

/* ═══ GBP Reviews ═══ */
.gbp-tone-select { cursor: pointer; }
.gbp-subtab { min-height: 100px; }

/* ═══ Pagination ═══ */
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ═══ Vertical Settings ═══ */
#vertical-settings .form-group { margin-bottom: 8px; }
#dept-table th { font-size: 11px; }
#dept-table td { padding: 4px 6px; }
#dept-table input { box-sizing: border-box; }

/* ═══ Tab overflow scroll on mobile ═══ */
@media (max-width: 768px) {
    .tabs { overflow-x: auto; flex-wrap: nowrap !important; -webkit-overflow-scrolling: touch; }
    .tabs .tab-btn { white-space: nowrap; font-size: 12px !important; padding: 10px 12px !important; }
}

/* ═══ Mega Tab Navigation (hat-client.php) ═══ */
.mega-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 100;
    flex-wrap: wrap;
}

.mega-tab-item {
    position: relative;
}

.mega-tab-btn {
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-family: inherit;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s, border-color 0.15s;
}

.mega-tab-btn:hover {
    color: var(--text-primary);
}

.mega-tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.mega-tab-btn .dropdown-arrow {
    font-size: 8px;
    margin-left: 2px;
    transition: transform 0.2s;
}

.mega-tab-item.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown menu */
.mega-tab-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 200;
    padding: 4px 0;
    margin-top: 2px;
}

.mega-tab-item.open .mega-tab-dropdown {
    display: block;
}

.mega-tab-dropdown a {
    display: block;
    padding: 8px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.1s, color 0.1s;
}

.mega-tab-dropdown a:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.mega-tab-dropdown a.active {
    color: var(--accent);
    background: var(--accent-glow);
}

/* Alert badge */
.mega-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    margin-left: 4px;
}

.mega-tab-badge.badge-red {
    background: #ef4444;
    color: white;
}

.mega-tab-badge.badge-gray {
    background: var(--bg-secondary);
    color: var(--text-muted);
}

/* AJAX loaded content container */
.mega-tab-ajax-content {
    min-height: 200px;
}

.mega-tab-ajax-content.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ═══ Mega Tabs — Mobile ═══ */
@media (max-width: 768px) {
    .mega-tabs {
        flex-direction: column;
        overflow-x: visible;
        gap: 0;
        border-bottom: none;
    }

    .mega-tab-btn {
        width: 100%;
        justify-content: space-between;
        padding: 14px 16px;
        border-bottom: 1px solid var(--border);
        border-bottom-width: 1px;
        font-size: 14px;
    }

    .mega-tab-btn.active {
        border-bottom-color: var(--border);
    }

    .mega-tab-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        margin-top: 0;
        padding: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
    }

    .mega-tab-dropdown a {
        padding: 12px 32px;
        font-size: 14px;
    }
}
