:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-bg: #f3f4f6;
    --card-bg: #ffffff;
    --dark-text: #2c3e50;
    --medium-text: #6d7677;
    --border-color: #dfe6e9;
    --sidebar-width: 250px;
    --navbar-height: 52px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 4px 0 rgba(0, 0, 0, 0.08);
    --primary: #2563EB;
    --primary-dark: #1e40af;

}


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

@font-face {
    font-family: 'Sahel';
    src: url('/static/fonts/Sahel.woff'); /* Make sure you have this font file */
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Sahel';
    src: url('/static/fonts/Sahel-Bold.woff'); /* Make sure you have this font file */
    font-weight: Bold;
    font-style: normal;
}

body {
    min-height: 100vh;
    padding-top: var(--navbar-height);
    font-family: "Sahel", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--light-bg);
    color: var(--dark-text);
    /* overflow-x: clip (not hidden) so position:sticky descendants keep working */
    overflow-x: hidden;
    overflow-x: clip;
}
/* Auto-resizing Textarea Styling */
textarea.form-control {
    overflow: hidden; /* Hide scrollbars */
    resize: none;     /* Disable the manual resize handle */
    min-height: 40px; 
    transition: height 0.1s ease;
}

.form-control {
    font-size: 0.9rem;
}

.form-label{
    font-size:11px;
        font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

/* Professional navbar */
.navbar {
    background: #1A2340;
    box-shadow: 0 1px 8px rgba(0, 0, 0, .25);
    height: var(--navbar-height);
    padding: 0 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}
.navbar-brand {
    font-weight: 600;
    font-size: 18px;
    letter-spacing: .04em;
    color: white !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-left: 1px solid #2D3B5E;
    padding-left: 1rem;
    margin-left: 0.5rem;
}

.navbar-brand::before {
    font-size: 1.6rem;
}

.nav-link.text-white {
    padding: 6px 12px !important;
    border-radius: 6px;
    font-weight: 500;
    font-size: 13px;
    color: #CBD5E1;
    transition: background 0.15s, color 0.15s;
}

.nav-link.text-white:hover {
    background: #243058;
    color: #fff;
}

.form-select-sm {font-size: 13px;}


/* Professional sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    position: fixed;
    top: var(--navbar-height);
    right: 0;
    height: calc(100vh - var(--navbar-height));
    z-index: 99;
    padding: 1.5rem 0;
    background: var(--card-bg);
    border-left: 1px solid var(--border-color);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.main-content {
    margin-right: var(--sidebar-width);
    margin-left: 0;
    padding: 2rem 2.5rem;
    min-height: calc(100vh - var(--navbar-height));
    transition: margin 0.3s ease;
}

/* Formal navigation items */
.sidebar .nav-link {
    color: var(--medium-text);
    padding: 0.25rem 1rem;
    margin: 0.25rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    transition: all 0.2s;
}

.sidebar .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: var(--accent-color);
    opacity: 0;
    transition: opacity 0.2s;
}

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

.sidebar .nav-link.active {
    background: #e8f4f8;
    color: var(--accent-color);
    font-weight: 600;
}

.sidebar .nav-link.active::before {
    opacity: 1;
}

.sidebar .nav-link i {
    width: 24px;
    font-size: 1.2rem;
    text-align: center;
}

/* Badge styles — consistent design system
   (merged from base.css + admin.css; admin's later values win) */
.badge {
    display: inline-block;
    gap: 4px;
    border-radius: 10px;
    font-weight: 600;
    padding: 4px 8px;
    font-size: 0.75rem;
    line-height: 1;
    white-space: nowrap;
}

/* Badge color variants */
.badge.bg-primary {
    background: #EFF6FF !important;
    color: #1E40AF !important;
}

.badge.bg-secondary {
    background: #F1F5F9 !important;
    color: #475569 !important;
}

.badge.bg-success {
    background: #F0FDF4 !important;
    color: #166534 !important;
}

.badge.bg-danger {
    background: #FEF2F2 !important;
    color: #991B1B !important;
}

.badge.bg-warning {
    background: #FEF3C7 !important;
    color: #92400E !important;
}

.badge.bg-info {
    background: #ECFEFF !important;
    color: #0E7490 !important;
}

/* Badge with dot indicator */
.badge-dot {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-dot.dot-primary::before { background: #3B82F6; }
.badge-dot.dot-success::before { background: #16A34A; }
.badge-dot.dot-warning::before { background: #D97706; }
.badge-dot.dot-danger::before { background: #DC2626; }
.badge-dot.dot-info::before { background: #0891B2; }

/* RTL fixes */
.text-start { text-align: right !important; }
.text-end { text-align: left !important; }
.float-start { float: right !important; }
.float-end { float: left !important; }
.me-auto { margin-left: auto !important; margin-right: 0 !important; }
.ms-auto { margin-right: auto !important; margin-left: 0 !important; }

/* Professional card styles */
.card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    background: #f8f9fa;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    padding: 1rem 1.5rem;
    font-size: 1.05rem;
    color: var(--dark-text);
}

.card-body {
    padding: 1.5rem;
}

/* Professional table styles */
.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--dark-text);
    border-bottom: 2px solid var(--border-color);
    padding: 0.875rem 1rem;
    white-space: nowrap;
}

.table td {
    padding: 0.4rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: var(--dark-text);
    font-size: 0.75rem;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-hover tbody tr:hover {
    background: #f8f9fa;
}

/* Responsive table wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Professional button styles
   (merged from base.css + admin.css; admin's later values win) */
.btn {
    padding: 8px 16px;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.2s, box-shadow 0.2s, color 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.75rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-outline-primary {
    background: white;
    color: #667eea;
    border: 1px solid #667eea;
}

.btn-outline-primary:hover {
    background: #667eea;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-outline-danger {
    border: 1px solid var(--danger-color) !important;
}

.btn-outline-info {
    background: white;
    color: #17a2b8;
    border: 1px solid #17a2b8;
}

.btn-outline-info:hover {
    background: #17a2b8;
    color: white;
}

.btn-group {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

/* Alert styles */
.alert {
    border-radius: 8px;
    border-right: 4px solid;
    padding: 1rem 1.25rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-right-color: var(--success-color);
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-right-color: var(--danger-color);
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-right-color: var(--warning-color);
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-right-color: var(--accent-color);
}

/* Mobile sidebar toggle button */
#sidebarToggle {
    border: none;
    border-radius: 6px;
    padding: 0.5rem 0.5rem;
    transition: background 0.2s;
    max-width: 2.5rem;
}

#sidebarToggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

#sidebarToggle i {
    font-size: 1.5rem;
}

.sticky-top{z-index: 1 !important;}
/* Form elements */
.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.625rem 0.875rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.15);
}


/* Override old sidebar margins and set clean content spacing */
.content-wrapper {
    padding: 2rem 1.5rem;
    min-height: calc(100vh - var(--navbar-height));
    width: 100%;
    max-width: min(1400px, calc(100vw - 80px));
    margin: 0 auto;
}

/* Navbar link active state styling */
.navbar-nav .nav-link {
    border-radius: 6px;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s ease;
}

.nav-link {
    font-size: 0.9rem;
}
.navbar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.navbar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    font-weight: bold;
}

.desktop{display: inline;}
.mobile{display:none;}

.navbar-date {
    font-size: 0.8rem;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive design */
@media (max-width: 991px) {
    .mobile{display: inline;}
    .desktop{display: none;}
    .content-wrapper {
    max-width: calc(100vw);
    padding: 0.5rem 0.8rem;
    }
    .navbar-nav{
    background-color:#1a365d ;
    border-radius: 0.5rem;
    margin-top: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
    }   

    .navbar-nav .nav-item {
    margin-bottom: 5px;
    }

    .navbar {
        padding: 0 1rem;
    }
    
    .main-content {
        padding: 1.5rem 1.5rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    .table th, .table td {
        padding: 0.75rem 0.75rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
    }
    
    .navbar-brand {
        font-size: 1.3rem;
    }
    
    .sidebar {
        transform: translateX(var(--sidebar-width));
        z-index: 1001;
        box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar:not(.collapsed) {
        transform: translateX(0);
    }
    
    .main-content {
        margin-right: 0;
        padding: 1.5rem 1rem;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        display: none;
        transition: opacity 0.3s;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .btn {
        padding: 0.45rem 1rem;
        font-size: 0.95rem;
    }
    
    .table th {
        font-size: 0.8rem;
    }
    
    .table td {
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .navbar {
        height: 52px;
        padding: 0 0.75rem;
    }
    
    :root {
        --navbar-height: 52px;
    }
    
    .navbar-brand {
        font-size: 16px;
    }
    
    .navbar-brand::before {
        font-size: 1.3rem;
    }
    
    .nav-link.text-white {
        padding: 4px 0.75rem !important;
        font-size: 12px;
    }
    
    .main-content {
        padding: 1rem 0.75rem;
    }
    
    .card-header {
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .sidebar .nav-link {
        padding: 0.65rem 1rem;
        margin: 0.2rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 0.4rem 0.85rem;
        font-size: 0.9rem;
    }
    
    .btn-sm {
        padding: 0.3rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .table th, .table td {
        padding: 0.625rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .form-control, .form-select {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    .alert {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 400px) {
    .main-content {
        padding: 0.75rem 0.5rem;
    }
    
    .card-body {
        padding: 0.875rem;
    }
    
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .table th, .table td {
        padding: 0.5rem 0.4rem;
        font-size: 0.8rem;
    }
}

/* Clean scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--medium-text);
}

/* Alert buzz animation */
@keyframes alertBuzz {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-2px); }
    30% { transform: translateX(2px); }
    45% { transform: translateX(-1.5px); }
    60% { transform: translateX(1.5px); }
    75% { transform: translateX(-0.5px); }
    90% { transform: translateX(0.5px); }
}
.alert-buzz { animation: alertBuzz 0.6s ease-in-out 1; }

/* =========================================
   ADMIN (merged from admin.css)
   ========================================= */
.admin-container {
    width: 100%;
    direction: rtl;
    text-align: right;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
    padding-left: 10px;
    border-radius: 0.5rem;
    padding-top: 1.5em;
    
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #212529;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.stat-card.warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #212529;
}

.stat-card.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.stat-card.danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.stat-content h4 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 5px 0;
}

.stat-content p {
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.95;
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.9;
}

/* Main Card */
.admin-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 25px;
}

.admin-card-header {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8eef5 100%);
    padding: 20px 25px;
    border-bottom: 3px solid #667eea;
}

.admin-card-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: #212529;
    margin: 0;
}

.admin-card-body {
    padding: 0;
}

/* Table Styles */
.table-wrapper {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.admin-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.admin-table th {
    padding: 12px 12px;
    text-align: center;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
    font-size: 0.85rem;
}

.admin-table td {
    padding: 12px 12px;
    border-bottom: 1px solid #f1f3f5;
    vertical-align: middle;
}

.admin-table tbody tr {
    transition: background-color 0.2s;
}

.admin-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Employee Info */
.employee-info {
    line-height: 1.5;
}

.employee-name {
    font-weight: 600;
    color: #212529;
    display: block;
}

.employee-username {
    font-size: 0.8rem;
    color: #6c757d;
    display: block;
}

.employee-stats {
    font-size: 0.75rem;
    margin-top: 4px;
}

.stat-info {
    color: #17a2b8;
    display: block;
}

.stat-success {
    color: #28a745;
    display: block;
}

.stat-warning {
    color: #ffc107;
    display: block;
}

/* Legacy badge modifier colors */
.badge.earned {
    background: #e3f2fd;
    color: #1976d2;
}

.badge.sick {
    background: #fff3e0;
    color: #f57c00;
}

.badge.hourly {
    background: #e1f5fe;
    color: #0288d1;
}

.badge.pending {
    background: #fff3cd;
    color: #856404;
}

.badge.approved {
    background: #d4edda;
    color: #155724;
}

.badge.rejected {
    background: #f8d7da;
    color: #721c24;
}

.badge.cancelled {
    background: #e2e3e5;
    color: #383d41;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h5 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #495057;
}

.empty-state p {
    font-size: 0.95rem;
    margin: 0;
}

/* Guide Section */
.guide-card {
    background: white;
    border-radius: 12px;
    padding: 20px 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
}

.guide-title {
    font-size: 1rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 15px;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.guide-section h6 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.guide-section ul {
    margin: 0;
    padding-right: 20px;
    font-size: 0.85rem;
    color: #6c757d;
}

.guide-section li {
    margin-bottom: 5px;
}

/* Responsive Design (admin) */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.4rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .guide-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-table {
        font-size: 0.75rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 8px 15px;
    }
    
    .header-actions {
        width: 100%;
    }
    
    .btn {
        font-size: 0.8rem;
    }
}
