/* ═══════════════════════════════════════════════════════════════
   OneTeam — DigiCert Unified People Platform styles
   ═══════════════════════════════════════════════════════════════ */

:root {
    --dc-blue:        #0C5FCD;
    --dc-blue-dark:   #0A4FA8;
    --dc-blue-darker: #083D82;
    --dc-blue-light:  #E8F0FE;
    --dc-blue-50:     #F0F6FF;
    --dc-navy:        #1B2A4A;
    --dc-white:       #FFFFFF;
    --dc-gray-50:     #F8F9FA;
    --dc-gray-100:    #F1F3F5;
    --dc-gray-200:    #E9ECEF;
    --dc-gray-300:    #DEE2E6;
    --dc-gray-400:    #ADB5BD;
    --dc-gray-500:    #6C757D;
    --dc-gray-600:    #495057;
    --dc-gray-700:    #343A40;
    --dc-gray-800:    #212529;

    --dc-green:   #1B8A5A;
    --dc-yellow:  #E6A817;
    --dc-orange:  #E67E22;
    --dc-red:     #D63031;
    --dc-purple:  #8E44AD;
    --dc-teal:    #0D7377;

    --sidebar-width: 260px;
    --topbar-height: 56px;
    --transition: all 0.2s ease;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--dc-gray-50);
    color: var(--dc-gray-800);
    line-height: 1.5;
    overflow-x: hidden;
}

a { color: var(--dc-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Login Page ──────────────────────────────────────────────── */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0C5FCD 0%, #083D82 50%, #1B2A4A 100%);
    position: relative; overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute; top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(12,95,205,0.3) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(27,138,90,0.15) 0%, transparent 50%);
    animation: loginBg 20s ease-in-out infinite alternate;
}
@keyframes loginBg {
    0% { transform: translate(0,0) rotate(0deg); }
    100% { transform: translate(-5%,3%) rotate(2deg); }
}

.login-card {
    position: relative;
    background: var(--dc-white);
    border-radius: 16px;
    padding: 48px 40px 40px;
    width: 420px; max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}
.login-logo {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--dc-blue); color: white;
    font-size: 24px; font-weight: 700;
    width: 56px; height: 56px; border-radius: 14px;
    margin-bottom: 16px; letter-spacing: -1px;
}
.login-title {
    font-size: 24px; font-weight: 700; color: var(--dc-gray-800); margin-bottom: 4px;
}
.login-subtitle {
    font-size: 14px; color: var(--dc-gray-500); margin-bottom: 28px;
}
.login-error {
    display: flex; align-items: center; gap: 8px; justify-content: center;
    background: #FEF2F2; color: var(--dc-red);
    border: 1px solid #FECACA; border-radius: var(--radius-sm);
    padding: 10px 16px; margin-bottom: 18px; font-size: 13px;
}

.form-group { margin-bottom: 16px; text-align: left; }
.form-label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--dc-gray-700); margin-bottom: 6px;
}
.input-wrapper { position: relative; }
.input-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: var(--dc-gray-400); pointer-events: none;
}
.form-input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1.5px solid var(--dc-gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px; outline: none;
    transition: var(--transition);
    background: var(--dc-white);
}
.form-input:focus {
    border-color: var(--dc-blue);
    box-shadow: 0 0 0 3px rgba(12,95,205,0.1);
}
select.form-input { padding-left: 14px; cursor: pointer; }
input[type="date"].form-input { padding-left: 14px; }

.login-footer {
    margin-top: 28px; padding-top: 20px;
    border-top: 1px solid var(--dc-gray-200);
}
.login-footer-brand {
    font-size: 16px; font-weight: 700; color: var(--dc-blue);
    letter-spacing: 0.5px; margin-bottom: 4px;
}
.login-footer-text {
    font-size: 11px; color: var(--dc-gray-400);
}

/* ── Buttons ─────────────────────────────────────────────────── */

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border: none; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: var(--transition); text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary {
    background: var(--dc-blue); color: white;
}
.btn-primary:hover { background: var(--dc-blue-dark); }
.btn-success {
    background: var(--dc-green); color: white;
}
.btn-success:hover { background: #157347; }
.btn-danger {
    background: var(--dc-red); color: white;
}
.btn-danger:hover { background: #b02a2a; }
.btn-outline {
    background: transparent; border: 1.5px solid var(--dc-gray-300);
    color: var(--dc-gray-600);
}
.btn-outline:hover { border-color: var(--dc-blue); color: var(--dc-blue); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border: none; border-radius: var(--radius-sm);
    background: transparent; cursor: pointer; color: var(--dc-gray-500);
    transition: var(--transition);
}
.btn-icon:hover { background: var(--dc-gray-100); color: var(--dc-blue); }

/* ── App Shell ───────────────────────────────────────────────── */

.app-shell {
    display: flex; min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────── */

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1B2A4A 0%, #162240 100%);
    color: white;
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
    overflow-y: auto;
}
.sidebar-header {
    display: flex; align-items: center; gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--dc-blue);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 800; letter-spacing: -1px;
    flex-shrink: 0;
}
.sidebar-brand { font-size: 17px; font-weight: 700; letter-spacing: 0.3px; }
.sidebar-brand-sub { font-size: 10px; opacity: 0.5; letter-spacing: 0.5px; text-transform: uppercase; }

.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-section { padding: 16px 20px 4px; }
.nav-section-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1.2px; color: rgba(255,255,255,0.3);
}
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 20px; margin: 1px 8px; border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.65); font-size: 13.5px; font-weight: 500;
    transition: var(--transition); text-decoration: none;
    position: relative;
}
.nav-item:hover {
    background: rgba(255,255,255,0.08); color: white; text-decoration: none;
}
.nav-item.active {
    background: rgba(12,95,205,0.3); color: white;
}
.nav-item.active::before {
    content: '';
    position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px;
    background: var(--dc-blue); border-radius: 0 3px 3px 0;
}
.nav-item i, .nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 20px; height: 20px; padding: 0 6px;
    background: var(--dc-blue); color: white;
    font-size: 11px; font-weight: 700; border-radius: 10px;
    margin-left: auto;
}
.badge-red { background: var(--dc-red); }

