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

:root {
    --sidebar-bg: #ffffff;
    --sidebar-hover: #f1f3f4;
    --sidebar-active: #e8f0fe;
    --sidebar-width: 260px;
    --sidebar-collapsed: 60px;
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --success: #1e8e3e;
    --warning: #f9ab00;
    --danger: #d93025;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f4;
    --gray-200: #e8eaed;
    --gray-300: #dadce0;
    --gray-400: #bdc1c6;
    --gray-500: #9aa0a6;
    --gray-600: #80868b;
    --gray-700: #5f6368;
    --gray-800: #3c4043;
    --gray-900: #202124;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,.12);
    --transition: all .2s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--gray-900);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--gray-200);
    transition: transform 0.3s ease;
}

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

.sidebar-brand .logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.sidebar-brand span {
    font-size: 16px;
    font-weight: 600;
}

.sidebar-brand small {
    display: block;
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.sidebar-nav .nav-label {
    padding: 8px 24px 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-500);
    font-weight: 600;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: var(--gray-700);
    text-decoration: none;
    transition: var(--transition);
    font-size: 13px;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: var(--sidebar-hover);
    color: var(--primary);
}

.sidebar-nav a.active {
    background: var(--sidebar-active);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

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

.sidebar-nav a .badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 12px;
    font-weight: 600;
}

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

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--gray-500);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 0;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
}

/* ===== TOP HEADER ===== */
.top-header {
    background: #fff;
    padding: 12px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title-area h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-900);
}

.page-title-area .breadcrumb {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

.page-title-area .breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-right .notification-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--gray-600);
    padding: 4px;
}

.header-right .notification-btn .dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
}

.header-right .user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.header-right .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.header-right .user-name {
    font-size: 13px;
    font-weight: 500;
}

.header-right .user-role {
    font-size: 11px;
    color: var(--gray-500);
}

