/* ================================================================
   Rare Indian Currency Note Collection System
   Main Stylesheet — Google Material UI
   Font: Inter | Design: Crisp, Minimal, highly professional
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
    /* Base system */
    --bg-base:       #f8f9fa;
    --bg-secondary:  #ffffff;
    --bg-surface:    #f1f3f4;
    --bg-card:       #ffffff;
    --border:        #dadce0;
    --border-hover:  #b6c4df;

    /* Semantic Colors */
    --gold:          #1a73e8; 
    --gold-light:    #4285f4;
    --gold-dark:     #174ea6;
    --gold-glow:     rgba(26, 115, 232, 0.08);

    /* Premium / Public Palette */
    --p-primary:     #1a73e8;
    --p-accent:      #d4af37; /* Actual Metallic Gold */
    --p-bg:          #ffffff;
    --p-text:        #1f2937;
    --p-text-muted:  #6b7280;
    --p-glass:       rgba(255, 255, 255, 0.7);
    --p-glass-border: rgba(255, 255, 255, 0.4);
    --p-shadow:      0 10px 40px rgba(0, 0, 0, 0.04);
    
    --text:          #202124;
    --text-muted:    #5f6368;
    --text-dim:      #80868b;


    --success:       #188038;
    --danger:        #d93025;
    --warning:       #f29900;
    --info:          #1a73e8;
    --purple:        #9334e6;

    --sidebar-w:     260px;
    --topbar-h:      64px;
    --radius:        8px;
    --radius-sm:     6px;
    --radius-lg:     12px;

    --shadow:        0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    --shadow-hover:  0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
    --shadow-gold:   0 1px 2px 0 rgba(26,115,232,0.3), 0 1px 3px 1px rgba(26,115,232,0.15);
    --transition:    0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-base);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

h1, h2, h3, h4, .premium-font {
    font-family: 'Outfit', sans-serif;
}

a { color: var(--gold); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold-dark); }
img { max-width: 100%; display: block; }

/* ── Premium Utilities ──────────────────────────────────────── */
.glass {
    background: var(--p-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--p-glass-border);
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.mesh-gradient {
    background: radial-gradient(at 0% 0%, rgba(26, 115, 232, 0.05) 0px, transparent 50%),
                radial-gradient(at 100% 0%, rgba(212, 175, 55, 0.05) 0px, transparent 50%),
                radial-gradient(at 100% 100%, rgba(26, 115, 232, 0.05) 0px, transparent 50%),
                radial-gradient(at 0% 100%, rgba(212, 175, 55, 0.05) 0px, transparent 50%);
}


/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #dadce0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #bdc1c6; }

/* ================================================================
   ADMIN LAYOUT
   ================================================================ */
.admin-body { display: flex; height: 100vh; overflow: hidden; background: var(--bg-base); }

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
    overflow-y: auto;
}

.sidebar-header {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--topbar-h);
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
    width: 32px; height: 32px;
    background: var(--gold);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; color: #fff;
}
.logo-title { font-size: 18px; font-weight: 500; color: var(--text); display: block; letter-spacing: -0.02em; }
.logo-sub   { display: none; }

.sidebar-toggle {
    display: none; flex-direction: column; gap: 4px;
    background: none; border: none; cursor: pointer; padding: 4px;
}
.sidebar-toggle span {
    display: block; width: 22px; height: 2px;
    background: var(--text-muted); border-radius: 2px;
    transition: var(--transition);
}

.sidebar-nav { flex: 1; padding: 8px 12px; overflow-y: auto; }

.nav-section { padding: 4px 0; }
.nav-section-title {
    font-size: 12px; font-weight: 500; letter-spacing: 0.05em;
    color: var(--text-muted); text-transform: uppercase;
    padding: 8px 16px; display: block;
}

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    color: var(--text-muted);
    font-size: 14px; font-weight: 500;
    border-radius: 24px; /* Pill shape for Google */
    transition: var(--transition);
    position: relative;
    text-decoration: none;
    margin-bottom: 2px;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; }
.nav-item:hover { color: var(--text); background: var(--bg-surface); }
.nav-item.active {
    color: var(--gold-dark);
    background: #e8f0fe;
}
.nav-item.active svg { stroke: var(--gold-dark); }

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.user-avatar {
    width: 32px; height: 32px;
    background: var(--gold);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 600; color: #fff;
    flex-shrink: 0;
}
.user-details { flex: 1; min-width: 0; }
.user-name  { font-size: 13px; font-weight: 600; color: var(--text); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { font-size: 11px; color: var(--text-muted); display: block; }

.logout-btn {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); border-radius: 50%;
    transition: var(--transition);
    flex-shrink: 0;
}
.logout-btn:hover { color: var(--text); background: var(--bg-surface); }
.logout-btn svg { width: 18px; height: 18px; }

/* ── Main Content ───────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-width: 0;
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 16px;
    padding: 0 24px;
    position: sticky; top: 0; z-index: 50;
}

.topbar-title h1 {
    font-size: 20px; font-weight: 500; color: var(--text);
    line-height: 1; letter-spacing: -0.01em;
}

.topbar-actions { margin-left: auto; display: flex; gap: 8px; }
.topbar-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); border-radius: 50%;
    transition: var(--transition); border: none; background: transparent;
}
.topbar-btn:hover { background: var(--bg-surface); color: var(--text); }
.topbar-btn svg { width: 20px; height: 20px; }

.mobile-toggle {
    display: none; flex-direction: column; gap: 4px;
    background: none; border: none; cursor: pointer; padding: 6px;
}
.mobile-toggle span { display: block; width: 20px; height: 2px; background: var(--text-muted); border-radius: 2px; }

/* ── Content Area ───────────────────────────────────────────── */
.content-area { flex: 1; padding: 24px; overflow-y: auto; }

/* ================================================================
   CARDS
   ================================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow); }

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px;
}
.card-title { font-size: 16px; font-weight: 500; flex: 1; color: var(--text); }
.card-badge {
    font-size: 12px; font-weight: 500;
    background: #e6f4ea;
    color: #137333;
    padding: 4px 12px; border-radius: 24px;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
    display: inline-flex; align-items: center; gap: 8px; justify-content: center;
    padding: 8px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 14px; font-weight: 500;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.5;
    letter-spacing: 0.01em;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--gold);
    color: #fff; font-weight: 500;
}
.btn-primary:hover:not(:disabled) {
    background: var(--gold-dark);
    box-shadow: var(--shadow);
}

.btn-ghost {
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: #f8f9fa; color: var(--gold-dark); }

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}
.btn-success:hover { background: var(--success); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 14px; }

/* ================================================================
   ALERTS
   ================================================================ */
.alert {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px; line-height: 1.5;
    margin-bottom: 20px;
    border: 1px solid transparent;
    position: relative;
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }

.alert-success { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.25); color: #6ee7b7; }
.alert-error    { background: rgba(239, 68, 68, 0.1);  border-color: rgba(239, 68, 68, 0.25);  color: #fca5a5; }
.alert-warning  { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.25); color: #fcd34d; }

.alert-close {
    position: absolute; top: 10px; right: 12px;
    background: none; border: none; cursor: pointer;
    color: inherit; font-size: 18px; line-height: 1; opacity: 0.6;
}
.alert-close:hover { opacity: 1; }

.error-list { padding-left: 16px; }
.error-list li { margin-bottom: 4px; }

/* ================================================================
   FORMS
   ================================================================ */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.form-label {
    font-size: 14px; font-weight: 500; color: var(--text);
    display: flex; align-items: center; gap: 6px;
}
.label-hint { font-size: 12px; color: var(--text-muted); font-weight: 400; }
.required { color: var(--danger); }

.form-input, .form-select, .form-textarea {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    padding: 10px 14px;
    transition: var(--transition);
    width: 100%;
    outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 2px var(--gold-glow);
}
.form-input::placeholder { color: var(--text-dim); }
.form-select { cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
    padding-right: 36px;
}
.form-select option { background: var(--bg-card); color: var(--text); }
.form-textarea { resize: vertical; min-height: 90px; }

.input-wrapper { position: relative; display: flex; align-items: center; }
.input-icon {
    position: absolute; left: 12px; width: 18px; height: 18px;
    stroke: var(--text-muted); pointer-events: none;
}
.input-wrapper .form-input { padding-left: 40px; }
.toggle-password {
    position: absolute; right: 12px;
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); display: flex; align-items: center;
}
.toggle-password svg { width: 18px; height: 18px; }
.toggle-password:hover { color: var(--gold); }

/* Serial input row */
.serial-input-wrap { display: flex; gap: 8px; }
.serial-input { font-family: 'Courier New', monospace; letter-spacing: 0.1em; text-transform: uppercase; }