.sidebar-footer {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-avatar {
    width: 34px; height: 34px; border-radius: 8px;
    background: rgba(12,95,205,0.5);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; opacity: 0.5; }
.sidebar-logout { color: rgba(255,255,255,0.4); margin-left: auto; }
.sidebar-logout:hover { color: white; }

/* ── Main Content ────────────────────────────────────────────── */

.main-content {
    flex: 1; margin-left: var(--sidebar-width);
    display: flex; flex-direction: column; min-height: 100vh;
}

.topbar {
    height: var(--topbar-height);
    background: var(--dc-white);
    border-bottom: 1px solid var(--dc-gray-200);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px;
    position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-left h2 { font-size: 18px; font-weight: 700; }
.topbar-breadcrumb { font-size: 12px; color: var(--dc-gray-400); }

.topbar-right { display: flex; align-items: center; gap: 12px; }
.search-wrap { position: relative; }
.search-icon {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: var(--dc-gray-400); pointer-events: none;
}
.search-input {
    padding: 7px 14px 7px 34px;
    border: 1px solid var(--dc-gray-300); border-radius: 8px;
    font-size: 13px; width: 260px; outline: none;
    transition: var(--transition);
}
.search-input:focus {
    border-color: var(--dc-blue);
    box-shadow: 0 0 0 3px rgba(12,95,205,0.1);
}
.topbar-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border: none; border-radius: var(--radius-sm);
    background: transparent; cursor: pointer; color: var(--dc-gray-500);
    transition: var(--transition); position: relative;
}
.topbar-btn:hover { background: var(--dc-gray-100); color: var(--dc-blue); }
.dot {
    position: absolute; top: 6px; right: 6px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--dc-red); border: 2px solid white;
}

.page-content { padding: 24px 28px 40px; flex: 1; }

/* ── Stats Grid ──────────────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px; margin-bottom: 24px;
}
.stat-card {
    background: var(--dc-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--dc-gray-200);
    transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.stat-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.stat-card-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
}
.stat-card-icon i, .stat-card-icon svg { width: 20px; height: 20px; }
.stat-card-icon.blue   { background: #E8F0FE; color: var(--dc-blue); }
.stat-card-icon.green  { background: #E6F7EE; color: var(--dc-green); }
.stat-card-icon.orange { background: #FEF3E2; color: var(--dc-orange); }
.stat-card-icon.red    { background: #FEE2E2; color: var(--dc-red); }
.stat-card-icon.purple { background: #F3E8FF; color: var(--dc-purple); }

.stat-value { font-size: 28px; font-weight: 800; color: var(--dc-gray-800); }
.stat-label { font-size: 13px; color: var(--dc-gray-500); margin-top: 2px; }
.stat-trend {
    font-size: 12px; margin-top: 6px; font-weight: 500;
}
.stat-trend.up { color: var(--dc-green); }
.stat-trend.down { color: var(--dc-red); }
.stat-trend.neutral { color: var(--dc-gray-500); }

/* ── Cards ───────────────────────────────────────────────────── */

.card {
    background: var(--dc-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--dc-gray-200);
    margin-bottom: 20px;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--dc-gray-100);
}
.card-header h3 {
    font-size: 15px; font-weight: 700;
    display: flex; align-items: center;
}
.card-body { padding: 20px; }

.content-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
}

/* ── Instance / Office Cards ─────────────────────────────────── */

.instance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.offices-full {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.instance-card {
    border: 1px solid var(--dc-gray-200);
    border-radius: var(--radius);
    padding: 16px;
    transition: var(--transition);
}
.instance-card:hover { border-color: var(--dc-blue); box-shadow: var(--shadow); }
.instance-card-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 10px;
}
.instance-name { display: flex; align-items: center; gap: 10px; }
.instance-flag { font-size: 28px; }
.instance-name h4 { font-size: 15px; font-weight: 700; }
.region { font-size: 12px; color: var(--dc-gray-500); }

.office-meta {
    display: flex; gap: 16px; font-size: 12px; color: var(--dc-gray-500);
    margin-bottom: 10px;
}
.office-meta span { display: flex; align-items: center; gap: 4px; }
.office-regs { display: flex; flex-wrap: wrap; gap: 4px; }
.reg-tag {
    display: inline-block; padding: 2px 8px;
    background: var(--dc-gray-100); border-radius: 4px;
    font-size: 11px; color: var(--dc-gray-600); font-weight: 500;
}

.office-address {
    display: flex; align-items: flex-start; gap: 6px;
    font-size: 12px; color: var(--dc-gray-500);
    margin-top: 10px;
}
.office-benefits {
    margin-top: 12px; padding-top: 12px;
    border-top: 1px solid var(--dc-gray-100);
}
.office-benefits-label {
    display: flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 700; color: var(--dc-gray-500);
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px;
}
.office-benefits-text { font-size: 12px; color: var(--dc-gray-600); }

.poortwachter-badge {
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: 10px; padding: 4px 10px;
    background: #F3E8FF; color: var(--dc-purple);
    border-radius: 4px; font-size: 11px; font-weight: 600;
}

/* ── Status Badges ───────────────────────────────────────────── */

