/* ========================================
   DANGCAPNE Enterprise HR System
   Premium Dark Glassmorphism Theme
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
/* Global CSS Variables Configuration */
:root {
    /* Premium Light Palette based on anhlogin.png */
    --bg-primary: #f0f4f9;
    /* Light blue-grey background */
    --bg-secondary: #ffffff;
    --bg-tertiary: #e9eff6;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-glass-hover: rgba(255, 255, 255, 1);
    --card-glass: rgba(255, 255, 255, 0.85);
    --border-glass: rgba(203, 213, 225, 0.4);
    /* Softer borders */
    --border-glass-hover: rgba(148, 163, 184, 0.5);

    /* Elegant Text colors */
    --text-primary: #1e293b;
    /* Dark slate blue-grey */
    --text-secondary: #475569;
    --text-muted: #4b5563;

    --accent-primary: #5c67f2;
    /* Indigo/Violet from button */
    --accent-primary-hover: #4e58e0;
    --accent-secondary: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #5c67f2, #7c3aed);

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);

    --sidebar-width: 280px;
    --sidebar-collapsed: 72px;
    --header-height: 64px;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-xxl: 40px;
    /* New massive radius for premium cards */

    --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 8px 30px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
    --shadow-glow: 0 0 20px rgba(92, 103, 242, 0.15);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base styles adjustments */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', 'Noto Sans', 'Roboto', Arial, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    font-weight: 400;
}

/* Make headers pop out strongly */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Raleway', 'Segoe UI', 'Noto Sans', Arial, sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

input,
button,
select,
textarea,
table,
th,
td,
.nav-link,
.user-name,
.user-role {
    font-family: 'Inter', 'Segoe UI', 'Noto Sans', 'Roboto', Arial, sans-serif;
}

/* UI Elements adjustments for Light Theme */
.stat-value,
.metric-value,
.fw-bold {
    font-weight: 700 !important;
    color: var(--text-primary);
}

.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-sm);
}

.nav-link.active {
    background: rgba(92, 103, 242, 0.12);
    color: var(--accent-primary);
    font-weight: 700;
    box-shadow: inset 0 0 0 1px rgba(92, 103, 242, 0.2);
}

.form-control {
    background: #ffffff;
    border: 1px solid var(--border-glass-hover);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(92, 103, 242, 0.1);
    background: #ffffff !important;
    color: var(--text-primary) !important;
}

select.form-control option {
    background: #ffffff;
    color: var(--text-primary);
}

[data-theme="light"] .data-table th,
[data-theme="light"] .table th {
    background: rgba(15, 23, 42, 0.03);
    color: #475569;
}

[data-theme="light"] .status-badge.pending {
    background: #fef3c7;
    color: #b45309;
    border-color: #fde68a;
}

[data-theme="light"] .status-badge.approved {
    background: #d1fae5;
    color: #047857;
    border-color: #a7f3d0;
}

