/* =============================================
   HR Management System - Main Stylesheet
   ============================================= */

:root {
    --primary: #1a3a5c;
    --primary-light: #2563a8;
    --primary-dark: #0f2340;
    --accent: #e8a317;
    --accent-light: #f5c842;
    --sidebar-width: 260px;
    --navbar-height: 60px;
    --sidebar-bg: #0f2340;
    --sidebar-hover: rgba(255,255,255,0.08);
    --sidebar-active: rgba(255,255,255,0.15);
    --text-muted-custom: #8899aa;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.07);
    --border-color: #e5eaf0;
    --bg-light: #f4f6f9;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-light);
    color: #2d3a4a;
    font-size: 14px;
}

/* =============================================
   NAVBAR
   ============================================= */
#topNavbar {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
    height: var(--navbar-height);
    z-index: 1050;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    padding: 0;
}

.brand-icon {
    width: 34px; height: 34px;
    background: var(--accent);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: white;
}

.brand-text {
    font-size: 15px; font-weight: 700;
    color: white; letter-spacing: 0.3px;
}

.navbar-brand { text-decoration: none; }

.user-avatar {
    width: 34px; height: 34px;
    background: var(--accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
    color: white;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background: var(--sidebar-bg);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1040;
    transition: transform 0.3s ease, width 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.sidebar-inner { padding: 16px 0 30px; }

.sidebar .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 10px 20px;
    display: flex; align-items: center; gap: 10px;
    font-size: 13.5px; font-weight: 500;
    transition: all 0.2s; border-radius: 0;
    text-decoration: none; position: relative;
}

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

.sidebar .nav-link.active,
.sidebar .nav-link[aria-expanded="true"] {
    background: var(--sidebar-active);
    color: white;
}

.sidebar .nav-link.active::before {
    content: '';
    position: absolute; left: 0; top: 0;
    width: 3px; height: 100%;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}

.sidebar .nav-link i:first-child { font-size: 16px; min-width: 20px; }
.sidebar .nav-link .arrow { font-size: 11px; transition: transform 0.2s; }
.sidebar .nav-link[aria-expanded="true"] .arrow { transform: rotate(180deg); }

.sidebar .sub-link {
    padding: 8px 20px 8px 16px;
    font-size: 13px;
    color: rgba(255,255,255,0.55);
}
.sidebar .sub-link:hover { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.05); }
.sidebar .sub-link i { font-size: 13px; }

/* Sidebar section dividers */
.sidebar-section-title {
    color: rgba(255,255,255,0.3);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 12px 20px 6px;
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--navbar-height);
    min-height: calc(100vh - var(--navbar-height));
    transition: margin-left 0.3s ease;
    padding: 0;
}

.page-header {
    background: white;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
}

.page-header h4 {
    font-size: 18px; font-weight: 700;
    color: var(--primary); margin: 0;
}

.breadcrumb { margin: 0; font-size: 12px; }
.breadcrumb-item + .breadcrumb-item::before { color: #aaa; }

.page-body { padding: 20px 24px; }

/* =============================================
   CARDS
   ============================================= */
.card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    background: white;
}

.card-header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 14px 20px;
    font-weight: 600; font-size: 14px;
    border-radius: 10px 10px 0 0 !important;
    display: flex; align-items: center; gap: 8px;
}

.card-header i { color: var(--primary-light); }

/* =============================================
   STAT CARDS (Dashboard)
   ============================================= */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    position: relative; overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

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

