/* 
   AIHR Custom Vanilla CSS Design System 
   Premium Light Theme inspired by Wellness App and Rasket Aesthetics 
*/

:root {
    --bg-app: #F8FAFC; /* Softer neutral light slate background */
    --bg-card: #FFFFFF; /* Pure white card containers */
    --bg-sidebar: #FFFFFF; /* Clean white sidebar */
    --border-color: #E2E8F0; /* Soft light gray borders */
    --card-bg: var(--bg-card);
    --border: var(--border-color);
    --background: #F8FAFC;
    
    /* Brand Colors (Aligned with Wanda ERP palette) */
    --primary: #3B82F6; /* Wanda Blue */
    --primary-hover: #2563EB;
    --primary-light: #60A5FA;
    --color-primary: #3B82F6;
    --color-primary-light: #60A5FA;
    --secondary: #10B981;
    --secondary-hover: #059669;
    
    /* Text Colors */
    --text-main: #1E293B; /* Dark slate gray for readability */
    --text-sub: #64748B; /* Soft slate for secondary labels */
    --text-muted: #94A3B8; /* Muted slate for small descriptions */
    
    /* Semantic Statuses */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;
    --color-info: #3B82F6;
    
    /* Layout Spacing Variables */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Layout Variables */
    --sidebar-width: 260px;
    --header-height: 70px;
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --font-stack: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Design System Migrations & Page Aliases */
    --bg-surface: var(--bg-card);
    --accent: var(--primary);
    --accent-hover: var(--primary-hover);
    --green: var(--success);
    --red: var(--danger);
}

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

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    font-family: var(--font-stack);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    background-image: radial-gradient(circle at 5% 5%, rgba(79, 70, 229, 0.04) 0%, transparent 40%),
                      radial-gradient(circle at 95% 95%, rgba(16, 185, 129, 0.03) 0%, transparent 40%);
}

body.role-super-admin {
    background-color: #eef4ff;
    background-image:
        radial-gradient(circle at top left, rgba(99, 102, 241, 0.16) 0%, transparent 28%),
        radial-gradient(circle at 85% 15%, rgba(14, 165, 233, 0.12) 0%, transparent 22%),
        linear-gradient(180deg, #f5f9ff 0%, #eef3fb 45%, #edf2f8 100%);
}

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

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

/* --- Layout Grid --- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.main-content {
    flex: none;
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    padding: 24px;
    padding-top: calc(var(--header-height) + 24px);
    min-height: 100vh;
    min-width: 0;
    overflow-x: hidden;
    transition: margin-left 0.3s ease;
}

/* --- Sidebar Style --- */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0F172A 0%, #1E293B 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.25);
    transition: width 0.3s ease;
}

.super-admin-shell .sidebar {
    box-shadow: 18px 0 48px rgba(15, 23, 42, 0.18);
}

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

.logo-text {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
}

.sidebar-menu {
    flex: 1;
    padding: 24px 16px;
    list-style: none;
    overflow-y: auto;
}

.menu-section {
    margin-bottom: 8px;
}

.menu-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #8E9CAE;
    margin-top: 18px;
    margin-bottom: 6px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    padding-right: 8px;
}

.label-chevron {
    transition: transform 0.2s ease;
    font-size: 14px;
    color: #8E9CAE;
}

.menu-section.collapsed .label-chevron {
    transform: rotate(-90deg);
}

.menu-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 800px;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    opacity: 1;
}

.menu-section.collapsed .menu-submenu {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.menu-item {
    margin-bottom: 6px;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-radius: 12px;
    color: #CBD5E1;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    gap: 12px;
}

.menu-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #FFFFFF;
    transform: translateX(4px);
}

.menu-badge {
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.2);
    color: #60A5FA;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.menu-item.active .menu-link {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.menu-item.active .menu-link .menu-icon {
    color: #FFFFFF;
    opacity: 1;
}

.menu-item.active .menu-badge {
    background: rgba(255, 255, 255, 0.18);
    color: #FFFFFF;
}

.menu-icon {
    font-size: 18px;
    color: #94A3B8;
    opacity: 0.9;
    width: 24px;
    text-align: center;
}

.sidebar-symbol {
    width: 24px;
    min-width: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    opacity: 0.92;
}

.user-profile-menu {
    border-radius: 12px;
    padding: 6px;
    transition: background 0.2s;
}

.user-profile-menu:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sa-sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #0B0F19;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sa-sidebar-footer .user-name {
    color: #FFFFFF;
}

.sa-sidebar-footer .user-role {
    color: #94A3B8;
}

.sa-sidebar-footer .sa-logout-link {
    color: #EF4444;
    font-size: 18px;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sa-sidebar-footer .sa-logout-link:hover {
    background: rgba(239, 68, 68, 0.15);
}

/* --- Top Header Style --- */
.header {
    height: var(--header-height);
    position: fixed;
    top: 0;
    right: 0;
    left: var(--sidebar-width);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    transition: all 0.3s ease;
}

.header-title-group {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-symbol {
    width: 18px;
    min-width: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    font-size: 16px;
    line-height: 1;
    font-weight: 700;
}

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

.header-notification-link {
    position: relative;
    color: var(--text-sub);
    font-size: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.header-notification-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
}

.header-notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-card);
}

.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.15);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.user-role {
    font-size: 11px;
    color: var(--text-sub);
}

/* --- UI Cards & Grid --- */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.role-super-admin .card,
.role-super-admin .panel-card {
    border-color: rgba(191, 219, 254, 0.7);
    box-shadow: 0 18px 40px rgba(30, 41, 59, 0.06);
}

.role-super-admin .sa-sidebar-footer {
    padding: 18px 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.88) 0%, rgba(2, 6, 23, 0.98) 100%);
}

.role-super-admin .sa-logout-link {
    color: #fb7185;
    font-size: 20px;
    padding: 8px;
    display: inline-flex;
    align-items: center;
    border-radius: 12px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.role-super-admin .sa-logout-link:hover {
    background: rgba(244, 63, 94, 0.12);
    transform: translateY(-1px);
}

.role-super-admin .btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #2563eb 55%, #06b6d4 100%);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.role-super-admin .btn-secondary {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.04);
}

.role-super-admin .btn-secondary:hover {
    background: #fff;
    box-shadow: 0 14px 24px rgba(15, 23, 42, 0.08);
}

.role-super-admin .form-control {
    background: rgba(255,255,255,0.94);
}

.soft-panel {
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.95) 100%);
}

.empty-state-box {
    border: 1px dashed var(--border-color);
    border-radius: 14px;
    padding: 18px;
    text-align: center;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.65);
}

.soft-accent-card {
    background: linear-gradient(180deg, #FFFFFF 0%, #F7F6FF 100%);
}

.soft-accent-card.success-accent-card {
    background: linear-gradient(180deg, #FFFFFF 0%, #F1FBF7 100%);
}

.soft-accent-card.warning-accent-card {
    background: linear-gradient(180deg, #FFFFFF 0%, #FFF8EE 100%);
}

.soft-accent-card.info-accent-card {
    background: linear-gradient(180deg, #FFFFFF 0%, #EFF6FF 100%);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.stat-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-sub);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.stat-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.stat-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: var(--border-radius-md);
    background: rgba(79, 70, 229, 0.06);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Wanda-ERP Gradient Stats Cards for Dashboard */
.kpi-card {
    position: relative;
    overflow: hidden;
    border: none;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.05);
    color: #ffffff !important;
}

.kpi-card::after {
    content: '';
    position: absolute;
    width: 130px;
    height: 130px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    bottom: -35px;
    right: -35px;
    pointer-events: none;
    z-index: 1;
}

.kpi-card::before {
    content: '';
    position: absolute;
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    bottom: 25px;
    right: 45px;
    pointer-events: none;
    z-index: 1;
}

.kpi-card.gradient-1 {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
}

.kpi-card.gradient-2 {
    background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%) !important;
}

.kpi-card.gradient-3 {
    background: linear-gradient(135deg, #34d399 0%, #059669 100%) !important;
}

.kpi-card.gradient-4 {
    background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%) !important;
}

.kpi-card .stat-icon-wrapper {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    border: none;
    z-index: 2;
}

.kpi-card .stat-title,
.kpi-card .stat-value,
.kpi-card .stat-desc,
.kpi-card .stat-desc strong {
    position: relative;
    z-index: 2;
    color: #ffffff !important;
}

/* Dashboard Section Divider Titles */
.dashboard-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-sub);
    margin-top: 36px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.dashboard-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
    opacity: 0.8;
}

/* --- Tables --- */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--border-radius-md);
}
.table-container::-webkit-scrollbar {
    height: 6px;
}
.table-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}
.table-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}
.table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

.custom-table, .data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th, .custom-table td,
.data-table th, .data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.custom-table th, .data-table th {
    background-color: #F8FAFC;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-table tr:hover, .data-table tr:hover {
    background-color: #F8FAFC;
}

.data-table {
    min-width: 720px;
}

.data-table td {
    vertical-align: top;
}

.cred-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    text-align: left;
    font-size: 13px;
}

.cred-table th, .cred-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.cred-table th {
    color: var(--text-sub);
    font-weight: 500;
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #D97706;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #DC2626;
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: #2563EB;
}

/* --- Forms & Controls --- */
.form-group {
    margin-bottom: 18px;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-sub);
}

