:root {
    --app-scale: 0.9;
    --viewport-height: calc(100vh / var(--app-scale));
    --sidebar-bg: #121e1e;
    --sidebar-width: 260px;
    --primary-green: #28a745;
    --primary-green-dark: #1e7e34;
    --dark-bg: #1a2e1a;
    --body-bg: #f0f2f5;
    --card-bg: #ffffff;
    --text-dark: #1a1a1a;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --header-bg: linear-gradient(135deg, #1a4d32 0%, #237a47 52%, #28a745 100%);
    --header-text: #ffffff;
    --header-subtitle: rgba(255, 255, 255, 0.82);
    --header-border: rgba(255, 255, 255, 0.12);
    --footer-bg: linear-gradient(90deg, #0f1f1a 0%, #152820 50%, #1a3328 100%);
    --footer-text: rgba(255, 255, 255, 0.78);
    --footer-border: #28a745;
}

body.app-layout {
    zoom: var(--app-scale);
    min-height: var(--viewport-height);
}

@supports not (zoom: 0.9) {
    body.app-layout {
        transform: scale(var(--app-scale));
        transform-origin: top left;
        width: calc(100% / var(--app-scale));
        min-height: var(--viewport-height);
    }
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--body-bg);
    margin: 0;
    color: var(--text-dark);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-height: var(--viewport-height);
    height: var(--viewport-height);
    background: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    overflow: hidden;
}

.sidebar-brand {
    padding: 16px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    overflow: hidden;
}

.brand-name {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
}

.brand-tagline {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
}

.sidebar-nav {
    list-style: none;
    padding: 8px 10px;
    margin: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: 6px;
    margin-bottom: 1px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.sidebar-nav .nav-link.active {
    background: var(--primary-green);
    color: #fff;
}

.sidebar-nav .nav-link i {
    font-size: 16px;
    width: 18px;
}

.app-icon {
    display: inline-block;
    flex-shrink: 0;
    object-fit: contain;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.75;
    filter: brightness(0) invert(1);
}

.sidebar-nav .nav-link:hover .nav-icon,
.sidebar-nav .nav-link.active .nav-icon {
    opacity: 1;
}

.brand-icon-img {
    width: 42px;
    height: 42px;
    filter: none;
    opacity: 1;
}

.btn .app-icon {
    vertical-align: -3px;
    margin-right: 4px;
}

.btn .app-icon:last-child {
    margin-right: 0;
    margin-left: 4px;
}

.btn-icon-only .app-icon {
    margin: 0;
}

.btn-success .app-icon,
.btn-success:hover .app-icon {
    filter: brightness(0) invert(1);
}

.user-logout .nav-icon {
    opacity: 0.7;
}

.app-icon-light {
    filter: brightness(0) invert(1);
}

.sidebar-footer {
    padding: 12px 16px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-logout {
    color: rgba(255,255,255,0.6);
    font-size: 18px;
    padding: 4px;
    text-decoration: none;
    transition: color 0.2s;
    flex-shrink: 0;
}

.user-logout:hover {
    color: #fff;
}

/* Main Content */
#page-content {
    margin-left: var(--sidebar-width);
    min-height: var(--viewport-height);
    background: var(--body-bg);
}

.dashboard-header {
    background: var(--header-bg);
    padding: 24px 32px;
    border-bottom: 1px solid var(--header-border);
    box-shadow: 0 4px 18px rgba(26, 77, 50, 0.18);
}

.dashboard-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin: 0;
    color: var(--header-text);
}

.dashboard-subtitle {
    font-size: 13px;
    color: var(--header-subtitle);
    margin: 4px 0 0;
    letter-spacing: 1px;
    font-weight: 500;
}

.dashboard-header .form-select {
    background-color: rgba(255, 255, 255, 0.96);
    border-color: rgba(255, 255, 255, 0.35);
    color: var(--text-dark);
}

.dashboard-header .btn-outline-secondary,
.dashboard-header .btn-outline-dark {
    border-color: rgba(255, 255, 255, 0.55);
    color: #fff;
    background: transparent;
}

.dashboard-header .btn-outline-secondary:hover,
.dashboard-header .btn-outline-dark:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.14);
    border-color: #fff;
    color: #fff;
}

