/* ============================================================
   HRIS JURAGAN NET - Main Stylesheet
   ============================================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;
    --secondary: #64748b;
    --success: #16a34a;
    --success-soft: #f0fdf4;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --info: #0891b2;
    --sidebar-bg: #0f172a;
    --sidebar-w: 260px;
    --topbar-h: 64px;
    --font: 'Inter', sans-serif;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 40px rgba(0,0,0,.12);
}

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

body {
    font-family: var(--font);
    background: #f1f5f9;
    color: #1e293b;
    margin: 0;
    padding: 0;
    font-size: 14px;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.brand-logo {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 20px;
    flex-shrink: 0;
}

.brand-title { color: #fff; font-weight: 700; font-size: 16px; line-height: 1.2; }
.brand-subtitle { color: #94a3b8; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    margin: 12px;
    background: rgba(255,255,255,.05);
    border-radius: var(--radius);
}

.user-avatar {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, #818cf8, #a78bfa);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

.user-name { color: #e2e8f0; font-weight: 600; font-size: 13px; }
.user-role { color: #94a3b8; font-size: 11px; text-transform: capitalize; }

.sidebar-nav {
    flex: 1;
    padding: 8px 12px;
}

.nav-section {
    color: #475569;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 12px 8px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all .2s;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(255,255,255,.07);
    color: #e2e8f0;
    text-decoration: none;
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37,99,235,.4);
}

.nav-item i { font-size: 17px; flex-shrink: 0; }

.text-danger-soft { color: #f87171 !important; }
.text-danger-soft:hover { background: rgba(248,113,113,.1) !important; color: #fca5a5 !important; }

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255,255,255,.07);
}

/* ============================================================
   MAIN WRAPPER + TOPBAR
   ============================================================ */
.main-wrapper {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .3s cubic-bezier(.4,0,.2,1);
}

.topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.btn-toggle-sidebar {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: background .2s;
    display: none;
}

