:root {
    --primary: #4A90E2;
    --primary-dark: #357abd;
    --sidebar-width: 230px;
    --topbar-height: 56px;
    --sidebar-bg: #1e2a3b;
    --sidebar-text: #c5cfe0;
    --sidebar-hover: rgba(255,255,255,0.08);
    --sidebar-active-bg: var(--primary);
}

/* ── Topbar ─────────────────────────────────── */
.topbar {
    background: var(--primary);
    height: var(--topbar-height);
    z-index: 1030;
}

/* ── Sidebar ─────────────────────────────────── */
#sidebar {
    width: var(--sidebar-width);
    min-height: calc(100vh - var(--topbar-height));
    background: var(--sidebar-bg);
    transition: width 0.25s ease;
    overflow: hidden;
    flex-shrink: 0;
}

#sidebar.collapsed {
    width: 58px;
}

#sidebar .nav-link {
    color: var(--sidebar-text);
    padding: 0.55rem 1rem;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: background 0.15s;
}

#sidebar .nav-link i {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

#sidebar .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

#sidebar .nav-link.active {
    background: var(--sidebar-active-bg);
    color: #fff;
    font-weight: 500;
}

#sidebar.collapsed .nav-label-text {
    display: none;
}

.nav-section-label {
    list-style: none;
    padding: 1rem 1rem 0.25rem 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #6b7e99;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
}

#sidebar.collapsed .nav-section-label {
    visibility: hidden;
}

/* ── Main content ────────────────────────────── */
.main-content {
    background: #f5f7fa;
    min-height: calc(100vh - var(--topbar-height));
    transition: margin-left 0.25s ease;
    overflow-x: hidden;
}

/* ── Cards ───────────────────────────────────── */
.card {
    border: none;
    border-radius: 0.6rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #eef0f4;
    font-weight: 600;
    border-radius: 0.6rem 0.6rem 0 0 !important;
}

/* ── Stat cards ──────────────────────────────── */
.stat-card {
    border-radius: 0.6rem;
    padding: 1.25rem 1.5rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.stat-card .stat-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    opacity: 0.2;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    opacity: 0.85;
    margin-top: 0.25rem;
}

.bg-primary-custom { background: var(--primary); }
.bg-success-custom { background: #27ae60; }
.bg-warning-custom { background: #f39c12; }
.bg-danger-custom  { background: #e74c3c; }

/* ── Punch button ────────────────────────────── */
.punch-btn {
    min-width: 180px;
    font-size: 1.1rem;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.1s, box-shadow 0.1s;
}

.punch-btn:active { transform: scale(0.97); }

.punch-btn.punch-in  { background: #27ae60; border-color: #27ae60; color: #fff; }
.punch-btn.punch-out { background: #e74c3c; border-color: #e74c3c; color: #fff; }

/* ── Badge status ────────────────────────────── */
.badge-fullday  { background-color: #27ae60; }
.badge-halfday  { background-color: #f39c12; }
.badge-absent   { background-color: #e74c3c; }
.badge-weekoff  { background-color: #7f8c8d; }
.badge-working  { background-color: #2980b9; }

/* ── Login page ──────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e2a3b 0%, var(--primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.login-logo {
    font-size: 2.5rem;
    color: var(--primary);
}

/* ── Tables ──────────────────────────────────── */
.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    border-top: none;
}

/* ── Spinner overlay ─────────────────────────── */
.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ── Misc ─────────────────────────────────────── */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e2a3b;
}

.running-task-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 50px;
    padding: 0.35rem 0.9rem;
    font-size: 0.875rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e74c3c;
    animation: pulse 1.2s ease-in-out infinite;
    display: inline-block;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%       { transform: scale(1.4); opacity: 0.6; }
}