.dashboard-header .btn-outline-success {
    border-color: #fff;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.dashboard-header .btn-outline-success:hover {
    background: #fff;
    border-color: #fff;
    color: var(--primary-green-dark);
}

.dashboard-header .btn-success {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.dashboard-body {
    padding: 24px 32px;
}

.project-select, .date-range-select {
    min-width: 180px;
    border-radius: 8px;
    font-size: 13px;
}

.dashboard-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.dashboard-header-actions .form-select,
.dashboard-header-actions .btn {
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    line-height: 1;
    padding: 0 16px;
}

.dashboard-header-actions .form-select {
    min-width: 220px;
    max-width: 280px;
    padding: 0 36px 0 14px;
}

.dashboard-header-actions .btn i {
    font-size: 15px;
    margin-right: 6px;
    line-height: 1;
}

.dashboard-header-actions .btn-outline-success {
    border-width: 1.5px;
}

.dashboard-header-actions .btn-outline-success:hover {
    background: var(--primary-green);
    border-color: var(--primary-green);
    color: #fff;
}

.dashboard-header-actions .btn-outline-dark {
    border-width: 1.5px;
    border-color: #212529;
    color: #212529;
}

.dashboard-header-actions .btn-outline-dark:hover:not(:disabled) {
    background: #212529;
    border-color: #212529;
    color: #fff;
}

.dashboard-header-actions .btn-outline-dark:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dashboard-header .dashboard-header-actions .btn.btn-download-report {
    --bs-btn-bg: #fbbf24;
    --bs-btn-color: #422006;
    --bs-btn-border-color: #fbbf24;
    --bs-btn-hover-bg: #f59e0b;
    --bs-btn-hover-color: #422006;
    --bs-btn-hover-border-color: #f59e0b;
    --bs-btn-disabled-bg: rgba(251, 191, 36, 0.45);
    --bs-btn-disabled-color: rgba(66, 32, 6, 0.75);
    --bs-btn-disabled-border-color: transparent;
    border: none;
    background: linear-gradient(135deg, #fde68a 0%, #fbbf24 48%, #f59e0b 100%);
    color: #422006;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.45);
}

.dashboard-header .dashboard-header-actions .btn.btn-download-report:hover:not(:disabled) {
    background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 48%, #d97706 100%);
    color: #422006;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.55);
}

.dashboard-header .dashboard-header-actions .btn.btn-download-report:disabled,
.dashboard-header .dashboard-header-actions .btn.btn-download-report.disabled {
    opacity: 1;
    cursor: not-allowed;
    background: linear-gradient(135deg, rgba(253, 230, 138, 0.55) 0%, rgba(251, 191, 36, 0.45) 100%);
    color: rgba(66, 32, 6, 0.7);
    box-shadow: none;
}

.dashboard-header-actions .btn-icon {
    width: 38px;
    min-width: 38px;
    padding: 0;
}

.dashboard-header-actions .btn-icon i {
    margin-right: 0;
}

.dashboard-header-actions .date-range-select {
    min-width: 140px;
    max-width: 160px;
}

.keyword-country-select {
    min-height: 140px;
}

.report-row-actions form {
    margin: 0;
}

.dashboard-audit-notice {
    font-size: 12px;
    line-height: 1.5;
}

.dashboard-audit-notice i {
    font-size: 12px;
}

.dashboard-audit-notice a {
    font-size: 12px;
}

/* KPI Cards */
.kpi-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px 24px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-interactive { cursor: pointer; }
.kpi-interactive:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    border-color: rgba(40,167,69,0.3);
}

.overview-welcome {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 45%, #60a5fa 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 4px solid #93c5fd;
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.28);
    color: #fff;
}

.overview-welcome h4 {
    font-weight: 700;
    font-size: 18px;
    color: #fff;
}

.overview-welcome .text-muted,
.overview-welcome .overview-date {
    color: rgba(255, 255, 255, 0.78) !important;
}

.overview-welcome-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.overview-welcome-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.overview-welcome-tag i {
    font-size: 13px;
    opacity: 0.9;
}

.quick-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    text-decoration: none;
    color: #fff;
    transition: all 0.2s;
    height: 100%;
}