.topbar-title { font-weight: 700; font-size: 16px; color: #1e293b; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.content-area { padding: 24px; flex: 1; }

/* ============================================================
   CARDS & STAT CARDS
   ============================================================ */
.card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #f1f5f9;
    padding: 16px 20px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body { padding: 20px; }

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform .2s, box-shadow .2s;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon.blue { background: var(--primary-soft); color: var(--primary); }
.stat-icon.green { background: var(--success-soft); color: var(--success); }
.stat-icon.red { background: var(--danger-soft); color: var(--danger); }
.stat-icon.yellow { background: var(--warning-soft); color: var(--warning); }
.stat-icon.purple { background: #f5f3ff; color: #7c3aed; }

.stat-value { font-size: 24px; font-weight: 800; color: #1e293b; line-height: 1; }
.stat-label { font-size: 12px; color: var(--secondary); font-weight: 500; margin-top: 4px; }

/* ============================================================
   TABLES
   ============================================================ */
.table { font-size: 13.5px; }
.table th { font-weight: 700; color: #475569; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; background: #f8fafc; }
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { background: #f8fafc; }

/* ============================================================
   BADGES
   ============================================================ */
.badge { font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 6px; }
.bg-primary-soft { background: var(--primary-soft) !important; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { font-weight: 600; border-radius: 8px; font-size: 13.5px; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-sm { font-size: 12px; padding: 4px 10px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-control, .form-select {
    border-radius: 8px;
    border-color: #e2e8f0;
    font-size: 13.5px;
    padding: 8px 12px;
    transition: border-color .2s, box-shadow .2s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.form-label { font-weight: 600; font-size: 13px; color: #374151; margin-bottom: 6px; }

/* ============================================================
   PAGE HEADERS
   ============================================================ */
.page-header {
    margin-bottom: 24px;
}
.page-header h1 { font-size: 22px; font-weight: 800; color: #1e293b; margin: 0; }
.page-header p { color: var(--secondary); margin: 4px 0 0; font-size: 13.5px; }
.page-header-actions { display: flex; gap: 8px; align-items: center; }

/* ============================================================
   CLOCK IN/OUT WIDGET
   ============================================================ */
.clock-widget {
    text-align: center;
    padding: 40px 20px;
}
.clock-display {
    font-size: 56px;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -2px;
    line-height: 1;
}
.clock-date { color: var(--secondary); font-size: 15px; margin-top: 8px; }
.clock-status { margin: 24px 0; }

.btn-clock {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all .3s;
    position: relative;
    overflow: hidden;
}

.btn-clock-in {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
    box-shadow: 0 8px 32px rgba(22,163,74,.4);
}

.btn-clock-in:hover { transform: scale(1.05); box-shadow: 0 12px 40px rgba(22,163,74,.5); }

.btn-clock-out {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #fff;
    box-shadow: 0 8px 32px rgba(220,38,38,.4);
}

.btn-clock-out:hover { transform: scale(1.05); box-shadow: 0 12px 40px rgba(220,38,38,.5); }
.btn-clock i { font-size: 36px; }

/* ============================================================
   SLIP GAJI PRINT STYLES
   ============================================================ */
.slip-wrapper {
    max-width: 680px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.slip-header {
    background: linear-gradient(135deg, #0f172a, #1e3a5f);
    color: #fff;
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.slip-logo {
    width: 60px; height: 60px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px;
    flex-shrink: 0;
}

.slip-company { font-size: 22px; font-weight: 800; }
.slip-subtitle { color: #94a3b8; font-size: 13px; margin-top: 2px; }
.slip-period { margin-left: auto; text-align: right; }
.slip-period-label { color: #94a3b8; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.slip-period-value { font-size: 18px; font-weight: 700; }

.slip-employee {
    padding: 20px 32px;
    background: var(--primary-soft);
    border-bottom: 1px solid #dbeafe;
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.slip-emp-item label { color: #64748b; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.slip-emp-item p { font-weight: 700; color: #1e293b; margin: 2px 0 0; font-size: 14px; }

.slip-body { padding: 24px 32px; }

.slip-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
}

.slip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f8fafc;
    font-size: 13.5px;
}
.slip-row:last-child { border-bottom: none; }
.slip-row .label { color: #475569; }
.slip-row .value { font-weight: 600; color: #1e293b; }
.slip-row.deduction .value { color: var(--danger); }

.slip-total {
    background: linear-gradient(135deg, #0f172a, #1e3a5f);
    color: #fff;
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slip-total-label { font-size: 14px; font-weight: 600; color: #94a3b8; }
.slip-total-value { font-size: 26px; font-weight: 800; }

.slip-footer {
    padding: 16px 32px;
    text-align: center;
    color: #94a3b8;
    font-size: 11px;
    border-top: 1px solid #f1f5f9;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0c4a6e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(37,99,235,.2) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(99,102,241,.15) 0%, transparent 50%);
    animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.1) rotate(5deg); }
}

.login-card {
    background: rgba(255,255,255,.98);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo-icon {
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    margin-bottom: 12px;
    box-shadow: 0 8px 24px rgba(37,99,235,.4);
}

.login-logo h1 { font-size: 22px; font-weight: 800; color: #1e293b; margin: 0; }
.login-logo p { color: var(--secondary); font-size: 13px; margin: 4px 0 0; }

.login-input-group {
    position: relative;
    margin-bottom: 16px;
}

.login-input-group i.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 16px;
}

.login-input-group .form-control {
    padding-left: 42px;
    height: 46px;
    border-radius: 10px;
}

.btn-login {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all .3s;
    margin-top: 8px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37,99,235,.4);
}

.login-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
}

/* ============================================================
   STATUS INDICATORS
   ============================================================ */
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}
.status-dot.online { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.status-dot.offline { background: #94a3b8; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}
.empty-state i { font-size: 56px; margin-bottom: 16px; display: block; }
.empty-state h5 { font-weight: 700; color: #64748b; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
    .btn-toggle-sidebar { display: flex; }
    .content-area { padding: 16px; }
}

@media (max-width: 576px) {
    .stat-card { padding: 16px; }
    .stat-value { font-size: 20px; }
    .slip-header { flex-direction: column; gap: 12px; }
    .slip-period { margin-left: 0; text-align: left; }
    .slip-body { padding: 16px; }
    .slip-total { padding: 16px; flex-direction: column; gap: 8px; text-align: center; }
    .clock-display { font-size: 40px; }
}

/* ============================================================
   PRINT MEDIA
   ============================================================ */
@media print {
    .sidebar, .topbar, .btn-print, .page-header-actions,
    .alert, .breadcrumb, .no-print { display: none !important; }
    .main-wrapper { margin-left: 0; }
    .content-area { padding: 0; }
    body { background: #fff; }
    .slip-wrapper { box-shadow: none; border: 1px solid #e2e8f0; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up { animation: fadeInUp .4s ease forwards; }