.status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 600; text-transform: capitalize;
}
.status-badge.active, .status-badge.healthy { background: #E6F7EE; color: var(--dc-green); }
.status-badge.sick { background: #FEF3E2; color: var(--dc-orange); }
.status-badge.onboarding { background: #E8F0FE; color: var(--dc-blue); }
.status-badge.inactive { background: var(--dc-gray-100); color: var(--dc-gray-500); }

.status-dot {
    width: 7px; height: 7px; border-radius: 50%;
}
.status-dot.active, .status-dot.healthy { background: var(--dc-green); }
.status-dot.sick { background: var(--dc-orange); }
.status-dot.onboarding { background: var(--dc-blue); }
.status-dot.inactive { background: var(--dc-gray-400); }

/* ── App Cards ───────────────────────────────────────────────── */

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}
.app-card {
    border: 1px solid var(--dc-gray-200);
    border-radius: var(--radius);
    padding: 16px;
    transition: var(--transition);
    position: relative;
}
.app-card:hover { border-color: var(--dc-blue); box-shadow: var(--shadow); }
.app-card.clickable { cursor: pointer; }
.app-card-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
}
.app-card-icon i, .app-card-icon svg { width: 20px; height: 20px; }
.app-card-name {
    font-size: 14px; font-weight: 700;
    display: flex; align-items: center; gap: 8px;
}
.app-code {
    font-size: 10px; font-weight: 700;
    padding: 1px 6px; border-radius: 3px;
    background: var(--dc-gray-100); color: var(--dc-gray-500);
}
.app-card-desc {
    font-size: 12px; color: var(--dc-gray-500);
    margin-top: 4px; line-height: 1.4;
}
.nl-badge {
    position: absolute; top: 12px; right: 12px;
    font-size: 10px; font-weight: 600;
    padding: 2px 8px; border-radius: 4px;
    background: #FEF3E2; color: var(--dc-orange);
}
.app-card-footer {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 14px; padding-top: 12px;
    border-top: 1px solid var(--dc-gray-100);
}
.app-users {
    display: flex; align-items: center; gap: 4px;
    font-size: 12px; color: var(--dc-gray-500);
}

/* ── People Page ─────────────────────────────────────────────── */

.page-actions {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-select {
    padding: 7px 12px; border: 1px solid var(--dc-gray-300);
    border-radius: var(--radius-sm); font-size: 13px;
    background: white; cursor: pointer; outline: none;
    transition: var(--transition);
}
.filter-select:focus { border-color: var(--dc-blue); }

.table-wrap { overflow-x: auto; }
.data-table {
    width: 100%; border-collapse: collapse;
}
.data-table th {
    text-align: left; padding: 10px 16px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--dc-gray-500);
    border-bottom: 2px solid var(--dc-gray-200);
    white-space: nowrap;
}
.data-table td {
    padding: 12px 16px; border-bottom: 1px solid var(--dc-gray-100);
    font-size: 13px; vertical-align: middle;
}
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: var(--dc-gray-50); }

.emp-cell { display: flex; align-items: center; gap: 10px; }
.user-avatar {
    width: 36px; height: 36px; border-radius: 8px;
    background: var(--dc-blue-light); color: var(--dc-blue);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.user-avatar.sm { width: 32px; height: 32px; font-size: 11px; }
.emp-name { font-weight: 600; font-size: 13px; }
.emp-email { font-size: 11px; color: var(--dc-gray-500); }

.dept-badge {
    display: inline-block; padding: 2px 10px;
    border-radius: 4px; font-size: 11px; font-weight: 600;
}
.office-pill {
    display: inline-block; font-size: 12px;
    white-space: nowrap;
}

.app-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.app-pill {
    display: inline-block; padding: 2px 8px;
    border: 1.5px solid var(--dc-gray-300); border-radius: 4px;
    font-size: 10px; font-weight: 700; cursor: pointer;
    transition: var(--transition);
}
.app-pill:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.app-pill.more {
    background: var(--dc-gray-100); border-color: var(--dc-gray-300);
    color: var(--dc-gray-600);
}

.pto-bar-wrap {
    display: flex; align-items: center; gap: 6px;
}
.pto-bar {
    width: 50px; height: 6px;
    background: var(--dc-gray-200); border-radius: 3px;
    overflow: hidden;
}
.pto-bar-fill {
    height: 100%; border-radius: 3px;
    background: var(--dc-green);
    transition: width 0.5s ease;
}
.pto-text { font-size: 11px; color: var(--dc-gray-500); white-space: nowrap; }

/* ── Onboarding Templates ────────────────────────────────────── */

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.template-card {
    border: 1px solid var(--dc-gray-200);
    border-radius: var(--radius-sm);
    padding: 14px;
    cursor: pointer;
    transition: var(--transition);
}
.template-card:hover { border-color: var(--dc-blue); background: var(--dc-blue-50); }
.template-name { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.template-apps { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.template-app-dot {
    width: 10px; height: 10px; border-radius: 3px;
}
.template-count {
    font-size: 11px; color: var(--dc-gray-500); margin-left: 4px;
}

.template-preview { margin-top: 16px; }
.template-apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}
.template-app-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--dc-gray-200);
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.template-app-item .app-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.template-app-level {
    font-size: 10px; font-weight: 700;
    color: var(--dc-gray-400); margin-left: auto;
    text-transform: uppercase;
}

/* ── Leave Requests ──────────────────────────────────────────── */

.leave-list { display: flex; flex-direction: column; }
.leave-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--dc-gray-100);
    gap: 16px;
}
.leave-item:last-child { border-bottom: none; }
.leave-info { display: flex; align-items: center; gap: 10px; }
.leave-name { font-size: 13px; font-weight: 600; }
.leave-detail { font-size: 12px; color: var(--dc-gray-500); }
.leave-actions { display: flex; gap: 6px; flex-shrink: 0; }

.leave-item.handled { opacity: 0.5; pointer-events: none; }

/* ── Action Items ────────────────────────────────────────────── */