.quick-action-card.qa-website {
    background: linear-gradient(145deg, #1e3a8a 0%, #2563eb 52%, #60a5fa 100%);
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.28);
}

.quick-action-card.qa-audit {
    background: linear-gradient(145deg, #14532d 0%, #16a34a 52%, #4ade80 100%);
    box-shadow: 0 10px 28px rgba(22, 163, 74, 0.28);
}

.quick-action-card.qa-keywords {
    background: linear-gradient(145deg, #5b21b6 0%, #7c3aed 52%, #a78bfa 100%);
    box-shadow: 0 10px 28px rgba(124, 58, 237, 0.28);
}

.quick-action-card.qa-reports {
    background: linear-gradient(145deg, #b45309 0%, #f59e0b 52%, #fbbf24 100%);
    box-shadow: 0 10px 28px rgba(245, 158, 11, 0.28);
}

.quick-action-card:hover {
    transform: translateY(-3px);
    color: #fff;
    filter: brightness(1.06);
}

.quick-action-card .qa-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    color: #b8f5c6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background 0.2s, color 0.2s;
}

.quick-action-card:hover .qa-icon {
    background: rgba(255, 255, 255, 0.95);
    color: #1e293b;
}

.quick-action-card .qa-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
}

.kpi-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
    margin-bottom: 8px;
}

.kpi-change {
    font-size: 13px;
    font-weight: 600;
}

.kpi-period {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 11px;
}

.kpi-sparkline {
    height: 40px;
    margin-top: 12px;
}

