/* ══════════════════════════════════════════════
   Aphias Capital — HRIS & ATS
   ══════════════════════════════════════════════ */

:root {
    --bg: #F0F2F5;
    --bg-card: #FFFFFF;
    --bg-hover: #E8EBF0;
    --bg-input: #FFFFFF;
    --border: #D0D4DC;
    --text: #1A1A1A;
    --text2: #444444;
    --muted: #6B7280;
    --blue: #0066CC;
    --blue-light: #DBEAFE;
    --green: #16A34A;
    --green-light: #D1FAE5;
    --red: #DC2626;
    --red-light: #FEE2E2;
    --orange: #D97706;
    --orange-light: #FEF3C7;
    --purple: #7C3AED;
    --topbar-bg: #1A1A2E;
    --sidebar-bg: #1A1A2E;
    --sidebar-hover: #2A2A40;
    --sidebar-active: #3B82F6;
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── Topbar ── */
.topbar {
    height: 48px;
    background: var(--topbar-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 8px; }
.topbar-logo { color: #58A6FF; font-size: 18px; }
.topbar-brand { color: #FFF; font-weight: 600; font-size: 12px; letter-spacing: 1px; }
.topbar-sub { color: #A0A8B8; font-size: 11px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-status { color: var(--green); font-size: 8px; }
.topbar-user { color: #A0A8B8; font-size: 12px; }
.topbar-role { opacity: 0.6; }
.topbar-logout {
    color: #A0A8B8; text-decoration: none; font-size: 16px;
    margin-left: 12px; opacity: 0.6; transition: opacity 0.2s;
}
.topbar-logout:hover { opacity: 1; }

/* ── Layout ── */
.app-body {
    display: flex;
    margin-top: 48px;
    min-height: calc(100vh - 48px);
}

/* ── Sidebar ── */
.sidebar {
    width: 200px;
    min-width: 200px;
    background: var(--sidebar-bg);
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 48px;
    bottom: 0;
    overflow-y: auto;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #CCCCDD;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s;
}
.nav-item:hover { background: var(--sidebar-hover); color: #FFF; }
.nav-item.active { background: var(--sidebar-active); color: #FFF; }
.nav-icon { font-size: 14px; width: 20px; text-align: center; }

/* ── Content ── */
.content {
    flex: 1;
    margin-left: 200px;
    padding: 24px;
    max-width: 1400px;
}

/* ── Flash messages ── */
.flash-container { margin-bottom: 16px; }
.flash {
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 8px;
}
.flash-success { background: var(--green-light); color: #065F46; }
.flash-error { background: var(--red-light); color: #991B1B; }
.flash-info { background: var(--blue-light); color: #1E40AF; }

/* ── Page headers ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.page-title { font-size: 22px; font-weight: 700; }
.page-subtitle { font-size: 13px; color: var(--muted); margin-left: 12px; }

/* ── Cards ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.15s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-title { font-weight: 600; font-size: 15px; }
.card-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.card-actions { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Metric cards ── */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 24px; }
.metric-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 20px;
    box-shadow: var(--shadow);
}
.metric-icon { font-size: 20px; margin-bottom: 4px; }
.metric-value { font-size: 28px; font-weight: 700; }
.metric-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    line-height: 1.4;
}
.btn-primary { background: var(--blue); color: #FFF; }
.btn-primary:hover { background: #0052A3; }
.btn-secondary { background: #E5E7EB; color: var(--text); }
.btn-secondary:hover { background: #D0D4DC; }
.btn-danger { background: var(--red-light); color: var(--red); }
.btn-danger:hover { background: #FECACA; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-sm-primary { padding: 4px 10px; font-size: 12px; background: var(--blue); color: #FFF; }
.btn-sm-primary:hover { background: #0052A3; }

/* ── Stage badges ── */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 600; font-size: 11px; color: var(--muted);
     text-transform: uppercase; letter-spacing: 0.5px; padding: 8px 12px;
     border-bottom: 2px solid var(--border); }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:hover td { background: var(--bg-hover); }

/* ── Forms ── */
.form-section { margin-bottom: 24px; }
.form-section-title {
    font-size: 11px; font-weight: 600; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.8px;
    margin-bottom: 10px; padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 13px;
    background: var(--bg-input);
    transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0,102,204,0.1);
}
.form-textarea { min-height: 80px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 16px; border-top: 1px solid var(--border); }

/* ── Radio group ── */
.radio-group { display: flex; gap: 12px; flex-wrap: wrap; }
.radio-group label {
    display: flex; align-items: center; gap: 4px;
    font-size: 13px; cursor: pointer;
}

/* ── Resume upload ── */
.upload-zone {
    background: #EFF6FF; border: 2px dashed var(--blue);
    border-radius: var(--radius); padding: 16px 20px;
    margin-bottom: 16px; transition: background 0.15s;
}
.upload-zone:hover { background: #DBEAFE; }
.upload-zone-title { font-weight: 600; font-size: 13px; color: var(--text); }
.upload-zone-sub { font-size: 11px; color: var(--muted); }
.upload-status { font-size: 12px; margin-top: 6px; color: var(--muted); }
.upload-status.ok { color: var(--green); }
.upload-status.warn { color: var(--orange); }

/* ── Pipeline board ── */
.pipeline-board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 16px;
}
.pipeline-col {
    min-width: 220px;
    max-width: 260px;
    flex-shrink: 0;
}
.pipeline-col-header {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    border-radius: var(--radius) var(--radius) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pipeline-col-count {
    background: rgba(0,0,0,0.1);
    padding: 1px 8px;
    border-radius: 99px;
    font-size: 11px;
}
.pipeline-col-body {
    background: var(--bg);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 8px;
    min-height: 120px;
}
.pipeline-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin-bottom: 6px;
    box-shadow: var(--shadow);
    font-size: 12px;
}
.pipeline-card-name { font-weight: 600; font-size: 13px; }
.pipeline-card-meta { color: var(--muted); margin-top: 2px; }
.pipeline-card-role { color: var(--blue); font-size: 11px; margin-top: 4px; }

/* ── Gantt chart ── */
.gantt-container { overflow-x: auto; }
.gantt-table { width: 100%; border-collapse: collapse; }
.gantt-table th { font-size: 10px; padding: 6px 8px; }
.gantt-table td { padding: 6px 8px; font-size: 12px; }
.gantt-bar-cell { position: relative; min-width: 400px; }
.gantt-bar {
    height: 14px;
    border-radius: 7px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.85;
}
.gantt-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    vertical-align: middle;
}
.gantt-dot-open { background: var(--green); }
.gantt-dot-hold { background: var(--orange); }
.gantt-dot-closed { background: var(--muted); }

/* ── Stars ── */
.stars { color: var(--orange); font-size: 13px; letter-spacing: 1px; }

/* ── Education line ── */
.edu-line { font-size: 11px; color: var(--blue); margin-top: 2px; }

/* ── Summary excerpt ── */
.summary-excerpt { font-size: 11px; color: var(--text2); margin-top: 3px; }

/* ── Login page ── */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--topbar-bg);
}
.login-box {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 48px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    max-width: 400px;
    width: 90%;
}
.login-logo { font-size: 36px; margin-bottom: 8px; }
.login-brand { font-size: 18px; font-weight: 700; letter-spacing: 2px; margin-bottom: 4px; }
.login-sub { font-size: 13px; color: var(--muted); margin-bottom: 32px; }
.login-btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 32px; background: var(--blue); color: #FFF;
    border: none; border-radius: var(--radius); font-size: 14px;
    font-weight: 600; cursor: pointer; text-decoration: none;
    transition: background 0.15s;
}
.login-btn:hover { background: #0052A3; }

/* ── Empty state ── */
.empty-state {
    text-align: center; padding: 48px 24px;
    color: var(--muted); font-size: 14px;
}
.empty-state-icon { font-size: 36px; margin-bottom: 8px; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .content { margin-left: 0; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .metrics { grid-template-columns: 1fr 1fr; }
}

/* ── Timeline ── */
.timeline { position: relative; padding-left: 20px; }
.timeline-item { position: relative; padding-bottom: 16px; padding-left: 16px; }
.timeline-item:not(:last-child)::before {
    content: ''; position: absolute; left: -15px; top: 8px; bottom: -8px;
    width: 1px; background: var(--border);
}
.timeline-dot {
    position: absolute; left: -20px; top: 4px;
    width: 10px; height: 10px; border-radius: 50%;
    border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border);
}
.timeline-content { min-height: 20px; }

/* ── Search bar ── */
.search-bar { display:flex; gap:8px; align-items:flex-end; flex-wrap:wrap; margin-bottom:16px; }
.search-bar input[type="search"] {
    padding:7px 12px; border:1px solid var(--border); border-radius:var(--radius);
    font-size:13px; min-width:280px; background:#fff;
}
.search-bar select { padding:7px 8px; font-size:12px; }

/* ── Gantt dot ── */
.gantt-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; vertical-align:middle; }
.gantt-dot-open { background:var(--green); }
.gantt-dot-hold { background:var(--orange); }
