:root {
    --bg-color: #f5f3ed;
    --card-bg: #ffffff;
    --text-primary: #542f20;
    --text-secondary: #ba6747;
    --accent: #ba6747;
    --accent-hover: #9c5437;
    --border-color: #e0d9d0;
    --success: #557a46;
    --warning: #b06b2d;
    --error: #a34e47;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
    font-family: inherit;
}

.app-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 24px 20px;
    min-height: 100vh;
}

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

.header h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.btn-primary {
    background: var(--accent);
    color: #fffaf5;
    border: none;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(143, 90, 54, 0.2);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(143, 90, 54, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.sync-status {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: opacity 0.3s;
}

.sync-status.hidden {
    opacity: 0;
    pointer-events: none;
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.tabs {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 24px;
    scrollbar-width: none; /* Firefox */
}

.tabs::-webkit-scrollbar {
    display: none; /* Chrome */
}

.tab-btn {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 18px;
    border-radius: 20px;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.tab-btn.active, .tab-btn:hover {
    background: var(--accent);
    color: #fffaf5;
    border-color: var(--accent);
}

.content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.loader {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
    font-size: 15px;
}

/* Glassmorphism Card */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    animation: fadeUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(15px);
    box-shadow: 0 4px 20px -2px rgba(143, 90, 54, 0.05), 0 2px 6px -1px rgba(143, 90, 54, 0.03);
}

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

.card-badge {
    display: inline-block;
    font-size: 11px;
    background: rgba(143, 90, 54, 0.1);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-title {
    font-size: 19px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.3;
    color: var(--text-primary);
}

.card-summary {
    font-size: 15px;
    color: #4e3f33;
    margin-bottom: 20px;
    line-height: 1.6;
}

.card-section {
    font-size: 14px;
    margin-bottom: 12px;
    padding-left: 14px;
    border-left: 2px solid var(--border-color);
    color: #5a4b3d;
}

.card-section strong {
    color: var(--text-primary);
}

.card-section.highlight {
    border-left: 3px solid var(--accent);
    background: linear-gradient(90deg, rgba(143, 90, 54, 0.05) 0%, transparent 100%);
    padding: 8px 14px;
    border-radius: 0 8px 8px 0;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.card-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}

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

.card-status {
    font-size: 12px;
    color: var(--warning);
    background: rgba(176, 107, 45, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 500;
}


/* =============================================
   CANDIDATES MODULE STYLES
   ============================================= */

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent, #6366f1);
    color: #fff;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    margin-left: 5px;
    min-width: 18px;
}

.candidates-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    height: calc(100vh - 160px);
    overflow: hidden;
}

.vacancy-sidebar {
    background: var(--card-bg, #1e1e2e);
    border-right: 1px solid rgba(255,255,255,0.07);
    overflow-y: auto;
    padding: 8px 0;
}

.vacancy-sidebar-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.35);
    padding: 8px 16px 12px;
}

.vacancy-item {
    padding: 10px 16px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.18s;
}

.vacancy-item:hover {
    background: rgba(255,255,255,0.04);
}

.vacancy-item.active {
    border-left-color: var(--accent, #6366f1);
    background: rgba(99,102,241,0.12);
}

.vac-title {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    line-height: 1.4;
    margin-bottom: 4px;
}

.vac-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.vac-meta span {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
}

.vac-count {
    background: rgba(99,102,241,0.25);
    color: #a5b4fc !important;
    border-radius: 4px;
    padding: 1px 5px;
}

.candidates-main {
    overflow-y: auto;
    padding: 16px 20px;
}

/* Stats */
.candidates-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 100px;
    background: var(--card-bg, #1e1e2e);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 14px 16px;
    text-align: center;
}

.stat-val {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-yes .stat-val { background: linear-gradient(135deg, #22c55e, #86efac); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.stat-maybe .stat-val { background: linear-gradient(135deg, #f59e0b, #fcd34d); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.stat-no .stat-val { background: linear-gradient(135deg, #ef4444, #fca5a5); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.stat-avg .stat-val { background: linear-gradient(135deg, #8b5cf6, #c4b5fd); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.stat-lbl {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    font-weight: 500;
}

/* Filters */
.candidates-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 14px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.7);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.filter-btn:hover { background: rgba(255,255,255,0.1); }
.filter-btn.active { background: rgba(99,102,241,0.25); border-color: #6366f1; color: #a5b4fc; }
.filter-btn.filter-yes.active { background: rgba(34,197,94,0.2); border-color: #22c55e; color: #86efac; }
.filter-btn.filter-maybe.active { background: rgba(245,158,11,0.2); border-color: #f59e0b; color: #fcd34d; }
.filter-btn.filter-no.active { background: rgba(239,68,68,0.2); border-color: #ef4444; color: #fca5a5; }

.cand-search {
    flex: 1;
    min-width: 200px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: rgba(255,255,255,0.85);
    font-size: 12px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

.cand-search:focus { border-color: #6366f1; }
.cand-search::placeholder { color: rgba(255,255,255,0.3); }

/* Candidates Grid */
.candidates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

.candidate-card {
    background: var(--card-bg, #1e1e2e);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.candidate-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99,102,241,0.4);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.cc-header {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.cc-score-ring {
    flex-shrink: 0;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: conic-gradient(var(--score-color) calc(var(--score-val, 50) * 3.6deg), rgba(255,255,255,0.08) 0);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.cc-score-ring::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: var(--card-bg, #1e1e2e);
}

.cc-score-val {
    font-size: 16px;
    font-weight: 800;
    color: var(--score-color);
    position: relative;
    z-index: 1;
    line-height: 1;
}

.cc-score-lbl {
    font-size: 8px;
    color: rgba(255,255,255,0.4);
    position: relative;
    z-index: 1;
}

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

.cc-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.92);
    margin: 0 0 5px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 7px;
}

.cc-meta span {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
}

.cc-status-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.status-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 5px;
}

.badge-yes { background: rgba(34,197,94,0.15); color: #86efac; }
.badge-maybe { background: rgba(245,158,11,0.15); color: #fcd34d; }
.badge-no { background: rgba(239,68,68,0.15); color: #fca5a5; }
.badge-unknown { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }
.badge-status { background: rgba(99,102,241,0.15); color: #a5b4fc; }

.cc-mini-scores {
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mini-score {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-bar {
    height: 3px;
    border-radius: 2px;
    transition: width 0.4s ease;
    min-width: 4px;
}

.mini-score span {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    white-space: nowrap;
}

.cc-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

.skill-tag {
    font-size: 10px;
    padding: 2px 7px;
    background: rgba(99,102,241,0.12);
    color: rgba(165,180,252,0.85);
    border-radius: 4px;
    border: 1px solid rgba(99,102,241,0.2);
}

.skill-tag-lg {
    font-size: 12px;
    padding: 4px 10px;
}

.cc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cc-date { font-size: 10px; color: rgba(255,255,255,0.25); }
.cc-detail-hint { font-size: 10px; color: rgba(99,102,241,0.6); }

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: rgba(255,255,255,0.4);
}

.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { color: rgba(255,255,255,0.7); margin-bottom: 8px; }
.empty-state a { color: #6366f1; }

/* =============================================
   CANDIDATE DRAWER
   ============================================= */

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    backdrop-filter: blur(4px);
    transition: opacity 0.3s;
}

.drawer-overlay.hidden { display: none; }

.candidate-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 101;
    background: #1a1a2e;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px 20px 0 0;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -20px 60px rgba(0,0,0,0.5);
    animation: slideUp 0.3s ease;
}

.candidate-drawer.hidden { display: none; }

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.drawer-candidate-info h2 {
    font-size: 18px;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
    margin: 0 0 4px;
}

.drawer-candidate-info p {
    font-size: 13px;
    color: rgba(255,255,255,0.45);
    margin: 0;
}

.btn-hh {
    padding: 8px 16px;
    background: rgba(255,70,70,0.2);
    border: 1px solid rgba(255,70,70,0.4);
    color: #fca5a5;
    border-radius: 8px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
}

.btn-hh:hover { background: rgba(255,70,70,0.35); }

.drawer-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.drawer-close-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }

.drawer-body {
    overflow-y: auto;
    padding: 20px 24px;
    flex: 1;
}

.drawer-scores {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.score-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    min-width: 80px;
    border-top: 3px solid var(--pill-color, #6366f1);
}

.score-label {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.score-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--pill-color, #6366f1);
}

.drawer-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.drawer-section h3 {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255,255,255,0.75);
    margin: 0 0 10px;
}

.drawer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.drawer-section li {
    font-size: 12px;
    color: rgba(255,255,255,0.55);
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 6px;
    line-height: 1.4;
    border-left: 2px solid rgba(255,255,255,0.08);
}

.drawer-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.update-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 10px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
}
.update-toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.update-toast span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}
#reload-data-btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
#reload-data-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}
.btn-subtle {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}
.btn-subtle:hover {
    background: rgba(0,0,0,0.05);
    color: var(--text);
}
