/* Ingress Uniques Futuristic Theme & Design System */

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111927;
    --bg-card: rgba(18, 26, 43, 0.85);
    --border-color: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Enlightened Theme Default */
    --accent-color: #00ff66;
    --accent-glow: rgba(0, 255, 102, 0.35);
    --faction-color: #00e676;
    
    --success-color: #00e676;
    --warning-color: #ffab00;
    --danger-color: #ff5252;
    --drone-color: #e040fb;
    
    --font-heading: 'Rajdhani', sans-serif;
    --font-mono: 'Roboto Mono', monospace;
    --font-body: 'Inter', sans-serif;
}

/* Faction Overrides */
body.theme-enlightened {
    --accent-color: #00ff66;
    --accent-glow: rgba(0, 255, 102, 0.35);
    --faction-color: #00e676;
}

body.theme-resistance {
    --accent-color: #00d2ff;
    --accent-glow: rgba(0, 210, 255, 0.35);
    --faction-color: #00a8ff;
}

body.theme-machina {
    --accent-color: #ff3366;
    --accent-glow: rgba(255, 51, 102, 0.35);
    --faction-color: #ff1744;
}

body.theme-neutral {
    --accent-color: #ffd600;
    --accent-glow: rgba(255, 214, 0, 0.35);
    --faction-color: #ffab00;
}

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

body {
    background: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(0, 255, 102, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(0, 210, 255, 0.03) 0%, transparent 40%),
        linear-gradient(rgba(10, 14, 23, 0.96), rgba(10, 14, 23, 0.96)),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255, 255, 255, 0.01) 2px, rgba(255, 255, 255, 0.01) 4px);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
}

.app-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.top-nav {
    position: relative;
    z-index: 1100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

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

.logo-symbol {
    font-size: 28px;
    color: var(--accent-color);
    text-shadow: 0 0 12px var(--accent-glow);
    animation: pulse 3s infinite ease-in-out;
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-primary);
}

.brand-sub {
    font-size: 10px;
    font-family: var(--font-mono);
    letter-spacing: 2px;
    color: var(--accent-color);
}

.nav-catalog-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.25);
    border-radius: 20px;
    padding: 6px 14px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #00e5ff;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.08);
    transition: all 0.2s ease;
}

.nav-catalog-badge:hover {
    background: rgba(0, 229, 255, 0.15);
    border-color: rgba(0, 229, 255, 0.45);
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.2);
}

.nav-catalog-icon {
    font-size: 14px;
}

.nav-catalog-label {
    color: var(--text-secondary);
    font-size: 11px;
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.nav-catalog-count {
    font-weight: 700;
    color: #fff;
    font-size: 13px;
}

.nav-catalog-sub {
    color: rgba(0, 229, 255, 0.7);
    font-size: 11px;
}

/* "Your Uniques" header badge - same shape as the global catalog badge, a
   distinct accent so the two aren't mistaken for each other at a glance. */
.nav-user-total-badge {
    background: rgba(80, 200, 120, 0.08);
    border-color: rgba(80, 200, 120, 0.25);
    color: #50c878;
    box-shadow: 0 0 10px rgba(80, 200, 120, 0.08);
}

.nav-user-total-badge:hover {
    background: rgba(80, 200, 120, 0.15);
    border-color: rgba(80, 200, 120, 0.45);
    box-shadow: 0 0 14px rgba(80, 200, 120, 0.2);
}

.nav-user-total-badge .nav-catalog-sub {
    color: rgba(80, 200, 120, 0.7);
}

/* Compact full-width info/progress bars above the stats grid - replaces a
   standalone stat-card for things that either aren't a "percent of my own
   total" (the named-portal backfill progress) at their own row height. */
.mini-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 14px;
    margin-bottom: 10px;
    font-size: 12px;
}

.mini-bar-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.mini-bar-label {
    font-family: var(--font-heading);
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.mini-bar-track {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-secondary, rgba(255, 255, 255, 0.06));
    overflow: hidden;
}

.mini-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: #8e44ad;
    transition: width 0.4s ease;
}

.mini-bar-value {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
}

.mini-bar-sub {
    color: var(--text-secondary);
    font-size: 11px;
    flex-shrink: 0;
}

.user-profile-bar {
    display: flex;
    align-items: center;
    gap: 16px;
}