.action-list { display: flex; flex-direction: column; gap: 8px; }
.action-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    border-left: 3px solid transparent;
}
.action-item.error { background: #FEF2F2; border-left-color: var(--dc-red); }
.action-item.warning { background: #FEF9E7; border-left-color: var(--dc-orange); }
.action-item.info { background: var(--dc-blue-50); border-left-color: var(--dc-blue); }
.action-item.success { background: #E6F7EE; border-left-color: var(--dc-green); }

.action-icon {
    width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.action-icon i, .action-icon svg { width: 16px; height: 16px; }
.action-icon.error { background: rgba(214,48,49,0.1); color: var(--dc-red); }
.action-icon.warning { background: rgba(230,126,34,0.1); color: var(--dc-orange); }
.action-icon.info { background: rgba(12,95,205,0.1); color: var(--dc-blue); }

.action-title { font-size: 13px; font-weight: 600; }
.action-detail { font-size: 12px; color: var(--dc-gray-500); }

/* ── Notifications ───────────────────────────────────────────── */

.notif-list { display: flex; flex-direction: column; }
.notif-item {
    display: flex; gap: 10px; padding: 10px 0;
    border-bottom: 1px solid var(--dc-gray-100);
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--dc-blue-50); margin: 0 -20px; padding: 10px 20px; border-radius: var(--radius-sm); }
.notif-dot-wrap { width: 10px; padding-top: 6px; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; display: block; }
.notif-dot.error { background: var(--dc-red); }
.notif-dot.warning { background: var(--dc-orange); }
.notif-dot.info { background: var(--dc-blue); }
.notif-dot.success { background: var(--dc-green); }
.notif-content { flex: 1; }
.notif-title { font-size: 13px; font-weight: 600; }
.notif-body { font-size: 12px; color: var(--dc-gray-500); margin-top: 2px; }
.notif-meta { margin-top: 4px; }
.notif-source { font-size: 11px; font-weight: 600; }

/* Full notifications page */
.notif-full-list { display: flex; flex-direction: column; }
.notif-full-item {
    display: flex; align-items: flex-start; gap: 0;
    padding: 16px 20px;
    border-bottom: 1px solid var(--dc-gray-100);
    position: relative; transition: background 0.15s;
}
.notif-full-item:hover { background: var(--dc-gray-50); }
.notif-full-item.unread { background: var(--dc-blue-50); }
.notif-severity-bar {
    width: 3px; min-height: 100%; border-radius: 2px;
    margin-right: 14px; flex-shrink: 0;
}
.notif-severity-bar.error { background: var(--dc-red); }
.notif-severity-bar.warning { background: var(--dc-orange); }
.notif-severity-bar.info { background: var(--dc-blue); }
.notif-severity-bar.success { background: var(--dc-green); }

.notif-full-content { flex: 1; }
.notif-full-top {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 4px;
}
.notif-source-badge {
    display: inline-block; padding: 2px 8px;
    border-radius: 4px; font-size: 10px; font-weight: 700;
}
.notif-time { font-size: 11px; color: var(--dc-gray-400); }
.notif-full-title { font-size: 14px; font-weight: 600; }
.notif-full-body { font-size: 12px; color: var(--dc-gray-500); margin-top: 2px; }
.notif-unread-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--dc-blue); flex-shrink: 0;
    margin-top: 6px; margin-left: 12px;
}

/* ── Quick Stats ─────────────────────────────────────────────── */

.quick-stats { display: flex; flex-direction: column; gap: 8px; }
.qs-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--dc-gray-100);
}
.qs-item:last-child { border-bottom: none; }
.qs-label { font-size: 13px; color: var(--dc-gray-500); }
.qs-value { font-size: 14px; font-weight: 700; }

/* ── Compliance / Timeline ───────────────────────────────────── */

.compliance-banner {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 16px 20px;
    background: #F3E8FF; border: 1px solid #DDD6FE;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 13px; color: var(--dc-purple);
}
.compliance-banner-icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: rgba(142,68,173,0.15);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.compliance-banner-icon i, .compliance-banner-icon svg { width: 16px; height: 16px; }

.compliance-case { overflow: hidden; }
.case-header-info { display: flex; align-items: center; gap: 12px; }
.case-header-right { display: flex; align-items: center; gap: 16px; }
.return-pct { text-align: right; }
.return-pct-label { display: block; font-size: 10px; color: var(--dc-gray-500); text-transform: uppercase; font-weight: 600; }
.return-pct-value { font-size: 18px; font-weight: 800; }
.return-pct-value.zero { color: var(--dc-red); }
.return-pct-value.low { color: var(--dc-orange); }
.return-pct-value.good { color: var(--dc-green); }

.timeline-container { margin-bottom: 24px; }
.timeline-track {
    position: relative;
    height: 8px;
    background: var(--dc-gray-200);
    border-radius: 4px;
    margin: 40px 0 30px;
}
.timeline-progress {
    position: absolute; top: 0; left: 0; height: 100%;
    background: linear-gradient(90deg, var(--dc-green), var(--dc-blue));
    border-radius: 4px;
    transition: width 0.8s ease;
}
.timeline-now {
    position: absolute; top: -28px;
    transform: translateX(-50%);
    z-index: 3;
}
.timeline-now-label {
    display: inline-block; padding: 2px 8px;
    background: var(--dc-blue); color: white;
    border-radius: 4px; font-size: 11px; font-weight: 700;
    white-space: nowrap;
}
.timeline-now-label::after {
    content: '';
    position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--dc-blue);
}
.timeline-marker {
    position: absolute; top: -6px;
    width: 20px; height: 20px; border-radius: 50%;
    transform: translateX(-50%);
    border: 3px solid white;
    box-shadow: 0 0 0 1px var(--dc-gray-300);
    z-index: 2;
    cursor: pointer;
    transition: var(--transition);
}
.timeline-marker:hover { transform: translateX(-50%) scale(1.2); }
.timeline-marker.completed { background: var(--dc-green); }
.timeline-marker.overdue { background: var(--dc-red); animation: pulse 2s infinite; }
.timeline-marker.upcoming { background: var(--dc-gray-300); }

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 1px var(--dc-gray-300); }
    50% { box-shadow: 0 0 0 4px rgba(214,48,49,0.3); }
}

.timeline-marker-label {
    position: absolute; top: 22px; left: 50%; transform: translateX(-50%);
    font-size: 9px; font-weight: 700; color: var(--dc-gray-500);
    white-space: nowrap;
}

