:root {
    --v5-primary: #0e7490;
    --v5-primary-dark: #155e75;
    --v5-primary-soft: #ecfeff;
    --v5-success: #059669;
    --v5-warning: #d97706;
    --v5-danger: #dc2626;
    --v5-ink: #0f172a;
    --v5-muted: #64748b;
    --v5-line: #e2e8f0;
    --v5-surface: #ffffff;
    --v5-canvas: #f8fafc;
    --v5-radius-sm: 10px;
    --v5-radius: 16px;
    --v5-radius-lg: 24px;
    --v5-shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .08);
    --v5-shadow: 0 14px 35px rgba(15, 23, 42, .10);
}

html { scroll-behavior: smooth; }
body {
    color: var(--v5-ink);
    background-color: var(--v5-canvas);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.card, .modal-content {
    border: 1px solid var(--v5-line);
    border-radius: var(--v5-radius);
    box-shadow: var(--v5-shadow-sm);
}
.modal-content { border-radius: var(--v5-radius-lg); overflow: hidden; }
.card-header, .modal-header { border-bottom-color: var(--v5-line); }
.card-footer, .modal-footer { border-top-color: var(--v5-line); }

.btn {
    border-radius: var(--v5-radius-sm);
    font-weight: 600;
    min-height: 40px;
    transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible, .form-control:focus-visible, .custom-select:focus-visible {
    outline: 3px solid rgba(14, 116, 144, .22) !important;
    outline-offset: 2px;
}
.btn-primary { background: var(--v5-primary); border-color: var(--v5-primary); }
.btn-primary:hover { background: var(--v5-primary-dark); border-color: var(--v5-primary-dark); }

.form-control, .custom-select, select.form-control {
    min-height: 44px;
    border-color: #cbd5e1;
    border-radius: var(--v5-radius-sm);
    color: var(--v5-ink);
}
.form-control:focus, .custom-select:focus {
    border-color: var(--v5-primary);
    box-shadow: 0 0 0 3px rgba(14, 116, 144, .12);
}
label { color: #334155; font-weight: 600; }
.text-muted { color: var(--v5-muted) !important; }

.alert { border: 0; border-radius: 12px; }
.alert-success { background: #ecfdf5; color: #065f46; }
.alert-danger { background: #fef2f2; color: #991b1b; }
.alert-warning { background: #fffbeb; color: #92400e; }

.table { color: #1e293b; }
.table thead th {
    background: #f8fafc;
    color: #475569;
    border-bottom: 1px solid var(--v5-line);
    font-size: .78rem;
    letter-spacing: .035em;
    text-transform: uppercase;
}
.table td { vertical-align: middle; border-top-color: #edf2f7; }
.table-hover tbody tr:hover { background: #f8fbff; }

.content-wrapper { background: var(--v5-canvas); }
.main-header.navbar { border-bottom: 1px solid var(--v5-line); box-shadow: none; }
.main-sidebar { box-shadow: 8px 0 28px rgba(15, 23, 42, .08) !important; }
.nav-sidebar .nav-link { border-radius: 10px; margin: 2px 8px; }
.nav-sidebar .nav-link.active { box-shadow: none !important; font-weight: 600; }

.v5-login-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 28px 16px;
    box-sizing: border-box;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 12% 18%, rgba(96, 165, 250, .30), transparent 31%),
        radial-gradient(circle at 88% 82%, rgba(45, 212, 191, .18), transparent 28%),
        linear-gradient(145deg, #082f3d, #0e5268 55%, #123b4a);
}
.v5-login-shell #appCapsule {
    width: 100%;
    min-height: calc(100vh - 56px);
    min-height: calc(100dvh - 56px);
    padding: 0;
    box-sizing: border-box;
}
.v5-login-panel { width: min(100%, 430px); }
.v5-login-card {
    background: rgba(255,255,255,.98);
    border: 1px solid rgba(255,255,255,.60);
    border-radius: 28px;
    padding: 30px;
    box-shadow: 0 30px 70px rgba(2, 6, 23, .35);
}
.v5-brand-mark {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    border-radius: 22px;
    overflow: hidden;
    background: var(--v5-primary-soft);
    box-shadow: inset 0 0 0 1px #dbeafe;
}
.v5-brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.v5-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--v5-primary-soft);
    color: var(--v5-primary-dark);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.v5-login-title { margin: 12px 0 5px; font-size: 1.55rem; font-weight: 800; letter-spacing: -.025em; }
.v5-login-subtitle { color: var(--v5-muted); font-size: .9rem; line-height: 1.55; }
.v5-login-card .input-wrapper { border: 1px solid #cbd5e1; box-shadow: none !important; }
.v5-login-card .btn-primary {
    min-height: 48px;
    color: #ffffff !important;
    box-shadow: 0 9px 20px rgba(14, 116, 144, .24);
}
.v5-login-card .btn-primary:hover,
.v5-login-card .btn-primary:focus,
.v5-login-card .btn-primary:active { color: #ffffff !important; }
.v5-login-footer { color: #94a3b8; text-align: center; font-size: .75rem; margin-top: 18px; }

@media (max-width: 575.98px) {
    .v5-login-shell { padding: 16px 12px; align-items: center; }
    .v5-login-shell #appCapsule {
        min-height: calc(100vh - 32px);
        min-height: calc(100dvh - 32px);
    }
    .v5-login-card { padding: 23px 18px; border-radius: 22px; }
    .v5-brand-mark { width: 64px; height: 64px; border-radius: 18px; }
    .v5-login-title { font-size: 1.3rem; }
    .card-body { padding: 1rem; }
    .table-responsive { border-radius: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; }
}

/* Dashboard v5 */
.v5-dashboard { padding-top: 8px; }
.v5-dashboard-hero {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    padding: 26px 28px; margin-bottom: 22px; color: #fff; border-radius: 22px;
    background: linear-gradient(120deg, #123b4a, #0e7490 68%, #22a6b3);
    box-shadow: 0 18px 36px rgba(14, 116, 144, .18);
}
.v5-dashboard-hero h1 { margin: 8px 0 5px; font-size: 1.65rem; font-weight: 800; letter-spacing: -.025em; }
.v5-dashboard-hero p { margin: 0; color: rgba(255,255,255,.78); }
.v5-dashboard-eyebrow { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.v5-dashboard-date { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid rgba(255,255,255,.25); border-radius: 12px; background: rgba(255,255,255,.12); white-space: nowrap; }
.v5-stat-grid > [class*="col-"] { margin-bottom: 20px; }
.v5-stat-card { height: 100%; display: flex; align-items: center; gap: 16px; padding: 20px; border: 1px solid var(--v5-line); border-radius: 17px; background: #fff; box-shadow: var(--v5-shadow-sm); }
.v5-stat-icon { flex: 0 0 48px; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; font-size: 1.15rem; }
.v5-stat-card div:last-child { min-width: 0; display: flex; flex-direction: column; }
.v5-stat-card span { color: var(--v5-muted); font-size: .8rem; font-weight: 600; }
.v5-stat-card strong { color: var(--v5-ink); font-size: 1.65rem; line-height: 1.2; }
.v5-stat-card small { color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v5-stat-blue .v5-stat-icon { color: #0e7490; background: #ecfeff; }
.v5-stat-green .v5-stat-icon { color: #059669; background: #ecfdf5; }
.v5-stat-amber .v5-stat-icon { color: #d97706; background: #fffbeb; }
.v5-stat-red .v5-stat-icon { color: #dc2626; background: #fef2f2; }
.v5-today-summary { display:flex; align-items:center; gap:24px; margin-bottom:20px; padding:18px 20px; border:1px solid var(--v5-line); border-radius:17px; background:#fff; box-shadow:var(--v5-shadow-sm); }
.v5-today-heading { min-width:230px; display:flex; align-items:center; gap:12px; }
.v5-today-heading > div { display:flex; flex-direction:column; }
.v5-today-heading strong { color:var(--v5-ink); }
.v5-today-heading small { color:var(--v5-muted); font-size:.72rem; }
.v5-section-icon { flex:0 0 40px; width:40px; height:40px; display:grid; place-items:center; color:#0e7490; border-radius:12px; background:#ecfeff; }
.v5-today-items { flex:1; display:grid; grid-template-columns:repeat(4,minmax(110px,1fr)); border-left:1px solid var(--v5-line); }
.v5-today-items > div { display:grid; grid-template-columns:10px 1fr auto; align-items:center; gap:8px; padding:4px 18px; border-right:1px solid var(--v5-line); }
.v5-today-items > div:last-child { border-right:0; }
.v5-today-items small { color:var(--v5-muted); font-weight:600; }
.v5-today-items strong { color:var(--v5-ink); font-size:1.15rem; }
.v5-dot { width:8px; height:8px; border-radius:50%; }
.v5-dot-green { background:#10b981; }.v5-dot-slate { background:#94a3b8; }.v5-dot-amber { background:#f59e0b; }.v5-dot-blue { background:#0e7490; }
.v5-insight-card { margin-bottom:0; overflow:hidden; border:1px solid var(--v5-line); border-radius:17px; box-shadow:var(--v5-shadow-sm); }
.v5-insight-card .card-header { min-height:72px; display:flex; align-items:center; padding:16px 20px; background:#fff; }
.v5-insight-card .card-title { float:none; margin:0 0 4px; color:var(--v5-ink); font-weight:750; }
.v5-insight-card .card-header small { color:var(--v5-muted); }
.v5-attendance-chart { height:210px; display:flex; align-items:flex-end; gap:14px; padding:12px 8px 0; border-bottom:1px solid var(--v5-line); background:repeating-linear-gradient(to top,transparent 0,transparent 49px,#eef2f7 50px); }
.v5-chart-column { height:100%; flex:1; min-width:30px; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; }
.v5-chart-value { margin-bottom:6px; color:#475569; font-size:.72rem; font-weight:700; }
.v5-chart-track { width:min(34px,70%); height:145px; display:flex; align-items:flex-end; overflow:hidden; border-radius:8px 8px 2px 2px; background:#f1f5f9; }
.v5-chart-track span { display:block; width:100%; min-height:4px; border-radius:8px 8px 2px 2px; background:linear-gradient(180deg,#22a6b3,#0e7490); }
.v5-chart-column small { margin-top:8px; color:var(--v5-muted); font-size:.7rem; }
.v5-chart-legend { margin-top:14px; color:var(--v5-muted); font-size:.75rem; }
.v5-chart-legend span { display:inline-block; width:9px; height:9px; margin-right:5px; border-radius:3px; background:#0e7490; }
.v5-activity-list { padding:4px 18px; }
.v5-activity-item { display:flex; align-items:center; gap:11px; padding:12px 0; border-bottom:1px solid #edf2f7; }
.v5-activity-item:last-child { border-bottom:0; }
.v5-activity-avatar { flex:0 0 36px; width:36px; height:36px; display:grid; place-items:center; color:#155e75; border-radius:11px; background:#cffafe; font-size:.78rem; font-weight:800; }
.v5-activity-copy { min-width:0; flex:1; display:flex; flex-direction:column; }
.v5-activity-copy strong { overflow:hidden; color:var(--v5-ink); font-size:.82rem; text-overflow:ellipsis; white-space:nowrap; }
.v5-activity-copy small { overflow:hidden; color:var(--v5-muted); font-size:.7rem; text-overflow:ellipsis; white-space:nowrap; }
.v5-activity-time { display:flex; flex-direction:column; align-items:flex-end; }
.v5-activity-time strong { color:var(--v5-ink); font-size:.8rem; }
.v5-activity-time span { color:#059669; font-size:.65rem; font-weight:700; }
.v5-activity-time span.is-late { color:#d97706; }
.v5-empty-state-compact { min-height:250px; }
.v5-request-card .card-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: #fff; }
.v5-request-card .card-title { float: none; margin: 0 0 4px; font-weight: 750; }
.v5-request-card .card-header small { color: var(--v5-muted); }
.v5-request-list { padding: 6px 20px; }
.v5-request-item { display: flex; align-items: center; gap: 14px; padding: 15px 0; border-bottom: 1px solid #edf2f7; }
.v5-request-item:last-child { border-bottom: 0; }
.v5-request-avatar { flex: 0 0 42px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #155e75; background: #cffafe; font-weight: 800; }
.v5-request-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.v5-request-copy > span, .v5-request-copy small { color: var(--v5-muted); }
.v5-empty-state { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--v5-muted); text-align: center; padding: 28px; }
.v5-empty-state i { margin-bottom: 6px; color: #10b981; font-size: 2rem; }
.v5-empty-state strong { color: var(--v5-ink); }
@media (max-width: 767.98px) {
    .v5-dashboard-hero { align-items: flex-start; flex-direction: column; padding: 21px 19px; border-radius: 17px; }
    .v5-dashboard-hero h1 { font-size: 1.35rem; }
    .v5-dashboard-date { width: 100%; justify-content: center; }
    .v5-today-summary { align-items:stretch; flex-direction:column; gap:14px; }
    .v5-today-items { grid-template-columns:repeat(2,1fr); border-top:1px solid var(--v5-line); border-left:0; }
    .v5-today-items > div { padding:12px 9px; border-right:0; border-bottom:1px solid var(--v5-line); }
    .v5-today-items > div:nth-last-child(-n+2) { border-bottom:0; }
    .v5-attendance-chart { gap:7px; padding-inline:0; }
    .v5-chart-track { width:70%; }
    .v5-request-item { align-items: flex-start; flex-wrap: wrap; }
    .v5-request-item .btn { width: 100%; }
}

/* Employee dashboard v5 */
.v5-employee-dashboard { max-width: 760px; margin: 0 auto; padding: 18px 16px 96px; }
.v5-employee-hero { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:22px; color:#fff; border-radius:22px; background:linear-gradient(125deg,#123b4a,#0e7490); box-shadow:0 16px 32px rgba(14,116,144,.2); }
.v5-employee-profile { display:flex; align-items:center; gap:14px; min-width:0; }
.v5-employee-profile img { width:64px; height:64px; flex:0 0 64px; object-fit:cover; border:3px solid rgba(255,255,255,.55); border-radius:18px; }
.v5-employee-greeting { color:rgba(255,255,255,.72); font-size:.75rem; }
.v5-employee-profile h1 { margin:2px 0; color:#ffffff!important; font-size:1.25rem; font-weight:800; text-shadow:0 1px 2px rgba(0,0,0,.16); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.v5-employee-profile p { margin:0; color:rgba(255,255,255,.88)!important; font-size:.82rem; }
.v5-employee-date { flex:0 0 auto; padding:9px 11px; border:1px solid rgba(255,255,255,.25); border-radius:10px; background:rgba(255,255,255,.1); font-size:.75rem; }
.v5-employee-section { margin-top:24px; }
.v5-section-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-bottom:11px; }
.v5-section-heading span { color:var(--v5-primary); font-size:.69rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.v5-section-heading h2 { margin:2px 0 0; font-size:1rem; font-weight:800; }
.v5-section-heading > small { color:var(--v5-muted); font-size:.7rem; }
.v5-attendance-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.v5-attendance-action { min-height:88px; display:flex; align-items:center; gap:12px; padding:15px; color:#fff!important; border-radius:17px; text-decoration:none!important; box-shadow:var(--v5-shadow-sm); }
.v5-attendance-in { background:linear-gradient(135deg,#047857,#10b981); }
.v5-attendance-out { background:linear-gradient(135deg,#be123c,#f43f5e); }
.v5-attendance-icon { width:42px; height:42px; flex:0 0 42px; display:grid; place-items:center; border-radius:12px; background:rgba(255,255,255,.17); font-size:1.1rem; }
.v5-attendance-action > span:nth-child(2), .v5-tool-item > span:nth-child(2) { min-width:0; display:flex; flex:1; flex-direction:column; }
.v5-attendance-action strong { font-size:.9rem; }
.v5-attendance-action small { color:rgba(255,255,255,.78); font-size:.72rem; }
.v5-attendance-state { opacity:.82; }
.v5-attendance-action.is-complete { background:#64748b; }
.v5-attendance-action.is-disabled { cursor:not-allowed; filter:saturate(.4); opacity:.62; }
.v5-employee-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
.v5-employee-stat { display:grid; grid-template-columns:34px 1fr; align-items:center; gap:3px 8px; padding:13px 11px; border:1px solid var(--v5-line); border-radius:15px; background:#fff; }
.v5-employee-stat > i { grid-row:span 2; width:34px; height:34px; display:grid; place-items:center; border-radius:10px; }
.v5-employee-stat > strong { font-size:1.18rem; line-height:1; }
.v5-employee-stat > span { color:#475569; font-size:.74rem; line-height:1.15; }
.v5-employee-stat small { display:block; color:#94a3b8; font-size:.62rem; }
.v5-employee-stat.is-blue i,.v5-tool-icon.is-blue { color:#0e7490; background:#ecfeff; }
.v5-employee-stat.is-amber i,.v5-tool-icon.is-amber { color:#d97706; background:#fffbeb; }
.v5-employee-stat.is-green i { color:#059669; background:#ecfdf5; }
.v5-employee-stat.is-red i { color:#dc2626; background:#fef2f2; }
.v5-tool-list { overflow:hidden; border:1px solid var(--v5-line); border-radius:17px; background:#fff; box-shadow:var(--v5-shadow-sm); }
.v5-tool-item { display:flex; align-items:center; gap:12px; padding:14px; color:var(--v5-ink)!important; border-bottom:1px solid #edf2f7; text-decoration:none!important; }
.v5-tool-item:last-child { border-bottom:0; }
.v5-tool-item strong { font-size:.85rem; }
.v5-tool-item small { color:var(--v5-muted); font-size:.7rem; }
.v5-tool-icon { width:40px; height:40px; flex:0 0 40px; display:grid; place-items:center; border-radius:11px; }
.v5-tool-icon.is-purple { color:#7c3aed; background:#f5f3ff; }
.v5-status { padding:5px 8px; border-radius:999px; font-size:.66rem; font-weight:800; }
.v5-status.is-ready { color:#047857; background:#d1fae5; }
.v5-status.is-pending { color:#b45309; background:#fef3c7; }
.v5-employee-logout { min-height:46px; display:flex; align-items:center; justify-content:center; gap:8px; margin-top:20px; color:#b91c1c!important; border:1px solid #fecaca; border-radius:13px; background:#fff; font-weight:700; text-decoration:none!important; }
@media (max-width:575.98px) {
    .v5-employee-dashboard { padding:14px 12px 90px; }
    .v5-employee-hero { align-items:flex-start; flex-direction:column; padding:18px; border-radius:18px; }
    .v5-employee-date { align-self:stretch; text-align:center; }
    .v5-attendance-grid { grid-template-columns:1fr; }
    .v5-employee-stats { grid-template-columns:1fr 1fr; }
    .v5-section-heading > small { display:none; }
}