.kpi-card-premium {
    background: linear-gradient(145deg, #155724 0%, #28a745 48%, #34ce57 100%);
    border: none;
    color: #fff;
    box-shadow: 0 10px 28px rgba(40, 167, 69, 0.3);
}

.kpi-card-premium .kpi-label,
.kpi-card-premium .kpi-value,
.kpi-card-premium .kpi-change,
.kpi-card-premium .kpi-period {
    color: #fff;
}

.kpi-card-premium .kpi-label {
    opacity: 0.92;
}

.kpi-card-premium .kpi-period {
    opacity: 0.85;
}

.kpi-card-premium .text-success,
.kpi-card-premium .text-danger {
    color: #fff !important;
}

.kpi-card-premium.kpi-interactive:hover {
    border-color: transparent;
    box-shadow: 0 14px 34px rgba(40, 167, 69, 0.38);
    transform: translateY(-3px);
}

.kpi-card-compact {
    padding: 14px 16px;
}

.kpi-card-compact .kpi-label {
    font-size: 12px;
    margin-bottom: 6px;
}

.kpi-card-compact .kpi-value {
    font-size: 28px;
    margin-bottom: 6px;
}

.kpi-card-compact .kpi-change {
    font-size: 12px;
}

.kpi-card-compact .kpi-sparkline {
    height: 32px;
    margin-top: 8px;
}

.kpi-card-premium.kpi-bl-total {
    background: linear-gradient(145deg, #1e3a8a 0%, #2563eb 52%, #60a5fa 100%);
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.28);
}

.kpi-card-premium.kpi-bl-domains {
    background: linear-gradient(145deg, #5b21b6 0%, #7c3aed 52%, #a78bfa 100%);
    box-shadow: 0 10px 28px rgba(124, 58, 237, 0.28);
}

.kpi-card-premium.kpi-bl-new {
    background: linear-gradient(145deg, #14532d 0%, #16a34a 52%, #4ade80 100%);
    box-shadow: 0 10px 28px rgba(22, 163, 74, 0.28);
}

.kpi-card-premium.kpi-bl-lost {
    background: linear-gradient(145deg, #7f1d1d 0%, #dc2626 52%, #f87171 100%);
    box-shadow: 0 10px 28px rgba(220, 38, 38, 0.28);
}

.kpi-card-premium.kpi-bl-new .kpi-value {
    color: #dcfce7;
}

.kpi-card-premium.kpi-bl-lost .kpi-value {
    color: #fee2e2;
}

/* Chart Cards */
.chart-card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 20px 24px;
}

.chart-card.overview-welcome {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 45%, #60a5fa 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 4px solid #93c5fd;
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.28);
    color: #fff;
}

.chart-card.getting-started-panel {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
    color: #fff;
}

.row > [class*="col"] > .chart-card,
.row > [class*="col"] > .kpi-card {
    height: 100%;
}

.overview-welcome,
.getting-started-panel {
    height: auto;
}

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

.chart-card-header h5 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

/* Premium SEO Score Breakdown */
.premium-score-chart {
    min-height: auto !important;
}

.premium-score-breakdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 4px 0 8px;
}

.score-ring-wrap {
    display: flex;
    justify-content: center;
}

.score-ring {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: conic-gradient(
        var(--ring-color) calc(var(--score) * 3.6deg),
        #edf0f3 calc(var(--score) * 3.6deg)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(40, 167, 69, 0.15);
}

.score-ring-inner {
    width: 104px;
    height: 104px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.score-ring-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    color: var(--text-dark);
    letter-spacing: -1px;
}

.score-ring-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 4px;
}

.score-bars {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.score-bar-row {
    width: 100%;
}

.score-bar-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 12px;
}

.score-bar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.score-bar-label {
    flex: 1;
    font-weight: 500;
    color: var(--text-dark);
}

.score-bar-value {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 13px;
}

.score-bar-track {
    height: 8px;
    background: #edf0f3;
    border-radius: 99px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.6s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

/* Keyword Table */
.keyword-table {
    font-size: 13px;
}

.keyword-table thead th {
    background: transparent;
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
}

.keyword-table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.backlink-url-cell {
    min-width: 280px;
    white-space: normal;
    word-break: break-all;
    overflow-wrap: anywhere;
}

.backlink-source-url {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 12px;
    line-height: 1.45;
}

.backlink-source-url:hover {
    color: var(--primary-green);
    text-decoration: underline;
}

.mini-spark {
    width: 60px;
    height: 24px;
    background: linear-gradient(90deg, transparent, var(--primary-green));
    border-radius: 4px;
    opacity: 0.6;
}

/* Local Map */
.local-map-wrap {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #fff;
    box-shadow: 0 8px 24px rgba(18, 30, 30, 0.08);
}

.premium-local-map-wrap {
    position: relative;
}

.local-map {
    height: 220px;
    position: relative;
    overflow: hidden;
}

.premium-local-map {
    height: 220px;
}

.local-map-canvas {
    width: 100%;
    height: 100%;
    min-height: 220px;
}

.local-map .leaflet-container {
    width: 100%;
    height: 100%;
    min-height: 220px;
    font-family: inherit;
}

.local-map-location {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8faf9 100%);
    border-top: 1px solid var(--border-color);
}

.local-map-location-pin {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(40, 167, 69, 0.12);
    color: var(--primary-green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.local-map-location-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.3;
}

.local-map-location-address {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.4;
}

.local-map-marker {
    background: transparent;
    border: none;
}

.local-map-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary-green);
    color: #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    border: 2px solid #fff;
}

.local-map-pin i {
    transform: rotate(45deg);
    font-size: 16px;
}

.map-empty-state {
    height: 100%;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: #f8f9fa;
    text-align: center;
    padding: 24px;
}

.map-empty-state i {
    font-size: 36px;
    margin-bottom: 10px;
    opacity: 0.45;
}

.map-empty-state p {
    margin: 0;
    font-size: 14px;
}

/* Footer */
.dashboard-footer {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    z-index: 900;
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 14px 32px;
    font-size: 11px;
    letter-spacing: 0.3px;
    border-top: 3px solid var(--footer-border);
    box-shadow: 0 -4px 20px rgba(15, 31, 26, 0.35);
}

#page-content:has(.dashboard-footer) {
    padding-bottom: 56px;
}

.footer-cta {
    background: linear-gradient(135deg, #34ce57 0%, #28a745 100%);
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 11px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(40, 167, 69, 0.35);
}

/* Auth Pages */
.auth-page { margin: 0; }

.auth-split {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
}

.auth-split-left {
    background: linear-gradient(145deg, #0d1616 0%, #1a3a2a 50%, #0f2419 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

.auth-split-left::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(40,167,69,0.2) 0%, transparent 70%);
    top: -100px;
    right: -100px;
}

.auth-brand-block {
    position: relative;
    z-index: 1;
    max-width: 420px;
    width: 100%;
}

.auth-brand-logo {
    width: 56px;
    height: 56px;
    display: block;
    margin-bottom: 4px;
}

.auth-brand-block h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 16px 0 12px;
    letter-spacing: 0.5px;
}