.stat-card .stat-number {
    font-size: 28px; font-weight: 700;
    color: var(--primary); line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 12.5px; color: #6b7c93;
    font-weight: 500; text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-change {
    font-size: 11px; margin-top: 8px;
}

.stat-card::after {
    content: '';
    position: absolute; right: -15px; top: -15px;
    width: 80px; height: 80px;
    border-radius: 50%;
    opacity: 0.05;
    background: var(--primary);
}

/* Color variants */
.icon-blue { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.icon-green { background: linear-gradient(135deg, #059669, #10b981); }
.icon-orange { background: linear-gradient(135deg, #d97706, #f59e0b); }
.icon-red { background: linear-gradient(135deg, #dc2626, #ef4444); }
.icon-purple { background: linear-gradient(135deg, #7c3aed, #8b5cf6); }
.icon-teal { background: linear-gradient(135deg, #0d9488, #14b8a6); }

/* =============================================
   TABLES
   ============================================= */
.table-card { border-radius: 10px; overflow: hidden; box-shadow: var(--card-shadow); }

.table thead th {
    background: #f8fafc;
    color: #4a5568;
    font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    padding: 12px 14px;
    white-space: nowrap;
}

.table tbody td {
    padding: 11px 14px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f4f8;
    font-size: 13.5px;
}

.table tbody tr:hover { background: #f8fafc; }
.table tbody tr:last-child td { border-bottom: none; }

/* =============================================
   BADGES
   ============================================= */
.badge { font-size: 11px; font-weight: 500; padding: 4px 8px; border-radius: 4px; }

.badge-active { background: #dcfce7; color: #166534; }
.badge-inactive { background: #fee2e2; color: #991b1b; }
.badge-probation { background: #fef9c3; color: #854d0e; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

/* =============================================
   FORMS
   ============================================= */
.form-label { font-weight: 500; font-size: 13px; color: #374151; margin-bottom: 5px; }
.form-control, .form-select {
    border: 1px solid #dce3ea;
    border-radius: 7px;
    font-size: 13.5px;
    padding: 8px 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(37,99,168,0.1);
    outline: none;
}

.section-title {
    font-size: 13px; font-weight: 700;
    color: var(--primary); letter-spacing: 0.5px;
    text-transform: uppercase; padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
    margin-bottom: 16px; display: flex;
    align-items: center; gap: 8px;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn { border-radius: 7px; font-size: 13.5px; font-weight: 500; padding: 7px 16px; }
.btn-primary { background: var(--primary-light); border-color: var(--primary-light); }
.btn-primary:hover { background: var(--primary); border-color: var(--primary); }
.btn-sm { font-size: 12px; padding: 4px 10px; border-radius: 5px; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

/* =============================================
   EMPLOYEE AVATAR
   ============================================= */
.emp-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px;
}

/* =============================================
   SIDEBAR COLLAPSED (Mobile)
   ============================================= */
.sidebar-collapsed .sidebar { transform: translateX(-100%); }
.sidebar-collapsed .main-content { margin-left: 0; }

@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .main-content { margin-left: 0; }
    .sidebar.show { transform: translateX(0); }
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    display: flex; align-items: center; justify-content: center;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%; max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
    width: 60px; height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; color: white;
    margin: 0 auto 16px;
}

/* =============================================
   MISC
   ============================================= */
.page-title { font-size: 20px; font-weight: 700; color: var(--primary); }
.text-primary-custom { color: var(--primary-light) !important; }
.fw-600 { font-weight: 600; }
.bg-primary-custom { background: var(--primary) !important; }

/* Search Box */
.search-box { position: relative; }
.search-box .form-control { padding-left: 36px; }
.search-box .bi-search {
    position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%); color: #9aacbe;
    pointer-events: none;
}

/* Profile Picture Upload */
.photo-upload-box {
    width: 100px; height: 100px; border-radius: 50%;
    border: 2px dashed #c0ccda;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; overflow: hidden; background: #f9fafb;
    transition: border-color 0.2s;
}
.photo-upload-box:hover { border-color: var(--primary-light); }
.photo-upload-box img { width: 100%; height: 100%; object-fit: cover; }

/* Status dots */
.status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    display: inline-block; margin-right: 5px;
}
.dot-green { background: #10b981; }
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-gray { background: #9ca3af; }

/* Scrollable table wrapper */
.table-responsive { border-radius: 0 0 10px 10px; }

/* Print styles */
@media print {
    .sidebar, #topNavbar, .btn, .no-print { display: none !important; }
    .main-content { margin: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
    .table-responsive { overflow: visible !important; }
    table { width: 100% !important; }
    table th, table td { border: 1px solid #999 !important; word-break: break-word; }
}

/* =============================================
   ALERT STYLING
   ============================================= */
.alert-danger {
    background-color: #fff5f5;
    border: 2px solid #ef4444;
    color: #991b1b;
    padding: 16px;
    border-radius: 8px;
    font-size: 15px;
}

.alert-danger .bi {
    color: #dc2626;
}

.alert-success {
    background-color: #f0fdf4;
    border: 1px solid #10b981;
    color: #065f46;
}

.alert-success .bi {
    color: #059669;
}

.alert-info {
    background-color: #eff6ff;
    border: 1px solid #3b82f6;
    color: #1e40af;
}

.alert-info .bi {
    color: #2563eb;
}