.agent-badge {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.faction-tag {
    padding: 4px 8px;
    background: var(--faction-color);
    color: #000;
    font-weight: 700;
    font-family: var(--font-heading);
    font-size: 11px;
}

.agent-name {
    padding: 4px 10px;
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 12px;
}

.user-avatar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--accent-color);
}

.user-email {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Buttons & Inputs */
.btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: 1px;
    font-size: 13px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-color);
    color: #050b14;
    box-shadow: 0 0 10px var(--accent-glow);
}

.btn-primary:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 16px var(--accent-glow);
}

/* No button anywhere had a disabled style at all - a disabled <button>
   genuinely can't be clicked, but with no visual difference from an active
   one it just looks broken/unresponsive instead of "not ready yet" (the
   import button, gated on picking a status for a plain GUID list, was a
   real case of this - clicking it silently did nothing with no visible
   reason why). :not(:hover) keeps hover filters/glow from fighting this. */
.btn:disabled,
.btn:disabled:hover {
    background: #1e293b;
    color: var(--text-muted);
    box-shadow: none;
    filter: none;
    cursor: not-allowed;
    opacity: 0.6;
}

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

.btn-secondary:hover {
    background: #334155;
}

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

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

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.btn-outline-danger:hover {
    background: var(--danger-color);
    color: #fff;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 11px;
}

.input-field {
    width: 100%;
    padding: 8px 12px;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.2s;
}

.input-field:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 8px var(--accent-glow);
}

/* A CSS transition on a <select> itself (not just its ancestors) makes
   Linux/GTK-backed Chromium/Firefox treat the focus-triggered repaint as a
   resize/focus-loss signal on the native popup, closing the dropdown the
   instant the mouse button is released instead of on an actual option
   click - text inputs/textareas don't have this problem, only selects, so
   only selects lose the transition. */
select.input-field {
    transition: none;
}

.code-text {
    font-family: var(--font-mono);
    font-size: 12px;
}

/* Auth Card */
.auth-card-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 55vh;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 40px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.auth-icon {
    font-size: 48px;
    color: var(--accent-color);
    margin-bottom: 16px;
    text-shadow: 0 0 16px var(--accent-glow);
}

.auth-card h2 {
    font-family: var(--font-heading);
    font-size: 22px;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.auth-card p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 24px;
}

.google-auth-box {
    margin-bottom: 24px;
}

.google-btn-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    min-height: 44px;
}

.btn-google-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #ffffff;
    color: #1f1f1f;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 24px;
    border-radius: 4px;
    border: 1px solid #dadce0;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    width: 100%;
    max-width: 280px;
}

.btn-google-custom:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.google-icon {
    flex-shrink: 0;
    display: block;
}

body.modal-open {
    overflow: hidden !important;
    touch-action: none;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(3, 7, 18, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* The blur lives on a ::before layer, not on .modal-overlay itself, so that
   .modal-card and everything inside it (including <select> elements) is
   never a *descendant* of an element with backdrop-filter. backdrop-filter
   (like transform/filter) forces a new compositing layer, and a native
   <select> popup that's positioned relative to an ancestor in a separate
   compositing layer can close itself immediately on Linux/GTK-backed
   Chromium - the select.input-field transition fix alone was confirmed live
   NOT to be enough on its own, so this addresses the other known cause of
   the same symptom. ::before is a sibling-ish generated box, not an ancestor
   of .modal-card, so it blurs the same backdrop with the same visual result
   without being in .modal-card's ancestor chain at all. */
.modal-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: -1;
}

.modal-card {
    background: #111827;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
    text-align: left;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    color: var(--accent-color);
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
}

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

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px 20px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-color);
}

.stat-card.stat-captured::before { background: var(--success-color); }
.stat-card.stat-visited::before { background: var(--warning-color); }
.stat-card.stat-scout::before { background: #ff9100; }
.stat-card.stat-drone::before { background: var(--drone-color); }

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

.stat-title {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

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

/* Tabs */
.content-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 10px 18px;
    cursor: pointer;
    transition: all 0.2s;
}

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

.tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-glow);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Toolbar */
.portal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--bg-card);
    padding: 14px 18px;
    border: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.filter-group {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
}