[data-theme="light"] .status-badge.rejected {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

[data-theme="light"] .status-badge.in-progress {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

[data-theme="light"] .status-badge.cancelled {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

[data-theme="light"] .status-badge.draft {
    background: #ede9fe;
    color: #6d28d9;
    border-color: #ddd6fe;
}

[data-theme="light"] .template-search {
    background: #ffffff;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-glass-hover);
}

.template-search:focus {
    background: #ffffff;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(92, 103, 242, 0.1);
}

/* Background animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(108, 125, 255, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(155, 123, 255, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 80%, rgba(59, 130, 246, 0.035) 0%, transparent 50%);
    z-index: -1;
    animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
    0% {
        opacity: 0.8;
    }

    100% {
        opacity: 1.2;
    }
}

/* ====== LINKS ====== */
a {
    color: var(--accent-primary);
    text-decoration: none;
}

a:hover {
    color: var(--accent-primary-hover);
}

/* ====== SCROLLBAR ====== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* ====== SIDEBAR ====== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: #ffffff;
    border-right: 1px solid var(--border-glass);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    box-shadow: 1px 0 10px rgba(15, 23, 42, 0.03);
}

.sidebar-brand {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-glass);
    min-height: var(--header-height);
}

.sidebar-brand .brand-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    box-shadow: var(--shadow-glow);
    flex-shrink: 0;
}

.sidebar-brand h1 {
    font-size: 18px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-brand h1 small {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.sidebar-nav {
    padding: 12px 12px 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 16px;
}

.nav-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding-left: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.nav-link:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(92, 103, 242, 0.08);
    color: var(--accent-primary);
    box-shadow: inset 0 0 0 1px rgba(92, 103, 242, 0.2);
}

.sidebar-footer {
    margin-top: auto;
    padding: 12px;
}

.user-card {
    display: flex;
    gap: 12px;
    align-items: center;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    padding: 12px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(99, 102, 241, 0.2);
    display: grid;
    place-items: center;
    font-weight: 700;
}

.user-info .user-name {
    font-size: 13px;
    font-weight: 600;
}

.user-info .user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ====== MAIN ====== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.page-content {
    padding: 32px 40px 40px;
}

.content-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.content-grid-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 24px;
}

.info-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.action-row {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
}

.inline-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-wrap > .table,
.table-wrap > .data-table {
    min-width: 640px;
}

.meta-box {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 20px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-glass);
    border-radius: var(--radius-sm);
    margin-top: 4px;
    min-width: 0;
    flex-wrap: wrap;
}

.attachment-item a {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* ====== TOP HEADER ====== */
.top-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.top-header > .d-flex {
    min-width: 0;
    flex: 1;
}

.top-header .page-title {
    font-family: 'Raleway', sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    min-width: 0;
    overflow-wrap: anywhere;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 18px;
    text-decoration: none;
}

.header-btn:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    border-color: var(--border-glass-hover);
}

.mobile-toggle {
    display: none;
}

.sidebar-overlay {
    display: none;
}

/* ====== CARDS ====== */
.glass-card {
    background: var(--card-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
}

.card-body {
    padding: 24px;
}

/* ====== STATS ====== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 18px;
    border-radius: var(--radius-lg);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    margin-bottom: 10px;
    background: rgba(92, 103, 242, 0.05);
}

.stat-card.primary .stat-icon {
    color: var(--accent-primary);
}

.stat-card.success .stat-icon {
    color: var(--success);
}

.stat-card.danger .stat-icon {
    color: var(--danger);
}

.stat-card.info .stat-icon {
    color: var(--info);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.chart-container {
    height: 260px;
}

/* ====== TABLES ====== */
.data-table,
.table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td,
.table th,
.table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-glass);
    font-size: 13px;
    line-height: 1.5;
}

.data-table th,
.table th {
    font-size: 11px;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    text-transform: uppercase;
    background: rgba(15, 23, 42, 0.03);
}

.admin-data-table {
    table-layout: fixed;
}

.admin-data-table th,
.admin-data-table td {
    text-align: left;
    vertical-align: middle;
}

.admin-data-table th:last-child,
.admin-data-table td:last-child {
    white-space: nowrap;
}

.admin-users-table th:nth-child(1),
.admin-users-table td:nth-child(1) {
    width: 12%;
}

.admin-users-table th:nth-child(2),
.admin-users-table td:nth-child(2) {
    width: 28%;
}

.admin-users-table th:nth-child(3),
.admin-users-table td:nth-child(3) {
    width: 20%;
}

.admin-users-table th:nth-child(4),
.admin-users-table td:nth-child(4) {
    width: 26%;
}

.admin-users-table th:nth-child(5),
.admin-users-table td:nth-child(5) {
    width: 14%;
}

.admin-timekeeping-table th:nth-child(1),
.admin-timekeeping-table td:nth-child(1) {
    width: 12%;
}

.admin-timekeeping-table th:nth-child(2),
.admin-timekeeping-table td:nth-child(2) {
    width: 19%;
}

.admin-timekeeping-table th:nth-child(3),
.admin-timekeeping-table td:nth-child(3) {
    width: 22%;
}

.admin-timekeeping-table th:nth-child(4),
.admin-timekeeping-table td:nth-child(4),
.admin-timekeeping-table th:nth-child(5),
.admin-timekeeping-table td:nth-child(5),
.admin-timekeeping-table th:nth-child(6),
.admin-timekeeping-table td:nth-child(6),
.admin-timekeeping-table th:nth-child(7),
.admin-timekeeping-table td:nth-child(7) {
    width: 10%;
}

.admin-timekeeping-table th:nth-child(8),
.admin-timekeeping-table td:nth-child(8) {
    width: 7%;
}

/* ====== STATUS ====== */
.status-badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    border: 1px solid transparent;
}