.auth-brand-block > p {
    color: rgba(255,255,255,0.75);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 28px;
}

.auth-brand-tagline {
    display: block;
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    margin-top: -6px;
    margin-bottom: 20px;
}

.auth-features { list-style: none; padding: 0; margin: 0; }
.auth-features li { padding: 8px 0; font-size: 14px; color: rgba(255,255,255,0.9); display: flex; align-items: center; gap: 10px; }
.auth-features i { color: var(--primary-green); }

.auth-split-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background: #f4f6f8;
}

.auth-card-premium {
    background: #fff;
    border-radius: 20px;
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.04);
}

.auth-card-premium h2 { font-weight: 700; font-size: 26px; margin-bottom: 6px; }
.auth-card-premium .subtitle { color: var(--text-muted); margin-bottom: 28px; font-size: 14px; }

.input-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-wrap > i.bi-envelope,
.input-icon-wrap > i.bi-lock {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 16px;
    z-index: 2;
    pointer-events: none;
}

.input-icon-wrap .form-control {
    padding: 12px 44px 12px 42px;
    border-radius: 10px;
    border: 1.5px solid var(--border-color);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-icon-wrap .form-control:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(40,167,69,0.12);
}

.settings-input .form-control { padding-left: 14px; padding-right: 44px; }

/* Settings Page */
.settings-page {
    padding-top: 16px;
}

.settings-header {
    padding-bottom: 16px;
}

.settings-header .dashboard-subtitle {
    margin-top: 2px;
    color: var(--header-subtitle);
}

.settings-project-select {
    min-width: 180px;
    max-width: 220px;
    border-radius: 8px;
    font-size: 13px;
}

.settings-profile-bar {
    padding: 14px 18px !important;
    background: linear-gradient(135deg, #fff 0%, #f8fdf9 100%);
    border-left: 4px solid var(--primary-green);
}

.settings-profile-inner {
    display: flex;
    align-items: center;
    gap: 14px;
}

.settings-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.settings-profile-meta h5 {
    font-size: 15px;
    font-weight: 600;
}

.settings-profile-meta span {
    font-size: 12px;
}

.settings-role-badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 4px 10px;
    border-radius: 99px;
    background: rgba(40, 167, 69, 0.1);
    color: var(--primary-green);
}

.settings-card {
    padding: 16px 18px !important;
}

.settings-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.settings-card-head h6 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.settings-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(40, 167, 69, 0.1);
    color: var(--primary-green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.settings-form .form-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.settings-field {
    margin-bottom: 10px;
}

.settings-form .form-control-sm,
.settings-form .form-select-sm {
    border-radius: 8px;
    border: 1.5px solid var(--border-color);
    font-size: 13px;
}

.settings-form .form-control-sm:focus,
.settings-form .form-select-sm:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.settings-form .btn {
    margin-top: 4px;
}

.settings-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-stack .settings-card {
    width: 100%;
}

#google-oauth,
#report-branding {
    position: relative;
    z-index: 1;
    overflow: hidden;
}

#google-oauth code {
    display: block;
    word-break: break-all;
    font-size: 11px;
    padding: 8px 10px;
    margin-top: 8px;
    background: #f4f6f8;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

#report-branding .row {
    align-items: flex-start;
}

.brand-logo-preview {
    width: 120px;
    height: 120px;
    max-width: 100%;
    margin: 0 auto;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafbfc;
    overflow: hidden;
    flex-shrink: 0;
}

.brand-logo-img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 116px;
    max-height: 116px;
    object-fit: contain;
}

.brand-logo-placeholder {
    font-size: 36px;
    color: #cbd5e0;
}

.integration-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.integration-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: border-color 0.2s;
}

.integration-item:hover {
    border-color: rgba(40, 167, 69, 0.35);
}

.integration-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.integration-icon.gsc {
    background: rgba(66, 133, 244, 0.12);
    color: #4285f4;
}