.form-control {
    width: 100%;
    background-color: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px 16px;
    color: var(--text-main);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748B'%3E%3Cpath d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 18px;
    padding-right: 40px;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #3B82F6 100%);
    color: #FFF;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}

.btn-secondary {
    background: #FFFFFF;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #F1F5F9;
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: #FFF;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #DC2626 100%);
    color: #FFF;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #D97706 100%);
    color: #FFF;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.btn-warning:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
}

/* --- Section Headers --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

.page-subtitle {
    margin-top: 6px;
    color: var(--text-sub);
    font-size: 14px;
    line-height: 1.5;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 20px;
}

.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.panel-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 18px;
}

.stack-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 16px;
}

.field-hint {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.45;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}



.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: capitalize;
}

.status-assigned,
.status-draft {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
}

.status-active,
.status-self_review_submitted {
    background: rgba(37, 99, 235, 0.12);
    color: var(--info);
}

.status-manager_reviewed,
.status-closed {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
}

/* Responsive constraints */
@media (max-width: 992px) {
    .sidebar {
        width: 0;
        overflow: hidden;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .header {
        left: 0;
    }
}

@media (max-width: 1200px) {
    .main-content {
        padding: 20px;
        padding-top: calc(var(--header-height) + 20px);
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 22px;
    }

    .btn {
        width: 100%;
    }

    .page-header > * {
        width: 100%;
    }
}

/* --- Premium Theme Extensions --- */
.card-interactive {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}
.card-interactive:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    border-color: rgba(96, 165, 250, 0.3) !important;
}

/* Premium Pill Badges */
.badge-premium {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge-premium-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #34D399;
}
.badge-premium-info {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #60A5FA;
}
.badge-premium-warning {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #FBBF24;
}
.badge-premium-danger {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #F87171;
}

/* Modern Glassmorphic Quick View Modal Styles */
.quickview-modal {
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(15, 23, 42, 0.6); /* Slate dark overlay */
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: qvFadeIn 0.3s ease;
}

.quickview-modal-content {
    background: rgba(30, 41, 59, 0.85); /* Dark slate with opacity */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius-lg, 12px);
    width: 90%;
    max-width: 520px;
    color: #f1f5f9;
    animation: qvSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.quickview-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.quickview-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-light, #60a5fa);
}

.quickview-close-btn {
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.quickview-close-btn:hover {
    color: #f1f5f9;
}

.quickview-modal-body {
    padding: 20px;
}

.quickview-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.quickview-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quickview-info-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b; /* Slate secondary */
    font-weight: 500;
}

.quickview-info-value {
    font-size: 14px;
    color: #e2e8f0;
}

.quickview-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.3);
}

/* Animations */
@keyframes qvFadeIn {
    from { background-color: rgba(15, 23, 42, 0); backdrop-filter: blur(0px); }
    to { background-color: rgba(15, 23, 42, 0.6); backdrop-filter: blur(8px); }
}

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

/* Generic Admin Modals & Overlays */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.modal-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 500px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    transform: translateY(15px);
    transition: transform 0.2s ease;
    border: 1px solid var(--border-color);
}
.modal-overlay.active .modal-card {
    transform: translateY(0);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}
.modal-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}
.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}
.modal-close-btn:hover {
    color: var(--text-main);
}
.modal-meta-row {
    display: flex;
    margin-bottom: 10px;
    font-size: 13px;
}
.modal-meta-label {
    width: 150px;
    color: var(--text-sub);
    font-weight: 500;
}
.modal-meta-val {
    font-weight: 600;
    color: var(--text-main);
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
    margin-top: 14px;
}


/* Telemetry activity bar enhancements */
.telemetry-chart-container {
    background: rgba(15, 23, 42, 0.03);
    border-radius: var(--border-radius-md);
    padding: 20px;
    border: 1px solid var(--border);
}

.telemetry-chart-row {
    display: grid;
    grid-template-columns: 72px 1fr 110px;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border-radius: var(--border-radius-sm);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.telemetry-chart-row:hover {
    background: rgba(99, 102, 241, 0.05);
    transform: translateX(4px);
}

.telemetry-bar-fill {
    height: 100%;
    border-radius: 999px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.2);
    transition: width 0.6s ease;
}