.status-badge.pending {
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.3);
}

.status-badge.approved {
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.3);
}

.status-badge.rejected {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.status-badge.in-progress {
    color: var(--info);
    border-color: rgba(59, 130, 246, 0.3);
}

.status-badge.cancelled {
    color: #9ca3af;
    border-color: rgba(156, 163, 175, 0.3);
}

.status-badge.draft {
    color: #a78bfa;
    border-color: rgba(167, 139, 250, 0.3);
}

/* ====== FORMS ====== */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.form-row > * {
    min-width: 0;
}

.form-row > .col-12 {
    grid-column: 1 / -1;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-control,
textarea.form-control {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    background: #ffffff;
    color: var(--text-primary) !important;
    font-weight: 500;
    transition: var(--transition);
    font-family: inherit;
}

.form-control::placeholder {
    color: rgba(71, 85, 105, 0.7);
    font-weight: 400;
}

.form-control:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(92, 103, 242, 0.1), var(--shadow-glow);
}

select.form-control {
    background-color: #ffffff;
    color: var(--text-primary);
}

select.form-control option {
    background: #ffffff;
    color: var(--text-primary);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

input[type="file"].form-control {
    padding: 8px 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

input[type="file"].form-control::file-selector-button {
    margin-right: 12px;
    padding: 8px 12px;
    border: 0;
    border-radius: 10px;
    background: rgba(92, 103, 242, 0.12);
    color: var(--accent-primary);
    font-weight: 700;
    cursor: pointer;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive > .table,
.table-responsive > .data-table {
    min-width: 640px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
}

.btn-ghost {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
}

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}

/* ====== UTIL ====== */
.text-muted {
    color: var(--text-muted);
}

.text-primary {
    color: var(--accent-primary);
}

.text-info {
    color: var(--info);
}

.text-warning {
    color: var(--warning);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.empty-state {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
}

.leave-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}

.leave-bar-fill {
    height: 100%;
    background: var(--accent-primary);
}

.leave-bar-fill.warning {
    background: var(--warning);
}

.leave-bar-fill.danger {
    background: var(--danger);
}

/* ====== MODULE CARDS ====== */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.module-card {
    display: block;
    padding: 16px;
    border-radius: var(--radius-lg);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.module-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.module-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.module-desc {
    color: var(--text-muted);
    font-size: 12px;
    min-height: 32px;
}

.module-cta {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 12px;
    margin-top: 8px;
}

/* ====== TEMPLATE SELECT ====== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.page-title {
    font-family: 'Raleway', sans-serif;
    font-size: 24px;
    font-weight: 800;
}

.template-search-wrap {
    position: relative;
    min-width: 260px;
    flex: 0 1 320px;
}

.template-search-wrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.template-search {
    width: 100%;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 10px 12px 10px 34px;
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition);
}

.template-search:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.template-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 32px;
}

.chip {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 12px 24px;
    font-weight: 500;
    border-radius: 999px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.chip:hover {
    color: var(--text-primary);
    border-color: var(--border-glass-hover);
}

.chip.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(92, 103, 242, 0.1);
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.template-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    padding: 16px;
    border-radius: var(--radius-lg);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    min-height: 190px;
}

.template-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-glass-hover);
    box-shadow: var(--shadow-md);
}

.template-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.template-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    color: var(--icon-color, #6366f1);
    border: 1px solid var(--border-glass);
    font-size: 20px;
}

.template-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge-category {
    color: #4338ca;
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

.badge-warning {
    color: #b45309;
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
}

.badge-muted {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-glass);
}

.template-title {
    font-family: 'Raleway', sans-serif;
    font-size: 16px;
    font-weight: 700;
    margin-top: 2px;
}

.template-desc {
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
    min-height: 40px;
}

.template-footer {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
}

.template-action {
    font-size: 12px;
    color: var(--accent-primary-hover);
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 1200px) {
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .page-content {
        padding: 20px;
    }

    .top-header {
        padding: 0 20px;
        gap: 12px;
    }

    .top-header .page-title {
        font-size: 18px;
    }

    .mobile-toggle {
        display: inline-flex;
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        pointer-events: none;
        transition: var(--transition);
        z-index: 900;
    }

    .sidebar-overlay.show {
        opacity: 1;
        pointer-events: auto;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .form-group {
        margin-bottom: 18px;
    }

    .content-grid-2,
    .content-grid-sidebar,
    .info-grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .page-content {
        padding: 16px;
    }

    .top-header {
        min-height: var(--header-height);
        height: auto;
        padding: 12px 16px;
        align-items: flex-start;
    }

    .top-header > .d-flex {
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .top-header .page-title {
        font-size: 16px;
    }

    .header-actions {
        gap: 8px;
        flex-shrink: 0;
    }

    .header-btn {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    #langDisplay {
        display: none;
    }

    .card-header,
    .card-body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .page-header {
        gap: 16px;
        margin-bottom: 20px;
    }

    .page-header > * {
        width: 100%;
        min-width: 0;
    }

    .page-title {
        font-size: 20px;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    .data-table th,
    .data-table td,
    .table th,
    .table td {
        padding: 12px 14px;
    }

    .filter-bar {
        padding: 16px;
        margin-bottom: 20px;
    }

    .filter-bar form {
        gap: 16px;
    }

    .search-input,
    .template-search-wrap {
        min-width: 0;
        width: 100%;
        flex-basis: 100%;
    }

    .action-row {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .action-row .btn,
    .inline-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .inline-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .table-wrap > .table,
    .table-wrap > .data-table,
    .table-responsive > .table,
    .table-responsive > .data-table {
        min-width: 560px;
    }

    .meta-box {
        padding: 16px;
    }

    .attachment-item {
        align-items: flex-start;
    }

    input[type="file"].form-control::file-selector-button {
        display: block;
        margin-right: 0;
        margin-bottom: 8px;
        width: 100%;
    }
}

@media (max-width: 420px) {
    .page-title {
        font-size: 18px;
    }

    .table-wrap > .table,
    .table-wrap > .data-table,
    .table-responsive > .table,
    .table-responsive > .data-table {
        min-width: 520px;
    }
}

/* ====== LOGIN PAGE ====== */
.login-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

.login-body::before {
    background: none;
    animation: none;
    opacity: 0;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 40px 24px;
    position: relative;
    overflow: hidden;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #060b14;
    padding: 20px;
    font-family: 'Inter', sans-serif;
}

.login-shell {
    position: relative;
    z-index: 1;
    width: min(1000px, 100%);
    border-radius: 20px;
    background: #0f1523;
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}

.login-hero {
    padding: 50px 48px;
    background: radial-gradient(circle at top left, rgba(55, 65, 120, 0.4) 0%, rgba(20, 25, 45, 0.9) 100%);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Base Top Typography */
.hero-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
}

.hero-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #c7d2fe;
    font-size: 20px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.hero-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
}

.hero-subtitle {
    color: rgba(229, 231, 235, 0.6);
    font-size: 12px;
    margin-top: 2px;
}

.hero-copy h1 {
    font-size: 32px;
    line-height: 1.3;
    font-weight: 700;
    margin-bottom: 24px;
    color: #fff;
}

.hero-copy p {
    color: rgba(229, 231, 235, 0.65);
    font-size: 14px;
    line-height: 1.5;
}

/* --- Custom Workflow Visualization --- */
.hero-workflow-visual {
    margin: 40px 0;
    position: relative;
    height: 240px;
}

.workflow-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.glow-line {
    fill: none;
    stroke: rgba(139, 92, 246, 0.4);
    stroke-width: 1.5;
    stroke-linecap: round;
    filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.5));
}

.particle {
    fill: #fff;
    filter: drop-shadow(0 0 6px #fff);
    animation: pulseParticle 2s infinite alternate ease-in-out;
}

.p1 {
    animation-delay: 0s;
}

.p2 {
    animation-delay: 0.4s;
}

.p3 {
    animation-delay: 0.8s;
}

.p4 {
    animation-delay: 1.2s;
}

.p5 {
    animation-delay: 1.6s;
}

@keyframes pulseParticle {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.5);
        opacity: 1;
        text-shadow: 0 0 10px #fff;
    }
}