.timeline-legend {
    display: flex; gap: 16px; justify-content: center; margin-top: 8px;
}
.tl-legend {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; color: var(--dc-gray-500);
}
.tl-dot { width: 8px; height: 8px; border-radius: 50%; }
.tl-dot.completed { background: var(--dc-green); }
.tl-dot.overdue { background: var(--dc-red); }
.tl-dot.upcoming { background: var(--dc-gray-300); }

/* Milestones */
.milestone-list { display: flex; flex-direction: column; }
.milestone-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--dc-gray-100);
}
.milestone-item:last-child { border-bottom: none; }
.milestone-item.overdue { background: #FEF2F2; margin: 0 -20px; padding: 10px 20px; border-radius: var(--radius-sm); }
.milestone-status { flex-shrink: 0; }
.milestone-info { flex: 1; display: flex; align-items: center; gap: 8px; }
.milestone-name { font-size: 13px; font-weight: 600; }
.milestone-week { font-size: 11px; color: var(--dc-gray-400); }
.milestone-date { font-size: 12px; color: var(--dc-gray-500); min-width: 100px; text-align: right; }
.text-danger { color: var(--dc-red) !important; font-weight: 600; }
.milestone-doc { min-width: 160px; text-align: right; }

.case-notes {
    padding: 12px 16px; margin-top: 16px;
    background: var(--dc-gray-50);
    border-radius: var(--radius-sm);
    font-size: 13px; color: var(--dc-gray-600);
}

/* ── 2nd Track ───────────────────────────────────────────────── */

.second-track-card {
    border: 1px solid var(--dc-gray-200);
    border-radius: var(--radius);
    padding: 16px;
}
.st-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px;
}
.st-details {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 8px 24px; margin-bottom: 12px;
}
.st-detail-item { font-size: 13px; }
.st-label { font-size: 11px; font-weight: 700; color: var(--dc-gray-500); text-transform: uppercase; display: block; margin-bottom: 2px; }

.st-meetings { padding-top: 12px; border-top: 1px solid var(--dc-gray-100); }
.st-meeting {
    display: flex; gap: 12px; padding: 6px 0;
    font-size: 12px;
}
.st-meeting-date { font-weight: 600; color: var(--dc-gray-700); min-width: 80px; }
.st-meeting-type {
    padding: 1px 8px; background: var(--dc-blue-50); color: var(--dc-blue);
    border-radius: 3px; font-weight: 600; font-size: 11px;
}
.st-meeting-notes { color: var(--dc-gray-500); }

/* ── Settings ────────────────────────────────────────────────── */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}
.settings-form { display: flex; flex-direction: column; gap: 16px; }
.settings-toggle {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 16px;
}
.settings-toggle-label { font-size: 14px; font-weight: 600; }
.settings-toggle-desc { font-size: 12px; color: var(--dc-gray-500); margin-top: 2px; }

.toggle {
    position: relative; display: inline-block;
    width: 40px; height: 22px; flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--dc-gray-300);
    transition: 0.3s; border-radius: 22px;
}
.toggle-slider::before {
    content: "";
    position: absolute; height: 16px; width: 16px;
    left: 3px; bottom: 3px;
    background: white; transition: 0.3s; border-radius: 50%;
}
.toggle input:checked + .toggle-slider { background: var(--dc-blue); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

.settings-form .form-input { padding-left: 14px; }

/* ── Modals ──────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
    background: var(--dc-white);
    border-radius: 14px;
    width: 560px; max-width: 90vw; max-height: 85vh;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    display: flex; flex-direction: column;
    transform: translateY(10px);
    transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal.modal-lg { width: 700px; }

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--dc-gray-200);
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
    width: 32px; height: 32px; border: none;
    background: transparent; font-size: 22px;
    color: var(--dc-gray-400); cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--dc-gray-100); color: var(--dc-gray-700); }

.modal-body {
    padding: 20px 24px;
    overflow-y: auto; flex: 1;
}
.modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 14px 24px;
    border-top: 1px solid var(--dc-gray-200);
}
.form-row {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Modal form inputs (no icon) */
.modal-body .form-input { padding-left: 14px; }

/* ── Popup ───────────────────────────────────────────────────── */

.popup {
    position: absolute;
    background: var(--dc-white);
    border: 1px solid var(--dc-gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 240px; max-width: 320px;
    z-index: 200; padding: 14px;
}
.popup-header {
    font-size: 13px; font-weight: 700;
    padding-bottom: 8px; margin-bottom: 8px;
    border-bottom: 1px solid var(--dc-gray-100);
}

/* ── Toast ───────────────────────────────────────────────────── */

.toast {
    position: fixed; bottom: 24px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--dc-gray-800); color: white;
    padding: 12px 24px; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    opacity: 0; transition: all 0.3s;
    z-index: 9999; pointer-events: none;
}
.toast.show {
    opacity: 1; transform: translateX(-50%) translateY(0);
}

/* ── Utilities ───────────────────────────────────────────────── */

.text-xs { font-size: 12px; }
.text-muted { color: var(--dc-gray-400) !important; }
.empty-state { text-align: center; padding: 20px; color: var(--dc-gray-400); font-size: 13px; }

/* ── Animated count ──────────────────────────────────────────── */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.stat-card { animation: fadeInUp 0.4s ease both; }
.stat-card:nth-child(2) { animation-delay: 0.05s; }
.stat-card:nth-child(3) { animation-delay: 0.1s; }
.stat-card:nth-child(4) { animation-delay: 0.15s; }

/* ── Employee detail in modal ────────────────────────────────── */

.emp-detail-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 12px 24px; margin-bottom: 20px;
}
.emp-detail-item { }
.emp-detail-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--dc-gray-500); margin-bottom: 2px;
}
.emp-detail-value { font-size: 14px; font-weight: 500; }