/* Fancy number checkboxes */
.fancy-checkboxes {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.fancy-check-label {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 20px;
    font-size: 12px; font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    transition: var(--transition);
    user-select: none;
}
.fancy-check-label input { display: none; }
.fancy-check-label:has(input:checked) { border-color: currentColor; background: rgba(currentColor, 0.1); }

/* Fancy suggestions */
.fancy-suggestions {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-top: 6px; min-height: 24px;
}
.suggestion-item {
    font-size: 12px; padding: 4px 12px;
    border-radius: 16px; cursor: pointer;
    background: #e8f0fe; color: var(--gold-dark);
    border: 1px solid #d2e3fc;
}

/* Form grid */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-col-full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.form-page { max-width: 900px; margin: 0 auto; }
.form-card  { padding: 28px; }

.form-actions {
    display: flex; justify-content: flex-end; gap: 12px;
    padding-top: 24px; margin-top: 24px;
    border-top: 1px solid var(--border);
}

/* Upload Zones */
.section-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.section-hint  { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; }
.upload-section { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .upload-grid { grid-template-columns: 1fr; } }

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px; text-align: center;
    transition: var(--transition); position: relative;
    background: var(--bg-surface);
}
.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--gold); background: var(--gold-glow);
}
.upload-input {
    position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer; z-index: 2;
}
.upload-label { cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.upload-icon svg { width: 32px; height: 32px; stroke: var(--text-dim); }
.upload-title { font-size: 13px; font-weight: 600; }
.upload-hint  { font-size: 11px; color: var(--text-muted); }

.upload-preview {
    width: 100%;
    max-height: 180px;
    object-fit: contain;
    border-radius: 8px;
    margin: 8px auto 0;
    display: none;
    border: 1px solid var(--border);
    background: #f8f9fa;
}

/* Existing images */
.existing-images { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.existing-img-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.existing-img-item { position: relative; width: 140px; }
.existing-img { width: 140px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.img-type-badge {
    position: absolute; top: 6px; left: 6px;
    font-size: 10px; padding: 2px 6px; border-radius: 4px;
    background: rgba(0,0,0,0.7); color: var(--gold); font-weight: 600;
}
.img-remove-btn {
    position: absolute; top: 4px; right: 4px;
    width: 22px; height: 22px;
    background: rgba(239, 68, 68, 0.9); color: #fff;
    border: none; border-radius: 50%; cursor: pointer;
    font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center;
}

/* ================================================================
   DASHBOARD
   ================================================================ */
.dashboard { display: flex; flex-direction: column; gap: 24px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex; align-items: center; gap: 16px;
    transition: var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow); }

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-card--gold .stat-icon  { background: #e8f0fe; }
.stat-card--red  .stat-icon  { background: #fce8e6; }
.stat-card--green .stat-icon { background: #e6f4ea; }
.stat-card--blue  .stat-icon { background: #fef7e0; }

.stat-icon svg { width: 24px; height: 24px; }
.stat-card--gold .stat-icon svg  { stroke: #1a73e8; }
.stat-card--red  .stat-icon svg  { stroke: #d93025; }
.stat-card--green .stat-icon svg { stroke: #188038; }
.stat-card--blue  .stat-icon svg { stroke: #f29900; }

.stat-value { font-size: 28px; font-weight: 500; display: block; line-height: 1; color: var(--text); }
.stat-label { font-size: 13px; color: var(--text-muted); display: block; margin-top: 4px; }

/* Dashboard grid */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* Denomination bars */
.denom-bars { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.denom-bar-row { display: flex; align-items: center; gap: 12px; }
.denom-label { font-size: 12px; font-weight: 600; color: var(--gold); width: 40px; text-align: right; flex-shrink: 0; }
.denom-bar-track {
    flex: 1; height: 8px; background: rgba(255,255,255,0.05);
    border-radius: 4px; overflow: hidden;
}
.denom-bar-fill {
    height: 100%; border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.denom-count { font-size: 12px; color: var(--text-muted); width: 30px; text-align: right; flex-shrink: 0; }

/* Activity feed */
.activity-feed { padding: 4px 0; }
.activity-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-blue   { background: var(--info); }
.dot-green  { background: var(--success); }
.dot-red    { background: var(--danger); }
.dot-gold   { background: var(--gold); }
.dot-gray   { background: var(--text-dim); }

.activity-body { flex: 1; min-width: 0; }
.activity-action { font-size: 13px; font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-user   { font-size: 11px; color: var(--text-muted); }
.activity-time   { font-size: 11px; color: var(--text-dim); margin-left: 6px; }
.activity-ip     { font-size: 11px; color: var(--text-dim); font-family: monospace; }

/* Recent notes list */
.recent-notes-list { padding: 8px 0; }
.recent-note-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: var(--transition); text-decoration: none;
}
.recent-note-item:hover { background: var(--bg-surface); }
.recent-note-item:last-child { border-bottom: none; }
.note-date { font-size: 12px; color: var(--text-muted); margin-left: auto; }

/* ================================================================
   NOTES GRID
   ================================================================ */
.notes-page { display: flex; flex-direction: column; gap: 20px; }

.filters-card { padding: 16px 20px; }
.filters-form {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: 1;
}
.filters-form + .notes-count {
    font-size: 13px; color: var(--text-muted); white-space: nowrap;
}
.filter-group { flex: 1; min-width: 140px; }
.notes-count { font-size: 13px; color: var(--text-muted); padding-top: 8px; }

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.notes-grid--dense {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.note-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex; flex-direction: column;
}
.note-card:hover {
    box-shadow: var(--shadow-hover);
}
.note-card--deleted { opacity: 0.6; }

.note-image-wrap  { position: relative; aspect-ratio: 2 / 1; overflow: hidden; background: rgba(255,255,255,0.02); }
.note-img         { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.note-card:hover .note-img { transform: scale(1.04); }
.note-img-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 700; color: var(--gold-dark);
    background: linear-gradient(135deg, rgba(212,175,55,0.08), rgba(212,175,55,0.02));
}
.denom-badge--overlay {
    position: absolute; top: 8px; right: 8px;
}

.note-card-body { padding: 14px; flex: 1; }
.note-serial     { font-size: 15px; font-weight: 600; font-family: 'Courier New', monospace; letter-spacing: 0.05em; color: var(--text); }
.note-meta       { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.note-meta span  { font-size: 12px; color: var(--text-muted); }
.note-tags       { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }

/* Compact modifier */
.note-card--compact .note-card-body { padding: 10px 12px; }
.note-card--compact .note-serial { font-size: 13px; letter-spacing: 0; }
.note-card--compact .note-meta { margin-top: 2px; }
.note-card--compact .note-meta span { font-size: 11px; }
.note-card--compact .denom-badge--overlay { padding: 2px 6px; font-size: 11px; top: 6px; right: 6px; }
.note-card--compact .note-tags { margin-top: 6px; gap: 3px; }
.note-card--compact .tag { padding: 1px 6px; font-size: 9px; line-height: 1.4; border-width: 0; }
.note-card--compact .badge-error-note { padding: 1px 6px; font-size: 9px; font-weight: 600; }
.note-card--compact .note-card-actions { padding: 6px 10px; }
.note-card--compact .note-card-actions .btn { font-size: 11px; padding: 4px 8px; height: 32px; }
.note-card--compact .note-card-actions .btn svg { width: 14px; height: 14px; }
.note-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 4px; }
.note-card--compact .condition-badge { font-size: 9px; padding: 2px 4px; }

.note-card-actions {
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    display: flex; gap: 6px; align-items: center;
    background: #f8f9fa;
}

/* ── Badges & Tags ─────────────────────────────────────────── */
.denom-badge {
    display: inline-flex; align-items: center; justify-content: center;
    background: #1a73e8;
    color: #fff; font-size: 13px; font-weight: 500;
    padding: 4px 10px; border-radius: 12px;
}

.condition-badge {
    font-size: 10px; font-weight: 600;
    background: rgba(59,130,246,0.15);
    color: var(--info); padding: 2px 7px;
    border-radius: 4px;
}

.tag {
    font-size: 10px; font-weight: 500;
    padding: 2px 8px; border-radius: 10px;
    white-space: nowrap;
}
.badge-birthday   { background: rgba(236,72,153,0.15); color: #f472b6; border: 1px solid rgba(236,72,153,0.25); }
.badge-repeater   { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); }
.badge-ladder     { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.25); }
.badge-palindrome { background: rgba(139,92,246,0.15); color: #a78bfa; border: 1px solid rgba(139,92,246,0.25); }
.badge-radar      { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.badge-solid      { background: rgba(212,175,55,0.15); color: var(--gold); border: 1px solid rgba(212,175,55,0.3); }
.badge-sequential { background: rgba(20,184,166,0.15); color: #2dd4bf; border: 1px solid rgba(20,184,166,0.25); }
.badge-mirror     { background: rgba(249,115,22,0.15); color: #fb923c; border: 1px solid rgba(249,115,22,0.25); }
.badge-default    { background: var(--bg-surface); color: var(--text-muted); border: 1px solid var(--border); }
.badge-danger     { background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.25); }
.badge-error-note {
    background: rgba(220, 38, 38, 0.12);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.35);
    font-weight: 700;
    letter-spacing: 0.03em;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    white-space: nowrap;
}


/* ── Empty State ──────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 24px; }
.empty-icon  { font-size: 60px; color: var(--text-dim); margin-bottom: 16px; }
.empty-state h2 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.empty-state p  { color: var(--text-muted); font-size: 14px; }
.empty-text     { color: var(--text-muted); font-size: 13px; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; padding: 20px 0; align-items: center; }
.page-btn {
    min-width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px; font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
}
.page-btn:hover { border-color: var(--gold); color: var(--gold); }
.page-btn.active { background: var(--gold); border-color: var(--gold); color: #000; font-weight: 700; }

/* ── Tables ──────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table th, .data-table td { padding: 12px 16px; font-size: 13px; text-align: left; }
.data-table th { font-weight: 500; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { border-bottom: 1px solid var(--border); }
.data-table tbody tr:hover { background: #f8f9fa; }
.data-table tbody tr:last-child td { border-bottom: none; }
.table-responsive { overflow-x: auto; }

.detail-table { width: 100%; }
.detail-table th, .detail-table td { padding: 12px 20px; font-size: 13px; border-bottom: 1px solid var(--border); }
.detail-table th { width: 180px; color: var(--text-muted); font-weight: 500; }
.detail-table tr:last-child th, .detail-table tr:last-child td { border-bottom: none; }

.serial-mono { font-family: 'Courier New', monospace; font-size: 13px; letter-spacing: 0.05em; }
.ip-code     { font-family: 'Courier New', monospace; font-size: 12px; color: var(--text-muted); }
.log-id      { color: var(--text-dim); font-size: 12px; }
.log-details { color: var(--text-muted); }
.log-time    { color: var(--text-dim); white-space: nowrap; }
.entity-tag  { font-size: 11px; padding: 2px 7px; border-radius: 4px; background: var(--bg-surface); color: var(--text-muted); border: 1px solid var(--border); }

/* Action badges */
.action-badge { font-size: 11px; font-weight: 500; padding: 3px 8px; border-radius: 4px; white-space: nowrap; }
.action-admin-login        { background: #e8f0fe; color: #1a73e8; }
.action-admin-login-fail   { background: #fce8e6; color: #d93025; }
.action-admin-logout       { background: #f1f3f4; color: #5f6368; }
.action-note-create        { background: #e6f4ea; color: #188038; }
.action-note-update        { background: #fef7e0; color: #b08a00; }
.action-note-soft-delete   { background: #fce8e6; color: #d93025; }
.action-note-restore       { background: #f3e8fd; color: #9334e6; }
.action-image-upload       { background: #e8f0fe; color: #1a73e8; }
.action-backup-run         { background: #e6f4ea; color: #188038; }
.action-backup-download    { background: #f8f9fa; color: #5f6368; }

/* ================================================================
   NOTE DETAIL PAGE
   ================================================================ */
.note-detail-page { display: flex; flex-direction: column; gap: 24px; }
.note-detail-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 20px; flex-wrap: wrap;
}
.detail-serial { font-size: 26px; font-weight: 700; font-family: 'Inter', monospace; letter-spacing: 0.04em; color: var(--text); }
.detail-meta-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.detail-year { font-size: 13px; color: var(--text-muted); }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.note-images-section { }
.detail-images-grid { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; }
.detail-img-wrap { position: relative; }
.detail-img { max-width: 300px; height: 180px; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; background: #f8f9fa; }
.detail-img-meta { margin-top: 6px; display: flex; justify-content: space-between; align-items: center; }
.img-meta-hash { font-size: 10px; color: var(--text-dim); font-family: monospace; }

/* ================================================================
   BACKUP PAGE
   ================================================================ */
.backup-page { display: flex; flex-direction: column; gap: 24px; }
.backup-options { padding: 20px; }
.backup-type-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }

.backup-type-card {
    flex: 1; min-width: 160px; cursor: pointer;
    border: 2px solid var(--border); border-radius: var(--radius);
    transition: var(--transition); user-select: none;
}
.backup-type-card:has(input:checked), .backup-type-card.selected {
    border-color: var(--gold);
    background: var(--gold-glow);
}
.backup-type-card input { display: none; }
.backup-type-body {
    padding: 18px; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.backup-type-body svg { width: 28px; height: 28px; stroke: var(--text-muted); }
.backup-type-card:has(input:checked) svg { stroke: var(--gold); }
.backup-type-body span { font-size: 13px; font-weight: 600; }
.backup-type-body small { font-size: 11px; color: var(--text-muted); }

.cron-info { padding: 20px; }
.cron-info p { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.code-block { background: rgba(0,0,0,0.4); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; font-size: 12px; font-family: 'Courier New', monospace; color: #a5f3fc; overflow-x: auto; white-space: nowrap; }
.cron-note { font-size: 12px; color: var(--warning); margin-top: 10px; }

.backup-table-wrap { overflow-x: auto; }

/* ================================================================
   CROPPER MODAL
   ================================================================ */
.custom-crop-modal {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.custom-crop-overlay {
    position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}
.custom-crop-content {
    background: #ffffff; border-radius: 12px; width: 100%; max-width: 800px;
    position: relative; z-index: 1; display: flex; flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2); overflow: hidden;
    animation: fadeScale 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes fadeScale { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

.custom-crop-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 24px; border-bottom: 1px solid var(--border);
}
.custom-crop-header h3 { font-size: 18px; font-weight: 500; color: var(--text); }
.custom-crop-close { background: none; border: none; font-size: 20px; color: var(--text-muted); cursor: pointer; }

.custom-crop-body { padding: 0; background: #2d2d2d; }
.img-container {
    /* Fixed height so Cropper.js can calculate correctly.
       Using height (not max-height) is essential — Cropper measures
       the container dimensions at init time. A max-height lets the
       container collapse to 0 before Cropper reads it. */
    height: 52vh;
    width: 100%;
    position: relative;
    background: #1a1a1a;
}
.img-container img { max-width: 100%; display: block; }
.cropper-hint { font-size: 13px; color: var(--text-muted); margin-top: 12px; text-align: center; }

.custom-crop-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 20px; border-top: 1px solid var(--border);
    background: #ffffff; gap: 12px; flex-wrap: wrap;
}
.crop-footer-hint { font-size: 12px; color: var(--text-muted); flex: 1; }
.crop-footer-btns { display: flex; gap: 10px; }

/* Rotation/Flip toolbar */
.crop-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 20px; background: #f8f9fa;
    border-top: 1px solid var(--border); gap: 8px; flex-wrap: wrap;
}
.crop-toolbar-group { display: flex; gap: 6px; flex-wrap: wrap; }

.crop-tb-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 13px; border-radius: 20px; cursor: pointer;
    border: 1px solid var(--border); background: #ffffff;
    font-size: 12px; font-weight: 500; color: var(--text);
    transition: all 0.15s ease;
}
.crop-tb-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.crop-tb-btn:hover {
    background: #e8f0fe; border-color: #1a73e8; color: #1a73e8;
}
.crop-tb-btn:hover svg { stroke: #1a73e8; }
.crop-tb-reset:hover {
    background: #fce8e8; border-color: #dc2626; color: #dc2626;
}
.crop-tb-reset:hover svg { stroke: #dc2626; }

/* Auto-Level & Auto-Crop special buttons */
.crop-tb-auto {
    background: linear-gradient(135deg, #e8f5e9, #e8f0fe);
    border-color: #34a853; color: #188038; font-weight: 600;
}
.crop-tb-auto svg { stroke: #188038; }
.crop-tb-auto:hover {
    background: linear-gradient(135deg, #c8e6c9, #d2e3fc);
    border-color: #137333; color: #137333;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(52,168,83,0.25);
}
.crop-tb-auto:hover svg { stroke: #137333; }
.crop-tb-auto:disabled {
    opacity: 0.65; cursor: not-allowed; transform: none; box-shadow: none;
}

/* ================================================================
   LOGIN PAGE
   ================================================================ */
.login-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; background: #f8f9fa; position: relative; overflow: hidden;
}

.login-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.login-orb {
    position: absolute; border-radius: 50%;
    filter: blur(80px); opacity: 0.08;
}
.login-orb-1 { width: 400px; height: 400px; background: #1a73e8; top: -100px; right: -100px; animation: orbit1 20s ease-in-out infinite; }
.login-orb-2 { width: 300px; height: 300px; background: #188038; bottom: -50px; left: -50px; animation: orbit2 25s ease-in-out infinite; }
.login-orb-3 { width: 300px; height: 300px; background: #f29900; top: 50%; left: 50%; transform: translate(-50%,-50%); animation: orbit3 15s ease-in-out infinite; }

@keyframes orbit1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-40px, 30px); } }
@keyframes orbit2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(30px, -20px); } }
@keyframes orbit3 { 0%,100% { opacity: 0.05; } 50% { opacity: 0.1; } }

.login-wrapper { position: relative; z-index: 1; width: 100%; max-width: 440px; padding: 20px; }

.login-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow-hover);
    animation: fadeUp 0.4s ease;
}
@keyframes fadeUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

.login-header { text-align: center; margin-bottom: 32px; }
.login-logo {
    width: 56px; height: 56px; margin: 0 auto 16px;
    background: #1a73e8;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 700; color: #fff;
    box-shadow: 0 4px 12px rgba(26,115,232,0.2);
}
.login-title    { font-size: 24px; font-weight: 500; margin-bottom: 4px; color: var(--text); }
.login-subtitle { font-size: 14px; color: var(--text-muted); }

.login-form { display: flex; flex-direction: column; gap: 0; }
.login-btn { width: 100%; margin-top: 12px; justify-content: center; font-size: 14px; padding: 12px; border-radius: 4px; }
.login-footer { margin-top: 24px; text-align: center; color: var(--text-dim); font-size: 13px; }
.login-footer code { font-size: 12px; color: #1a73e8; }

/* ================================================================
   PUBLIC SITE
   ================================================================ */
.public-body { background: #ffffff; min-height: 100vh; }

.public-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    height: 64px;
}
.nav-container {
    max-width: 1200px; margin: 0 auto; padding: 0 24px;
    height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.pub-logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 18px; font-weight: 500; color: var(--text);
    text-decoration: none; letter-spacing: -0.01em;
}
.pub-logo .logo-icon {
    width: 32px; height: 32px; font-size: 16px; border-radius: 6px;
    background: #1a73e8; color: #fff;
    display: flex; align-items: center; justify-content: center;
}
.nav-admin-btn {
    font-size: 14px; font-weight: 500; color: #1a73e8;
    padding: 6px 16px; border: 1px solid #1a73e8;
    border-radius: 4px; transition: var(--transition);
    text-decoration: none;
}
.nav-admin-btn:hover { background: #e8f0fe; }

/* Hero */
.pub-hero {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden; padding: 100px 24px 80px;
}
.hero-bg-pattern {
    position: absolute; inset: 0;
    background-image: radial-gradient(circle at 20% 50%, rgba(26,115,232,0.06) 0%, transparent 50%),
                      radial-gradient(circle at 80% 50%, rgba(24,128,56,0.06) 0%, transparent 50%);
    pointer-events: none;
}
.hero-content {
    position: relative; z-index: 1;
    max-width: 680px; text-align: center;
}
.hero-badge {
    display: inline-block; font-size: 12px; font-weight: 500;
    background: #e8f0fe; color: #1a73e8;
    padding: 6px 16px; border-radius: 20px; margin-bottom: 20px;
}
.hero-title {
    font-size: clamp(36px, 6vw, 64px); font-weight: 700;
    line-height: 1.15; margin-bottom: 16px; color: var(--text); letter-spacing: -0.02em;
}
.gold-text { color: #1a73e8; }
.hero-subtitle {
    font-size: 16px; color: var(--text-muted); margin-bottom: 36px;
    line-height: 1.6; max-width: 520px; margin-left: auto; margin-right: auto;
}
.hero-micro { font-size: 12px; color: var(--text-dim); margin-top: 12px; }

/* DOB Search */
.dob-search-form { max-width: 500px; margin: 0 auto; }
.dob-input-wrap {
    display: flex; align-items: center;
    background: #ffffff;
    border: 1px solid #dadce0; border-radius: 24px;
    padding: 6px 6px 6px 16px;
    gap: 8px; box-shadow: 0 1px 6px rgba(32,33,36,0.1);
    transition: var(--transition);
}
.dob-input-wrap:focus-within { box-shadow: 0 1px 6px rgba(32,33,36,0.2); border-color: #1a73e8; }
.dob-icon { width: 20px; height: 20px; stroke: #5f6368; flex-shrink: 0; }
.dob-input {
    flex: 1; background: none; border: none; outline: none;
    color: var(--text); font-family: 'Inter', sans-serif;
    font-size: 15px;
}
.dob-search-btn {
    background: #1a73e8;
    color: #fff; border: none; border-radius: 20px;
    padding: 10px 24px; font-family: 'Inter', sans-serif;
    font-size: 14px; font-weight: 500; cursor: pointer;
    transition: var(--transition); white-space: nowrap;
}
.dob-search-btn:hover { background: #174ea6; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }

/* Floating notes */
.hero-notes-float { position: absolute; right: 5%; top: 50%; transform: translateY(-50%); opacity: 0.12; pointer-events: none; }
.float-note {
    background: #f8f9fa;
    color: #5f6368; border: 1px solid #dadce0; text-align: center;
    padding: 16px 20px; border-radius: 8px; font-size: 14px; font-weight: 500;
    margin-bottom: 12px; line-height: 1.4; min-width: 100px;
}
.float-note-1 { transform: rotate(-8deg); }
.float-note-2 { transform: rotate(5deg) translateX(10px); }
.float-note-3 { transform: rotate(-3deg); }

/* Container */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* Results */
.pub-results { padding: 60px 0; }
.results-title { font-size: 22px; font-weight: 700; margin-bottom: 28px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.results-count { font-size: 14px; color: var(--text-muted); font-weight: 400; }

.pub-notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.pub-note-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
    transition: var(--transition);
}
.pub-note-card:hover { border-color: var(--border-hover); transform: translateY(-3px); box-shadow: var(--shadow-gold); }
.pub-note-denom { font-size: 24px; font-weight: 800; color: var(--gold); margin-bottom: 8px; }
.pub-note-serial { font-family: 'Courier New', monospace; font-size: 15px; font-weight: 600; letter-spacing: 0.1em; }
.pub-note-year   { font-size: 12px; color: var(--text-muted); margin: 6px 0 10px; }

.no-results { text-align: center; padding: 60px 24px; }
.no-results-icon { font-size: 60px; color: var(--text-dim); margin-bottom: 16px; }
.no-results h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.no-results p  { color: var(--text-muted); font-size: 14px; }

/* Features */
.pub-features { padding: 80px 0; background: #f8f9fa; }
.features-title { font-size: 28px; font-weight: 700; text-align: center; margin-bottom: 40px; color: var(--text); }
.features-grid  { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.feature-card {
    background: #ffffff; border: 1px solid var(--border);
    border-radius: 8px; padding: 24px;
    text-align: center; transition: var(--transition);
}
.feature-card:hover { border-color: var(--border-hover); transform: translateY(-3px); box-shadow: var(--shadow); }
.feature-icon { font-size: 36px; margin-bottom: 12px; }
.feature-card h3 { font-size: 16px; font-weight: 500; margin-bottom: 8px; color: var(--text); }
.feature-card p  { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* Footer */
.public-footer  { padding: 32px 24px; border-top: 1px solid var(--border); text-align: center; }
.footer-container { max-width: 600px; margin: 0 auto; }
.public-footer p { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.footer-note { font-size: 11px; color: var(--text-dim); }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 40px rgba(0,0,0,0.6);
    }
    .main-content { margin-left: 0; }
    .mobile-toggle { display: flex; }
    .sidebar-toggle { display: flex; }
    .content-area { padding: 16px; }

    .stats-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }

    .form-card { padding: 20px; }
    .notes-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

    .detail-images-grid .detail-img { max-width: 100%; }
    .note-detail-header { flex-direction: column; }

    .hero-notes-float { display: none; }
    .features-grid    { grid-template-columns: 1fr 1fr; }
    .backup-type-grid { flex-direction: column; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .upload-grid { grid-template-columns: 1fr; }
    .dob-input-wrap { flex-direction: column; padding: 12px; }
    .dob-search-btn { width: 100%; }
    .form-actions { flex-direction: column; }
    .features-grid { grid-template-columns: 1fr; }
}

/* ================================================================
   UTILITY
   ================================================================ */
.text-gold   { color: var(--gold); }
.text-muted  { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }


/* ================================================================
   NOTE IMAGE VIEWER (FULL VIEW & DEEP CHECK)
   ================================================================ */
.note-viewer-modal {
    position: fixed; inset: 0; z-index: 2000;
    display: none; flex-direction: column;
    background: rgba(10, 10, 12, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    animation: viewerFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes viewerFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.viewer-header {
    height: 72px; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff; z-index: 10;
}

.viewer-info { display: flex; flex-direction: column; gap: 2px; }
.viewer-title { font-size: 16px; font-weight: 600; letter-spacing: 0.02em; }
.viewer-meta  { font-size: 11px; color: rgba(255,255,255,0.5); font-family: monospace; }

.viewer-controls { display: flex; align-items: center; gap: 8px; }
.v-btn {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff; cursor: pointer; transition: all 0.2s;
}
.v-btn:hover { background: rgba(255, 255, 255, 0.2); transform: translateY(-2px); }
.v-btn svg { width: 20px; height: 20px; }
.v-btn-close:hover { background: #ef4444; border-color: #ef4444; }

.viewer-stage {
    flex: 1; position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    cursor: grab;
}
.viewer-stage:active { cursor: grabbing; }

.viewer-img-wrap {
    transition: transform 0.1s linear;
    transform-origin: center center;
    display: flex; align-items: center; justify-content: center;
    will-change: transform;
}
.viewer-img {
    max-width: 90vw; max-height: 80vh;
    object-fit: contain;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border-radius: 4px;
    user-select: none;
    -webkit-user-drag: none;
    background: #000;
}

.viewer-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 60px; height: 60px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff; cursor: pointer; z-index: 5;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.viewer-nav:hover { background: rgba(255, 255, 255, 0.15); scale: 1.1; }
.v-nav-prev { left: 40px; }
.v-nav-next { right: 40px; }

.deep-check-indicator {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    padding: 8px 16px; border-radius: 20px;
    background: rgba(26, 115, 232, 0.2);
    border: 1px solid rgba(26, 115, 232, 0.4);
    color: #8ab4f8; font-size: 12px; font-weight: 600;
    display: flex; align-items: center; gap: 8px;
    backdrop-filter: blur(10px); z-index: 5;
    pointer-events: none; opacity: 0; transition: opacity 0.3s;
}
.deep-check-indicator.active { opacity: 1; }
.pulse-dot {
    width: 8px; height: 8px; background: #1a73e8; border-radius: 50%;
    animation: v-pulse 1.5s infinite;
}
@keyframes v-pulse {
    0% { box-shadow: 0 0 0 0 rgba(26, 115, 232, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(26, 115, 232, 0); }
    100% { box-shadow: 0 0 0 0 rgba(26, 115, 232, 0); }
}

.zoom-overlay {
    position: absolute; bottom: 30px; right: 30px;
    background: rgba(0,0,0,0.5); border-radius: 8px;
    padding: 8px 12px; color: #fff; font-size: 12px;
    font-family: monospace; z-index: 5; border: 1px solid rgba(255,255,255,0.1);
}

/* Detail page enhancements */
.detail-img-wrap {
    cursor: zoom-in; position: relative;
    transition: transform 0.3s ease;
}
.detail-img-wrap:hover { transform: translateY(-4px); }
.detail-img-wrap::after {
    content: 'Click to Inspect';
    position: absolute; inset: 0;
    background: rgba(26, 115, 232, 0.4);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 12px; font-weight: 600;
    opacity: 0; transition: 0.2s; border-radius: 8px;
    backdrop-filter: blur(2px);
}
.detail-img-wrap:hover::after { opacity: 1; }

/* ================================================================
   CENTRAL CONFIRM MODAL (RARE CONFIRM)
   ================================================================ */
.rare-confirm-modal {
    position: fixed; inset: 0; z-index: 9999;
    display: none; align-items: center; justify-content: center;
    padding: 24px;
}
.rc-overlay {
    position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    animation: rcFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes rcFadeIn { from { opacity: 0; } to { opacity: 1; } }

.rc-card {
    background: var(--bg-card); border-radius: 12px; width: 100%; max-width: 400px;
    position: relative; z-index: 1; display: flex; flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2); overflow: hidden;
    animation: rcSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
}
@keyframes rcSlideUp { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.rc-header {
    padding: 24px 24px 16px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px;
}
.rc-icon {
    width: 48px; height: 48px; border-radius: 50%;
    background: #fef7e0; color: #f29900;
    display: flex; align-items: center; justify-content: center;
}
.rc-icon.danger { background: #fce8e6; color: #d93025; }
.rc-icon svg { width: 24px; height: 24px; }
.rc-title { font-size: 18px; font-weight: 600; color: var(--text); }

.rc-body {
    padding: 0 24px 24px; text-align: center;
}
.rc-body p { font-size: 14px; color: var(--text-muted); line-height: 1.5; }

.rc-footer {
    display: flex; padding: 16px 24px; background: #f8f9fa;
    border-top: 1px solid var(--border); gap: 12px; justify-content: flex-end;
}

/* ================================================================
   FANCY NUMBERS DASHBOARD
   ================================================================ */
.fancy-page { display: flex; flex-direction: column; gap: 24px; }

.fancy-page-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    flex-wrap: wrap; gap: 16px;
}
.fancy-page-title { font-size: 24px; font-weight: 700; color: var(--text); }
.fancy-page-sub   { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.fancy-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Type stat cards */
.fancy-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
}
.fancy-stat-card {
    background: var(--bg-card); border: 2px solid var(--border);
    border-radius: var(--radius); padding: 16px 12px;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    text-decoration: none; color: var(--text);
    transition: var(--transition); cursor: pointer;
    text-align: center;
}
.fancy-stat-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.fancy-stat-card.active { border-color: var(--gold); background: #e8f0fe; }
.fsc-icon  { font-size: 26px; }
.fsc-count { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; }
.fsc-label { font-size: 11px; font-weight: 500; color: var(--text-muted); }

/* Per-type card coloring on active */
.fancy-stat-card.badge-birthday.active   { border-color: #db2777; background: rgba(236,72,153,0.08); }
.fancy-stat-card.badge-repeater.active   { border-color: #2563eb; background: rgba(59,130,246,0.08); }
.fancy-stat-card.badge-ladder.active     { border-color: #059669; background: rgba(16,185,129,0.08); }
.fancy-stat-card.badge-palindrome.active { border-color: #7c3aed; background: rgba(139,92,246,0.08); }
.fancy-stat-card.badge-radar.active      { border-color: #d97706; background: rgba(245,158,11,0.08); }
.fancy-stat-card.badge-solid.active      { border-color: #b45309; background: rgba(212,175,55,0.1); }
.fancy-stat-card.badge-sequential.active { border-color: #0891b2; background: rgba(20,184,166,0.08); }
.fancy-stat-card.badge-mirror.active     { border-color: #ea580c; background: rgba(249,115,22,0.08); }

/* Filter bar */
.fancy-filter-bar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 12px 16px; background: var(--bg-surface);
    border-radius: var(--radius); border: 1px solid var(--border);
}
.fancy-filter-count { font-size: 13px; color: var(--text-muted); }

@media (max-width: 768px) {
    .fancy-stats-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
    .fsc-icon { font-size: 20px; }
    .fsc-count { font-size: 18px; }
}

/* ================================================================
   REDESIGNED ADD/EDIT NOTE FORM
   ================================================================ */

/* Form Sections */
.form-section {
    padding: 24px 28px; border-bottom: 1px solid var(--border);
}
.form-section:last-of-type { border-bottom: none; }
.form-section-header {
    display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px;
}
.form-section-num {
    width: 28px; height: 28px; border-radius: 50%; background: var(--gold);
    color: #fff; font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; margin-top: 2px;
}
.form-section-title { font-size: 15px; font-weight: 600; color: var(--text); }
.form-section-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Auto-detect bar */
.auto-detect-bar {
    display: flex; align-items: center; gap: 12px;
    margin-top: 8px; flex-wrap: wrap;
}
.auto-detect-trigger { gap: 6px; }
.auto-detect-trigger svg { width: 15px; height: 15px; }
.auto-detect-hint { font-size: 11px; color: var(--text-dim); }

/* "Regular note / None" row */
.fancy-none-row {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--bg-surface);
    margin-bottom: 16px; transition: var(--transition);
}
.fancy-none-row.none-active { border-color: var(--gold); background: #e8f0fe; }
.fancy-none-label {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text);
}
.fancy-none-chk { width: 16px; height: 16px; cursor: pointer; accent-color: var(--gold); }
.fancy-none-hint { font-size: 11px; color: var(--text-dim); }

/* Fancy Type Cards Grid */
.fancy-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}
.fancy-type-card {
    position: relative; border-radius: 10px;
    padding: 14px 14px 14px 14px;
    border: 2px solid transparent;
    cursor: pointer; display: flex; flex-direction: column; gap: 4px;
    transition: all 0.18s cubic-bezier(0.4,0,0.2,1);
    background: var(--bg-surface);
    user-select: none;
}
.fancy-type-card input[type="checkbox"] { display: none; }
.fancy-type-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }

/* Selected state */
.fancy-type-card.selected { box-shadow: var(--shadow); }

/* Per-type soft backgrounds and border on selected */
.fancy-type-card.badge-birthday   { background: rgba(236,72,153,0.05); }
.fancy-type-card.badge-repeater   { background: rgba(59,130,246,0.05); }
.fancy-type-card.badge-ladder     { background: rgba(16,185,129,0.05); }
.fancy-type-card.badge-palindrome { background: rgba(139,92,246,0.05); }
.fancy-type-card.badge-radar      { background: rgba(245,158,11,0.05); }
.fancy-type-card.badge-solid      { background: rgba(212,175,55,0.05); }
.fancy-type-card.badge-sequential { background: rgba(20,184,166,0.05); }
.fancy-type-card.badge-mirror     { background: rgba(249,115,22,0.05); }

.fancy-type-card.badge-birthday.selected   { border-color: #db2777; background: rgba(236,72,153,0.12); }
.fancy-type-card.badge-repeater.selected   { border-color: #2563eb; background: rgba(59,130,246,0.12); }
.fancy-type-card.badge-ladder.selected     { border-color: #059669; background: rgba(16,185,129,0.12); }
.fancy-type-card.badge-palindrome.selected { border-color: #7c3aed; background: rgba(139,92,246,0.12); }
.fancy-type-card.badge-radar.selected      { border-color: #d97706; background: rgba(245,158,11,0.12); }
.fancy-type-card.badge-solid.selected      { border-color: #b45309; background: rgba(212,175,55,0.12); }
.fancy-type-card.badge-sequential.selected { border-color: #0891b2; background: rgba(20,184,166,0.12); }
.fancy-type-card.badge-mirror.selected     { border-color: #ea580c; background: rgba(249,115,22,0.12); }

.ftc-icon   { font-size: 22px; line-height: 1; margin-bottom: 2px; }
.ftc-name   { font-size: 13px; font-weight: 600; color: var(--text); }
.ftc-desc   { font-size: 11px; color: var(--text-muted); line-height: 1.4; }

/* Checkmark tick shown on selected */
.ftc-check {
    position: absolute; top: 10px; right: 10px;
    width: 20px; height: 20px; border-radius: 50%;
    background: transparent; border: 1.5px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.18s;
}
.ftc-check svg { width: 12px; height: 12px; stroke: transparent; }
.fancy-type-card.selected .ftc-check { background: var(--gold); border-color: var(--gold); }
.fancy-type-card.selected .ftc-check svg { stroke: #fff; }

/* Birthday DOB reveal panel */
.birthday-dob-panel {
    margin-top: 14px; border-radius: 10px;
    background: rgba(236,72,153,0.07);
    border: 1.5px solid rgba(236,72,153,0.35);
    animation: rcSlideUp 0.25s cubic-bezier(0.4,0,0.2,1);
}
.bday-panel-inner {
    padding: 16px 20px; display: flex; align-items: flex-start; gap: 14px;
}
.bday-icon  { font-size: 28px; }
.bday-fields { flex: 1; min-width: 0; }
.bday-input-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.bday-result  { margin-top: 8px; font-size: 13px; }
.bday-yes { color: #059669; font-weight: 500; }
.bday-no  { color: #dc2626; font-weight: 500; }

@media (max-width: 640px) {
    .fancy-type-grid { grid-template-columns: 1fr 1fr; }
    .form-section { padding: 16px; }
}

/* ── Auto-Detect Result Bars ── */
.detect-result-bar {
    display: flex; flex-direction: column; gap: 8px;
    padding: 12px 14px; border-radius: 8px; font-size: 13px;
    margin-top: 8px; animation: rcSlideUp 0.2s cubic-bezier(0.4,0,0.2,1);
}
.detect-result-bar.detect-success {
    background: rgba(5,150,105,0.08); border: 1px solid rgba(5,150,105,0.3); color: #065f46;
}
.detect-result-bar.detect-none {
    background: rgba(100,116,139,0.07); border: 1px solid rgba(100,116,139,0.2); color: var(--text-muted);
}
.detect-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.detect-tag {
    padding: 3px 10px; background: rgba(5,150,105,0.12);
    border-radius: 20px; font-size: 12px; font-weight: 500; color: #065f46;
    border: 1px solid rgba(5,150,105,0.25);
}
.detect-dupe-bar {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 12px 14px; border-radius: 8px; font-size: 13px;
    background: rgba(220,38,38,0.07); border: 1px solid rgba(220,38,38,0.25);
    color: #991b1b; margin-top: 8px;
    animation: rcSlideUp 0.2s cubic-bezier(0.4,0,0.2,1);
}
.detect-dupe-bar a { color: #1a73e8; font-weight: 500; }
.detect-msg { font-size: 12px; display: inline-block; margin-top: 6px; }
.detect-warn { color: #b45309; }

/* Spinner for loading state */
@keyframes spin { to { transform: rotate(360deg); } }
.spin-icon { animation: spin 0.7s linear infinite; display: inline-block; vertical-align: middle; }




/* ── Upload Progress Overlay ──────────────────────────────── */
.upload-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: rcFadeIn 0.3s ease;
}

.up-content {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    width: 100%;
    max-width: 440px;
    text-align: center;
}

.up-loader {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.up-spinner {
    width: 48px; height: 48px;
    border: 3px solid var(--bg-surface);
    border-top: 3px solid var(--gold);
    border-radius: 50%;
    animation: upSpin 1s linear infinite;
}

@keyframes upSpin {
    to { transform: rotate(360deg); }
}

.up-details {
    margin-bottom: 24px;
}

.up-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.up-status {
    font-size: 14px;
    color: var(--text-muted);
}

.up-progress-wrap {
    margin-bottom: 20px;
}

.up-progress-bar {
    height: 8px;
    background: var(--bg-surface);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.up-progress-fill {
    height: 100%;
    background: var(--gold);
    width: 0%;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(26, 115, 232, 0.3);
}

.up-progress-text {
    font-size: 13px;
    font-weight: 700;
    color: var(--gold);
}

.up-hint {
    font-size: 12px;
    color: var(--text-dim);
    font-style: italic;
}

/* ================================================================
   ANALYTICS PAGE
   ================================================================ */
.analytics-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 40px;
}

/* Header */
.an-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
}
.an-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}
.an-title svg { width: 22px; height: 22px; stroke: var(--gold); }
.an-sub { font-size: 13px; color: var(--text-muted); margin: 4px 0 0 32px; }
.an-header-pills { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.an-pill {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.an-pill--blue { background: rgba(26,115,232,0.12); color: #1a73e8; }

/* KPI Row */
.an-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
.an-kpi {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    border-left: 3px solid transparent;
}
.an-kpi:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.an-kpi--blue  { border-left-color: #1a73e8; }
.an-kpi--green { border-left-color: #34a853; }
.an-kpi--red   { border-left-color: #ea4335; }
.an-kpi--amber { border-left-color: #fbbc04; }
.an-kpi--purple { border-left-color: #7c3aed; }

.an-kpi-icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.an-kpi-icon svg { width: 20px; height: 20px; }
.an-kpi--blue   .an-kpi-icon { background: rgba(26,115,232,.1);  stroke: #1a73e8; }
.an-kpi--blue   .an-kpi-icon svg { stroke: #1a73e8; }
.an-kpi--green  .an-kpi-icon { background: rgba(52,168,83,.1);  }
.an-kpi--green  .an-kpi-icon svg { stroke: #34a853; }
.an-kpi--red    .an-kpi-icon { background: rgba(234,67,53,.1); }
.an-kpi--red    .an-kpi-icon svg { stroke: #ea4335; }
.an-kpi--amber  .an-kpi-icon { background: rgba(251,188,4,.1); }
.an-kpi--amber  .an-kpi-icon svg { stroke: #fbbc04; }
.an-kpi--purple .an-kpi-icon { background: rgba(124,58,237,.1); }
.an-kpi--purple .an-kpi-icon svg { stroke: #7c3aed; }

.an-kpi-val {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    letter-spacing: -0.5px;
}
.an-kpi-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* Grid layouts */
.an-grid { display: grid; gap: 20px; }
.an-grid--2 { grid-template-columns: 1fr 1fr; }
.an-grid--3 { grid-template-columns: repeat(3, 1fr); }

/* Cards */
.an-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.an-card--span2 { grid-column: span 2; }

.an-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    gap: 8px;
    flex-wrap: wrap;
}
.an-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    display: flex; align-items: center; gap: 7px;
}
.an-card-title svg { width: 16px; height: 16px; stroke: var(--gold); flex-shrink: 0; }

.an-badge {
    font-size: 11px;
    font-weight: 500;
    background: rgba(26,115,232,0.1);
    color: #1a73e8;
    padding: 3px 10px;
    border-radius: 100px;
    white-space: nowrap;
}
.an-badge--gold { background: rgba(212,175,55,0.12); color: #d4af37; }
.an-badge--red  { background: rgba(234,67,53,.1); color: #ea4335; }

.an-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--gold);
    text-decoration: none;
    transition: opacity .2s;
}
.an-link:hover { opacity: .7; }

/* Chart containers */
.an-chart-wrap { padding: 16px 20px; position: relative; }
.an-chart-wrap--doughnut {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 16px 20px;
}

/* Doughnut legend */
.an-doughnut-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    justify-content: center;
    margin-top: 12px;
}
.an-legend-item {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; color: var(--text-muted);
}
.an-legend-item strong { color: var(--text); margin-left: 2px; }
.an-legend-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Stat highlight */
.an-stat-highlight {
    font-size: 28px; font-weight: 700; color: #1a73e8;
}
.an-stat-sub { font-size: 12px; color: var(--text-muted); display: block; }

/* List rows (governor/color/error type) */
.an-list { padding: 8px 16px 12px; display: flex; flex-direction: column; gap: 10px; }
.an-list-row { display: flex; align-items: center; gap: 8px; }
.an-list-label { font-size: 12px; color: var(--text); min-width: 90px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.an-list-bar-track { flex: 1; height: 6px; background: rgba(0,0,0,0.06); border-radius: 3px; overflow: hidden; }
.an-list-bar { height: 100%; border-radius: 3px; transition: width 1s cubic-bezier(0.4,0,0.2,1); }
.an-list-bar--blue   { background: #1a73e8; }
.an-list-bar--red    { background: #ea4335; }
.an-list-bar--purple { background: #7c3aed; }
.an-list-bar--green  { background: #34a853; }
.an-list-count { font-size: 12px; color: var(--text-muted); min-width: 28px; text-align: right; font-variant-numeric: tabular-nums; }

/* Empty state */
.an-empty {
    padding: 24px;
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
}

/* Summary table */
.an-summary-table th, .an-summary-table td { padding: 10px 16px; }
.an-mini-bar-track { height: 5px; background: rgba(0,0,0,0.06); border-radius: 3px; overflow:hidden; width: 80px; display: inline-block; vertical-align: middle; }
.an-mini-bar { height: 100%; background: #1a73e8; border-radius: 3px; }
.an-mini-bar--green { background: #34a853; }

/* Responsive */
@media (max-width: 1024px) {
    .an-grid--3 { grid-template-columns: 1fr 1fr; }
    .an-card--span2 { grid-column: span 1; }
}
@media (max-width: 720px) {
    .an-grid--2, .an-grid--3 { grid-template-columns: 1fr; }
    .an-kpi-row { grid-template-columns: 1fr 1fr; }
    .an-card--span2 { grid-column: span 1; }
}