.wf-node {
    position: absolute;
    width: 64px;
    height: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transform: translate(-50%, -50%);
    /* center origin */
}

/* 3D Glass Pedestal base */
.wf-pedestal {
    position: absolute;
    bottom: -15px;
    width: 60px;
    height: 25px;
    background: radial-gradient(ellipse at center, rgba(139, 92, 246, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5), inset 0 2px 5px rgba(255, 255, 255, 0.05);
    transform: perspective(200px) rotateX(60deg);
}

.wf-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 240, 250, 1));
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.8);
    display: grid;
    place-items: center;
    font-size: 20px;
    color: #4f46e5;
    position: relative;
    z-index: 3;
}

.wf-label {
    margin-top: 18px;
    font-size: 11px;
    color: rgba(229, 231, 235, 0.85);
    white-space: nowrap;
    z-index: 3;
}

.wf-status-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #6366f1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: white;
    font-size: 10px;
    border: 2px solid white;
}

/* ====== NOTIFICATIONS ====== */
.notif-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 800;
    padding: 0 6px;
    height: 20px;
    min-width: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.45);
    border: 2px solid #ffffff;
    pointer-events: none;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: -10px;
    width: 340px;
    background: #ffffff;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.98);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    overflow: hidden;
}

.notif-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.notif-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
}