/* Table */
.table-responsive {
    overflow-x: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: none;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    background: #0f172a;
    padding: 12px 16px;
    text-align: left;
    font-family: var(--font-heading);
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Status Badges - Squared Boxes */
.badge-group {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.badge {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    line-height: 1;
    text-align: center;
    padding: 0;
}

.badge-captured { background: rgba(0, 230, 118, 0.2); color: var(--success-color); border: 1px solid var(--success-color); }
.badge-visited { background: rgba(255, 171, 0, 0.2); color: var(--warning-color); border: 1px solid var(--warning-color); }
.badge-drone { background: rgba(224, 64, 251, 0.2); color: var(--drone-color); border: 1px solid var(--drone-color); }
.badge-scout { background: rgba(255, 145, 0, 0.2); color: #ff9100; border: 1px solid #ff9100; }
.badge-none, .badge-off { background: rgba(255, 255, 255, 0.03); color: rgba(255, 255, 255, 0.25); border: 1px solid rgba(255, 255, 255, 0.07); }

/* Text Badges - Pills (role/status/format labels, anything longer than a
   single C/V/D/S letter). .badge's own width/height/min-width are a fixed
   22x22 square meant for exactly one character - reusing it as-is for a word
   like "admin" or "ACTIVE" (as the Agent Access table briefly did) crams
   multi-character text into a box sized for one glyph. Same color variants
   above still apply on top - this only overrides the sizing/shape. */
.badge-pill {
    width: auto;
    height: auto;
    min-width: 0;
    padding: 3px 10px;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 10px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.guid-cell {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    padding-right: 24px;
}

.location-cell {
    white-space: nowrap;
    padding-left: 12px;
}

.guid-text {
    display: inline-block;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    letter-spacing: -0.2px;
}

.copyable {
    user-select: all;
    cursor: pointer;
    transition: color 0.15s ease;
}

.copyable:hover {
    color: var(--accent-color);
}

.portal-title-cell {
    font-weight: 500;
    color: #fff;
}

.portal-title-text {
    display: inline-block;
}

.portal-title-unknown {
    color: var(--text-muted);
    font-weight: 500;
    opacity: 0.8;
    font-size: 14px;
    user-select: none;
    display: inline-block;
}

.link-intel {
    color: var(--accent-color);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 11px;
}

.link-intel:hover {
    text-decoration: underline;
}

/* Pagination */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    margin-bottom: 24px;
}

.page-info {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* Split Pane Layout */
.split-pane {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 860px) {
    .split-pane {
        grid-template-columns: 1fr;
    }
}

.info-card, .tokens-manager, .profile-card, .data-tools-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
}

.info-card h3, .tokens-manager h4, .profile-card h3, .data-tools-card h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    letter-spacing: 1px;
    margin-bottom: 16px;
    color: var(--accent-color);
}

.setup-steps {
    padding-left: 20px;
    line-height: 1.8;
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 20px;
}

.setup-steps a {
    color: var(--accent-color);
}

.form-group {
    margin-bottom: 16px;
}

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

.form-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

/* Token List */
.tokens-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.token-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.token-item-info {
    display: flex;
    flex-direction: column;
}

.token-item-label {
    font-weight: 600;
    font-size: 13px;
}

.token-item-prefix {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

/* Alerts */
.alert-box {
    padding: 14px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.alert-success {
    background: rgba(0, 230, 118, 0.1);
    border: 1px solid var(--success-color);
    color: var(--text-primary);
}

.alert-title {
    font-weight: 700;
    color: var(--success-color);
    margin-bottom: 4px;
}

.token-copy-wrapper {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.tool-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.import-section {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Modal Large */
.modal-card.modal-lg {
    max-width: 920px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Dropzone */
.dropzone-box {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    background: rgba(15, 23, 42, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropzone-box:hover, .dropzone-box.dragover {
    border-color: var(--accent-color);
    background: rgba(0, 255, 102, 0.05);
}

.dropzone-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.dropzone-text {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.dropzone-text .browse-link {
    color: var(--accent-color);
    text-decoration: underline;
}

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

/* Preview Card & Mini Stats */
.preview-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 14px;
}

.stat-mini-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
}

/* Import preview: for a bare GUID list (no status of its own), the relevant
   tiles double as the type picker instead of a separate dropdown - avoids a
   documented Linux/GTK-backed-browser bug where native <select> popups close
   themselves the instant the mouse button releases, seen across multiple
   projects and unrelated to anything in this page's own CSS/JS. Tapping a
   tile re-runs the analysis forcing that status onto every parsed entry. */
.stat-mini-card.selectable {
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.stat-mini-card.selectable:hover {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.06);
}

.stat-mini-card.selected {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 1px var(--accent-color);
}

.stat-mini-label {
    font-size: 9.5px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.stat-mini-val {
    font-size: 16px;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
}

.text-captured { color: var(--success-color); }
.text-visited { color: #00d2ff; }
.text-drone { color: var(--drone-color); }

.badge-info {
    background: rgba(0, 210, 255, 0.15);
    color: #00d2ff;
    border: 1px solid rgba(0, 210, 255, 0.4);
}

/* Progress Container */
.progress-container {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 12px;
}

.progress-bar-track {
    width: 100%;
    height: 8px;
    background: #0f172a;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--faction-color));
    transition: width 0.3s ease;
}

.hidden {
    display: none !important;
}

@keyframes pulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* Notification Bell & Activity Log */
.notification-center-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.btn-icon-bell {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    padding: 6px 8px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

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

.btn-icon-bell.pulsing {
    animation: bellPulse 1.8s infinite;
    color: var(--accent-color);
    border-color: var(--accent-color);
}

@keyframes bellPulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 194, 255, 0.5); }
    70% { box-shadow: 0 0 0 8px rgba(0, 194, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 194, 255, 0); }
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-color);
    color: #000;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
    line-height: 1.2;
    min-width: 14px;
    text-align: center;
}

.notification-badge.badge-busy {
    background: #00d2ff;
    color: #000;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 650px;
    max-width: calc(100vw - 32px);
    max-height: 600px;
    background: #0f172a; /* 100% solid opaque background to prevent page bleed-through */
    border: 1px solid #334155;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(0, 255, 102, 0.15);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    border-bottom: 1px solid #1e293b;
    background: #090e1a; /* 100% solid dark header */
}

.notification-title {
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-heading);
    letter-spacing: 1px;
    color: var(--text-primary);
}

.btn-text-clear {
    background: transparent;
    border: 1px solid #334155;
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-text-clear:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background: rgba(0, 255, 102, 0.1);
}

.notification-list {
    overflow-y: auto;
    max-height: 540px;
    padding: 6px 0;
    background: #0f172a;
}

.notification-item {
    padding: 14px 20px;
    border-bottom: 1px solid #1e293b;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 13px;
    background: #0f172a;
    transition: background 0.15s;
}

.notification-item:hover {
    background: #1e293b;
}

.notification-item:last-child {
    border-bottom: none;
}

.notif-msg {
    color: #f8fafc;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.notif-details {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.45;
    padding-left: 24px;
    word-break: break-word;
}

.notif-details strong {
    color: #e2e8f0;
}

.notification-action-link {
    align-self: flex-start;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-color);
    text-decoration: none;
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    padding: 3px 10px;
    margin-top: 2px;
}

.notification-action-link:hover {
    background: var(--accent-color);
    color: #050b14;
}

.notif-time {
    font-size: 11px;
    color: #64748b;
    padding-left: 24px;
    font-family: var(--font-mono);
}

.notification-empty {
    padding: 36px 18px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* Toast Overlay Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: #111827;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
    color: var(--text-primary);
    font-size: 13px;
    animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.2s ease;
}

.toast-success {
    border-color: var(--success-color);
    box-shadow: 0 0 14px rgba(0, 230, 118, 0.25);
}

.toast-success .toast-icon {
    color: var(--success-color);
    font-weight: bold;
}

.toast-error {
    border-color: var(--danger-color);
    box-shadow: 0 0 14px rgba(255, 82, 82, 0.25);
}

.toast-error .toast-icon {
    color: var(--danger-color);
    font-weight: bold;
}

.toast-warning {
    border-color: var(--warning-color);
    box-shadow: 0 0 14px rgba(255, 171, 0, 0.25);
}

.toast-warning .toast-icon {
    color: var(--warning-color);
    font-weight: bold;
}

.toast-info {
    border-color: var(--accent-color);
    box-shadow: 0 0 14px var(--accent-glow);
}

.toast-info .toast-icon {
    color: var(--accent-color);
}

.toast-message {
    flex: 1;
    line-height: 1.4;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
    padding: 2px;
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast-hiding {
    opacity: 0;
    transform: translateY(10px);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