.emp-apps-section { margin-top: 16px; }
.emp-apps-section h4 {
    font-size: 13px; font-weight: 700; margin-bottom: 10px;
    padding-bottom: 8px; border-bottom: 1px solid var(--dc-gray-100);
}
.emp-app-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--dc-gray-100);
}
.emp-app-row:last-child { border-bottom: none; }
.emp-app-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.emp-app-name { font-size: 13px; font-weight: 500; flex: 1; }
.emp-app-level {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    padding: 2px 8px; border-radius: 3px;
    background: var(--dc-gray-100); color: var(--dc-gray-600);
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 1100px) {
    .content-grid { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .case-header-right { flex-direction: column; align-items: flex-end; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 8px 10px; }
}

/* ═══════════════════════════════════════════════════════════════
   App Detail Modal — Full-width views for each internal app
   ═══════════════════════════════════════════════════════════════ */

.modal.modal-xl {
    width: 900px;
    max-width: 94vw;
    max-height: 90vh;
}

.app-modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}
.app-modal-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.app-modal-icon i, .app-modal-icon svg { width: 20px; height: 20px; }

/* ── Tab bar ── */
.app-modal-tabs {
    display: flex;
    border-bottom: 2px solid var(--dc-gray-200);
    padding: 0 24px;
    gap: 0;
    overflow-x: auto;
    flex-shrink: 0;
}
.app-tab {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--dc-gray-500);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}
.app-tab:hover { color: var(--dc-gray-800); }
.app-tab.active {
    color: var(--dc-blue);
    border-bottom-color: var(--dc-blue);
}

/* ── Tab content ── */
.app-tab-content {
    overflow-y: auto;
    max-height: calc(90vh - 180px);
}

/* ── App view header (stats strip) ── */
.app-view-header {
    padding: 16px 20px;
    background: var(--dc-gray-50);
    border-bottom: 1px solid var(--dc-gray-200);
}
.app-view-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.app-mini-stat {
    display: flex;
    flex-direction: column;
}
.app-mini-val {
    font-size: 20px;
    font-weight: 800;
    color: var(--dc-gray-800);
}
.app-mini-lbl {
    font-size: 11px;
    color: var(--dc-gray-500);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ── Contract cards ── */
.contract-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid var(--dc-gray-200);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: var(--transition);
}
.contract-card:hover { border-color: var(--dc-blue); }
.contract-card.warn {
    border-color: var(--dc-orange);
    background: #FEF9E7;
}
.contract-actions { display: flex; gap: 6px; }

/* ── Org chart ── */
.org-node {
    margin-bottom: 20px;
    border: 1px solid var(--dc-gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}
.org-manager {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--dc-gray-50);
    border-bottom: 1px solid var(--dc-gray-200);
}
.org-reports {
    padding: 4px 16px 8px;
}
.org-report {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0 8px 24px;
    border-bottom: 1px solid var(--dc-gray-100);
    position: relative;
}
.org-report:last-child { border-bottom: none; }
.org-report-line {
    position: absolute;
    left: 8px; top: 0; bottom: 50%;
    width: 12px;
    border-left: 2px solid var(--dc-gray-300);
    border-bottom: 2px solid var(--dc-gray-300);
    border-radius: 0 0 0 6px;
}

/* ── Audit log ── */
.audit-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--dc-gray-100);
    transition: background 0.15s;
}
.audit-row:hover { background: var(--dc-gray-50); }
.audit-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.audit-info { flex: 1; font-size: 13px; }
.audit-time {
    font-size: 11px;
    color: var(--dc-gray-400);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── External app view ── */
.app-ext-card {
    border: 1px solid var(--dc-gray-200);
    border-radius: var(--radius);
    padding: 16px;
}
.app-ext-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--dc-gray-100);
    font-size: 13px;
}
.app-ext-row:last-child { border-bottom: none; }
.app-ext-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--dc-gray-500);
    text-transform: uppercase;
}
.app-ext-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--dc-gray-100);
}
.app-ext-user:last-child { border-bottom: none; }

/* ── Info boxes ── */
.app-info-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: var(--dc-blue-50);
    border: 1px solid #C5D9F5;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--dc-blue);
}
.app-info-box.warn {
    background: #FEF9E7;
    border-color: #F5D98A;
    color: #B7791F;
}

/* ── Payslip accordions ── */
.payslip-month {
    border: 1px solid var(--dc-gray-200);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    overflow: hidden;
}
.payslip-month-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    background: var(--dc-gray-50);
    font-size: 14px;
    transition: background 0.15s;
}
.payslip-month-header:hover { background: var(--dc-gray-100); }
.payslip-chevron { transition: transform 0.2s; }
.payslip-month.open .payslip-chevron { transform: rotate(90deg); }
.payslip-month-body {
    display: none;
    padding: 8px 16px;
}
.payslip-month.open .payslip-month-body { display: block; }
.payslip-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--dc-gray-100);
}
.payslip-row:last-child { border-bottom: none; }

/* ── PTO team bars ── */
.pto-team-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--dc-gray-100);
}
.pto-team-row:last-child { border-bottom: none; }
.pto-team-bar-wrap { flex: 1; }
.pto-team-bar {
    width: 100%;
    height: 8px;
    background: var(--dc-gray-200);
    border-radius: 4px;
    overflow: hidden;
}
.pto-team-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}
.pto-team-nums {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    min-width: 100px;
    text-align: right;
}

/* ── Sick pay cards ── */
.sick-pay-card {
    border: 1px solid var(--dc-gray-200);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}
.sick-pay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.sick-pay-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.sick-pay-item {
    padding: 8px 12px;
    background: var(--dc-gray-50);
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.sick-pay-item .app-ext-label {
    display: block;
    margin-bottom: 4px;
}

/* ── Finance bars ── */
.finance-bar-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}
.finance-bar-label {
    font-size: 13px;
    font-weight: 600;
    min-width: 140px;
}
.finance-bar-track {
    flex: 1;
    height: 10px;
    background: var(--dc-gray-200);
    border-radius: 5px;
    overflow: hidden;
}
.finance-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
}
.finance-bar-value {
    font-size: 13px;
    font-weight: 700;
    min-width: 110px;
    text-align: right;
}