/* ===== PAGE CONTENT ===== */
.page-content {
    padding: 24px 32px;
}

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

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-card .stat-icon.blue { background: #e8f0fe; color: var(--primary); }
.stat-card .stat-icon.green { background: #e6f4ea; color: var(--success); }
.stat-card .stat-icon.yellow { background: #fef7e0; color: var(--warning); }
.stat-card .stat-icon.red { background: #fce8e6; color: var(--danger); }

.stat-card .stat-info h3 {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-info p {
    font-size: 13px;
    color: var(--gray-500);
}

/* ===== TABLES ===== */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

.table-container {
    overflow-x: auto;
}

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

table thead th {
    background: var(--gray-50);
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
    vertical-align: middle;
}

table tbody tr:hover {
    background: var(--gray-50);
}

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

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    align-items: center;
    gap: 4px;
}

.badge-pending { background: #fef7e0; color: #e37400; }
.badge-in-progress { background: #e8f0fe; color: #1a73e8; }
.badge-completed { background: #e6f4ea; color: #1e8e3e; }
.badge-confirm { background: #e6f4ea; color: #1e8e3e; }
.badge-extend { background: #fef7e0; color: #e37400; }
.badge-terminate { background: #fce8e6; color: #d93025; }
.badge-transfer { background: #e8f0fe; color: #1a73e8; }

/* ===== STATUS INDICATORS ===== */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.green { background: var(--success); }
.status-dot.yellow { background: var(--warning); }
.status-dot.red { background: var(--danger); }

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 16px;
}

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

.form-group .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 13px;
    color: var(--gray-900);
    background: #fff;
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,115,232,.15);
}

.form-control:disabled {
    background: var(--gray-50);
    color: var(--gray-500);
}

select.form-control {
    appearance: auto;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

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

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

.form-row-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

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

.form-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section-title .section-icon {
    font-size: 18px;
}

.form-section-title .section-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 1px 8px;
    border-radius: 10px;
    background: var(--gray-200);
    color: var(--gray-600);
    margin-left: auto;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #167d32;
}

.btn-warning {
    background: var(--warning);
    color: #fff;
}

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

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

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

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

.btn-icon {
    padding: 6px;
    border-radius: 6px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    transition: var(--transition);
    font-size: 16px;
}

.btn-icon:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ===== RATING STARS ===== */
.rating-group {
    display: flex;
    gap: 4px;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.rating-group input {
    display: none;
}

.rating-group label {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--gray-400);
    background: #fff;
}

.rating-group label:hover,
.rating-group label:hover ~ label,
.rating-group input:checked ~ label {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.rating-group.rating-sm label {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

/* ===== APPRAISAL TABLE ===== */
.appraisal-section {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.appraisal-section .section-header {
    padding: 14px 20px;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-200);
}

.appraisal-section .section-header .weight-badge {
    font-size: 12px;
    font-weight: 500;
    padding: 2px 10px;
    border-radius: 12px;
    background: var(--gray-100);
    color: var(--gray-600);
}

.appraisal-section .section-body {
    padding: 0;
}

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

.appraisal-table th {
    background: var(--gray-50);
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.appraisal-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
    vertical-align: middle;
}

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

/* ===== PROFILE CARD ===== */
.profile-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    align-items: flex-start;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-details {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px 24px;
}

.profile-details .detail-item label {
    display: block;
    font-size: 11px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 600;
}

.profile-details .detail-item span {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-900);
}

/* ===== WORKFLOW STEPS ===== */
.workflow-steps {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 24px;
    overflow-x: auto;
    padding: 8px 0;
}

.workflow-step {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.workflow-step .step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid var(--gray-300);
    color: var(--gray-500);
    background: #fff;
}

.workflow-step.completed .step-circle {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.workflow-step.active .step-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(26,115,232,.2);
}

.workflow-step.rejected .step-circle {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.workflow-step .step-info {
    display: flex;
    flex-direction: column;
}

.workflow-step .step-info .step-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
}

.workflow-step .step-info .step-date {
    font-size: 11px;
    color: var(--gray-500);
}

.workflow-step .step-info .step-user {
    font-size: 11px;
    color: var(--gray-400);
}

.workflow-connector {
    width: 40px;
    height: 2px;
    background: var(--gray-300);
    flex-shrink: 0;
    margin: 0 4px;
}

.workflow-connector.completed {
    background: var(--success);
}

/* ===== TIMELINE ===== */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--primary);
}

.timeline-item .tl-time {
    font-size: 11px;
    color: var(--gray-500);
}

.timeline-item .tl-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-800);
}

.timeline-item .tl-desc {
    font-size: 12px;
    color: var(--gray-600);
}

/* ===== LETTER PREVIEW ===== */
.letter-preview {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 48px;
    max-width: 800px;
    margin: 0 auto;
    font-size: 14px;
    line-height: 1.8;
    border: 1px solid var(--gray-200);
}

.letter-preview .letter-header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--gray-200);
}

.letter-preview .letter-header h2 {
    font-size: 18px;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.letter-preview .letter-header p {
    color: var(--gray-500);
    font-size: 13px;
}

.letter-preview .letter-no {
    text-align: right;
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 24px;
}

.letter-preview .letter-body {
    min-height: 300px;
}

.letter-preview .letter-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.letter-preview .letter-footer .signature-area {
    margin-top: 32px;
}

.letter-preview .letter-footer .signature-area .sig-line {
    width: 200px;
    border-top: 1px solid var(--gray-800);
    margin-top: 48px;
    padding-top: 8px;
}

/* ===== TEMPLATE EDITOR ===== */
.template-editor {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    padding: 16px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    min-height: 400px;
    width: 100%;
    resize: vertical;
}

.merge-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.merge-tag {
    display: inline-flex;
    padding: 3px 10px;
    background: #e8f0fe;
    color: var(--primary);
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
    cursor: pointer;
    border: 1px solid #c5d9f7;
    transition: var(--transition);
}

.merge-tag:hover {
    background: var(--primary);
    color: #fff;
}

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

/* Modal sticky header/footer pattern */
.modal-sticky {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-sticky .modal-header {
    flex-shrink: 0;
}
.modal-sticky .modal-body {
    overflow-y: auto;
    flex: 1;
}
.modal-sticky .modal-footer {
    flex-shrink: 0;
}

/* Navy header style */
.modal-header-navy {
    background: #1E3A8A;
    border-bottom: none;
    padding: 20px 28px;
}
.modal-header-navy h3 {
    color: #fff;
    font-size: 17px;
    font-weight: 600;
}
.modal-header-navy .modal-close {
    color: rgba(255,255,255,.7);
    font-size: 24px;
}
.modal-header-navy .modal-close:hover {
    color: #fff;
}

/* Footer light style */
.modal-footer-light {
    background: var(--gray-50);
    padding: 16px 28px;
}

/* Extra large modal */
.modal-xl {
    max-width: 920px;
}

.modal-lg {
    max-width: 800px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--gray-500);
    padding: 4px;
    line-height: 1;
}

.modal-body {
    padding: 28px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ===== FILTER BAR ===== */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-bar .form-control {
    width: auto;
    min-width: 160px;
}

.filter-bar .search-box {
    display: flex;
    align-items: center;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    padding: 0 12px;
    background: #fff;
    flex: 1;
    min-width: 200px;
}

.filter-bar .search-box input {
    border: none;
    padding: 9px 8px;
    font-size: 13px;
    background: transparent;
    width: 100%;
    outline: none;
    font-family: inherit;
}

.filter-bar .search-box .search-icon {
    color: var(--gray-500);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
    padding: 16px 0;
}

.pagination .page-btn {
    padding: 6px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background: #fff;
    color: var(--gray-700);
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}

.pagination .page-btn:hover {
    background: var(--gray-50);
}

.pagination .page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination .page-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ===== ALERTS ===== */
.alert {
    padding: 14px 20px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-info {
    background: #e8f0fe;
    color: #1a73e8;
    border: 1px solid #c5d9f7;
}

.alert-success {
    background: #e6f4ea;
    color: #1e8e3e;
    border: 1px solid #b7e1c1;
}

.alert-warning {
    background: #fef7e0;
    color: #e37400;
    border: 1px solid #fde7b3;
}

.alert-danger {
    background: #fce8e6;
    color: #d93025;
    border: 1px solid #f5c6c2;
}

/* ===== TOOLTIP ===== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 100;
}

/* ===== ABSENTEEISM METER ===== */
.meter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meter-bar .bar-track {
    flex: 1;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.meter-bar .bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .5s ease;
}

.meter-bar .bar-fill.green { background: var(--success); }
.meter-bar .bar-fill.yellow { background: var(--warning); }
.meter-bar .bar-fill.red { background: var(--danger); }

.meter-bar .bar-label {
    font-size: 12px;
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

/* ===== NOTIFICATION DROPDOWN ===== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    z-index: 500;
    border: 1px solid var(--gray-200);
}

.dropdown-menu.open {
    display: block;
}

.dropdown-menu .dropdown-header {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-200);
}

.dropdown-menu .dropdown-item {
    padding: 10px 16px;
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: var(--transition);
}

.dropdown-menu .dropdown-item:hover {
    background: var(--gray-50);
}

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

/* ===== SIDEBAR TOGGLE ===== */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    color: var(--gray-700);
    margin-right: 8px;
    flex-shrink: 0;
}
.sidebar-toggle:hover {
    color: var(--gray-900);
}

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.4);
    z-index: 999;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .form-row-3, .form-row-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .modal-xl, .modal-requisition, .modal-lg {
        max-width: 95%;
    }
    .view-job-details,
    .view-candidate-grid {
        grid-template-columns: 1fr;
    }
    .score-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }
    body.sidebar-open .sidebar {
        transform: translateX(0);
    }
    body.sidebar-open .sidebar-overlay {
        display: block;
    }
    .sidebar-nav a {
        justify-content: flex-start;
        padding: 10px 24px;
    }
    .sidebar-nav a span,
    .sidebar-nav .nav-label,
    .sidebar-footer span {
        display: inline;
    }
    .sidebar-nav a .badge {
        display: inline-flex;
    }
    .sidebar-brand span {
        display: inline;
    }
    .main-content {
        margin-left: 0;
    }
    .page-content {
        padding: 16px;
    }
    .form-row-3, .form-row-4 {
        grid-template-columns: 1fr;
    }
    .form-row-2 {
        grid-template-columns: 1fr;
    }
    .profile-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .letter-preview {
        padding: 24px;
    }
    .top-header {
        padding: 10px 16px;
    }
    .top-header .page-title-area h1 {
        font-size: 16px;
    }
    .top-header .breadcrumb {
        font-size: 11px;
    }
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-bar .form-control,
    .filter-bar .search-box {
        width: 100%;
        min-width: 0;
    }
    .filter-bar .btn {
        width: 100%;
        justify-content: center;
    }
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-container table {
        min-width: 700px;
    }
    .modal-xl, .modal-requisition {
        max-width: 95%;
    }
    .modal-lg {
        max-width: 95%;
    }
    .modal-header-navy {
        padding: 16px 20px;
    }
    .modal-header-navy h3 {
        font-size: 15px;
    }
    .modal-body {
        padding: 20px;
    }
    .modal-footer-light {
        padding: 12px 20px;
    }
    .welcome-card {
        padding: 32px 24px;
    }
    .welcome-card h1 {
        font-size: 22px;
    }
    .lifecycle-flow {
        padding: 16px 12px;
        gap: 0;
    }
    .flow-step {
        min-width: 60px;
        padding: 8px 10px;
    }
    .flow-step .flow-icon {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    .flow-step .flow-label {
        font-size: 10px;
    }
    .quick-links-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    .pipeline-flow {
        gap: 0;
    }
    .pf-step {
        min-width: 60px;
        padding: 6px 8px;
    }
    .pf-step .pf-count {
        font-size: 18px;
    }
    .pf-step .pf-label {
        font-size: 10px;
    }
    .pf-connector {
        width: 24px;
    }
    .quick-stats {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    .tab-bar {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    .tab-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    .iv-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .iv-card-header-right {
        width: 100%;
        justify-content: space-between;
    }
    .iv-scores {
        grid-template-columns: 1fr;
    }
    .iv-meta {
        flex-direction: column;
        gap: 4px;
    }
    .header-right .user-info div:last-child {
        display: none;
    }
    .pagination-bar {
        flex-direction: column;
        align-items: center;
    }
    .approval-level {
        flex-wrap: wrap;
    }
    .btn-group {
        flex-wrap: wrap;
    }
    .btn {
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .top-header {
        padding: 8px 12px;
    }
    .page-content {
        padding: 12px;
    }
    .stat-card {
        padding: 14px 16px;
    }
    .qs-card {
        padding: 14px 16px;
    }
    .modal {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
    }
    .modal-overlay {
        align-items: flex-end;
    }
    .modal-header-navy {
        padding: 14px 16px;
    }
    .modal-header-navy h3 {
        font-size: 14px;
    }
    .modal-body {
        padding: 16px;
    }
    .modal-footer-light {
        padding: 12px 16px;
    }
    .modal-sticky {
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
        height: auto;
    }
    .header-right .notification-btn {
        font-size: 18px;
    }
    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }
    .welcome-card {
        padding: 24px 16px;
    }
    .welcome-card h1 {
        font-size: 18px;
    }
    .quick-links-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    .quick-link-card {
        padding: 14px 12px;
    }
    .quick-link-card .ql-icon {
        font-size: 22px;
    }
    .flow-connector {
        width: 16px;
    }
    .quick-stats {
        grid-template-columns: 1fr;
    }
}

/* ===== PRINT ===== */
@media print {
    .sidebar, .top-header, .btn, .filter-bar, .no-print {
        display: none !important;
    }
    .main-content {
        margin-left: 0;
    }
    .page-content {
        padding: 0;
    }
    .letter-preview {
        box-shadow: none;
        border: none;
        padding: 0;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* ===== REQUISITION MODAL ===== */
.modal-requisition {
    max-width: 920px;
}

/* Section styling */
.requisition-section {
    margin-bottom: 28px;
}

.requisition-section:last-child {
    margin-bottom: 0;
}

.requisition-section .section-title {
    font-size: 15px;
    font-weight: 600;
    color: #1E3A8A;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8edf5;
    display: flex;
    align-items: center;
    gap: 8px;
}

.requisition-section .section-title .section-step {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1E3A8A;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

/* 2-column form row */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Searchable select */
.searchable-select {
    position: relative;
}

.searchable-select .ss-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 13px;
    color: var(--gray-900);
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
    font-family: inherit;
}

.searchable-select .ss-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,115,232,.15);
}

.searchable-select .ss-control .ss-placeholder {
    color: var(--gray-500);
}

.searchable-select .ss-control .ss-arrow {
    font-size: 10px;
    color: var(--gray-500);
    transition: var(--transition);
}

.searchable-select.open .ss-control .ss-arrow {
    transform: rotate(180deg);
}

.searchable-select .ss-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    max-height: 200px;
    overflow: hidden;
}

.searchable-select.open .ss-dropdown {
    display: block;
}

.searchable-select .ss-dropdown .ss-search {
    padding: 8px;
    border-bottom: 1px solid var(--gray-200);
}

.searchable-select .ss-dropdown .ss-search input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 13px;
    outline: none;
    font-family: inherit;
}

.searchable-select .ss-dropdown .ss-search input:focus {
    border-color: var(--primary);
}

.searchable-select .ss-dropdown .ss-options {
    max-height: 150px;
    overflow-y: auto;
}

.searchable-select .ss-dropdown .ss-option {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.searchable-select .ss-dropdown .ss-option:hover {
    background: var(--gray-50);
}

.searchable-select .ss-dropdown .ss-option.selected {
    background: #e8f0fe;
    color: var(--primary);
    font-weight: 500;
}

/* Tag input */
.tag-input-wrapper {
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    padding: 6px 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    cursor: text;
    transition: var(--transition);
    min-height: 38px;
    background: #fff;
}

.tag-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,115,232,.15);
}

.tag-input-wrapper .tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #e8f0fe;
    color: #1E3A8A;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.tag-input-wrapper .tag .tag-remove {
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    color: #1E3A8A;
    opacity: .6;
    transition: var(--transition);
}

.tag-input-wrapper .tag .tag-remove:hover {
    opacity: 1;
}

.tag-input-wrapper .tag-input {
    border: none;
    outline: none;
    font-size: 13px;
    font-family: inherit;
    flex: 1;
    min-width: 100px;
    padding: 2px 4px;
    background: transparent;
}

/* Date input with icon */
.date-input-wrapper {
    position: relative;
}

.date-input-wrapper .form-control {
    padding-right: 36px;
}

.date-input-wrapper .date-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
    pointer-events: none;
    font-size: 16px;
}

/* Full-width text areas */
.textarea-full {
    min-height: 100px;
}

.textarea-full-lg {
    min-height: 140px;
}

/* ===== MISC ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }
