/* ============================================================
   PayMasterHub - HR/HCM Platform Stylesheet
   ============================================================ */

/* --- Custom Properties --- */
:root {
    --primary: #6C3FC5;
    --primary-dark: #5B2FB0;
    --primary-light: #8B5CF6;
    --primary-bg: #F0EBFA;
    --primary-glow: rgba(108, 63, 197, 0.35);
    --success: #10B981;
    --success-glow: rgba(16, 185, 129, 0.3);
    --danger: #EF4444;
    --danger-glow: rgba(239, 68, 68, 0.3);
    --warning: #F59E0B;
    --warning-glow: rgba(245, 158, 11, 0.3);
    --info: #3B82F6;
    --info-glow: rgba(59, 130, 246, 0.3);
    --purple: #8B5CF6;
    --teal: #14B8A6;
    --dark-blue: #1E40AF;
    --bg: #F5F6FA;
    --sidebar-bg: #1E1B2E;
    --sidebar-text: #E5E7EB;
    --card-bg: #FFFFFF;
    --text: #1a1d26;
    --text-muted: #6B7280;
    --border: #E2E5EF;
    --border-light: #F0F1F6;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.12), 0 8px 20px rgba(0, 0, 0, 0.06);
    --shadow-purple: 0 4px 14px rgba(108, 63, 197, 0.25);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --sidebar-width: 260px;
    --header-height: 64px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text);
    letter-spacing: -0.025em;
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

/* --- Utility --- */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.text-muted { color: var(--text-muted) !important; }

.bg-primary { background-color: var(--primary) !important; }
.bg-primary-light { background-color: var(--primary-bg) !important; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }
.flex-wrap { flex-wrap: wrap; }

.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, width 0.3s ease;
    overflow: hidden;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    height: var(--header-height);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.sidebar-logo img {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
}

.sidebar-logo .logo-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
    margin-left: 12px;
    white-space: nowrap;
    letter-spacing: -0.02em;
}

.sidebar-logo .logo-text span {
    color: var(--primary-light);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

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

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

.sidebar-section-title {
    font-size: 0.675rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.35);
    padding: 16px 20px 6px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.875rem;
    font-weight: 400;
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    gap: 12px;
}

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

.nav-link .nav-text {
    flex: 1;
    white-space: nowrap;
}

.nav-link .nav-arrow {
    font-size: 0.625rem;
    transition: transform 0.2s ease;
    margin-left: auto;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.nav-item.active > .nav-link,
.nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(108, 63, 197, 0.35);
}

.nav-item.active > .nav-link .nav-arrow {
    transform: rotate(90deg);
}

.nav-submenu {
    display: none;
    padding: 4px 0;
    background: rgba(0, 0, 0, 0.15);
}

.nav-item.active > .nav-submenu,
.nav-item.open > .nav-submenu {
    display: block;
}

.nav-submenu .nav-link {
    padding: 8px 20px 8px 52px;
    font-size: 0.8125rem;
}

.nav-submenu .nav-link::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    position: absolute;
    left: 36px;
    top: 50%;
    transform: translateY(-50%);
    transition: background var(--transition);
}

.nav-submenu .nav-link:hover::before,
.nav-submenu .nav-link.active::before {
    background: var(--primary-light);
}

.nav-submenu .nav-link.active {
    background: rgba(108, 63, 197, 0.25);
    color: var(--primary-light);
}

/* ============================================================
   TOP HEADER
   ============================================================ */
.top-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.05);
    z-index: 900;
    display: flex;
    align-items: center;
    padding: 0 28px;
    transition: left 0.3s ease;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.header-hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.header-hamburger:hover {
    background: var(--bg);
}

.header-selectors {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-select {
    appearance: none;
    background: linear-gradient(180deg, #fff 0%, #f8f9fc 100%) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236C3FC5' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E") no-repeat right 10px center;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 36px 8px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: var(--font-family);
    color: var(--text);
    cursor: pointer;
    min-width: 160px;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.header-select:hover {
    border-color: #c5c9d6;
}

.header-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-bg);
}

.header-timezone,
.header-timezone-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(108, 63, 197, 0.08);
    border: 1px solid rgba(108, 63, 197, 0.15);
    border-radius: 8px;
    font-size: 0.8125rem;
    color: var(--text);
    white-space: nowrap;
}

.header-timezone-badge .header-tz-name {
    font-weight: 600;
    color: var(--primary-dark);
}

.header-timezone-badge .header-tz-offset {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.header-clock {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    min-width: 95px;
    text-align: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-icon-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.125rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    transition: all var(--transition);
}

.header-icon-btn:hover {
    background: var(--bg);
    color: var(--text);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    background: var(--danger);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

.header-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
    position: relative;
}

.header-profile:hover {
    background: var(--bg);
}

.header-profile-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.header-profile-info {
    line-height: 1.2;
}

.header-profile-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
}

.header-profile-role {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

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

.content-wrapper {
    padding: 24px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 1.625rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    list-style: none;
}

.breadcrumb li + li::before {
    content: '/';
    margin-right: 6px;
    color: var(--border);
}

.breadcrumb a {
    color: var(--text-muted);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb .active {
    color: var(--text);
    font-weight: 500;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: box-shadow var(--transition), transform var(--transition);
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--teal));
    opacity: 0;
    transition: opacity var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(248,249,252,0.5) 100%);
}

.card-header h2,
.card-header h3,
.card-header h4 {
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border-light);
    background: linear-gradient(180deg, rgba(248,249,252,0.5) 0%, rgba(243,244,246,0.8) 100%);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* --- Dashboard Stat Cards --- */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,0.9);
    padding: 22px 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: 0.06;
    transition: transform var(--transition), opacity var(--transition);
}

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

.stat-card:hover::after {
    transform: scale(1.5);
    opacity: 0.1;
}

.stat-card-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    position: relative;
}

.stat-card-icon.purple {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    color: var(--primary);
}

.stat-card-icon.green {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #059669;
}

.stat-card-icon.red {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #dc2626;
}

.stat-card-icon.blue {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #2563eb;
}

.stat-card-icon.orange {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #d97706;
}

.stat-card-icon.teal {
    background: linear-gradient(135deg, #ccfbf1, #99f6e4);
    color: #0d9488;
}

.stat-card-info {
    flex: 1;
    min-width: 0;
}

.stat-card-number {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.15;
    color: var(--text);
    letter-spacing: -0.03em;
    font-family: var(--font-display);
}

.stat-card-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.6875rem;
}

.stat-card-change {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 99px;
}

.stat-card-change.up { color: #059669; background: #d1fae5; }
.stat-card-change.down { color: #dc2626; background: #fee2e2; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 99px;
    white-space: nowrap;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.badge:hover {
    transform: scale(1.05);
}

.badge-present {
    background: #D1FAE5;
    color: #065F46;
}

.badge-absent {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-late {
    background: #FEF3C7;
    color: #92400E;
}

.badge-leave {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-wfh {
    background: #EDE9FE;
    color: #5B21B6;
}

.badge-bt {
    background: #CCFBF1;
    color: #0F766E;
}

.badge-pending {
    background: #FEF9C3;
    color: #854D0E;
}

.badge-approved {
    background: #D1FAE5;
    color: #065F46;
}

.badge-rejected {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-corrected {
    background: #DBEAFE;
    color: var(--dark-blue);
}

.badge-primary {
    background: var(--primary-bg);
    color: var(--primary);
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-danger {
    background: #FEE2E2;
    color: #991B1B;
}

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

.badge-info {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-purple {
    background: linear-gradient(135deg, #ede9fe, #e0d7fe);
    color: #6d28d9;
}

.badge-gray {
    background: #f1f3f5;
    color: #6b7280;
}

/* ============================================================
   TABLES
   ============================================================ */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
}

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

table th,
.table th {
    background: linear-gradient(180deg, #f8f9fc 0%, #f1f3f8 100%);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 16px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid var(--border);
    position: relative;
    cursor: default;
    user-select: none;
}

.table th.sortable {
    cursor: pointer;
}

.table th.sortable::after {
    content: '\f0dc';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: 6px;
    font-size: 0.625rem;
    color: var(--border);
}

.table th.sort-asc::after {
    content: '\f0de';
    color: var(--primary);
}

.table th.sort-desc::after {
    content: '\f0dd';
    color: var(--primary);
}

table td,
.table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

table tbody tr,
.table tbody tr {
    transition: background var(--transition);
}

.table-striped tbody tr:nth-child(even) {
    background: rgba(243, 244, 246, 0.5);
}

table tbody tr:hover,
.table tbody tr:hover {
    background: linear-gradient(90deg, var(--primary-bg), rgba(240, 235, 250, 0.3));
}

.table .checkbox-col {
    width: 40px;
    text-align: center;
}

.table .actions-col {
    width: 100px;
    text-align: right;
}

.table-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-muted);
}

.table-empty i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: var(--border);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: var(--font-family);
    color: var(--text);
    background: var(--card-bg);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    line-height: 1.5;
}

.form-control:hover {
    border-color: #c5c9d6;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-bg), 0 1px 3px rgba(108, 63, 197, 0.1);
    background: #fff;
}

.form-control::placeholder {
    color: #a0a6b4;
}

.form-control:disabled,
.form-control[readonly] {
    background: var(--bg);
    cursor: not-allowed;
    opacity: 0.65;
    border-style: dashed;
}

.form-control.is-invalid {
    border-color: var(--danger);
    background: #fff5f5;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 4px #fee2e2, 0 1px 3px rgba(239, 68, 68, 0.1);
}

.invalid-feedback {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 6px;
    font-weight: 500;
}

textarea.form-control {
    resize: vertical;
    min-height: 90px;
}

select.form-control,
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236C3FC5' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    cursor: pointer;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.form-check-input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-check-label {
    font-size: 0.875rem;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.input-group {
    display: flex;
}

.input-group .form-control {
    border-radius: var(--radius) 0 0 var(--radius);
}

.input-group-append {
    display: flex;
}

.input-group-append .btn {
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-family);
    border-radius: var(--radius);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
    letter-spacing: -0.005em;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 60%);
    pointer-events: none;
}

.btn:active:not(:disabled) {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 16px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: #fff;
    border-color: #10b981;
    box-shadow: 0 2px 8px var(--success-glow);
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border-color: #059669;
    box-shadow: 0 4px 16px var(--success-glow);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: #fff;
    border-color: #ef4444;
    box-shadow: 0 2px 8px var(--danger-glow);
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    border-color: #dc2626;
    box-shadow: 0 4px 16px var(--danger-glow);
    transform: translateY(-1px);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: #fff;
    border-color: #f59e0b;
    box-shadow: 0 2px 8px var(--warning-glow);
}

.btn-warning:hover:not(:disabled) {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    border-color: #d97706;
    box-shadow: 0 4px 16px var(--warning-glow);
    transform: translateY(-1px);
}

.btn-info {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: #fff;
    border-color: #3b82f6;
    box-shadow: 0 2px 8px var(--info-glow);
}

.btn-info:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    border-color: #2563eb;
    box-shadow: 0 4px 16px var(--info-glow);
    transform: translateY(-1px);
}

.btn-light {
    background: linear-gradient(180deg, #fff 0%, #f8f9fc 100%);
    color: var(--text);
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.btn-light:hover:not(:disabled) {
    background: linear-gradient(180deg, #f8f9fc 0%, #f0f1f6 100%);
    border-color: #d1d5e0;
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary::after { display: none; }

.btn-outline-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    box-shadow: 0 4px 14px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-outline-success {
    background: transparent;
    color: var(--success);
    border-color: var(--success);
}

.btn-outline-success::after { display: none; }

.btn-outline-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: #fff;
    box-shadow: 0 4px 14px var(--success-glow);
    transform: translateY(-1px);
}

.btn-outline-danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger);
}

.btn-outline-danger::after { display: none; }

.btn-outline-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: #fff;
    box-shadow: 0 4px 14px var(--danger-glow);
    transform: translateY(-1px);
}

.btn-outline-warning {
    background: transparent;
    color: var(--warning);
    border-color: var(--warning);
}

.btn-outline-warning::after { display: none; }

.btn-outline-warning:hover:not(:disabled) {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: #fff;
    box-shadow: 0 4px 14px var(--warning-glow);
    transform: translateY(-1px);
}

.btn-icon {
    padding: 9px;
    line-height: 1;
}

.btn-group {
    display: inline-flex;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}

.btn-group .btn + .btn {
    margin-left: -1px;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 30, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.1);
    width: 100%;
    max-width: 560px;
    max-height: min(85vh, calc(100dvh - 32px));
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    margin: auto 0;
    transform: translateY(12px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: inherit;
    overflow: hidden;
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 22px 28px 18px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius);
    transition: all var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--bg);
    color: var(--danger);
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
    background: var(--card-bg);
}

.modal-lg {
    max-width: 800px;
}

.modal-sm {
    max-width: 400px;
}

.manual-leave-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 576px) {
    .manual-leave-form-grid {
        grid-template-columns: 1fr;
    }

    .manual-leave-form-grid .half-day-row {
        padding-top: 0 !important;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0;
}

.tab-link {
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    border: none;
    background: none;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    transition: all var(--transition);
    border-bottom: 2.5px solid transparent;
    margin-bottom: -2px;
}

.tab-link:hover {
    color: var(--primary);
    background: rgba(108, 63, 197, 0.04);
}

.tab-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(108, 63, 197, 0.04);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

/* ============================================================
   DROPDOWN
   ============================================================ */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.9);
    padding: 6px;
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(0.96);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(6px) scale(1);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text);
    transition: all var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    border-radius: var(--radius-sm);
}

.dropdown-item:hover {
    background: linear-gradient(135deg, var(--primary-bg), rgba(139, 92, 246, 0.08));
    color: var(--primary-dark);
    transform: translateX(2px);
}

.dropdown-item i {
    width: 18px;
    text-align: center;
    color: var(--text-muted);
    transition: color var(--transition);
}

.dropdown-item:hover i {
    color: var(--primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 6px;
}

.dropdown-item.text-danger {
    color: var(--danger);
}

.dropdown-item.text-danger:hover {
    background: #fef2f2;
    color: #dc2626;
}

.dropdown-item.text-danger i {
    color: var(--danger);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin-top: 20px;
    justify-content: center;
}

.pagination li a,
.pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 8px;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all var(--transition);
    border: 1.5px solid transparent;
}

.pagination li a:hover {
    background: var(--primary-bg);
    border-color: rgba(108, 63, 197, 0.2);
    color: var(--primary);
    transform: translateY(-1px);
}

.pagination li.active span {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px var(--primary-glow);
}

.pagination li.disabled span {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 380px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border-left: 4px solid var(--text-muted);
    animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-danger { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-info { border-left-color: var(--info); }

.toast-icon {
    font-size: 1.125rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-success .toast-icon { color: var(--success); }
.toast-danger .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }

.toast-body {
    flex: 1;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    font-size: 0.875rem;
    line-height: 1;
}

.toast.removing {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-lg {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

.page-loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    gap: 12px;
}

.page-loader .spinner {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

.page-loader-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   TIMELINE / ACTIVITY LOG
   ============================================================ */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -28px;
    top: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.timeline-dot i {
    font-size: 0.5rem;
    color: var(--primary);
}

.timeline-dot.success { border-color: var(--success); }
.timeline-dot.success i { color: var(--success); }
.timeline-dot.danger { border-color: var(--danger); }
.timeline-dot.danger i { color: var(--danger); }
.timeline-dot.warning { border-color: var(--warning); }
.timeline-dot.warning i { color: var(--warning); }

.timeline-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.timeline-content {
    font-size: 0.875rem;
}

.timeline-content strong {
    font-weight: 600;
}

/* ============================================================
   MAP CONTAINER (Geofence)
   ============================================================ */
.map-container {
    width: 100%;
    height: 450px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg);
    position: relative;
}

.map-container.map-sm {
    height: 280px;
}

.map-container.map-lg {
    height: 600px;
}

.map-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.map-info-window {
    max-width: 280px;
    padding: 8px;
    font-size: 0.8125rem;
}

/* ============================================================
   CALENDAR (Attendance Grid)
   ============================================================ */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.calendar-header-cell {
    background: var(--bg);
    padding: 10px 4px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.calendar-cell {
    background: var(--card-bg);
    padding: 8px;
    min-height: 80px;
    font-size: 0.8125rem;
    position: relative;
    transition: background var(--transition);
}

.calendar-cell:hover {
    background: var(--primary-bg);
}

.calendar-cell.other-month {
    color: var(--border);
    background: var(--bg);
}

.calendar-cell.today {
    background: var(--primary-bg);
}

.calendar-day {
    font-weight: 600;
    font-size: 0.8125rem;
    margin-bottom: 4px;
}

.calendar-cell.today .calendar-day {
    color: var(--primary);
}

.calendar-event {
    display: block;
    padding: 2px 4px;
    font-size: 0.6875rem;
    border-radius: 3px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-event.present { background: #D1FAE5; color: #065F46; }
.calendar-event.absent { background: #FEE2E2; color: #991B1B; }
.calendar-event.leave { background: #DBEAFE; color: #1E40AF; }
.calendar-event.holiday { background: #FEF3C7; color: #92400E; }

/* ============================================================
   FILE UPLOAD
   ============================================================ */
.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.file-upload-area i {
    font-size: 2.5rem;
    color: var(--primary-light);
    margin-bottom: 12px;
}

.file-upload-area p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.file-upload-area .file-upload-hint {
    font-size: 0.75rem;
    color: #9CA3AF;
}

.file-upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius);
    font-size: 0.8125rem;
}

.file-preview-item .remove-file {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 2px;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 16px;
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border-color: #A7F3D0;
}

.alert-danger {
    background: #FEE2E2;
    color: #991B1B;
    border-color: #FECACA;
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border-color: #FDE68A;
}

.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
    border-color: #BFDBFE;
}

.alert i {
    font-size: 1rem;
    margin-top: 1px;
}

.alert-dismissible {
    position: relative;
    padding-right: 40px;
}

.alert-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
}

.alert-close:hover {
    opacity: 1;
}

/* ============================================================
   MISC COMPONENTS
   ============================================================ */

/* Avatar */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-bg), #e0d7fe);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.8);
    box-shadow: 0 1px 4px rgba(108, 63, 197, 0.15);
}

.avatar-sm { width: 30px; height: 30px; font-size: 0.75rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.125rem; }
.avatar-xl { width: 80px; height: 80px; font-size: 1.5rem; }

/* Tooltip */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    background: #1F2937;
    color: #fff;
    font-size: 0.6875rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s ease;
    pointer-events: none;
    z-index: 100;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Progress Bar */
.progress {
    height: 8px;
    background: var(--bg);
    border-radius: 99px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 99px;
    background: var(--primary);
    transition: width 0.5s ease;
}

.progress-bar.success { background: var(--success); }
.progress-bar.danger { background: var(--danger); }
.progress-bar.warning { background: var(--warning); }

/* Divider */
.divider {
    height: 1px;
    background: var(--border-light);
    margin: 20px 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 72px 24px;
}

.empty-state i {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--border), var(--primary-bg));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.empty-state h4 {
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 700;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 24px;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

/* Confirm Dialog */
.confirm-dialog .modal-body {
    text-align: center;
    padding: 32px 24px;
}

.confirm-dialog .confirm-icon {
    font-size: 3rem;
    color: var(--warning);
    margin-bottom: 16px;
}

.confirm-dialog .confirm-message {
    font-size: 1rem;
    margin-bottom: 8px;
}

.confirm-dialog .confirm-sub {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Session Timeout Warning */
.session-warning {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--warning);
    color: #fff;
    padding: 10px 24px;
    text-align: center;
    z-index: 4000;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.session-warning.active {
    transform: translateY(0);
}

/* Search Bar */
.search-box {
    position: relative;
}

.search-box .form-control {
    padding-left: 40px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #fff 0%, #fafbfe 100%);
}

.search-box .form-control:focus {
    background: #fff;
}

.search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-light);
    font-size: 0.875rem;
    transition: color var(--transition);
}

.search-box .form-control:focus ~ .search-icon,
.search-box:focus-within .search-icon {
    color: var(--primary);
}

.designation-combobox .form-control {
    padding-right: 14px;
}

.designation-combobox-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1050;
    max-height: 220px;
    overflow-y: auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
}

.designation-combobox-menu .designation-option {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 10px 12px;
    border-radius: var(--radius-sm, 6px);
    font-size: 0.875rem;
    font-family: var(--font-family);
    color: var(--text);
    cursor: pointer;
}

.designation-combobox-menu .designation-option:hover,
.designation-combobox-menu .designation-option.active {
    background: var(--primary-bg);
    color: var(--primary);
}

.designation-combobox-menu .designation-option-empty {
    padding: 10px 12px;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.8) 0%, rgba(248,249,252,0.6) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}

.filter-bar .search-box {
    flex: 1;
    min-width: 200px;
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================================
   AUTH LAYOUT
   ============================================================ */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a0a3e 0%, var(--primary-dark) 40%, var(--primary) 70%, var(--primary-light) 100%);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(139, 92, 246, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(91, 47, 176, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(20, 184, 166, 0.15) 0%, transparent 50%);
}

.auth-wrapper::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.08);
    top: -200px;
    right: -200px;
    animation: pulse 6s ease-in-out infinite;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255,255,255,0.1);
    width: 100%;
    max-width: 440px;
    padding: 44px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo img {
    width: 56px;
    height: 56px;
    margin-bottom: 12px;
}

.auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.auth-logo h1 span {
    color: var(--primary);
}

.auth-logo p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 0.9375rem;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ============================================================
   MOBILE LAYOUT
   ============================================================ */
.mobile-wrapper {
    min-height: 100vh;
    background: var(--bg);
    max-width: 480px;
    margin: 0 auto;
}

.mobile-header {
    background: var(--primary);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-header h1 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
}

.mobile-header-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
}

.mobile-content {
    padding: 20px;
}

.mobile-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 20px;
    border-radius: var(--radius-lg);
    border: none;
    font-size: 1.125rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition);
    gap: 12px;
}

.mobile-action-btn i {
    font-size: 1.5rem;
}

.mobile-action-btn.check-in {
    background: var(--success);
    color: #fff;
}

.mobile-action-btn.check-in:hover {
    background: #059669;
}

.mobile-action-btn.check-out {
    background: var(--danger);
    color: #fff;
}

.mobile-action-btn.check-out:hover {
    background: #DC2626;
}

.mobile-status {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.mobile-status .status-time {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
}

.mobile-status .status-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.mobile-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-top: 16px;
    box-shadow: var(--shadow-sm);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-fade-in { animation: fadeIn 0.3s ease; }
.animate-fade-in-up { animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.animate-pulse { animation: pulse 2s infinite; }

.content-wrapper > * {
    animation: fadeInUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.content-wrapper > *:nth-child(1) { animation-delay: 0s; }
.content-wrapper > *:nth-child(2) { animation-delay: 0.04s; }
.content-wrapper > *:nth-child(3) { animation-delay: 0.08s; }
.content-wrapper > *:nth-child(4) { animation-delay: 0.12s; }
.content-wrapper > *:nth-child(5) { animation-delay: 0.16s; }

.skeleton {
    background: linear-gradient(90deg, var(--bg) 25%, var(--border-light) 50%, var(--bg) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .top-header {
        left: 0;
    }

    .header-hamburger {
        display: flex;
    }

    .header-selectors {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .content-wrapper {
        padding: 16px;
    }

    .stat-cards {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-bar {
        flex-direction: column;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-actions {
        justify-content: flex-end;
    }

    .modal {
        margin: 0;
        max-height: min(90vh, calc(100dvh - 24px));
    }

    .auth-card {
        padding: 28px;
    }

    .calendar-cell {
        min-height: 60px;
        padding: 4px;
    }

    .tabs {
        gap: 0;
    }

    .tab-link {
        padding: 8px 12px;
        font-size: 0.8125rem;
    }

    .header-profile-info {
        display: none;
    }

    .header-timezone {
        display: none;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }

    .stat-cards {
        grid-template-columns: 1fr 1fr;
    }

    .stat-card-number {
        font-size: 1.5rem;
    }

    .calendar-grid {
        font-size: 0.75rem;
    }

    .calendar-header-cell {
        padding: 6px 2px;
    }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    .sidebar,
    .top-header,
    .sidebar-overlay,
    .toast-container,
    .btn,
    .pagination,
    .filter-bar,
    .toolbar,
    .header-hamburger,
    .modal-overlay {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding-top: 0 !important;
    }

    body {
        background: #fff;
        color: #000;
        font-size: 12pt;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

    .table th {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .badge {
        border: 1px solid currentColor;
    }

    a {
        color: #000;
    }

    .page-header {
        border-bottom: 2px solid #000;
        padding-bottom: 8px;
    }

    @page {
        margin: 1.5cm;
    }
}

/* ============================================================
   BOOTSTRAP COMPATIBILITY LAYER
   Maps Bootstrap utility/component classes to our design system
   ============================================================ */

/* --- Layout Utilities --- */
.container-fluid { width: 100%; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 1rem; }
.me-1 { margin-right: 0.25rem; }
.me-2 { margin-right: 0.5rem; }
.ms-1 { margin-left: 0.25rem; }
.ms-2 { margin-left: 0.5rem; }
.p-0 { padding: 0; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }

.d-flex { display: flex; }
.d-none { display: none; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.flex-column { flex-direction: column; }
.flex-grow-1 { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-middle { vertical-align: middle; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.text-start { text-align: left; }
.text-nowrap { white-space: nowrap; }

/* Grid */
.row { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.row.g-2 { gap: 8px; margin: 0; }
.row.g-3 { gap: 12px; margin: 0; }
.row.g-4 { gap: 16px; margin: 0; }
[class*="col-"] { padding: 0 8px; flex: 0 0 auto; }
.col { flex: 1 0 0%; }
.col-auto { flex: 0 0 auto; width: auto; }
.col-6 { width: 50%; }
.col-12 { width: 100%; }
.col-md-2 { width: 16.666%; }
.col-md-3 { width: 25%; }
.col-md-4 { width: 33.333%; }
.col-md-5 { width: 41.666%; }
.col-md-6 { width: 50%; }
.col-md-8 { width: 66.666%; }
.col-lg-3 { width: 25%; }
.col-lg-4 { width: 33.333%; }
.col-lg-6 { width: 50%; }
.col-lg-8 { width: 66.666%; }

@media (max-width: 768px) {
    [class*="col-md-"] { width: 100%; }
}

/* --- Typography --- */
.h3 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; }
.h4 { font-size: 1.25rem; font-weight: 700; }
.h5 { font-size: 1.1rem; font-weight: 700; }
.fw-semibold, .fw-bold { font-weight: 700; }
.fw-medium { font-weight: 600; }
.small { font-size: 0.8125rem; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-decoration-none { text-decoration: none; }

/* --- Bootstrap Buttons Mapped --- */
.btn-outline-secondary {
    background: linear-gradient(180deg, #fff 0%, #f8f9fc 100%);
    color: var(--text);
    border: 1.5px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.btn-outline-secondary:hover:not(:disabled) {
    background: linear-gradient(180deg, #f8f9fc 0%, #f0f1f6 100%);
    border-color: #d1d5e0;
    transform: translateY(-1px);
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.5;
    padding: 4px;
    line-height: 1;
}
.btn-close:hover { opacity: 1; }
.btn-close::before { content: '\\00d7'; }

.w-100 { width: 100%; }
.btn-group-sm .btn { padding: 5px 12px; font-size: 0.8125rem; }

/* --- Form Elements (Bootstrap compat) --- */
.form-select {
    width: 100%;
    padding: 10px 40px 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: var(--font-family);
    color: var(--text);
    background: var(--card-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236C3FC5' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: all var(--transition);
    line-height: 1.5;
}
.form-select:hover { border-color: #c5c9d6; }
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-bg), 0 1px 3px rgba(108, 63, 197, 0.1);
}
.form-select.is-invalid { border-color: var(--danger); background-color: #fff5f5; }
.form-select-sm { padding: 6px 32px 6px 10px; font-size: 0.8125rem; }

.input-group {
    display: flex;
    position: relative;
}
.input-group .form-control {
    border-radius: 0 var(--radius) var(--radius) 0;
    flex: 1;
}
.input-group-text {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: linear-gradient(180deg, #f8f9fc 0%, #f0f1f6 100%);
    border: 1.5px solid var(--border);
    border-right: 0;
    border-radius: var(--radius) 0 0 var(--radius);
    color: var(--primary-light);
    font-size: 0.875rem;
}

.form-text { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.form-text a { color: var(--primary); font-weight: 600; text-decoration: none; }
.form-text a:hover { text-decoration: underline; }
.form-text a.disabled, .form-text a.pe-none { color: var(--text-muted); pointer-events: none; text-decoration: none; }
.form-floating { position: relative; }

/* --- Bootstrap Table Compat --- */
.table-hover tbody tr:hover { background: linear-gradient(90deg, var(--primary-bg), rgba(240,235,250,0.3)); }
.table-light th { background: linear-gradient(180deg, #f8f9fc 0%, #f1f3f8 100%); }
.table-bordered { border: 1px solid var(--border); }
.table-bordered td, .table-bordered th { border: 1px solid var(--border-light); }
.table-sm td, .table-sm th { padding: 8px 12px; }
.table-borderless td, .table-borderless th { border: none !important; }
.table.mb-0 { margin-bottom: 0; }

/* --- Bootstrap Badges Mapped --- */
.badge.bg-success, .badge-success { background: linear-gradient(135deg, #d1fae5, #a7f3d0) !important; color: #065f46 !important; }
.badge.bg-danger, .badge-danger { background: linear-gradient(135deg, #fee2e2, #fecaca) !important; color: #991b1b !important; }
.badge.bg-warning, .badge-warning { background: linear-gradient(135deg, #fef3c7, #fde68a) !important; color: #92400e !important; }
.badge.bg-info, .badge-info { background: linear-gradient(135deg, #dbeafe, #bfdbfe) !important; color: #1e40af !important; }
.badge.bg-primary, .badge-primary { background: linear-gradient(135deg, var(--primary-bg), #e0d7fe) !important; color: var(--primary) !important; }
.badge.bg-secondary { background: #f1f3f5 !important; color: #6b7280 !important; }
.badge.bg-light { background: var(--bg) !important; color: var(--text-muted) !important; }
.badge.bg-dark { background: #1f2937 !important; color: #fff !important; }

.badge.rounded-pill, .rounded-pill { border-radius: 99px; }

/* --- Bootstrap Alert Compat --- */
.alert-dismissible { position: relative; padding-right: 40px; }
.alert-dismissible .btn-close {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    color: inherit;
}
.fade.show { opacity: 1; }

/* --- Bootstrap Dropdown Compat --- */
.dropdown-toggle::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 6px;
    vertical-align: middle;
    border-top: 5px solid;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}
.dropdown-menu-end { right: 0; left: auto; }
ul.dropdown-menu { list-style: none; padding: 6px; margin: 0; }
ul.dropdown-menu li { list-style: none; }
a.dropdown-item { text-decoration: none; }
.dropdown-item:active { background: var(--primary-bg); }
hr.dropdown-divider { border: 0; height: 1px; background: var(--border-light); margin: 4px 6px; }
.dropdown-toggle:focus { box-shadow: 0 0 0 3px var(--primary-bg); }

/* Toggle dropdown via JS fallback */
.dropdown-toggle[aria-expanded="true"] + .dropdown-menu,
.dropdown.show .dropdown-menu,
.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(6px) scale(1); }

/* --- Bootstrap Card Extras --- */
.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.02em; }
.card-text { font-size: 0.875rem; color: var(--text-muted); }
.card-subtitle { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 8px; }
.list-group { list-style: none; padding: 0; margin: 0; }
.list-group-item {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background var(--transition);
}
.list-group-item:hover { background: var(--primary-bg); }
.list-group-item:last-child { border-bottom: none; }
.list-group-flush .list-group-item { border-radius: 0; }

/* --- Misc Bootstrap Compat --- */
.bg-light { background: var(--bg) !important; }
.bg-white { background: #fff !important; }
.bg-success-subtle { background: #d1fae5 !important; }
.bg-danger-subtle { background: #fee2e2 !important; }
.bg-warning-subtle { background: #fef3c7 !important; }
.bg-info-subtle { background: #dbeafe !important; }

.border { border: 1px solid var(--border) !important; }
.border-0 { border: 0 !important; }
.border-bottom { border-bottom: 1px solid var(--border-light) !important; }
.border-top { border-top: 1px solid var(--border-light) !important; }
.rounded { border-radius: var(--radius) !important; }
.rounded-circle { border-radius: 50% !important; }
.rounded-3 { border-radius: var(--radius-lg) !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.position-relative { position: relative; }
.position-absolute { position: absolute; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

/* --- Page Item / Pagination Bootstrap --- */
.page-item { list-style: none; }
.page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition);
    border: 1.5px solid transparent;
}
.page-item .page-link:hover {
    background: var(--primary-bg);
    border-color: rgba(108,63,197,0.2);
    color: var(--primary);
    transform: translateY(-1px);
}
.page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px var(--primary-glow);
}
.page-item.disabled .page-link {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.pagination-sm .page-link { min-width: 32px; height: 32px; font-size: 0.75rem; }

/* --- Nav Tabs & Pills Bootstrap --- */
.nav { display: flex; list-style: none; padding: 0; flex-wrap: wrap; }
.nav-tabs { border-bottom: 2px solid var(--border-light); }
.nav-tabs .nav-link {
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
    width: auto;
    display: inline-flex;
    gap: 6px;
}
.nav-tabs .nav-link:hover { color: var(--primary); background: rgba(108,63,197,0.04); }
.nav-tabs .nav-link.active { color: var(--primary); border-bottom-color: var(--primary); background: rgba(108,63,197,0.04); }
.nav-tabs .nav-item { list-style: none; }
.tab-pane { display: none; }
.tab-pane.show.active, .tab-pane.active { display: block; }

/* --- JS-less dropdown toggle --- */
.dropdown-toggle { cursor: pointer; }

/* --- Accordion / Collapse (minimal) --- */
.collapse:not(.show) { display: none; }
.collapse.show { display: block; }

/* --- Spinner Bootstrap --- */
.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: text-bottom;
    border: 3px solid var(--border);
    border-right-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.spinner-border-sm { width: 1rem; height: 1rem; border-width: 2px; }

/* --- Extra Button Variants --- */
.btn-outline-info {
    background: linear-gradient(180deg, #fff 0%, #f0f9ff 100%);
    color: #0369a1;
    border: 1.5px solid #bae6fd;
    box-shadow: var(--shadow-sm);
}
.btn-outline-info:hover:not(:disabled) {
    background: linear-gradient(180deg, #e0f2fe 0%, #bae6fd 100%);
    border-color: #7dd3fc;
    color: #0c4a6e;
    transform: translateY(-1px);
}

.btn-outline-primary {
    background: linear-gradient(180deg, #fff 0%, var(--primary-bg) 100%);
    color: var(--primary);
    border: 1.5px solid rgba(108, 63, 197, 0.25);
    box-shadow: var(--shadow-sm);
}
.btn-outline-primary:hover:not(:disabled) {
    background: linear-gradient(180deg, var(--primary-bg) 0%, #e0d7fe 100%);
    border-color: var(--primary-light);
    color: var(--primary-dark);
    transform: translateY(-1px);
}

/* --- Form Sizes --- */
.form-control-sm {
    padding: 6px 10px;
    font-size: 0.8125rem;
    min-height: auto;
}
.input-group-sm .form-control { padding: 6px 10px; font-size: 0.8125rem; }
.input-group-sm .input-group-text { padding: 6px 10px; font-size: 0.8125rem; }

/* --- Utility Extras --- */
.flex-fill { flex: 1 1 auto; }
.bg-primary { background: var(--primary) !important; }
.bg-opacity-10 { opacity: 1; background-color: var(--primary-bg) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: #059669 !important; }
.text-danger { color: #dc2626 !important; }
.text-warning { color: #d97706 !important; }
.text-info { color: #0284c7 !important; }
.form-label { display: block; font-size: 0.8125rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.form-label .required, .form-label.required::after { color: var(--danger); }

/* Override status badges from inline styles with better design */
.status-badge {
    padding: 5px 12px !important;
    border-radius: 99px !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.03em !important;
    text-transform: uppercase !important;
    display: inline-flex !important;
    align-items: center !important;
}
.badge-submitted { background: linear-gradient(135deg, #dbeafe, #bfdbfe) !important; color: #1e40af !important; }
.badge-pending { background: linear-gradient(135deg, #fef3c7, #fde68a) !important; color: #92400e !important; }
.badge-approved, .badge-active { background: linear-gradient(135deg, #d1fae5, #a7f3d0) !important; color: #065f46 !important; }
.badge-rejected { background: linear-gradient(135deg, #fee2e2, #fecaca) !important; color: #991b1b !important; }
.badge-cancelled, .badge-withdrawn, .badge-draft { background: linear-gradient(135deg, #f3f4f6, #e5e7eb) !important; color: #4b5563 !important; }
.badge-returned { background: linear-gradient(135deg, #ffedd5, #fed7aa) !important; color: #9a3412 !important; }
.badge-inactive { background: linear-gradient(135deg, #fee2e2, #fecaca) !important; color: #991b1b !important; }

/* Override inline filter-bar styles */
.filter-bar {
    background: linear-gradient(180deg, #fafbfe 0%, #f5f6fa 100%) !important;
    padding: 18px !important;
    border-radius: var(--radius-lg) !important;
    border: 1px solid var(--border-light) !important;
}

/* Override inline shift-time styles */
.shift-time {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    color: var(--primary-dark) !important;
    letter-spacing: 0.02em !important;
}
.shift-badge {
    padding: 5px 12px !important;
    border-radius: 99px !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.03em !important;
}

/* Trip badges */
.trip-badge {
    padding: 4px 10px !important;
    border-radius: 99px !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
}
.trip-local { background: linear-gradient(135deg, #dbeafe, #bfdbfe) !important; color: #1e40af !important; }
.trip-international { background: linear-gradient(135deg, #fce7f3, #fbcfe8) !important; color: #9d174d !important; }

/* Tab filter (approval center) */
.tab-filter {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.tab-filter a {
    padding: 8px 18px;
    border-radius: 99px;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 600;
    background: linear-gradient(180deg, #fff 0%, #f8f9fc 100%);
    color: var(--text-muted);
    border: 1.5px solid var(--border);
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}
.tab-filter a:hover {
    background: var(--primary-bg);
    border-color: rgba(108,63,197,0.2);
    color: var(--primary);
    transform: translateY(-1px);
}
.tab-filter a.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 10px var(--primary-glow);
}
.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0 6px;
    margin-left: 4px;
    background: rgba(0,0,0,0.08);
}
.tab-filter a.active .tab-count { background: rgba(255,255,255,0.25); }

/* Action buttons group */
.action-btns {
    display: flex;
    gap: 4px;
}

/* Export buttons */
.export-btns {
    display: flex;
    gap: 8px;
}

/* --- Font Size Utilities --- */
.fs-1 { font-size: 2.5rem; }
.fs-2 { font-size: 2rem; }
.fs-3 { font-size: 1.5rem; }
.fs-4 { font-size: 1.25rem; }
.fs-5 { font-size: 1.1rem; }
.fs-6 { font-size: 0.875rem; }

/* --- More Spacing --- */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }
.mb-1 { margin-bottom: 0.25rem; }
.ms-auto { margin-left: auto; }
.me-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 1rem; }
.pt-4 { padding-top: 1.5rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-3 { padding-bottom: 1rem; }

/* --- Width / Height Utilities --- */
.w-50 { width: 50%; }
.w-75 { width: 75%; }
.h-100 { height: 100%; }
.mw-100 { max-width: 100%; }

/* --- Misc --- */
.lh-1 { line-height: 1; }
.lh-sm { line-height: 1.25; }
.user-select-none { user-select: none; }
.cursor-pointer { cursor: pointer; }
code { background: rgba(108,63,197,0.07); color: var(--primary-dark); padding: 2px 6px; border-radius: 4px; font-size: 0.8125rem; }

/* ============================================================
   GLOBAL DROPDOWN JS FALLBACK
   ============================================================ */

/* --- Region currency (UAE Dirham glyph sized to match text; others use ISO code) --- */
img.currency-dirham,
img.fs-dirham {
    height: 1em !important;
    width: auto !important;
    max-height: 1em !important;
    max-width: 1.15em;
    vertical-align: -0.15em;
    margin-right: 0.4em;
    display: inline-block;
    object-fit: contain;
}
span.currency-code {
    font-size: inherit;
    font-weight: inherit;
    margin-right: 0.35em;
}
span.fs-dirham {
    display: inline-block;
    position: relative;
    width: 0.65em;
    height: 1em;
    vertical-align: -0.1em;
    margin-right: 0.4em;
    line-height: 1;
    font-size: inherit;
}
span.fs-dirham .fs-dirham-d {
    display: block;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;
    font-size: 1em;
    line-height: 1em;
    text-align: center;
    color: inherit;
}
span.fs-dirham .fs-dirham-b {
    position: absolute;
    left: -0.12em;
    width: 0.9em;
    height: 1px;
    background: currentColor;
}
span.fs-dirham .fs-dirham-b1 { top: 0.32em; }
span.fs-dirham .fs-dirham-b2 { top: 0.58em; }