/* ── Budget bars ── */
.budget-row {
    margin-bottom: 16px;
}
.budget-row-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
}
.budget-bar {
    height: 8px;
    background: var(--dc-gray-200);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}
.budget-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ── Document rows ── */
.doc-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--dc-gray-100);
}
.doc-row:last-child { border-bottom: none; }
.doc-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: var(--dc-gray-100);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--dc-gray-600);
}
.doc-info { flex: 1; min-width: 0; }
.doc-date {
    font-size: 11px;
    color: var(--dc-gray-400);
    white-space: nowrap;
    flex-shrink: 0;
}
.doc-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* ── Poortwachter mini timeline in app modal ── */
.pw-case {
    border: 1px solid var(--dc-gray-200);
    border-radius: var(--radius);
    padding: 16px;
}
.pw-case-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--dc-gray-100);
}
.pw-timeline-mini {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 12px;
}
.pw-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-left: 3px solid var(--dc-gray-200);
    font-size: 13px;
    transition: background 0.15s;
}
.pw-step:hover { background: var(--dc-gray-50); }
.pw-step.done { border-left-color: var(--dc-green); color: var(--dc-green); }
.pw-step.overdue { border-left-color: var(--dc-red); color: var(--dc-red); background: #FEF2F2; }
.pw-step.upcoming { border-left-color: var(--dc-gray-300); color: var(--dc-gray-400); }
.pw-step > div { color: var(--dc-gray-800); flex: 1; }

/* ── UWV timeline ── */
.uwv-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.uwv-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--dc-gray-100);
}
.uwv-item:last-child { border-bottom: none; }
.uwv-week {
    min-width: 44px;
    font-size: 13px;
    font-weight: 800;
    color: var(--dc-purple);
    background: #F3E8FF;
    padding: 4px 8px;
    border-radius: 4px;
    text-align: center;
    flex-shrink: 0;
}
.uwv-desc {
    flex: 1;
    font-size: 13px;
}
.uwv-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.uwv-tag.mandatory { background: #FEE2E2; color: var(--dc-red); }
.uwv-tag.recommended { background: #E8F0FE; color: var(--dc-blue); }
.uwv-tag.info { background: var(--dc-gray-100); color: var(--dc-gray-600); }

/* ── Active filter button state ── */
.btn-outline.active-filter {
    background: var(--dc-blue);
    color: white;
    border-color: var(--dc-blue);
}

/* ── Responsive app modal ── */
@media (max-width: 768px) {
    .modal.modal-xl { width: 100vw; max-width: 100vw; max-height: 100vh; border-radius: 0; }
    .app-view-stats { gap: 12px; }
    .app-mini-val { font-size: 16px; }
    .sick-pay-grid { grid-template-columns: repeat(2, 1fr); }
    .finance-bar-label { min-width: 100px; }
    .org-report { padding-left: 16px; }
}


/* ═══════════════════════════════════════════════════════════════
   Role Switcher
   ═══════════════════════════════════════════════════════════════ */

.role-switcher { position: relative; }

.role-switch-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--dc-gray-200); background: var(--dc-white);
    cursor: pointer; font-size: 13px; font-weight: 600; color: var(--dc-gray-700);
    transition: var(--transition); white-space: nowrap;
}
.role-switch-btn:hover { border-color: var(--dc-blue); color: var(--dc-blue); }

.role-switch-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 280px; background: var(--dc-white);
    border: 1px solid var(--dc-gray-200); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); z-index: 200;
    display: none; overflow: hidden;
}
.role-switch-dropdown.open { display: block; }

.role-dropdown-header {
    padding: 10px 16px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; color: var(--dc-gray-400);
    border-bottom: 1px solid var(--dc-gray-100);
    letter-spacing: 0.5px;
}

.role-option {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; cursor: pointer; transition: var(--transition);
}
.role-option:hover { background: var(--dc-blue-50); }
.role-option.active { background: var(--dc-blue-light); }

.role-option-icon {
    width: 32px; height: 32px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: var(--dc-gray-100); color: var(--dc-gray-600); flex-shrink: 0;
}
.role-option.active .role-option-icon {
    background: var(--dc-blue-light); color: var(--dc-blue);
}

.role-option-info { flex: 1; min-width: 0; }
.role-option-label { font-size: 13px; font-weight: 600; }
.role-option-desc { font-size: 11px; color: var(--dc-gray-500); }


/* ═══════════════════════════════════════════════════════════════
   AI Chat Widget
   ═══════════════════════════════════════════════════════════════ */

.ai-chat-fab {
    position: fixed; bottom: 24px; right: 24px;
    width: 52px; height: 52px; border-radius: 50%;
    background: linear-gradient(135deg, var(--dc-blue), var(--dc-blue-dark));
    color: white; display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: 0 4px 16px rgba(12, 95, 205, 0.35);
    z-index: 1000; transition: var(--transition);
}
.ai-chat-fab:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(12, 95, 205, 0.45); }
.ai-chat-fab.open { transform: scale(0.9); opacity: 0.6; }

.ai-chat-fab-badge {
    position: absolute; top: -4px; right: -4px;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--dc-red); color: white;
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--dc-white);
}

.ai-chat-panel {
    position: fixed; bottom: 88px; right: 24px;
    width: 420px; height: 580px;
    background: var(--dc-white); border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.15);
    z-index: 999; display: flex; flex-direction: column;
    opacity: 0; transform: translateY(20px) scale(0.95);
    pointer-events: none; transition: all 0.25s ease;
    overflow: hidden;
}
.ai-chat-panel.open {
    opacity: 1; transform: translateY(0) scale(1);
    pointer-events: auto;
}

.ai-chat-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--dc-blue), var(--dc-blue-dark));
    color: white;
}
.ai-chat-header-info { display: flex; align-items: center; gap: 10px; }

.ai-chat-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,0.2); display: flex;
    align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800;
}
.ai-chat-name { font-size: 14px; font-weight: 700; }
.ai-chat-status { font-size: 11px; opacity: 0.7; }

