/* ============================================
   Job Hunter - Court Compliance Tracker
   Mobile-first responsive dark theme
   ============================================ */

:root {
    --bg: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-input: #16213e;
    --bg-hover: #1f2b47;
    --accent: #e94560;
    --accent-hover: #ff6b81;
    --accent-glow: rgba(233, 69, 96, 0.2);
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --text: #eaeaea;
    --text-dim: #8892a4;
    --text-muted: #555e70;
    --border: #2a2a4a;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --transition: all 0.2s ease;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

/* ---- MOBILE TOP BAR ---- */

#topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    z-index: 200;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-title {
    font-weight: 700;
    font-size: 17px;
}

.topbar-deadline {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--warning);
}

.topbar-deadline.urgent {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(231, 76, 60, 0.1);
}

/* ---- SIDEBAR (desktop) ---- */

#sidebar {
    width: 240px;
    min-height: 100vh;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    color: white;
    flex-shrink: 0;
}

.logo-text {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.5px;
}

.nav-links {
    list-style: none;
    padding: 16px 12px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-dim);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 4px;
}

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

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

.nav-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

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

.deadline-badge {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
    font-size: 13px;
    color: var(--text-dim);
}

.deadline-badge span {
    font-weight: 700;
    color: var(--warning);
    font-size: 18px;
}

.deadline-badge.urgent {
    border-color: var(--danger);
    background: rgba(231, 76, 60, 0.1);
}

.deadline-badge.urgent span {
    color: var(--danger);
}

/* ---- BOTTOM TAB BAR (mobile) ---- */

#bottombar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(64px + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    z-index: 200;
    justify-content: space-around;
    align-items: center;
}

.tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 4px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    flex: 1;
    transition: color 0.15s;
    min-width: 0;
}

.tab-btn .tab-icon {
    font-size: 20px;
    line-height: 1;
}

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

/* ---- MORE MENU (mobile overlay) ---- */

.more-menu {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 300;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: calc(80px + var(--safe-bottom));
}

.more-menu.open {
    display: flex;
}

.more-menu-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 24px;
    width: 100%;
    max-width: 400px;
}

.more-menu-content h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text-dim);
}

.more-link {
    display: block;
    padding: 14px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    transition: background 0.15s;
}

.more-link:hover, .more-link:active {
    background: var(--bg-hover);
}

/* ---- MAIN CONTENT ---- */

#main-content {
    margin-left: 240px;
    flex: 1;
    padding: 32px 40px;
    max-width: 1200px;
    min-height: 100vh;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.25s ease;
}

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

/* ---- PAGE HEADER ---- */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-dim);
    font-size: 14px;
    margin-top: 2px;
}

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

.filter-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

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

.section-header h2 {
    font-size: 17px;
    font-weight: 600;
}

/* ---- STAT CARDS ---- */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 12px;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 6px;
}

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

.stat-label {
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---- TABLES (desktop) ---- */

.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

thead {
    background: var(--bg-input);
}

th {
    text-align: left;
    padding: 12px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 12px 14px;
    font-size: 14px;
    border-bottom: 1px solid rgba(42, 42, 74, 0.5);
}

tr:hover td {
    background: var(--bg-hover);
}

tr:last-child td {
    border-bottom: none;
}

/* ---- MOBILE CARD LIST ---- */

.card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.data-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.data-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.data-card-title {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
}

.data-card-subtitle {
    color: var(--text-dim);
    font-size: 13px;
    margin-top: 2px;
}

.data-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-dim);
}

.data-card-meta span {
    background: var(--bg-input);
    padding: 3px 8px;
    border-radius: 4px;
}

.data-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.empty-state {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
}

/* ---- FORMS ---- */

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 700px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 16px;
}

.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.form-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

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

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.input-field,
.input-select {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
    -webkit-appearance: none;
}

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

textarea.input-field {
    resize: vertical;
    min-height: 60px;
}

