/* AuraLink Admin Dashboard — Dark Ops V2 (Premium) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-dark: #050505;
    --bg-card: rgba(18, 18, 18, 0.6);
    --bg-card-hover: rgba(30, 30, 30, 0.8);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);

    --text-primary: #FFFFFF;
    --text-secondary: #A1A1AA;
    --text-muted: #52525B;

    /* Neon Accents */
    --accent: #00FF9D;
    /* Neon Green */
    --accent-glow: 0 0 20px rgba(0, 255, 157, 0.2);
    --accent-dim: rgba(0, 255, 157, 0.1);

    --danger: #FF4B4B;
    --danger-glow: 0 0 15px rgba(255, 75, 75, 0.3);

    --warning: #FFD600;

    --glass: blur(12px);
    --radius: 16px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at 50% 0%, #1a1a1a 0%, #050505 100%);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
    line-height: 1.5;
}

/* --- Layout --- */

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* --- Components --- */

/* Glass Card */
.card,
.login-card,
.stat-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all 0.2s ease;
}

.login-card {
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.card:hover,
.stat-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

h2 {
    font-size: 18px;
    margin-bottom: 16px;
}

h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.brand {
    font-weight: 800;
    letter-spacing: -0.03em;
    font-size: 18px;
    background: linear-gradient(90deg, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navigation */
.topnav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 12px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-tabs {
    background: rgba(255, 255, 255, 0.03);
    padding: 4px;
    border-radius: 12px;
    display: flex;
    gap: 4px;
}

.nav-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    gap: 24px;
}

.stats-grid.four {
    grid-template-columns: repeat(4, 1fr);
}

.stats-grid.three {
    grid-template-columns: repeat(3, 1fr);
}

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

.stat-value {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.stat-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.accent-green .stat-value {
    color: var(--accent);
    text-shadow: var(--accent-glow);
}

.accent-warn .stat-value {
    color: var(--warning);
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
}

th {
    text-align: left;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
}

td {
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

td:first-child {
    border-left: 1px solid var(--border);
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

td:last-child {
    border-right: 1px solid var(--border);
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
    cursor: pointer;
}

/* Buttons (Fixed) */
.btn-primary,
.btn-secondary,
.filter-btn,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--text-primary);
    color: #000;
    border: none;
    height: 36px;
    padding: 0 20px;
    border-radius: 8px;
    font-weight: 600;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    height: 36px;
    padding: 0 16px;
    border-radius: 8px;
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 4px 8px;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: 12px;
}

/* Filters */
.filter-group {
    display: flex;
    gap: 8px;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
}

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

.filter-btn.active {
    background: var(--text-primary);
    color: #000;
    border-color: var(--text-primary);
    font-weight: 600;
}

/* Badge (Yield) */
.yield-high {
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(0, 255, 157, 0.3);
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: var(--accent-glow);
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: rgba(0, 255, 157, 0.1);
    color: var(--accent);
}

.status-badge.slow {
    background: rgba(255, 214, 0, 0.1);
    color: var(--warning);
}

.status-badge.inactive {
    background: rgba(255, 75, 75, 0.1);
    color: var(--danger);
}

.partnership-badge.active {
    color: var(--accent);
}

/* Ticker */
.live-ticker {
    background: rgba(0, 255, 157, 0.05);
    border-bottom: 1px solid rgba(0, 255, 157, 0.2);
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.ticker-item {
    margin: 0 16px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ticker-time {
    opacity: 0.5;
    margin-right: 8px;
}

/* Dossier Modal */
.cmd-overlay {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cmd-modal {
    background: #0f0f0f;
    border: 1px solid var(--border);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    border-radius: 24px;
    overflow: hidden;
    max-width: 800px;
    width: 90%;
    display: flex;
    flex-direction: column;
}

.dossier-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent);
    padding: 32px;
    display: flex;
    gap: 24px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.dossier-img {
    width: 100px;
    height: 100px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.dossier-info h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.dossier-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.dossier-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
}

.stat-box {
    background: #0f0f0f;
    padding: 24px;
    text-align: center;
}

.dossier-footer {
    padding: 16px 32px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #0a0a0a;
}

.close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Helpers */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.text-right {
    text-align: right;
}

.revenue-cell {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
}

/* Animation */
.status-indicator {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Print Overrides */
@media print {
    body {
        background: white !important;
        color: black !important;
    }

    .card {
        border: 1px solid #ddd;
        background: white;
        box-shadow: none;
    }

    .nav-tabs,
    .topnav,
    .dossier-footer,
    .close-btn {
        display: none !important;
    }

    #linkDossierModal {
        display: block !important;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: white;
    }

    .cmd-overlay {
        background: white;
    }

    .yield-high {
        border: 2px solid #000;
        color: #000;
        background: #eee;
    }
}

/* AI Score Badges */
.score-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    font-family: monospace;
}

.score-high {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.score-mid {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.score-low {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.aesthetic-tag {
    font-size: 10px;
    color: #888;
    background: #1a1a1a;
    padding: 2px 6px;
    border-radius: 4px;

    border: 1px solid #333;
}

/* ─── Kanban Board ────────────────────────────────────────── */

.kanban-board {
    display: flex;
    gap: 16px;
    height: 100%;
    padding: 0 4px;
    align-items: flex-start;
}

.kanban-column {
    flex: 0 0 280px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.kanban-header {
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
}

.kanban-header .count {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

.kanban-items {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 100px;
    /* Drop target area */
}

.kanban-items.drag-over {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0 0 12px 12px;
}

.kanban-card {
    background: #151515;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    cursor: grab;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.kanban-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.3);
}

.kanban-card:active {
    cursor: grabbing;
}

.card-tag {
    font-size: 10px;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 4px;
    font-weight: 700;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.card-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.card-meta {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 8px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
}

.mini-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

.time-ago {
    font-size: 10px;
    color: var(--text-muted);
}

/* --- Stats Grid Two --- */
.stats-grid.two {
    grid-template-columns: repeat(2, 1fr);
}

/* --- Mapcn Block: Sovereign Map Layout --- */
.map-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

#map-container {
    height: 350px;
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background-color: #0b0b0b;
}

#map {
    width: 100%;
    height: 100%;
}

.geo-details {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 350px;
}

.map-legend {
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-muted);
}

/* Pulsing neon map markers */
.mapcn-marker {
    width: 12px;
    height: 12px;
    background-color: var(--accent);
    border-radius: 50%;
    border: 2px solid #000;
    box-shadow: var(--accent-glow);
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease;
}

.mapcn-marker:hover {
    transform: scale(1.3);
}

.mapcn-marker::after {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    opacity: 0;
    animation: marker-pulse 2s infinite;
}

@keyframes marker-pulse {
    0% {
        transform: scale(0.5);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* MapLibre Popup Overrides */
.maplibregl-popup-content {
    background: #0f0f0f !important;
    color: #fff !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    padding: 12px 16px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
    font-family: inherit !important;
    font-size: 13px !important;
}

.maplibregl-popup-anchor-top .maplibregl-popup-tip {
    border-bottom-color: #0f0f0f !important;
}
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
    border-top-color: #0f0f0f !important;
}
.maplibregl-popup-anchor-left .maplibregl-popup-tip {
    border-right-color: #0f0f0f !important;
}
.maplibregl-popup-anchor-right .maplibregl-popup-tip {
    border-left-color: #0f0f0f !important;
}

.popup-title {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 6px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.popup-clicks {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--accent);
    margin-bottom: 2px;
    font-weight: 500;
}

.popup-revenue {
    font-size: 11px;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .map-layout {
        grid-template-columns: 1fr;
    }
    .geo-details {
        min-height: auto;
        gap: 24px;
    }
}