.integration-icon.ga {
    background: rgba(251, 188, 5, 0.15);
    color: #e37400;
}

.integration-info {
    flex: 1;
    min-width: 0;
}

.integration-info strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.integration-status {
    font-size: 11px;
    color: var(--text-muted);
}

.integration-status.connected {
    color: var(--primary-green);
    font-weight: 500;
}

.settings-team-table {
    font-size: 13px;
}

.settings-team-table thead th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    font-weight: 600;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
}

.settings-team-table tbody td {
    padding: 10px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.settings-team-table .team-name {
    display: block;
    font-weight: 500;
    font-size: 13px;
}

.settings-team-table .team-email {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.password-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 4px 8px;
    cursor: pointer;
    z-index: 3;
    line-height: 1;
}

.password-toggle:hover { color: var(--primary-green); }

.btn-auth-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #28a745, #1e7e34);
    border: none;
    color: #fff;
    padding: 13px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-auth-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(40,167,69,0.35);
    color: #fff;
}

.auth-link { color: var(--primary-green); text-decoration: none; font-weight: 500; font-size: 13px; }
.auth-link:hover { text-decoration: underline; }
.auth-footer-text { text-align: center; margin-top: 24px; font-size: 14px; color: var(--text-muted); }
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, #1a3a2a 100%);
}

.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

@media (max-width: 991px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-split-left { display: none; }
    .auth-split-right { padding: 32px 20px; }
}

/* Score Cards (Audit) */
.score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

/* SEO Audit — premium search panel */
.audit-search-panel {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(40, 167, 69, 0.2);
    background: linear-gradient(145deg, #0d1616 0%, #142820 45%, #1a3a2a 100%);
    color: #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.audit-search-glow {
    position: absolute;
    top: -40%;
    right: -10%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(40, 167, 69, 0.25) 0%, transparent 70%);
    pointer-events: none;
}

.audit-search-content {
    position: relative;
    padding: 28px 32px 24px;
    z-index: 1;
}

.audit-search-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 5px 12px;
    border-radius: 99px;
    background: rgba(40, 167, 69, 0.2);
    color: #6ee7a0;
    margin-bottom: 12px;
}

.audit-search-intro h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
    letter-spacing: -0.3px;
}

.audit-search-intro p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.65);
    margin: 0 0 20px;
    max-width: 560px;
}

.audit-url-bar {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 720px;
}

.audit-url-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    color: var(--text-muted);
    font-size: 18px;
    flex-shrink: 0;
    padding-left: 8px;
}

.audit-url-bar .form-control {
    border: none;
    box-shadow: none !important;
    font-size: 15px;
    padding: 12px 8px;
    background: transparent;
}

.audit-url-bar .form-control:focus {
    outline: none;
}

.audit-run-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 24px;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: transform 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
}

.audit-run-btn:hover {
    background: linear-gradient(135deg, #2fbd4e, #228b3a);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(40, 167, 69, 0.4);
}

.audit-project-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    max-width: 400px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.audit-project-row .form-select {
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
}

.audit-project-row .form-select option {
    color: #212529;
    background: #fff;
}

.audit-check-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.audit-check-pills span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.audit-check-pills i {
    color: var(--primary-green);
    font-size: 13px;
}

@media (max-width: 767px) {
    .audit-search-content {
        padding: 20px 16px 18px;
    }

    .audit-url-bar {
        flex-direction: column;
        padding: 12px;
        gap: 10px;
    }

    .audit-url-icon {
        display: none;
    }

    .audit-run-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }

    .audit-search-intro h2 {
        font-size: 18px;
    }
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 18px;
    height: 100%;
    text-align: center;
    transition: box-shadow 0.2s, transform 0.2s;
}

.feature-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.feature-card .feature-icon {
    width: 48px;
    height: 48px;
    background: rgba(40, 167, 69, 0.12);
    color: var(--primary-green);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin: 0 auto 12px;
}