.input-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%238892a4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* ---- BUTTONS ---- */

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    -webkit-appearance: none;
    touch-action: manipulation;
}

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

.btn-primary:hover, .btn-primary:active {
    background: var(--accent-hover);
}

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

.btn-secondary:hover, .btn-secondary:active {
    background: var(--bg-hover);
    color: var(--text);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

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

.btn-block {
    width: 100%;
    flex: 1;
}

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

/* ---- STATUS BADGES ---- */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-applied { background: rgba(52, 152, 219, 0.15); color: #3498db; }
.badge-interviewing { background: rgba(243, 156, 18, 0.15); color: #f39c12; }
.badge-offered { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.badge-rejected { background: rgba(231, 76, 60, 0.15); color: #e74c3c; }
.badge-no-response { background: rgba(136, 146, 164, 0.15); color: #8892a4; }
.badge-scheduled { background: rgba(52, 152, 219, 0.15); color: #3498db; }
.badge-completed { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.badge-pending { background: rgba(243, 156, 18, 0.15); color: #f39c12; }
.badge-accepted { background: rgba(46, 204, 113, 0.15); color: #2ecc71; }
.badge-declined { background: rgba(231, 76, 60, 0.15); color: #e74c3c; }

/* ---- COURT REPORT ---- */

.report-container {
    background: white;
    color: #111;
    border-radius: var(--radius);
    padding: 32px;
    max-width: 850px;
    margin: 0 auto;
    font-family: 'Inter', Arial, sans-serif;
    line-height: 1.5;
    overflow-x: auto;
}

.report-container h1 {
    text-align: center;
    font-size: 20px;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.report-container .report-subtitle {
    text-align: center;
    font-size: 13px;
    color: #666;
    margin-bottom: 20px;
}

.report-container hr {
    border: none;
    border-top: 2px solid #1a1a2e;
    margin: 16px 0;
}

.report-container h2 {
    font-size: 14px;
    color: #1a1a2e;
    margin: 20px 0 10px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 4px;
}

.report-container table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin: 12px 0;
}

.report-container th {
    background: #1a1a2e;
    color: white;
    padding: 6px 8px;
    text-align: left;
    font-size: 10px;
    text-transform: uppercase;
}

.report-container td {
    padding: 6px 8px;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
}

.report-container tr:nth-child(even) td { background: #f8f8f8; }
.report-container tr:hover td { background: #f0f0f0; }

.report-info-grid {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 4px 12px;
    font-size: 13px;
    margin-bottom: 16px;
}

.report-info-grid .label { font-weight: 600; color: #333; }
.report-info-grid .value { color: #555; }

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 16px 0;
}

.report-summary-card {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
}

.report-summary-card .num {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
}

.report-summary-card .lbl {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
}

.signature-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ccc;
}

.sig-line {
    border-bottom: 1px solid #333;
    width: 250px;
    display: inline-block;
    margin-bottom: 4px;
}

/* ---- TOAST ---- */

#toast-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--success);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    font-size: 14px;
    box-shadow: var(--shadow);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    max-width: 340px;
    text-align: center;
    pointer-events: auto;
}

.toast.error { border-left-color: var(--danger); }

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

@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ---- EXPERIENCE/EDUCATION BLOCKS ---- */

.exp-block, .edu-block {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    position: relative;
}

.remove-block {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 8px;
    border-radius: 4px;
    line-height: 1;
}

.remove-block:hover, .remove-block:active {
    color: var(--danger);
    background: rgba(231,76,60,0.1);
}

/* ---- VISIBILITY HELPERS ---- */

.desktop-only { display: block; }
.mobile-only { display: none; }

/* ---- PRINT STYLES ---- */

@media print {
    body { background: white; color: black; }
    #sidebar, #main-content, #toast-container, #topbar, #bottombar, .more-menu { display: none !important; }
    .print-only { display: block !important; }
    #print-area { display: block !important; padding: 0; margin: 0; }
    .report-container { box-shadow: none; border: none; padding: 20px; }
}

.print-only { display: none; }

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */

@media (max-width: 1024px) {
    #main-content {
        padding: 24px 20px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* Show mobile nav, hide desktop sidebar */
    #sidebar { display: none; }
    #topbar { display: flex; }
    #bottombar { display: flex; }

    /* Toggle desktop/mobile views */
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }

    #main-content {
        margin-left: 0;
        padding: 72px 16px 88px 16px;
        max-width: 100%;
    }

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

    .page-header h1 {
        font-size: 22px;
    }

    /* Stat cards: 2 columns on small phones */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 20px;
    }

    .stat-card {
        padding: 14px 8px;
    }

    .stat-value {
        font-size: 26px;
    }

    .stat-label {
        font-size: 10px;
    }

    /* Forms */
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-card {
        padding: 20px 16px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    /* Filter bar */
    .filter-bar {
        flex-direction: column;
    }

    .filter-bar .input-select,
    .filter-bar .btn {
        width: 100%;
    }

    /* Report */
    .report-container {
        padding: 20px 14px;
        border-radius: var(--radius-sm);
    }

    .report-info-grid {
        grid-template-columns: 110px 1fr;
        font-size: 12px;
    }

    .report-summary-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .report-summary-card {
        padding: 10px 6px;
    }

    .report-summary-card .num {
        font-size: 20px;
    }

    .sig-line {
        width: 200px;
    }

    /* Toast */
    #toast-container {
        bottom: calc(80px + var(--safe-bottom));
        left: 16px;
        right: 16px;
        transform: none;
    }

    .toast {
        max-width: 100%;
        width: 100%;
    }
}

/* Very small screens */
@media (max-width: 380px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-value {
        font-size: 22px;
    }

    .page-header h1 {
        font-size: 20px;
    }

    .form-card {
        padding: 16px 12px;
    }
}

/* ============================================
   LARGE DESKTOP
   ============================================ */

@media (min-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ============================================
   SPINNER
   ============================================ */

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

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

.loading-row {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px;
    grid-column: 1 / -1;
}

/* ============================================
   COURT COMPLIANCE WIDGET
   ============================================ */

.compliance-widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 16px;
}

.compliance-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.compliance-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    display: block;
}

.compliance-sub {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
    display: block;
}

.compliance-hours {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.compliance-unit {
    font-size: 14px;
    color: var(--text-dim);
}

.compliance-sep {
    font-size: 16px;
    color: var(--text-dim);
    margin: 0 4px;
}

.compliance-bar-bg {
    height: 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 14px;
}

.compliance-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease, background 0.3s;
}

.auto-track-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 4px;
}

.auto-track-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.auto-track-elapsed {
    color: var(--text-dim);
    font-size: 12px;
}

/* ============================================
   SEARCH STATUS BAR
   ============================================ */

.search-status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 20px;
}

/* ============================================
   JOB DETAIL DRAWER
   ============================================ */
.drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
}
.drawer-backdrop.open { display: block; }
.listing-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(600px, 100vw);
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    z-index: 201;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.listing-drawer.open { transform: translateX(0); }
.drawer-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 20px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.drawer-title-block { flex: 1; min-width: 0; }
.drawer-job-title { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1.3; }
.drawer-company { font-size: 14px; color: var(--accent); margin-top: 4px; font-weight: 500; }
.drawer-close {
    background: none; border: none; font-size: 20px;
    color: var(--text-dim); cursor: pointer; padding: 4px 8px;
    flex-shrink: 0;
}
.drawer-close:hover { color: var(--text); }
.drawer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.drawer-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-dim);
    background: var(--bg-hover);
    padding: 4px 10px;
    border-radius: 20px;
}
.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}
.drawer-body::-webkit-scrollbar { width: 6px; }
.drawer-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.drawer-actions {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    background: var(--bg-card);
}

/* ============================================
   CATEGORY CHIPS
   ============================================ */
.find-jobs-search-bar {
    margin-bottom: 10px;
}
.find-jobs-search-bar .input-field {
    width: 100%;
    font-size: 15px;
}
.category-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.chip {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ============================================
   FIND JOBS (LISTINGS)
   ============================================ */

.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

/* ---- Bulk action bar ---- */
.bulk-action-bar {
    display: none;
    align-items: center;
    gap: 10px;
    background: var(--accent);
    color: #fff;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
    flex-wrap: wrap;
}
.bulk-action-bar.visible { display: flex; }
.bulk-action-bar .btn-secondary {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    color: #fff;
}
.bulk-action-bar .btn-secondary:hover {
    background: rgba(255,255,255,0.25);
}
.bulk-action-bar .btn-primary {
    background: #fff;
    color: var(--accent);
    border-color: #fff;
}

/* ---- Listing card ---- */
.listing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--transition);
    cursor: pointer;
}

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

.listing-card.selected {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, var(--bg-card));
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.listing-checkbox {
    display: flex;
    align-items: center;
    padding: 4px;
    margin-right: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

.listing-checkbox input[type=checkbox] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
}

.listing-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.listing-title {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
}

.listing-company {
    color: var(--text-dim);
    font-size: 13px;
    margin-top: 2px;
}

.listing-location {
    font-size: 13px;
    color: var(--text-dim);
    margin: 4px 0 6px;
    font-weight: 500;
}

.listing-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    color: var(--text-dim);
}