.ai-chat-close {
    background: none; border: none; color: white;
    font-size: 22px; cursor: pointer; opacity: 0.7;
    width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: var(--transition);
}
.ai-chat-close:hover { opacity: 1; background: rgba(255,255,255,0.15); }

.ai-chat-messages {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 12px;
    scroll-behavior: smooth;
}

.ai-msg { display: flex; gap: 8px; max-width: 92%; }
.ai-msg.user { flex-direction: row-reverse; align-self: flex-end; }
.ai-msg.bot { align-self: flex-start; }

.ai-msg-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, var(--dc-blue), var(--dc-blue-dark)); color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 800; flex-shrink: 0;
}

.ai-msg-content {
    padding: 10px 14px; border-radius: 14px;
    font-size: 13px; line-height: 1.6;
}
.ai-msg.bot .ai-msg-content {
    background: var(--dc-gray-100); color: var(--dc-gray-800);
    border-bottom-left-radius: 4px;
}
.ai-msg.user .ai-msg-content {
    background: var(--dc-blue); color: white;
    border-bottom-right-radius: 4px;
}
.ai-msg.ai-insight .ai-msg-content {
    background: #FFF8E6; border: 1px solid #F0D060;
    border-bottom-left-radius: 4px;
}
.ai-msg-text { word-break: break-word; }
.ai-msg-time { font-size: 10px; color: var(--dc-gray-400); margin-top: 4px; }
.ai-msg.user .ai-msg-time { color: rgba(255,255,255,0.6); }

.ai-typing { display: flex; gap: 5px; padding: 6px 0; }
.ai-typing span {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--dc-gray-400);
    animation: aiTypingBounce 1.4s infinite ease-in-out;
}
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes aiTypingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.ai-chat-presets {
    padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 6px;
    border-top: 1px solid var(--dc-gray-100);
}
.ai-preset-btn {
    padding: 5px 10px; border-radius: 16px;
    border: 1px solid var(--dc-gray-200); background: var(--dc-white);
    font-size: 11px; cursor: pointer; transition: var(--transition);
    white-space: nowrap; color: var(--dc-gray-600);
}
.ai-preset-btn:hover {
    background: var(--dc-blue-50); border-color: var(--dc-blue); color: var(--dc-blue);
}

.ai-chat-input-wrap {
    display: flex; align-items: center; gap: 8px;
    padding: 12px; border-top: 1px solid var(--dc-gray-100);
}
.ai-chat-input {
    flex: 1; padding: 9px 14px; border-radius: 20px;
    border: 1px solid var(--dc-gray-200); font-size: 13px;
    outline: none; transition: var(--transition);
    font-family: inherit;
}
.ai-chat-input:focus { border-color: var(--dc-blue); box-shadow: 0 0 0 3px rgba(12,95,205,0.1); }

.ai-chat-send {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--dc-blue); color: white; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: var(--transition); flex-shrink: 0;
}
.ai-chat-send:hover { background: var(--dc-blue-dark); }


/* ═══════════════════════════════════════════════════════════════
   Access Restricted Page
   ═══════════════════════════════════════════════════════════════ */

.access-restricted-wrap {
    display: flex; align-items: center; justify-content: center;
    min-height: 60vh;
}
.access-restricted-card {
    text-align: center; padding: 48px;
    background: var(--dc-white); border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.access-restricted-card h3 { margin: 16px 0 8px; font-size: 18px; }
.access-restricted-card p { color: var(--dc-gray-500); font-size: 13px; margin-bottom: 20px; }


/* ═══════════════════════════════════════════════════════════════
   My Dashboard Components (Employee / Manager / Payroll views)
   ═══════════════════════════════════════════════════════════════ */

.welcome-banner {
    padding: 20px 24px; margin-bottom: 20px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--dc-blue) 0%, var(--dc-blue-dark) 100%);
    color: white;
}
.welcome-banner h2 { font-size: 20px; margin-bottom: 4px; }
.welcome-banner p { opacity: 0.8; font-size: 13px; }

/* PTO Ring */
.my-pto-visual { display: flex; align-items: center; gap: 20px; }

.my-pto-ring {
    width: 100px; height: 100px; border-radius: 50%;
    background: conic-gradient(var(--color) calc(var(--pct) * 1%), var(--dc-gray-100) 0);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.my-pto-ring-inner {
    width: 76px; height: 76px; border-radius: 50%;
    background: var(--dc-white); display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.my-pto-ring-val { font-size: 22px; font-weight: 800; line-height: 1; color: var(--dc-gray-800); }
.my-pto-ring-label { font-size: 10px; color: var(--dc-gray-500); margin-top: 2px; }

.my-pto-info { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.my-pto-stat {
    display: flex; justify-content: space-between; font-size: 13px;
    padding: 5px 0; border-bottom: 1px solid var(--dc-gray-100);
}
.my-pto-stat:last-child { border-bottom: none; }

/* My App Items */
.my-app-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px; cursor: pointer; transition: var(--transition);
    border-bottom: 1px solid var(--dc-gray-50);
}
.my-app-item:hover { background: var(--dc-gray-50); }
.my-app-item:last-child { border-bottom: none; }

.my-app-icon {
    width: 34px; height: 34px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}

/* My Team Members */
.my-team-member {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 20px;
}

/* My Leave Items */
.my-leave-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 0; border-bottom: 1px solid var(--dc-gray-50);
}
.my-leave-item:last-child { border-bottom: none; }

/* My Payslip Items */
.my-payslip-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px; border-bottom: 1px solid var(--dc-gray-50);
}
.my-payslip-item:last-child { border-bottom: none; }
.my-payslip-info { display: flex; align-items: center; gap: 10px; }

/* Responsive AI Chat */
@media (max-width: 768px) {
    .ai-chat-panel { width: calc(100vw - 32px); right: 16px; bottom: 80px; height: 70vh; }
    .ai-chat-fab { bottom: 16px; right: 16px; }
    .role-switch-dropdown { width: 250px; }
    .role-switch-btn span { display: none; }
}