.feature-card h5 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.empty-dashboard-state .empty-state-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    background: rgba(40, 167, 69, 0.1);
    color: var(--primary-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.getting-started-panel {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
    color: #fff;
}

.getting-started-panel h5 {
    color: #fff;
}

.getting-started-panel .text-muted {
    color: rgba(255, 255, 255, 0.75) !important;
}

.getting-started-panel .empty-state-icon {
    color: rgba(255, 255, 255, 0.35);
}

.website-pick-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    text-decoration: none;
    color: #fff;
    transition: all 0.2s;
    height: 100%;
}

.website-pick-card.wpc-blue {
    background: linear-gradient(145deg, #1e3a8a 0%, #2563eb 52%, #60a5fa 100%);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
}

.website-pick-card.wpc-purple {
    background: linear-gradient(145deg, #5b21b6 0%, #7c3aed 52%, #a78bfa 100%);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.25);
}

.website-pick-card.wpc-teal {
    background: linear-gradient(145deg, #0f766e 0%, #14b8a6 52%, #5eead4 100%);
    box-shadow: 0 8px 24px rgba(20, 184, 166, 0.25);
}

.website-pick-card:hover {
    transform: translateY(-2px);
    color: #fff;
    filter: brightness(1.06);
}

.website-pick-card .wpc-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #b8f5c6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 6px;
}

.website-pick-card .wpc-name { font-weight: 600; font-size: 15px; color: #fff; }
.website-pick-card .wpc-domain { font-size: 13px; color: rgba(255, 255, 255, 0.72); }
.website-pick-card .wpc-action { font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, 0.92); margin-top: 8px; }

.chart-empty-state {
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-align: center;
    padding: 24px;
}

.chart-empty-state i {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.chart-empty-state p {
    margin: 0;
    font-size: 14px;
}

.score-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.score-card-premium {
    background: linear-gradient(155deg, #0b1a15 0%, #153528 42%, #1e5c3a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 22px 18px;
    box-shadow: 0 12px 32px rgba(11, 26, 21, 0.28);
    position: relative;
    overflow: hidden;
}

.score-card-premium::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #34ce57, #28a745);
    opacity: 0.9;
}

.score-card-premium.score-excellent::before {
    background: linear-gradient(90deg, #34ce57, #7ee08f);
}

.score-card-premium.score-good::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.score-card-premium.score-poor::before {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.score-card .score-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-green);
}

.score-card-premium .score-value {
    font-size: 38px;
    color: #ffffff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.score-card-premium.score-excellent .score-value {
    color: #b8f5c6;
}

.score-card-premium.score-good .score-value {
    color: #fde68a;
}

.score-card-premium.score-poor .score-value {
    color: #fecaca;
}

.score-card .score-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.score-card-premium .score-label {
    color: rgba(255, 255, 255, 0.82);
    font-weight: 500;
    letter-spacing: 0.2px;
}

.progress-score {
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
    margin-top: 12px;
    overflow: hidden;
}

.score-card-premium .progress-score {
    height: 6px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.14);
    margin-top: 14px;
}

.progress-score .bar {
    height: 100%;
    background: var(--primary-green);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.score-card-premium .progress-score .bar {
    border-radius: 99px;
    background: linear-gradient(90deg, #28a745, #7ee08f);
    box-shadow: 0 0 10px rgba(52, 206, 87, 0.45);
}

.score-card-premium.score-good .progress-score .bar {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

.score-card-premium.score-poor .progress-score .bar {
    background: linear-gradient(90deg, #ef4444, #f87171);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
}

.badge-high { background: #dc3545; color: #fff; }
.badge-medium { background: #ffc107; color: #333; }
.badge-low { background: #17a2b8; color: #fff; }

.sidebar-toggle {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
    border-radius: 8px;
    padding: 8px 12px;
}

/* Responsive */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    .sidebar.show { transform: translateX(0); }
    #page-content { margin-left: 0; }
    .dashboard-body { padding: 16px; padding-top: 56px; }
    .dashboard-header { padding: 16px; padding-top: 56px; }
    .dashboard-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    .dashboard-header-actions .form-select {
        flex: 1;
        min-width: 0;
        max-width: none;
    }
    .dashboard-footer {
        left: 0;
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 12px 16px;
    }
    #page-content:has(.dashboard-footer) { padding-bottom: 72px; }
}

@media (min-width: 992px) {
    .sidebar-toggle { display: none; }
}