.listing-meta span {
    background: var(--bg-input);
    padding: 3px 8px;
    border-radius: 4px;
}

.source-badge {
    background: var(--accent-glow) !important;
    color: var(--accent) !important;
    font-weight: 600;
    text-transform: capitalize;
}

.listing-desc {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
}

.listing-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

/* ============================================
   LOAD MORE BAR
   ============================================ */

.load-more-bar {
    display: flex;
    justify-content: center;
    padding: 16px 0;
}

/* ============================================
   BADGE — NEW / REVIEWED for listings
   ============================================ */

.badge-new { background: rgba(52,152,219,0.15); color: #3498db; }
.badge-reviewed { background: rgba(243,156,18,0.15); color: #f39c12; }

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

/* ============================================
   ANALYTICS CHARTS
   ============================================ */

.charts-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.chart-card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* ============================================
   ACTIVITY HEATMAP CALENDAR
   ============================================ */

.calendar-section {
    margin-bottom: 24px;
}

.section-sub {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

.activity-calendar {
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    gap: 4px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

@media (max-width: 600px) {
    .activity-calendar {
        grid-template-columns: repeat(9, 1fr);
    }
}

.cal-cell {
    aspect-ratio: 1;
    border-radius: 3px;
    background: var(--border);
    transition: transform 0.1s;
}

.cal-cell.active {
    background: #6c63ff;
    cursor: pointer;
}

.cal-cell.active:hover {
    transform: scale(1.2);
}

/* ============================================
   APPLICATION PIPELINE VIEW
   ============================================ */

.pipeline-view {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

@media (max-width: 700px) {
    .pipeline-view {
        grid-template-columns: repeat(3, 1fr);
    }
}

.pipeline-col {
    text-align: center;
    padding: 12px 8px;
    border-radius: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
}

.pipeline-col.accent {
    border-color: #22c55e;
}

.pipeline-col.muted {
    border-color: #ef4444;
}

.pipeline-col-header {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.pipeline-count {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

/* ============================================
   RESUME TAB
   ============================================ */

.resume-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 900px) {
    .resume-layout {
        grid-template-columns: 1fr;
    }
}

.resume-controls-col .form-card {
    position: sticky;
    top: 80px;
}

.resume-controls-col .form-card p.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 14px;
    line-height: 1.5;
}

.link-inline {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
}

.resume-preview-card {
    background: #fff;
    color: #1a1a2e;
    border-radius: 12px;
    padding: 40px 48px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    line-height: 1.55;
    min-height: 200px;
}

/* Resume preview internal styles */
.rp-header {
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid #1a1a2e;
}

.rp-name {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: 0.5px;
}

.rp-contact {
    font-size: 11px;
    color: #555;
    margin-top: 4px;
}

.rp-section {
    margin-top: 16px;
}

.rp-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #1a1a2e;
    margin-bottom: 6px;
    padding-bottom: 3px;
    border-bottom: 1px solid #ddd;
}

.rp-body {
    font-size: 12px;
    color: #333;
    margin: 4px 0;
}

.rp-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.rp-skill-chip {
    background: #f0f2ff;
    color: #1a1a2e;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
}

.rp-job {
    margin-bottom: 10px;
}

.rp-job-title {
    font-size: 12px;
    font-weight: 600;
    color: #222;
    margin-bottom: 2px;
}

.rp-muted {
    color: #888;
    font-weight: 400;
}

.rp-bullet {
    font-size: 12px;
    color: #444;
    padding-left: 12px;
    margin-top: 2px;
}

/* ---- Match Score Pill ---- */
.score-pill {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}
.score-high { background: #dcfce7; color: #166534; }
.score-mid  { background: #fef9c3; color: #854d0e; }
.score-low  { background: #f3f4f6; color: #6b7280; }

/* ---- Daemon Status Dot ---- */
.daemon-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #d1d5db;
    cursor: default;
}
.daemon-online  { background: #22c55e; box-shadow: 0 0 0 2px rgba(34,197,94,.25); }
.daemon-offline { background: #ef4444; box-shadow: 0 0 0 2px rgba(239,68,68,.25); }
.daemon-unknown { background: #f59e0b; }

/* ---- Setup Checklist ---- */
.setup-checklist {
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
}
.setup-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.setup-icon { font-size: 16px; }
.setup-header strong { font-size: 14px; color: #92400e; }
.setup-sub { font-size: 12px; color: #b45309; margin-left: 4px; }
.setup-dismiss {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: #b45309;
    font-size: 14px;
    padding: 0 4px;
    line-height: 1;
}
.setup-items { display: flex; flex-direction: column; gap: 6px; }
.setup-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.setup-item.done { opacity: 0.55; }
.setup-check {
    font-size: 14px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}
.setup-item.done .setup-check { color: #16a34a; }
.setup-item.pending .setup-check { color: #d97706; }
.setup-item-label { flex: 1; color: #374151; }
.setup-item.done .setup-item-label { color: #9ca3af; }
.btn-link {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
    text-decoration: underline;
}
.setup-go { font-size: 12px; white-space: nowrap; }

/* ---- Toggle Switch ---- */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    user-select: none;
}
.toggle-check { display: none; }
.toggle-slider {
    position: relative;
    width: 40px;
    height: 22px;
    background: #d1d5db;
    border-radius: 11px;
    flex-shrink: 0;
    transition: background 0.2s;
}
.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 16px; height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-check:checked + .toggle-slider { background: #2563eb; }
.toggle-check:checked + .toggle-slider::after { transform: translateX(18px); }

/* ---- AI Settings ---- */
.ai-status-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    margin-left: 10px;
    vertical-align: middle;
    letter-spacing: 0.03em;
}
.ai-badge-active { background: #d1fae5; color: #065f46; }
.ai-badge-warn   { background: #fef3c7; color: #92400e; }
.ai-badge-off    { background: #f3f4f6; color: #6b7280; }

.ai-key-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.ai-key-row .input-field { flex: 1; }

.ai-sub-note {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #1e40af;
    margin: 8px 0;
    line-height: 1.6;
}
.ai-sub-icon { margin-right: 6px; }

.ai-pricing-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
}
.ai-pricing-label { color: #6b7280; }
.ai-pricing-value { font-weight: 600; color: #111827; }

.ai-test-result {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
    background: #f3f4f6;
    color: #374151;
}
.ai-test-ok  { background: #d1fae5; color: #065f46; }
.ai-test-err { background: #fee2e2; color: #991b1b; }

/* ============================================
   JOB PICKER
   ============================================ */

.picker-selected-area {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 38px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    margin-bottom: 10px;
}
.picker-selected-area:empty::before {
    content: 'No job titles selected yet — pick from the categories below';
    color: var(--text-dim);
    font-size: 13px;
    font-style: italic;
    align-self: center;
}
.picker-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 16px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    cursor: default;
    animation: tagIn 0.15s ease;
}
@keyframes tagIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.picker-tag-remove {
    background: none;
    border: none;
    color: rgba(255,255,255,0.75);
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.1s;
}
.picker-tag-remove:hover { color: #fff; }
.picker-search-wrap {
    margin-bottom: 12px;
}
.picker-categories {
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
}
.picker-cat-section {
    border-bottom: 1px solid var(--border);
}
.picker-cat-section:last-child { border-bottom: none; }
.picker-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.1s;
}
.picker-cat-header:hover { background: var(--bg-card); }
.picker-cat-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.picker-cat-count {
    font-size: 11px;
    background: var(--accent);
    color: #fff;
    border-radius: 10px;
    padding: 1px 7px;
    display: none;
}
.picker-cat-count.has-selected { display: inline; }
.picker-cat-arrow {
    font-size: 10px;
    color: var(--text-dim);
    transition: transform 0.2s;
}
.picker-cat-section.open .picker-cat-arrow { transform: rotate(90deg); }
.picker-cat-chips {
    display: none;
    flex-wrap: wrap;
    gap: 7px;
    padding: 10px 14px 14px;
}
.picker-cat-section.open .picker-cat-chips { display: flex; }
.picker-job-chip {
    padding: 5px 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-dim);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.picker-job-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(74, 144, 226, 0.07);
}
.picker-job-chip.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.picker-empty-msg {
    padding: 20px;
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
    font-style: italic;
}

/* ===== MySearchLog styles ===== */
.form-error {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.08);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    margin-top: 8px;
}
.badge-client { background: rgba(52,152,219,.15); color:#3498db; }
.badge-caseworker { background: rgba(155,89,182,.15); color:#9b59b6; }
.badge-admin { background: rgba(231,76,60,.15); color:#e74c3c; }
.wp-user-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 500;
}
.wp-client-row {
    padding: 8px 0;
}

/* ===== Official Job Boards ===== */
.official-boards {
    margin-bottom: 20px;
}
.boards-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.8px; color: var(--text-dim); margin-bottom: 10px;
}
.boards-row {
    display: flex; gap: 10px; flex-wrap: wrap;
}
.board-card {
    display: flex; align-items: center; gap: 12px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 12px 14px; flex: 1; min-width: 220px;
}
.board-caljobs { border-color: rgba(29,78,216,0.35); background: rgba(29,78,216,0.05); }
.board-logo {
    width: 36px; height: 36px; border-radius: 8px;
    background: var(--accent-dim, rgba(74,144,226,0.15));
    display: grid; place-items: center;
    font-size: 11px; font-weight: 800; color: var(--accent); flex-shrink: 0;
}
.board-caljobs .board-logo { background: rgba(29,78,216,0.15); color: #3b82f6; }
.board-info { flex: 1; min-width: 0; }
.board-name { font-size: 14px; font-weight: 700; color: var(--text-primary, #e2e8f0); }
.board-sub { font-size: 11px; color: var(--text-dim); }
.board-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ===== Source banner (Log tab) ===== */
.source-banner {
    display: flex; align-items: center; gap: 10px;
    background: rgba(34,197,94,0.06); border: 1px solid rgba(34,197,94,0.2);
    border-radius: 8px; padding: 10px 14px; margin-bottom: 16px;
    font-size: 13px; color: var(--text-dim); flex-wrap: wrap;
}
.source-badge {
    font-size: 11px; font-weight: 700; padding: 3px 10px;
    border-radius: 100px; border: 1px solid; white-space: nowrap;
}