.notif-header h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.notif-header h3 i {
    color: var(--accent-primary);
}

.notif-header .btn-ghost {
    font-size: 11px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: var(--transition);
}

.notif-header .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

#notifList {
    max-height: 380px;
    overflow-y: auto;
}

#notifList::-webkit-scrollbar {
    width: 6px;
}

#notifList::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.notif-footer {
    display: block;
    padding: 14px;
    text-align: center;
    border-top: 1px solid var(--border-glass);
    background: rgba(0, 0, 0, 0.2);
    color: var(--accent-primary);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.notif-footer:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--accent-primary-hover);
}

.notif-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.notif-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    border: 1px solid rgba(37, 99, 235, 0.3);
    font-weight: 700;
}

.notif-list {
    display: grid;
}

.notif-item {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-glass);
    text-decoration: none;
    color: inherit;
    background: transparent;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.notif-item.unread {
    background: rgba(99, 102, 241, 0.12);
}

.notif-item.unread .notif-title {
    color: var(--text-primary);
}

.notif-item.unread .notif-msg {
    color: var(--text-primary);
    font-weight: 500;
}

.notif-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
}

.notif-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.notif-msg {
    font-size: 13px;
    color: #334155;
    line-height: 1.5;
}

.notif-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

.notif-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
    margin-top: 6px;
}

/* ====== REQUESTS LIST ====== */
.filter-bar {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
}

.filter-bar form {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-end;
}

.search-input {
    min-width: 260px;
}

.filter-bar .form-control {
    min-height: 48px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

.filter-bar .form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.filter-bar select.form-control {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(229, 231, 235, 0.7) 50%),
        linear-gradient(135deg, rgba(229, 231, 235, 0.7) 50%, transparent 50%),
        linear-gradient(to right, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08));
    background-position:
        calc(100% - 18px) 55%,
        calc(100% - 12px) 55%,
        calc(100% - 36px) 50%;
    background-size: 6px 6px, 6px 6px, 1px 18px;
    background-repeat: no-repeat;
    padding-right: 44px;
}

.filter-bar select.form-control option {
    background: #ffffff;
    color: var(--text-primary);
}

.data-table thead th {
    background: rgba(255, 255, 255, 0.03);
}

.data-table tbody tr {
    transition: background 0.15s ease;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    border: 1px solid transparent;
}

.priority-badge.high {
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.3);
    background: rgba(185, 28, 28, 0.05);
    font-weight: 700;
}

.priority-badge.urgent {
    color: #ffffff;
    background: #dc2626;
    border-color: #991b1b;
    font-weight: 800;
}

.priority-badge.low {
    color: #15803d;
    border-color: rgba(21, 128, 61, 0.3);
    background: rgba(21, 128, 61, 0.05);
    font-weight: 600;
}

.priority-badge.normal {
    color: #4338ca;
    border-color: rgba(67, 56, 202, 0.3);
    background: rgba(67, 56, 202, 0.05);
    font-weight: 600;
}

.pagination {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.page-link {
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    text-decoration: none;
    background: var(--bg-glass);
}

.page-link.active {
    background: rgba(99, 102, 241, 0.2);
    color: #fff;
    border-color: rgba(99, 102, 241, 0.4);
}

/* ====== KANBAN ====== */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.kanban-column {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 260px;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.kanban-column-header h4 {
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.col-count {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
}

.kanban-cards {
    display: grid;
    gap: 16px;
}

.kanban-card {
    display: block;
    padding: 16px 18px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid var(--border-glass);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, border-color 0.15s ease;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.02);
}

.kanban-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-glass-hover);
}

.card-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
}

.card-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.card-requester {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-avatar {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.2);
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    color: #c7d2fe;
}

.kanban-column.pending {
    border-top: 3px solid rgba(245, 158, 11, 0.7);
}

.kanban-column.in-progress {
    border-top: 3px solid rgba(59, 130, 246, 0.7);
}

.kanban-column.approved {
    border-top: 3px solid rgba(16, 185, 129, 0.7);
}

.kanban-column.rejected {
    border-top: 3px solid rgba(239, 68, 68, 0.7);
}

.anomaly-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.04);
    margin-bottom: 10px;
}

.anomaly-card .flag {
    font-size: 20px;
}

.anomaly-card h4 {
    font-size: 13px;
    margin-bottom: 4px;
}

.anomaly-card p {
    font-size: 12px;
    color: var(--text-secondary);
}

@media (max-width: 1200px) {
    .kanban-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .kanban-board {
        grid-template-columns: 1fr;
    }
}

/* ====== TABS (ADMIN) ====== */
.tab-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tab-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    transition: var(--transition);
}

.tab-link:hover {
    color: var(--text-primary);
    border-color: var(--border-glass-hover);
    background: var(--bg-glass-hover);
}

.tab-link.active {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

.tab-link i {
    font-size: 14px;
}

/* =========================================
   GLOBAL AI CHATBOX
   ========================================= */

.ai-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.ai-chat-btn {
    width: 56px;
    height: 56px;
    border-radius: 28px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: #fff;
    border: none;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s, background 0.3s;
}

.ai-chat-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.5);
}

.ai-chat-btn:active {
    cursor: grabbing;
}

.ai-chat-btn.active {
    transform: rotate(45deg);
    background: #1e293b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ai-chat-panel {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 360px;
    height: 500px;
    background: #ffffff;
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: chatSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom right;
}

@keyframes chatSlideUp {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ai-chat-header {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.1));
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-chat-title i {
    color: #a855f7;
}

.ai-chat-subtitle {
    font-size: 11px;
    color: rgba(229, 231, 235, 0.6);
    margin-top: 2px;
}

.ai-close-btn {
    background: none;
    border: none;
    color: rgba(229, 231, 235, 0.6);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s;
}

.ai-close-btn:hover {
    color: #f87171;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.chat-msg {
    max-width: 85%;
    padding: 12px 16px;
    font-size: 13.5px;
    line-height: 1.5;
    word-wrap: break-word;
}

.ai-msg {
    align-self: flex-start;
    background: #f1f5f9;
    color: var(--text-primary);
    border-radius: 16px 16px 16px 4px;
    border: 1px solid var(--border-glass);
}