.telemetry-bar-fill.total {
    background: linear-gradient(90deg, #60A5FA, #2563EB);
}

.telemetry-bar-fill.error {
    background: linear-gradient(90deg, #FCA5A5, #DC2626);
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.3);
}

/* Page Specific Adjustments */
.page-dashboard .main-content {
    padding-top: calc(var(--header-height) + 15px);
}
.page-dashboard .dashboard-section-title:first-of-type {
    margin-top: 15px;
}

/* --- Helper Utilities --- */
.text-right {
    text-align: right !important;
}
.text-center {
    text-align: center !important;
}

/* --- Consolidated Widget Styles --- */
.reports-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.reports-tabs-header {
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 18px;
    background: transparent;
    border: none;
    color: var(--text-sub);
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    background: var(--border-color);
    color: var(--text-main);
}

.tab-btn.active {
    background: var(--accent);
    color: #ffffff;
}

.tab-content {
    display: none;
}

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

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

.filter-bar {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 12px;
    color: var(--text-sub);
    font-weight: 500;
}

.filter-input {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 8px 12px;
    color: var(--text-main);
    font-size: 13.5px;
    outline: none;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.kpi-card .stat-header {
    margin-bottom: 6px;
}

.kpi-card .stat-value {
    font-size: 26px;
    margin-bottom: 2px;
}

.kpi-card:not([class*="gradient"])::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
}

.kpi-card.green::after { background: var(--green); }
.kpi-card.red::after { background: var(--red); }

.kpi-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.report-table th, .report-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.report-table th {
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
}

.report-table tr.total-row {
    background: #f1f5f9;
    font-weight: 700;
}

.report-table tr.total-row td {
    border-top: 2px solid var(--border-color);
}

/* Chat Layout Styles */
.chat-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--bg-surface);
    height: 550px;
    overflow: hidden;
}

.chat-sidebar {
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-title {
    padding: 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.agent-list {
    overflow-y: auto;
    flex: 1;
}

.agent-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.agent-item:hover, .agent-item.active {
    background: #f1f5f9;
}

.agent-name {
    font-weight: 500;
    font-size: 13.5px;
}

.agent-email {
    font-size: 11px;
    color: var(--text-muted);
}

.chat-main {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
}

.chat-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    font-size: 13.5px;
    line-height: 1.4;
}

.chat-bubble.agent {
    background: var(--border-color);
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 0;
}

.chat-bubble.admin {
    background: var(--accent);
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 0;
}

.chat-time {
    font-size: 9.5px;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: right;
}

.chat-input-area {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
}

.chat-textbox {
    flex: 1;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 10px 14px;
    color: var(--text-main);
    outline: none;
}

.chat-send-btn {
    padding: 8px 18px;
    background: var(--accent);
    border: none;
    color: #fff;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.chat-send-btn:hover {
    background: var(--accent-hover);
}

/* --- Pagination & Saved Views Styles --- */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    border-bottom-left-radius: var(--border-radius-lg);
    border-bottom-right-radius: var(--border-radius-lg);
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-info {
    font-size: 13.5px;
    color: var(--text-sub);
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border-radius: var(--border-radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-main);
    background: transparent;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.pagination-btn:hover {
    background: #F1F5F9;
    border-color: var(--text-muted);
}

.pagination-btn.active {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.pagination-btn.disabled {
    color: var(--text-muted);
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.pagination-btn.dots {
    border: none;
    cursor: default;
    pointer-events: none;
}

/* Saved Views Styles */
.saved-views-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.5);
    padding: 8px 16px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
}

.saved-views-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.saved-views-list {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.saved-view-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.saved-view-tag:hover {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.05);
}

.saved-view-tag.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.saved-view-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.saved-view-delete:hover {
    background: var(--danger);
    color: #ffffff;
}

.saved-view-save-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px dashed var(--accent);
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.saved-view-save-btn:hover {
    background: rgba(59, 130, 246, 0.05);
}

/* Centralized Workflow Timeline CSS Styles */
.workflow-timeline {
    position: relative;
    padding-left: 24px;
    margin: 16px 0;
    border-left: 2px solid var(--border-color, #E2E8F0);
}

.workflow-timeline-item {
    position: relative;
    margin-bottom: 20px;
}

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

.workflow-timeline-marker {
    position: absolute;
    left: -31px;
    top: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary, #3B82F6);
    border: 2px solid var(--bg-card, #FFFFFF);
}

.workflow-timeline-item.approve .workflow-timeline-marker {
    background: var(--success, #10B981);
}

.workflow-timeline-item.reject .workflow-timeline-marker {
    background: var(--danger, #EF4444);
}

.workflow-timeline-item.submit .workflow-timeline-marker {
    background: var(--info, #3B82F6);
}

.workflow-timeline-time {
    font-size: 11px;
    color: var(--text-muted);
}

.workflow-timeline-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-main);
}

.workflow-timeline-note {
    font-size: 12.5px;
    color: var(--text-sub);
    margin-top: 4px;
    font-style: italic;
    background: rgba(0, 0, 0, 0.02);
    padding: 6px 10px;
    border-radius: var(--border-radius-sm, 6px);
}