.user-msg {
    align-self: flex-end;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.ai-msg.error {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

.ai-chat-input {
    padding: 14px 20px;
    background: rgba(15, 23, 42, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 10px;
}

.ai-chat-input input {
    flex: 1;
    background: #f8fafc;
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 13.5px;
    outline: none;
    transition: all 0.2s;
}

.ai-chat-input input:focus {
    background: #ffffff;
    border-color: var(--accent-primary);
}

.ai-chat-input button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #6366f1;
    color: white;
    border: none;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.ai-chat-input button:hover {
    background: #4f46e5;
    transform: scale(1.05);
}

.typing {
    display: inline-flex;
    align-items: center;
    font-style: italic;
    color: rgba(229, 231, 235, 0.5);
}

.typing::after {
    content: '...';
    overflow: hidden;
    display: inline-block;
    vertical-align: bottom;
    animation: typing-dots 1.5s steps(4, end) infinite;
    width: 0px;
}

@keyframes typing-dots {
    to {
        width: 1.25em;
    }
}


/* ====== UTILITY CLASSES ====== */
.d-flex {
    display: flex !important;
}

.d-grid {
    display: grid !important;
}

.flex-column {
    flex-direction: column !important;
}

.flex-wrap {
    flex-wrap: wrap !important;
}

.justify-between {
    justify-content: space-between !important;
}

.justify-center {
    justify-content: center !important;
}

.align-center {
    align-items: center !important;
}

/* Gaps */
.gap-4 {
    gap: 12px !important;
}

.gap-8 {
    gap: 20px !important;
}

.gap-12 {
    gap: 24px !important;
}

.gap-16 {
    gap: 32px !important;
}

.gap-24 {
    gap: 40px !important;
}

/* Margins */
.mb-4 {
    margin-bottom: 12px !important;
}

.mb-8 {
    margin-bottom: 16px !important;
}

.mb-12 {
    margin-bottom: 20px !important;
}

.mb-16 {
    margin-bottom: 24px !important;
}

.mb-24 {
    margin-bottom: 32px !important;
}

.mb-32 {
    margin-bottom: 48px !important;
}

.mt-8 {
    margin-top: 16px !important;
}

.mt-16 {
    margin-top: 24px !important;
}

.mt-24 {
    margin-top: 32px !important;
}

.p-24 {
    padding: 24px !important;
}

.text-muted {
    color: var(--text-muted) !important;
}
/* Employee dashboard sections */
.mini-stat-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.mini-stat { background:var(--bg-glass); border:1px solid var(--border-glass); border-radius:12px; padding:12px; text-align:center; }
.mini-stat-value { font-size:18px; font-weight:800; }
.mini-stat-label { font-size:12px; color:var(--text-muted); }
.shift-list { display:flex; flex-direction:column; gap:10px; }
.shift-item { display:flex; justify-content:space-between; align-items:center; padding:10px 12px; border-radius:12px; border:1px solid var(--border-glass); background:var(--bg-glass); }
.shift-title { font-weight:700; }
.shift-time { font-weight:700; color:var(--accent-primary); }
.timeline { display:flex; flex-direction:column; gap:12px; position:relative; }
.timeline-item { display:flex; gap:12px; align-items:flex-start; }
.timeline-dot { width:10px; height:10px; border-radius:50%; margin-top:6px; background:#10b981; }
.timeline-dot.pending { background:#f59e0b; }
.timeline-dot.rejected { background:#ef4444; }
.timeline-dot.approved { background:#10b981; }
.timeline-content { flex:1; background:var(--bg-glass); border:1px solid var(--border-glass); padding:10px 12px; border-radius:12px; }
.swap-list { display:flex; flex-direction:column; gap:10px; }
.swap-item { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:10px 12px; border:1px solid var(--border-glass); background:var(--bg-glass); border-radius:12px; }
.swap-actions { display:flex; gap:8px; align-items:center; }
@media (max-width: 1100px) {
  .mini-stat-grid { grid-template-columns:repeat(2,1fr); }
}
@media (max-width: 900px) {
  .mini-stat-grid { grid-template-columns:1fr; }
  .swap-item { flex-direction:column; align-items:flex-start; }
  .swap-actions { width:100%; justify-content:flex-start; }
}

/* Calendar */
.calendar-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:8px; min-width:560px; }
.cal-head { font-weight:700; font-size:12px; text-align:center; color:var(--text-muted); }
.cal-cell { min-height:70px; border:1px solid var(--border-glass); background:var(--bg-glass); border-radius:12px; padding:8px; display:flex; flex-direction:column; gap:6px; }
.cal-cell.empty { background:transparent; border:none; }
.cal-cell.today { outline:2px solid var(--accent-primary); }
.cal-day { font-weight:700; font-size:12px; }
.cal-status { display:flex; align-items:center; gap:6px; font-size:11px; color:var(--text-muted); }
.cal-status .dot { width:8px; height:8px; border-radius:50%; display:inline-block; background:#94a3b8; }
.cal-cell.ok .cal-status .dot { background:#10b981; }
.cal-cell.warn .cal-status .dot { background:#f59e0b; }
.cal-cell.bad .cal-status .dot { background:#ef4444; }
.cal-cell.na .cal-status .dot { background:#cbd5e1; }
.cal-legend { display:flex; flex-wrap:wrap; gap:12px; margin-top:12px; font-size:12px; color:var(--text-muted); }
.cal-legend .dot { width:8px; height:8px; border-radius:50%; display:inline-block; margin-right:6px; }
.cal-legend .ok .dot { background:#10b981; }
.cal-legend .warn .dot { background:#f59e0b; }
.cal-legend .bad .dot { background:#ef4444; }
.cal-legend .na .dot { background:#cbd5e1; }

/* Overview shortcuts */
.shortcut-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.shortcut-item { display:flex; flex-direction:column; gap:8px; align-items:flex-start; padding:14px; border-radius:14px; border:1px solid var(--border-glass); background:var(--bg-glass); text-decoration:none; color:inherit; font-weight:600; }
.shortcut-item i { font-size:18px; color:var(--accent-primary); }
.shortcut-item:hover { box-shadow:var(--shadow-sm); transform:translateY(-1px); }
.stat-pill { background:var(--bg-glass); border:1px solid var(--border-glass); border-radius:12px; padding:8px 12px; min-width:88px; text-align:center; }
.stat-pill .pill-label { font-size:11px; color:var(--text-muted); }
.stat-pill .pill-value { font-size:18px; font-weight:800; }
.stat-pill.success .pill-value { color:#10b981; }
.stat-pill.danger .pill-value { color:#ef4444; }
@media (max-width: 1100px) { .shortcut-grid { grid-template-columns:repeat(3,1fr); } }
@media (max-width: 900px) { .shortcut-grid { grid-template-columns:repeat(2,1fr); } }
@media (max-width: 600px) { .shortcut-grid { grid-template-columns:1fr; } }

/* Professional button style */
.btn-pill { border-radius:999px; padding:8px 14px; font-weight:600; }

/* ========================================
   GLOBAL SMOOTH ANIMATIONS UTILITIES
   ======================================== */

/* Reveal Animations */
.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-fade {
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}
.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-visible {
    opacity: 1 !important;
    transform: translate(0, 0) !important;
}

/* Page Transition Fade */
body.page-fade-out {
    opacity: 0;
    transition: opacity 0.15s ease-out;
}
body.page-fade-in {
    opacity: 1;
    transition: opacity 0.4s ease-in;
}

/* Ripple Effect */
.ripple-container {
    position: relative;
    overflow: hidden;
}
.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple-anim 0.35s linear;
    background-color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
}
.ripple-dark {
    background-color: rgba(0, 0, 0, 0.1);
}
@keyframes ripple-anim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Mouse Tracking Glow Effect */
.glow-card {
    position: relative;
    overflow: hidden;
}
.glow-card::before {
    content: '';
    position: absolute;
    inset: 0px;
    z-index: 0;
    background: radial-gradient(
        300px circle at var(--mouse-x) var(--mouse-y),
        rgba(92, 103, 242, 0.1),
        transparent 60%
    );
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}
.glow-card:hover::before {
    opacity: 1;
}

/* Skeleton Shimmer */
.skeleton {
    position: relative;
    overflow: hidden;
    background-color: #f1f5f9;
    border-radius: 4px;
}
.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.5),
        transparent
    );
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Premium Card Lift */
.card-lift {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.card-lift:hover {
    transform: translateY(-5px) scale(1.01);
}

/* Vertical Indicator for Active Nav Link */
.nav-link {
    position: relative;
}
.nav-link.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 20%;
    height: 60%;
    width: 4px;
    background: var(--accent-primary);
    border-radius: 0 4px 4px 0;
    box-shadow: 2px 0 10px rgba(92, 103, 242, 0.4);
}
/* Top Progress Bar (NProgress style) */
#top-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    z-index: 10000;
    transition: width 0.4s ease;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

/* Button Loading State */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.btn-loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-top: -9px;
    margin-left: -9px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Page Loader Overlay (Optional, used for major transitions) */
#page-loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
#page-loader.active {
    opacity: 1;
    pointer-events: all;
}


/* Smooth Table Row Hovers */
.data-table tbody tr {
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.data-table tbody tr:hover {
    transform: scale(1.005);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Enhancing existing transitions */
.btn, .nav-link, .glass-card, .form-control {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
