/* ========================================
   HRIS - Human Resource Information System
   Professional Turquoise & Clean White Theme
   ======================================== */

/* ===== CSS Variables ===== */
:root {
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #14b8a6;
    --primary-50: #f5faf9;
    --primary-100: #e0f5f2;
    --primary-200: #b8e8e1;
    --primary-300: #7dd4c9;
    --primary-400: #3cbfb0;
    --primary-500: #14b8a6;
    --primary-600: #0d9488;
    --primary-700: #0f766e;
    --primary-800: #115e59;
    --primary-900: #134e4a;
    --primary-950: #042f2e;

    /* Sidebar dark turquoise theme */
    --sidebar-bg: #0f766e;
    --sidebar-border: rgba(255,255,255,0.08);
    --sidebar-text: rgba(255,255,255,0.6);
    --sidebar-text-hover: #ffffff;
    --sidebar-hover: rgba(255,255,255,0.1);
    --sidebar-active-bg: rgba(255,255,255,0.15);
    --sidebar-active-text: #ffffff;
    --sidebar-active-border: #5eead4;
    --sidebar-header-bg: #0d6b63;
    --white: #ffffff;
    --black: #000000;
    --gray-50: #fafbfc;
    --gray-100: #f4f5f7;
    --gray-200: #e8eaed;
    --gray-300: #d4d8de;
    --gray-400: #a3aab4;
    --gray-500: #7c8594;
    --gray-600: #556070;
    --gray-700: #3d4a5c;
    --gray-800: #2d3748;
    --gray-900: #1a2332;
    --success: #10b981;
    --success-light: #d1fae5;
    --success-dark: #065f46;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-dark: #92400e;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --danger-dark: #991b1b;
    --info: #3b82f6;
    --info-light: #dbeafe;
    --info-dark: #1e40af;
    --purple: #8b5cf6;
    --purple-light: #ede9fe;
    --pink: #ec4899;
    --pink-light: #fce7f3;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.03);
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 2px 8px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 6px 16px rgba(0,0,0,0.07), 0 2px 6px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 24px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.1), 0 8px 16px rgba(0,0,0,0.05);
    --shadow-primary: 0 3px 10px rgba(13,148,136,0.12);
    --shadow-primary-lg: 0 6px 20px rgba(13,148,136,0.15);
    --radius-sm: 0.5rem;
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-full: 9999px;
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Soft visible borders */
    --card-border: #dfe3e8;
    --divider: #eef0f4;
    --card-border-hover: #cdd3da;

    /* Theme accent variables (overridden by theme-system.css) */
    --theme-accent: #5eead4;
    --theme-accent-rgb: 94, 234, 212;
    --theme-primary-rgb: 13, 148, 136;
    --sidebar-bg: #0f766e;
    --sidebar-bg-gradient: linear-gradient(180deg, #0f766e 0%, #115e59 100%);
    --sidebar-header-bg: #0d6b63;
    --sidebar-active-border: #5eead4;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--theme-primary-rgb),0.2); }
    50% { box-shadow: 0 0 0 6px rgba(var(--theme-primary-rgb),0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes slideToastIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideToastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes ripple {
    0% { transform: scale(0); opacity: 0.6; }
    100% { transform: scale(4); opacity: 0; }
}

/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f8f9fb;
    color: var(--gray-800);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }
.sidebar::-webkit-scrollbar-thumb { background: var(--gray-200); }
.sidebar::-webkit-scrollbar-thumb:hover { background: var(--gray-300); }

/* ===== Selection ===== */
::selection { background: var(--primary-100); color: var(--primary-800); }

/* ===== Login Page ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-950) 0%, var(--primary-800) 30%, var(--primary) 70%, var(--primary-300) 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    top: -200px;
    right: -200px;
    animation: float 8s ease-in-out infinite;
}

.login-container::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    bottom: -100px;
    left: -100px;
    animation: float 6s ease-in-out infinite reverse;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    animation: fadeInUp 0.6s ease-out;
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
    z-index: 1;
}

.login-card .logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-card .logo-icon {
    width: 56px;
    height: 56px;
    background: var(--primary);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-primary);
    animation: pulseGlow 2s ease-in-out infinite;
}

.login-card .logo h1 {
    color: var(--primary-900);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.login-card .logo p {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-top: 0.375rem;
    font-weight: 400;
}

/* ===== Form Elements ===== */
.form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
    transition: color var(--transition-fast);
}

.form-group:focus-within label {
    color: var(--primary);
}

.form-input, .form-select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: inherit;
    transition: all var(--transition);
    outline: none;
    background: var(--white);
    color: var(--gray-800);
}

.form-input:hover, .form-select:hover {
    border-color: var(--gray-300);
}

.form-input:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-100);
    background: var(--white);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-input.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px var(--danger-light);
}

textarea.form-input {
    resize: vertical;
    min-height: 60px;
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 2.5rem;
}

/* ===== Floating Label Support ===== */
.floating-label {
    position: relative;
}

.floating-label .form-input {
    padding-top: 1.25rem;
    padding-bottom: 0.25rem;
}

.floating-label label {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
    color: var(--gray-400);
    pointer-events: none;
    transition: all var(--transition);
    background: transparent;
    margin-bottom: 0;
    font-weight: 500;
}

.floating-label .form-input:focus ~ label,
.floating-label .form-input:not(:placeholder-shown) ~ label {
    top: 0.5rem;
    transform: translateY(0);
    font-size: 0.6875rem;
    color: var(--primary);
    font-weight: 600;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow-primary);
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: var(--shadow-primary-lg);
    transform: translateY(-1px);
}

.btn-login {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    letter-spacing: 0.025em;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
}

.btn-success {
    background: var(--success);
    color: var(--white);
    box-shadow: 0 3px 10px rgba(16,185,129,0.2);
}
.btn-success:hover:not(:disabled) {
    box-shadow: 0 5px 15px rgba(16,185,129,0.3);
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--warning);
    color: var(--white);
    box-shadow: 0 3px 10px rgba(245,158,11,0.2);
}
.btn-warning:hover:not(:disabled) {
    box-shadow: 0 5px 15px rgba(245,158,11,0.3);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
    box-shadow: 0 3px 10px rgba(239,68,68,0.2);
}
.btn-danger:hover:not(:disabled) {
    box-shadow: 0 5px 15px rgba(239,68,68,0.3);
    transform: translateY(-1px);
}

.btn-info {
    background: var(--info);
    color: var(--white);
    box-shadow: 0 3px 10px rgba(59,130,246,0.2);
}
.btn-info:hover:not(:disabled) {
    box-shadow: 0 5px 15px rgba(59,130,246,0.3);
    transform: translateY(-1px);
}

.btn-outline {
    background: var(--white);
    border: 2px solid var(--gray-200);
    color: var(--gray-700);
}
.btn-outline:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-50);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
}
.btn-ghost:hover:not(:disabled) {
    background: var(--gray-100);
    color: var(--gray-800);
}

/* ===== Login Error ===== */
.login-error {
    background: var(--danger-light);
    color: var(--danger-dark);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    margin-bottom: 1rem;
    display: none;
    animation: fadeIn 0.3s ease-out;
    border-left: 3px solid var(--danger);
}

.login-demo {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--divider);
    font-size: 0.8125rem;
    color: var(--gray-500);
    text-align: center;
}

.login-demo code {
    background: var(--primary-50);
    color: var(--primary-700);
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--primary-100);
}

/* ===== Admin Layout ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar — Mini 60px shortcut rail ===== */
.sidebar {
    width: 60px;
    background: linear-gradient(180deg, var(--primary-700) 0%, var(--primary-800) 100%);
    color: rgba(255,255,255,0.7);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 40;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(var(--theme-primary-rgb),0.2);
}

/* Legacy sidebar selectors — kept for compatibility but styled for mini sidebar */
.sidebar-header { display: none; }
.sidebar-nav { display: none; }
.sidebar-footer { display: none; }
.nav-item { display: none; }
.nav-section { display: none; }
.nav-submenu { display: none; }
.sidebar-user-card { display: none; }
.sidebar-user-avatar { display: none; }
.sidebar-user-info { display: none; }
.sidebar-user-name { display: none; }
.sidebar-user-role { display: none; }
.sidebar-logout-btn { display: none; }
.sidebar-collapse-btn { display: none; }

/* Collapsed state — no longer needed, sidebar is always mini */
.sidebar.collapsed { width: 60px; }
.sidebar.collapsed .sidebar-header h2,
.sidebar.collapsed .sidebar-header p,
.sidebar.collapsed .nav-item-text,
.sidebar.collapsed .nav-tree-count,
.sidebar.collapsed .nav-tree-arrow,
.sidebar.collapsed .nav-tree-children,
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .sidebar-logout-btn,
.sidebar.collapsed .sidebar-collapse-btn span,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .tree-connector { display: none; }

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: 60px;
    min-height: 100vh;
    padding-top: 59px;
    display: flex;
    flex-direction: column;
    max-width: calc(100vw - 60px);
    overflow-x: hidden;
}
.main-content.sidebar-collapsed {
    margin-left: 60px;
}

/* ===== Top Bar ===== */
.top-bar {
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--divider);
    padding: 0.875rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 30;
}

.top-bar .page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.top-bar .page-subtitle {
    font-size: 0.8125rem;
    color: var(--gray-500);
    font-weight: 400;
    margin-top: 0.0625rem;
}

.top-bar .user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.top-bar .user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
}

.top-bar .user-role {
    font-size: 0.6875rem;
    color: var(--gray-500);
    font-weight: 500;
}

.top-bar .user-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius);
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    box-shadow: var(--shadow-primary);
}

/* ===== Page Content ===== */
.page-content {
    padding: 2rem;
    flex: 1;
    animation: fadeIn 0.4s ease-out;
    max-width: 100%;
    overflow-x: hidden;
}

/* ===== Cards ===== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--card-border);
    transition: all var(--transition);
    overflow: visible;
}

.card:hover {
    box-shadow: var(--shadow);
    border-color: var(--card-border-hover);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--divider);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.01em;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--divider);
    background: var(--gray-50);
}

/* ===== Stat Cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-radius: 0 0 0 80px;
    opacity: 0.04;
    transition: all var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::after {
    width: 120px;
    height: 120px;
    opacity: 0.08;
}

.stat-card.turquoise::after { background: var(--primary); }
.stat-card.green::after { background: var(--success); }
.stat-card.orange::after { background: var(--warning); }
.stat-card.red::after { background: var(--danger); }
.stat-card.blue::after { background: var(--info); }
.stat-card.purple::after { background: var(--purple); }

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-icon.turquoise { background: var(--primary-100); color: var(--primary-700); }
.stat-icon.green { background: #d1fae5; color: #065f46; }
.stat-icon.orange { background: #fef3c7; color: #92400e; }
.stat-icon.red { background: #fee2e2; color: #991b1b; }
.stat-icon.blue { background: #dbeafe; color: #1e40af; }
.stat-icon.purple { background: #ede9fe; color: #5b21b6; }

.stat-info { flex: 1; }
.stat-info h4 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
    letter-spacing: -0.03em;
    animation: countUp 0.5s ease-out;
}
.stat-info p {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 0.375rem;
    font-weight: 500;
}
.stat-info .stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.375rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
}
.stat-trend.up { color: var(--success-dark); background: var(--success-light); }
.stat-trend.down { color: var(--danger-dark); background: var(--danger-light); }

/* ===== Tables ===== */
.table-container {
    overflow-x: auto;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.table-search {
    position: relative;
    min-width: 250px;
}

.table-search .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    width: 1rem;
    height: 1rem;
}

.table-search input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    transition: all var(--transition);
    outline: none;
    font-family: inherit;
}

.table-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-100);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    position: sticky;
    top: 0;
    z-index: 5;
}

table th {
    background: var(--gray-50);
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

table td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--divider);
    transition: background var(--transition-fast);
}

table tbody tr {
    transition: all var(--transition-fast);
}

table tbody tr:hover td {
    background: var(--primary-50);
    color: var(--gray-800);
}

table tbody tr:hover {
    transform: none;
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1875rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.badge-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.6;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; animation: pulse 2s ease-in-out infinite; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-primary { background: var(--primary-100); color: var(--primary-800); }

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
    padding: 1rem;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-spring);
}

.modal-overlay.show .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--divider);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 2;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-header h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-close {
    background: var(--gray-100);
    border: none;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius);
    font-size: 1.125rem;
    color: var(--gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.modal-body { padding: 1.5rem; }

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--divider);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ===== Form Grid ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-grid .full-width { grid-column: 1 / -1; }

.form-section-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary);
    margin: 1.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-100);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section-title svg {
    width: 1rem;
    height: 1rem;
}

/* ===== Enhanced Form Section Cards ===== */
.form-section-card {
    background: linear-gradient(135deg, #f8fffe, var(--primary-50));
    border: 1px solid rgba(var(--theme-primary-rgb),0.12);
    border-left: 3px solid var(--primary);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 0.5rem;
    position: relative;
    overflow: visible;
}
.form-section-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle at top right, rgba(var(--theme-primary-rgb),0.06), transparent 70%);
    pointer-events: none;
}
.form-section-card + .form-section-card {
    margin-top: 0.5rem;
}

/* Section step number badge */
.section-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-500));
    color: white;
    font-weight: 700;
    font-size: 0.6875rem;
    margin-right: 0.5rem;
    box-shadow: 0 2px 4px rgba(var(--theme-primary-rgb),0.2);
    flex-shrink: 0;
}

/* Input Icon Group */
.input-icon-group {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon-prefix {
    position: absolute;
    left: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    transition: color 0.2s ease;
    z-index: 1;
    pointer-events: none;
}
.input-icon-group:focus-within .input-icon-prefix {
    color: var(--primary);
}
.form-group .form-input.has-icon-prefix,
.form-group select.form-input.has-icon-prefix,
.form-group textarea.form-input.has-icon-prefix {
    padding-left: 2.5rem;
}
.input-icon-suffix {
    position: absolute;
    right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    font-weight: 600;
    font-size: 0.875rem;
    z-index: 1;
    pointer-events: none;
}
.form-group .form-input.has-icon-suffix {
    padding-right: 2.5rem;
}
/* Form hint text */
.form-group .form-hint {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
    margin-bottom: 0;
    line-height: 1.4;
}

/* Required dot and optional tag in labels */
.form-group label .required-dot {
    color: #ef4444;
    font-weight: 700;
    font-size: 0.75rem;
    line-height: 1;
}
.form-group label .optional-tag {
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--gray-400);
    background: var(--gray-100);
    padding: 0.0625rem 0.375rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-left: auto;
}

/* Enhanced form inputs */
.form-group .form-input,
.form-group select.form-input {
    transition: all 0.2s ease;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    background: var(--white);
    min-height: 40px;
}
.form-group .form-input:hover {
    border-color: var(--gray-300);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.form-group .form-input:focus,
.form-group select.form-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb),0.12), 0 1px 3px rgba(var(--theme-primary-rgb),0.08) !important;
    outline: none;
}
.form-group .form-input::placeholder {
    color: var(--gray-400);
    font-size: 0.8125rem;
}
.form-group textarea.form-input {
    resize: vertical;
    min-height: 60px;
    line-height: 1.6;
}

/* Enhanced select with teal chevron */
select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230d9488' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    padding-right: 2.5rem !important;
    cursor: pointer;
}

/* Field hint */
.form-group .field-hint {
    font-size: 0.6875rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(var(--theme-primary-rgb),0.04);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(var(--theme-primary-rgb),0.08);
}
.form-group .field-hint svg {
    flex-shrink: 0;
    opacity: 0.6;
}

/* Enhanced toggle switch */
.form-group .toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    transition: all 0.2s ease;
    width: fit-content;
    cursor: pointer;
}
.form-group .toggle-switch:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}
.form-group .toggle-switch input[type="checkbox"] {
    width: 0;
    height: 0;
    opacity: 0;
    position: absolute;
}
.form-group .toggle-slider {
    width: 40px;
    height: 22px;
    background: var(--gray-300);
    border-radius: 11px;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.form-group .toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.form-group .toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}
.form-group .toggle-switch input:checked + .toggle-slider::after {
    transform: translateX(18px);
}
.form-group .toggle-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-700);
}

/* Toggle status text */
.toggle-status-text {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    transition: all 0.25s ease;
    margin-left: 0.5rem;
}
.toggle-status-text.active {
    background: #d1fae5;
    color: #065f46;
}
.toggle-status-text.inactive {
    background: var(--gray-100);
    color: var(--gray-500);
}

/* Toggle glow when active */
.form-group .toggle-switch.active-glow {
    background: #ecfdf5;
    border-color: #6ee7b7;
    box-shadow: 0 0 0 2px rgba(34,197,94,0.1);
}

/* Modal footer shadow */
.modal-v2-footer {
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}

/* Divider with label */
.section-divider-labeled {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    grid-column: 1 / -1;
    margin: 0.75rem 0 0.25rem;
}
.section-divider-labeled::before,
.section-divider-labeled::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gray-200), transparent);
}
.section-divider-labeled span {
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    max-width: 420px;
    animation: slideToastIn 0.4s var(--transition-spring);
    pointer-events: auto;
    border-left: 4px solid var(--gray-400);
}

.toast.removing { animation: slideToastOut 0.3s ease-in forwards; }
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-danger { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-info { border-left-color: var(--info); }

.toast-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}
.toast.toast-success .toast-icon { color: var(--success); }
.toast.toast-danger .toast-icon { color: var(--danger); }
.toast.toast-warning .toast-icon { color: var(--warning); }
.toast.toast-info .toast-icon { color: var(--info); }

.toast-message {
    font-size: 0.8125rem;
    color: var(--gray-700);
    flex: 1;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.125rem;
    transition: color var(--transition-fast);
}
.toast-close:hover { color: var(--gray-600); }

/* ===== Skeleton Loading ===== */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text { height: 0.875rem; margin-bottom: 0.5rem; }
.skeleton-text.w-75 { width: 75%; }
.skeleton-text.w-50 { width: 50%; }
.skeleton-heading { height: 1.5rem; width: 60%; margin-bottom: 0.75rem; }
.skeleton-avatar { width: 2.5rem; height: 2.5rem; border-radius: 50%; }
.skeleton-card { height: 100px; }

/* ===== ESS Layout ===== */
.ess-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--gray-50);
}

.ess-topnav {
    background: var(--primary);
    color: var(--white);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 1px 4px rgba(var(--theme-primary-rgb),0.1);
}

.ess-topnav .brand {
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ess-topnav .brand-icon {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ess-topnav .nav-links {
    display: flex;
    gap: 0.25rem;
}

.ess-topnav .nav-link {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition);
    position: relative;
}

.ess-topnav .nav-link:hover {
    color: var(--white);
    background: rgba(255,255,255,0.1);
}

.ess-topnav .nav-link.active {
    color: var(--white);
    background: rgba(255,255,255,0.15);
    font-weight: 600;
}

.ess-topnav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -0.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: 1.5rem;
    height: 2px;
    background: var(--white);
    border-radius: var(--radius-full);
}

.ess-content {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    animation: fadeIn 0.4s ease-out;
}

.ess-welcome {
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius-xl);
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(var(--theme-primary-rgb),0.12);
}

.ess-welcome::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -25%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.ess-welcome::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: 10%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
}

.ess-welcome h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

.ess-welcome p {
    opacity: 0.85;
    font-size: 0.9375rem;
    margin-top: 0.375rem;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

.ess-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--divider);
    transition: background var(--transition-fast);
}

.info-item:last-child { border-bottom: none; }
.info-item:hover { background: var(--primary-50); margin: 0 -0.5rem; padding: 0.625rem 0.5rem; border-radius: var(--radius-sm); }

.info-item .label {
    font-size: 0.8125rem;
    color: var(--gray-500);
    font-weight: 500;
}

.info-item .value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
    text-align: right;
}

/* ===== Timeline ===== */
.timeline {
    position: relative;
    padding-left: 2.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.625rem;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-200), var(--primary-100));
    border-radius: var(--radius-full);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.75rem;
    animation: fadeInUp 0.4s ease-out both;
}

.timeline-item:nth-child(1) { animation-delay: 0.05s; }
.timeline-item:nth-child(2) { animation-delay: 0.1s; }
.timeline-item:nth-child(3) { animation-delay: 0.15s; }
.timeline-item:nth-child(4) { animation-delay: 0.2s; }
.timeline-item:nth-child(5) { animation-delay: 0.25s; }

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0.375rem;
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--white);
    box-shadow: 0 0 0 2px var(--primary-100), var(--shadow-xs);
    z-index: 1;
}

.timeline-item .date {
    font-size: 0.75rem;
    color: var(--gray-400);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.timeline-item .title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.timeline-item .desc {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin-top: 0.375rem;
    line-height: 1.5;
}

/* ===== Progress Bar ===== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--primary);
    transition: width 1s ease-out;
}

.progress-bar-sm { height: 4px; }
.progress-bar-lg { height: 12px; }

.progress-fill.success { background: var(--success); }
.progress-fill.warning { background: var(--warning); }
.progress-fill.danger { background: var(--danger); }

/* ===== Tooltip ===== */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: var(--gray-900);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    pointer-events: none;
    z-index: 10;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}

.tooltip-bottom::after {
    bottom: auto;
    top: 100%;
    transform: translateX(-50%) translateY(4px);
}

.tooltip-bottom:hover::after {
    transform: translateX(-50%) translateY(8px);
}

.tooltip-left::after {
    bottom: auto;
    left: auto;
    right: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
}

.tooltip-left:hover::after {
    transform: translateY(-50%) translateX(-8px);
}

.tooltip-right::after {
    bottom: auto;
    left: 100%;
    top: 50%;
    transform: translateY(-50%) translateX(4px);
}

.tooltip-right:hover::after {
    transform: translateY(-50%) translateX(8px);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray-400);
}

.empty-state svg {
    width: 4rem;
    height: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.empty-state p {
    font-size: 0.875rem;
}

/* ===== Loading Spinner ===== */
.spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner-lg { width: 2.5rem; height: 2.5rem; border-width: 3px; }

/* ===== Filter Tabs ===== */
.filter-tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--gray-100);
    padding: 0.25rem;
    border-radius: var(--radius);
    width: fit-content;
}

.filter-tab {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-500);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.filter-tab:hover { color: var(--gray-700); }

.filter-tab.active {
    background: var(--white);
    color: var(--primary-700);
    box-shadow: var(--shadow-xs);
}

/* ===== Custom Dropdown/Select ===== */
.custom-select {
    position: relative;
    display: inline-block;
}

.custom-select select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 0.875rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--white);
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
}

.custom-select select:hover {
    border-color: var(--gray-300);
}

.custom-select select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-100);
}

.custom-select::after {
    content: '';
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--gray-400);
    pointer-events: none;
    transition: border-color var(--transition-fast);
}

.custom-select:hover::after {
    border-top-color: var(--gray-600);
}

.custom-select:focus-within::after {
    border-top-color: var(--primary);
}

/* ===== Glassmorphism Card ===== */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow);
    transition: all var(--transition);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: var(--shadow-md);
}

/* ===== Animated Counter ===== */
.counter {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

.counter-animate {
    animation: countUp 0.5s ease-out;
}

/* ===== Dot Indicator ===== */
.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot-success { background: var(--success); }
.dot-warning { background: var(--warning); animation: pulse 2s ease-in-out infinite; }
.dot-danger { background: var(--danger); }
.dot-info { background: var(--info); }
.dot-gray { background: var(--gray-400); }

/* ===== Avatar Group ===== */
.avatar-group {
    display: flex;
}

.avatar-group .avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px solid var(--white);
    margin-left: -0.5rem;
    background: linear-gradient(135deg, var(--primary-200), var(--primary-300));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 700;
    color: var(--primary-800);
    transition: all var(--transition-fast);
}

.avatar-group .avatar:first-child { margin-left: 0; }
.avatar-group .avatar:hover { z-index: 1; transform: scale(1.15); }

/* ===== Tab Navigation ===== */
.tab-nav {
    display: flex;
    border-bottom: 2px solid var(--divider);
    gap: 0;
}

.tab-nav-item {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-fast);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
}

.tab-nav-item:hover {
    color: var(--gray-700);
}

.tab-nav-item.active {
    color: var(--primary);
    font-weight: 600;
    border-bottom-color: var(--primary);
}

/* ===== Alert/Callout ===== */
.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border: 1px solid;
}

.alert-success {
    background: var(--success-light);
    border-color: #a7f3d0;
    color: var(--success-dark);
}

.alert-warning {
    background: var(--warning-light);
    border-color: #fde68a;
    color: var(--warning-dark);
}

.alert-danger {
    background: var(--danger-light);
    border-color: #fecaca;
    color: var(--danger-dark);
}

.alert-info {
    background: var(--info-light);
    border-color: #bfdbfe;
    color: var(--info-dark);
}

/* ===== Divider ===== */
.divider {
    height: 1px;
    background: var(--gray-200);
    margin: 1.5rem 0;
}

.divider-text {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--gray-400);
    font-size: 0.8125rem;
}

.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

/* ===== Switch Toggle ===== */
.switch {
    position: relative;
    width: 2.75rem;
    height: 1.5rem;
    display: inline-block;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    transition: all var(--transition);
}

.switch-slider::before {
    content: '';
    position: absolute;
    height: 1.125rem;
    width: 1.125rem;
    left: 0.1875rem;
    bottom: 0.1875rem;
    background: var(--white);
    border-radius: 50%;
    transition: all var(--transition);
    box-shadow: var(--shadow-xs);
}

.switch input:checked + .switch-slider {
    background: var(--primary);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(1.25rem);
}

.switch input:focus + .switch-slider {
    box-shadow: 0 0 0 4px var(--primary-100);
}

/* ===== Checkbox Custom ===== */
.checkbox-custom {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.checkbox-custom input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid var(--gray-300);
    border-radius: 0.25rem;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    flex-shrink: 0;
}

.checkbox-custom input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-custom input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 4px;
    width: 5px;
    height: 9px;
    border: solid var(--white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-custom input[type="checkbox"]:focus {
    box-shadow: 0 0 0 4px var(--primary-100);
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-600);
    background: var(--white);
    border: 1px solid var(--gray-200);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.pagination-btn:hover {
    background: var(--primary-50);
    border-color: var(--primary-200);
    color: var(--primary);
}

.pagination-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
    font-weight: 600;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== Tag/Chip ===== */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.tag:hover {
    background: var(--gray-200);
}

.tag-remove {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0;
    line-height: 1;
    transition: color var(--transition-fast);
}

.tag-remove:hover {
    color: var(--danger);
}

/* ===== Stepper ===== */
.stepper {
    display: flex;
    align-items: center;
}

.step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.step-number {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid var(--gray-300);
    color: var(--gray-400);
    background: var(--white);
    transition: all var(--transition);
}

.step.active .step-number {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow-primary);
}

.step.completed .step-number {
    border-color: var(--success);
    background: var(--success);
    color: var(--white);
}

.step-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-400);
}

.step.active .step-label {
    color: var(--primary);
    font-weight: 600;
}

.step.completed .step-label {
    color: var(--success);
}

.step-connector {
    width: 2rem;
    height: 2px;
    background: var(--gray-200);
    margin: 0 0.5rem;
    transition: background var(--transition);
}

.step-connector.completed {
    background: var(--success);
}

/* ===== Notification Dropdown ===== */
.notification-bell {
    position: relative;
    cursor: pointer;
}

.notification-bell .bell-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--gray-600);
    transition: color var(--transition-fast);
}

.notification-bell:hover .bell-icon {
    color: var(--primary);
}

.notification-bell .count {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 1rem;
    height: 1rem;
    background: var(--danger);
    color: var(--white);
    font-size: 0.5625rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white);
    animation: scaleIn 0.3s ease-out;
}

/* ===== Status Dot Animation ===== */
.status-online {
    position: relative;
}

.status-online::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: var(--success);
    border: 2px solid var(--white);
    border-radius: 50%;
}

.status-online::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    animation: pulseGlow 2s ease-in-out infinite;
}

/* ===== Sidebar Overlay (legacy — no longer used for mini sidebar) ===== */
.sidebar-overlay {
    display: none !important;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 35;
    backdrop-filter: blur(2px);
    transition: opacity var(--transition);
}

.sidebar-overlay.show {
    display: none !important;
}

/* ===== Mobile Menu Button ===== */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--gray-600);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.menu-toggle:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

@media (max-width: 1024px) {
    .menu-toggle { display: flex; }
}

/* ===== Accordion ===== */
.accordion {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid var(--divider);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--gray-800);
    background: var(--white);
    transition: background var(--transition-fast);
}

.accordion-header:hover {
    background: var(--gray-50);
}

.accordion-header .accordion-icon {
    transition: transform var(--transition);
    color: var(--gray-400);
}

.accordion-item.open .accordion-header .accordion-icon {
    transform: rotate(180deg);
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
}

.accordion-item.open .accordion-body {
    max-height: 500px;
}

.accordion-body-inner {
    padding: 0 1.25rem 1rem;
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.6;
}

/* ===== Image Avatar ===== */
.avatar-img {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--white);
    box-shadow: var(--shadow-xs);
}

.avatar-sm { width: 2rem; height: 2rem; }
.avatar-lg { width: 3.5rem; height: 3.5rem; }
.avatar-xl { width: 5rem; height: 5rem; }

.avatar-square { border-radius: var(--radius); }

/* ===== Data List ===== */
.data-list {
    list-style: none;
}

.data-list-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--divider);
    transition: background var(--transition-fast);
}

.data-list-item:last-child {
    border-bottom: none;
}

.data-list-item:hover {
    background: var(--primary-50);
}

/* ===== Stat Mini ===== */
.stat-mini {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-mini .stat-mini-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-mini .stat-mini-label {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ===== Streak / Activity Heatmap ===== */
.activity-cell {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: var(--gray-100);
    transition: all var(--transition-fast);
}

.activity-cell:hover {
    transform: scale(1.5);
}

.activity-cell.level-1 { background: var(--primary-100); }
.activity-cell.level-2 { background: var(--primary-200); }
.activity-cell.level-3 { background: var(--primary-400); }
.activity-cell.level-4 { background: var(--primary-600); }

/* ===== Chart Container ===== */
.chart-container {
    position: relative;
    width: 100%;
    min-height: 250px;
    padding: 1rem;
}

/* ===== Print Styles ===== */
@media print {
    .sidebar,
    .top-bar,
    .ess-topnav,
    .btn,
    .modal-overlay,
    .toast-container {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding-top: 0 !important;
    }

    .page-content {
        padding: 0 !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    body {
        background: white !important;
    }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .sidebar { width: 60px !important; }
    .main-content { margin-left: 60px !important; }
    .main-content.sidebar-collapsed { margin-left: 60px !important; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar { display: none !important; }
    .main-content { margin-left: 0 !important; padding-bottom: 56px; padding-top: 59px; max-width: 100vw; }
    .main-content.sidebar-collapsed { margin-left: 0 !important; }
    .form-grid { grid-template-columns: 1fr; }
    .page-content { padding: 1rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .ess-topnav { padding: 0 1rem; height: 3.5rem; }
    .ess-topnav .nav-links { gap: 0; }
    .ess-topnav .nav-link { padding: 0.5rem 0.5rem; font-size: 0.8125rem; }
    .ess-content { padding: 1rem; }
    .modal { max-width: calc(100vw - 2rem); }
    .table-toolbar { flex-direction: column; align-items: stretch; }
    .table-search { min-width: unset; }
    .stat-card { padding: 1rem; }
    .stat-info h4 { font-size: 1.375rem; }
    .tab-nav { overflow-x: auto; }
    .stepper { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .ess-info-grid { grid-template-columns: 1fr; }
    .top-bar { padding: 0.75rem 1rem; }
    .login-card { padding: 1.5rem; }
    .ess-welcome { padding: 1.25rem; }
    .ess-welcome h2 { font-size: 1.25rem; }
    .filter-tabs { width: 100%; overflow-x: auto; }
    .pagination { flex-wrap: wrap; justify-content: center; }
}

/* ===== Utilities ===== */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }
.text-purple { color: var(--purple); }
.text-pink { color: var(--pink); }
.text-gray { color: var(--gray-500); }
.text-white { color: var(--white); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.font-bold { font-weight: 700; }
.font-semi { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-normal { font-weight: 400; }
.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }
.leading-tight { line-height: 1.25; }
.leading-normal { line-height: 1.5; }
.tracking-tight { letter-spacing: -0.02em; }
.tracking-wide { letter-spacing: 0.05em; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.ml-2 { margin-left: 0.5rem; }
.mr-2 { margin-right: 0.5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.justify-start { justify-content: flex-start; }
.w-full { width: 100%; }
.w-auto { width: auto; }
.h-full { height: 100%; }
.min-w-0 { min-width: 0; }
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }
.border { border: 1px solid var(--gray-200); }
.border-b { border-bottom: 1px solid var(--gray-200); }
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.bg-white { background: var(--white); }
.bg-gray-50 { background: var(--gray-50); }
.bg-primary { background: var(--primary); }
.no-underline { text-decoration: none; }
.list-none { list-style: none; }

/* ========================================
   MODERN CSS ENHANCEMENTS V2
   Enhanced components for HRIS
   ======================================== */

/* ===== New Keyframe Animations ===== */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeScale {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes shineSweep {
    0% { left: -100%; }
    100% { left: 200%; }
}

@keyframes gradientRotate {
    0% { --gradient-angle: 0deg; }
    100% { --gradient-angle: 360deg; }
}

@keyframes borderPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes countUpV2 {
    0% { opacity: 0; transform: translateY(12px); }
    60% { opacity: 1; transform: translateY(-2px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes sparklineDraw {
    from { stroke-dashoffset: 200; }
    to { stroke-dashoffset: 0; }
}

/* ===== 1. Modern Page Headers ===== */
.page-header {
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--card-border);
}

.page-header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    gap: 1rem;
    position: relative;
}

.page-header-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--primary-300));
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.page-header-title h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.page-header-title p {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
    font-weight: 400;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ===== 2. Modern Stat Cards V2 ===== */
.stat-card-v2 {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
    border: 1px solid var(--card-border);
    animation: fadeScale 0.5s ease-out both;
}

.stat-card-v2::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 2px;
    background: linear-gradient(135deg, transparent 40%, var(--primary-200) 50%, transparent 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--transition);
}

.stat-card-v2:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-card-v2:hover::before {
    opacity: 1;
}

.stat-card-v2 .stat-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card-v2 .stat-label svg,
.stat-card-v2 .stat-label .icon {
    width: 1rem;
    height: 1rem;
    opacity: 0.6;
}

.stat-card-v2 .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.04em;
    line-height: 1;
    margin-top: 0.75rem;
    animation: countUpV2 0.6s ease-out both;
}

.stat-card-v2 .stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 0.5rem;
    padding: 0.1875rem 0.5rem;
    border-radius: var(--radius-full);
}

.stat-card-v2 .stat-trend.up {
    color: var(--success-dark);
    background: var(--success-light);
}

.stat-card-v2 .stat-trend.down {
    color: var(--danger-dark);
    background: var(--danger-light);
}

.stat-card-v2 .stat-trend svg {
    width: 0.75rem;
    height: 0.75rem;
}

.stat-card-v2 .stat-chart {
    margin-top: 0.75rem;
    height: 32px;
    position: relative;
    overflow: hidden;
}

.stat-card-v2 .stat-chart svg {
    width: 100%;
    height: 100%;
}

.stat-card-v2 .stat-chart .sparkline {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 200;
    animation: sparklineDraw 1.5s ease-out forwards;
}

.stat-card-v2 .stat-chart .sparkline-area {
    opacity: 0.08;
}

/* Stat Card V2 Color Variants */
.stat-card-v2.turquoise .stat-label svg,
.stat-card-v2.turquoise .stat-label .icon { color: var(--primary); }
.stat-card-v2.turquoise .stat-chart .sparkline { stroke: var(--primary); }
.stat-card-v2.turquoise .stat-chart .sparkline-area { fill: var(--primary); }
.stat-card-v2.turquoise::before { background: linear-gradient(135deg, transparent 40%, var(--primary-300) 50%, transparent 60%); }

.stat-card-v2.green .stat-label svg,
.stat-card-v2.green .stat-label .icon { color: var(--success); }
.stat-card-v2.green .stat-chart .sparkline { stroke: var(--success); }
.stat-card-v2.green .stat-chart .sparkline-area { fill: var(--success); }
.stat-card-v2.green::before { background: linear-gradient(135deg, transparent 40%, #a7f3d0 50%, transparent 60%); }

.stat-card-v2.orange .stat-label svg,
.stat-card-v2.orange .stat-label .icon { color: var(--warning); }
.stat-card-v2.orange .stat-chart .sparkline { stroke: var(--warning); }
.stat-card-v2.orange .stat-chart .sparkline-area { fill: var(--warning); }
.stat-card-v2.orange::before { background: linear-gradient(135deg, transparent 40%, #fde68a 50%, transparent 60%); }

.stat-card-v2.red .stat-label svg,
.stat-card-v2.red .stat-label .icon { color: var(--danger); }
.stat-card-v2.red .stat-chart .sparkline { stroke: var(--danger); }
.stat-card-v2.red .stat-chart .sparkline-area { fill: var(--danger); }
.stat-card-v2.red::before { background: linear-gradient(135deg, transparent 40%, #fecaca 50%, transparent 60%); }

.stat-card-v2.blue .stat-label svg,
.stat-card-v2.blue .stat-label .icon { color: var(--info); }
.stat-card-v2.blue .stat-chart .sparkline { stroke: var(--info); }
.stat-card-v2.blue .stat-chart .sparkline-area { fill: var(--info); }
.stat-card-v2.blue::before { background: linear-gradient(135deg, transparent 40%, #bfdbfe 50%, transparent 60%); }

.stat-card-v2.purple .stat-label svg,
.stat-card-v2.purple .stat-label .icon { color: var(--purple); }
.stat-card-v2.purple .stat-chart .sparkline { stroke: var(--purple); }
.stat-card-v2.purple .stat-chart .sparkline-area { fill: var(--purple); }
.stat-card-v2.purple::before { background: linear-gradient(135deg, transparent 40%, #ddd6fe 50%, transparent 60%); }

/* ===== 3. Modern Data Cards ===== */
.data-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--card-border);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.data-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-100);
}

.data-card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    transition: transform var(--transition-spring);
}

.data-card:hover .data-card-icon {
    transform: scale(1.1);
}

.data-card-icon.turquoise { background: var(--primary-100); color: var(--primary-700); }
.data-card-icon.green { background: #d1fae5; color: #065f46; }
.data-card-icon.orange { background: #fef3c7; color: #92400e; }
.data-card-icon.red { background: #fee2e2; color: #991b1b; }
.data-card-icon.blue { background: #dbeafe; color: #1e40af; }
.data-card-icon.purple { background: #ede9fe; color: #5b21b6; }

.data-card-body {
    flex: 1;
}

.data-card-body h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.01em;
    margin-bottom: 0.375rem;
}

.data-card-body p {
    font-size: 0.8125rem;
    color: var(--gray-500);
    line-height: 1.5;
}

.data-card-actions {
    display: flex;
    gap: 0.375rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--divider);
    opacity: 0;
    transform: translateY(4px);
    transition: all var(--transition);
}

.data-card:hover .data-card-actions {
    opacity: 1;
    transform: translateY(0);
}

/* Data Cards Grid */
.data-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

/* ===== 4. Modern Sidebar V2 ===== */
.sidebar-v2 {
    width: 270px;
    background: rgba(4, 47, 46, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 40;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition-slow);
    border-right: 1px solid rgba(255,255,255,0.06);
}

.nav-item-v2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    margin: 2px 0.75rem;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
}

.nav-item-v2:hover {
    color: rgba(255,255,255,0.95);
    background: rgba(255,255,255,0.06);
    box-shadow: 0 0 20px rgba(var(--theme-primary-rgb),0.1);
}

.nav-item-v2.active {
    color: var(--white);
    background: linear-gradient(135deg, rgba(var(--theme-primary-rgb),0.25), rgba(var(--theme-primary-rgb),0.15));
    font-weight: 600;
    box-shadow: 0 0 24px rgba(var(--theme-primary-rgb),0.15);
}

.nav-item-v2.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: linear-gradient(180deg, var(--primary-light), var(--primary-300));
    border-radius: 0 3px 3px 0;
}

.nav-item-v2 .nav-item-icon {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    flex-shrink: 0;
    transition: all var(--transition);
}

.nav-item-v2 .nav-item-icon svg,
.nav-item-v2 .nav-item-icon .icon {
    width: 1rem;
    height: 1rem;
    opacity: 0.7;
    transition: opacity var(--transition);
}

.nav-item-v2:hover .nav-item-icon {
    background: rgba(255,255,255,0.1);
}

.nav-item-v2:hover .nav-item-icon svg,
.nav-item-v2:hover .nav-item-icon .icon,
.nav-item-v2.active .nav-item-icon svg,
.nav-item-v2.active .nav-item-icon .icon {
    opacity: 1;
}

.nav-item-v2.active .nav-item-icon {
    background: rgba(255,255,255,0.12);
}

.nav-section-v2 {
    padding: 1.25rem 1.5rem 0.375rem;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.25);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-section-v2::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.06);
}

/* ===== 5. Modern Form Wizard ===== */
.form-wizard {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: 1.5rem 0;
    position: relative;
}

.form-wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.form-wizard-step .step-number {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    background: var(--gray-100);
    color: var(--gray-400);
    border: 2px solid var(--gray-200);
    transition: all var(--transition);
    position: relative;
    z-index: 2;
}

.form-wizard-step .step-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-400);
    margin-top: 0.5rem;
    text-align: center;
    transition: color var(--transition);
    white-space: nowrap;
}

.form-wizard-step .step-connector {
    position: absolute;
    top: 1.125rem;
    left: calc(50% + 1.125rem);
    right: calc(-50% + 1.125rem);
    height: 2px;
    background: var(--gray-200);
    z-index: 1;
}

.form-wizard-step .step-connector::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.form-wizard-step:last-child .step-connector {
    display: none;
}

.form-wizard-step.active .step-number {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
    border-color: var(--primary);
    box-shadow: var(--shadow-primary);
    transform: scale(1.1);
}

.form-wizard-step.active .step-title {
    color: var(--primary-700);
    font-weight: 700;
}

.form-wizard-step.completed .step-number {
    background: var(--success);
    color: var(--white);
    border-color: var(--success);
}

.form-wizard-step.completed .step-title {
    color: var(--success-dark);
}

.form-wizard-step.completed .step-connector::after {
    width: 100%;
}

.form-wizard-step.completed .step-number::after {
    content: '✓';
    font-size: 0.75rem;
    font-weight: 800;
}

/* ===== 6. Modern ESS Dashboard Widgets ===== */
.ess-widget {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--card-border);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.ess-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity var(--transition);
}

.ess-widget:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.ess-widget:hover::before {
    opacity: 1;
}

.ess-widget.turquoise::before { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.ess-widget.green::before { background: linear-gradient(90deg, var(--success), #34d399); }
.ess-widget.orange::before { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.ess-widget.red::before { background: linear-gradient(90deg, var(--danger), #f87171); }
.ess-widget.blue::before { background: linear-gradient(90deg, var(--info), #60a5fa); }
.ess-widget.purple::before { background: linear-gradient(90deg, var(--purple), #a78bfa); }

.ess-widget-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    position: relative;
    overflow: hidden;
}

.ess-widget-icon.turquoise { background: var(--primary); color: var(--white); }
.ess-widget-icon.green { background: var(--success); color: var(--white); }
.ess-widget-icon.orange { background: var(--warning); color: var(--white); }
.ess-widget-icon.red { background: var(--danger); color: var(--white); }
.ess-widget-icon.blue { background: var(--info); color: var(--white); }
.ess-widget-icon.purple { background: var(--purple); color: var(--white); }

.ess-widget-info h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.01em;
}

.ess-widget-info p {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.ess-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.ess-quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    border-radius: var(--radius);
    background: var(--white);
    border: 1px solid var(--card-border);
    text-decoration: none;
    color: var(--gray-700);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all var(--transition);
    cursor: pointer;
}

.ess-quick-action:hover {
    border-color: var(--primary-200);
    background: var(--primary-50);
    color: var(--primary-700);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.ess-quick-action .action-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: var(--primary-50);
    color: var(--primary);
    transition: all var(--transition);
}

.ess-quick-action:hover .action-icon {
    background: var(--primary);
    color: var(--white);
    transform: scale(1.05);
}

/* ===== 7. Modern Timeline V2 ===== */
.timeline-v2 {
    position: relative;
    padding: 1rem 0;
}

.timeline-v2::before {
    content: '';
    position: absolute;
    left: 1.25rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-200), var(--primary-100), transparent);
    border-radius: var(--radius-full);
}

.timeline-v2-item {
    position: relative;
    padding-left: 3.5rem;
    padding-bottom: 2rem;
    animation: fadeInUp 0.4s ease-out both;
}

.timeline-v2-item:nth-child(1) { animation-delay: 0.05s; }
.timeline-v2-item:nth-child(2) { animation-delay: 0.1s; }
.timeline-v2-item:nth-child(3) { animation-delay: 0.15s; }
.timeline-v2-item:nth-child(4) { animation-delay: 0.2s; }
.timeline-v2-item:nth-child(5) { animation-delay: 0.25s; }
.timeline-v2-item:nth-child(6) { animation-delay: 0.3s; }

.timeline-v2-icon {
    position: absolute;
    left: 0;
    top: 0.25rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
    border: 3px solid var(--white);
    box-shadow: 0 0 0 2px var(--primary-200), var(--shadow-sm);
    z-index: 2;
    transition: transform var(--transition-spring);
}

.timeline-v2-item:hover .timeline-v2-icon {
    transform: scale(1.15);
}

.timeline-v2-icon.turquoise { background: var(--primary); }
.timeline-v2-icon.green { background: var(--success); }
.timeline-v2-icon.orange { background: var(--warning); }
.timeline-v2-icon.red { background: var(--danger); }
.timeline-v2-icon.blue { background: var(--info); }

.timeline-v2-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--card-border);
    transition: all var(--transition);
}

.timeline-v2-content:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary-100);
}

.timeline-v2-content .date {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.timeline-v2-content .title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-top: 0.25rem;
}

.timeline-v2-content .desc {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 0.375rem;
    line-height: 1.5;
}

/* Desktop alternating timeline */
@media (min-width: 768px) {
    .timeline-v2.alternating {
        padding-left: 0;
    }

    .timeline-v2.alternating::before {
        left: 50%;
        transform: translateX(-50%);
    }

    .timeline-v2.alternating .timeline-v2-item {
        padding-left: 0;
        padding-right: 0;
        width: 50%;
        position: relative;
    }

    .timeline-v2.alternating .timeline-v2-item:nth-child(odd) {
        margin-left: 0;
        padding-right: 2.5rem;
        text-align: right;
    }

    .timeline-v2.alternating .timeline-v2-item:nth-child(even) {
        margin-left: 50%;
        padding-left: 2.5rem;
    }

    .timeline-v2.alternating .timeline-v2-item:nth-child(odd) .timeline-v2-icon {
        left: auto;
        right: -1.25rem;
    }

    .timeline-v2.alternating .timeline-v2-item:nth-child(even) .timeline-v2-icon {
        left: -1.25rem;
    }
}

/* ===== 8. Modern Table V2 ===== */
.table-v2 {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
}

.table-v2 thead {
    position: sticky;
    top: 0;
    z-index: 5;
}

.table-v2 thead th {
    background: linear-gradient(180deg, var(--gray-50), var(--gray-100));
    padding: 0.875rem 1.25rem;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.table-v2 thead th:first-child {
    border-radius: var(--radius-lg) 0 0 0;
}

.table-v2 thead th:last-child {
    border-radius: 0 var(--radius-lg) 0 0;
}

.table-v2 td {
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-50);
    transition: background var(--transition-fast);
}

.table-v2 tbody tr {
    transition: all var(--transition-fast);
}

.table-v2 tbody tr:hover td {
    background: var(--primary-50);
}

.table-v2 tbody tr:last-child td {
    border-bottom: none;
}

.table-v2 .row-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transform: translateX(4px);
    transition: all var(--transition-fast);
}

.table-v2 tbody tr:hover .row-actions {
    opacity: 1;
    transform: translateX(0);
}

.table-v2 .row-actions .btn-xs {
    padding: 0.1875rem 0.5rem;
    font-size: 0.6875rem;
    border-radius: var(--radius-sm);
}

/* ===== 9. Micro-interactions & Hover Effects ===== */
.hover-lift {
    transition: all var(--transition);
}

.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.hover-glow {
    transition: all var(--transition);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(var(--theme-primary-rgb),0.2), var(--shadow-md);
}

.hover-scale {
    transition: all var(--transition);
}

.hover-scale:hover {
    transform: scale(1.03);
}

.hover-shine {
    position: relative;
    overflow: hidden;
}

.hover-shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: none;
    pointer-events: none;
}

.hover-shine:hover::after {
    animation: shineSweep 0.6s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.5s ease-out both;
}

.animate-slide-up:nth-child(1) { animation-delay: 0.05s; }
.animate-slide-up:nth-child(2) { animation-delay: 0.1s; }
.animate-slide-up:nth-child(3) { animation-delay: 0.15s; }
.animate-slide-up:nth-child(4) { animation-delay: 0.2s; }
.animate-slide-up:nth-child(5) { animation-delay: 0.25s; }
.animate-slide-up:nth-child(6) { animation-delay: 0.3s; }

.animate-fade-scale {
    animation: fadeScale 0.4s ease-out both;
}

.animate-fade-scale:nth-child(1) { animation-delay: 0.05s; }
.animate-fade-scale:nth-child(2) { animation-delay: 0.1s; }
.animate-fade-scale:nth-child(3) { animation-delay: 0.15s; }
.animate-fade-scale:nth-child(4) { animation-delay: 0.2s; }

/* ===== 10. Modern Modal V2 ===== */
.modal-v2 {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-spring);
}

.modal-overlay.show .modal-v2 {
    transform: scale(1) translateY(0);
}

.modal-v2-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-900), var(--primary-700));
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.modal-v2-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.modal-v2-header .header-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.modal-v2-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--white);
    position: relative;
    z-index: 1;
}

.modal-v2-header .modal-close {
    margin-left: auto;
    background: rgba(255,255,255,0.15);
    color: var(--white);
    position: relative;
    z-index: 1;
}

.modal-v2-header .modal-close:hover {
    background: rgba(255,255,255,0.25);
    color: var(--white);
}

.modal-v2-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-v2-body .section-divider {
    border: none;
    height: 1px;
    background: var(--gray-100);
    margin: 1.25rem 0;
}

.modal-v2-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--divider);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    background: var(--gray-50);
    position: sticky;
    bottom: 0;
    z-index: 2;
}

/* ===== 11. Gradient Accent Utilities ===== */
.gradient-border {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-lg);
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius-lg) + 2px);
    background: linear-gradient(135deg, var(--primary), var(--primary-light), var(--primary-300), var(--primary-light), var(--primary));
    background-size: 300% 300%;
    animation: gradientShift 4s ease infinite;
    z-index: -1;
    opacity: 0.7;
    transition: opacity var(--transition);
}

.gradient-border:hover::before {
    opacity: 1;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-700), var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow);
    transition: all var(--transition);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: var(--shadow-md);
}

.glass-dark {
    background: rgba(17, 24, 39, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--white);
    box-shadow: var(--shadow-lg);
}

/* ===== 12. Responsive Enhancements ===== */

/* Mobile adjustments for Page Header */
@media (max-width: 640px) {
    .page-header-wrapper {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem 1.5rem;
    }

    .page-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .page-header-actions .btn {
        flex: 1;
        min-width: 0;
    }

    .stat-card-v2 .stat-value {
        font-size: 1.5rem;
    }

    .data-cards-grid {
        grid-template-columns: 1fr;
    }

    .form-wizard {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .form-wizard-step {
        flex-direction: row;
        gap: 0.75rem;
        padding: 0.5rem 0;
    }

    .form-wizard-step .step-connector {
        display: none;
    }

    .form-wizard-step .step-title {
        text-align: left;
        margin-top: 0;
    }

    .ess-quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .timeline-v2::before {
        left: 1rem;
    }

    .timeline-v2-item {
        padding-left: 3rem;
    }

    .timeline-v2-icon {
        width: 2rem;
        height: 2rem;
        font-size: 0.75rem;
        left: 0;
    }

    .table-v2 {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-v2 .row-actions {
        opacity: 1;
        transform: none;
    }

    .modal-v2 {
        margin: 0.5rem;
        max-height: 95vh;
    }

    .modal-v2-header {
        padding: 1.25rem;
    }

    .modal-v2-body {
        padding: 1.25rem;
    }
}

/* Tablet adjustments */
@media (min-width: 641px) and (max-width: 1024px) {
    .data-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ess-quick-actions {
        grid-template-columns: repeat(3, 1fr);
    }

    .stat-card-v2 .stat-value {
        font-size: 1.75rem;
    }
}

/* Large desktop enhancements */
@media (min-width: 1280px) {
    .data-cards-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .ess-quick-actions {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .animate-slide-up,
    .animate-fade-scale,
    .stat-card-v2,
    .timeline-v2-item,
    .stat-card-v2 .stat-value,
    .stat-card-v2 .stat-chart .sparkline {
        animation: none !important;
    }

    .hover-lift:hover,
    .hover-scale:hover,
    .hover-glow:hover,
    .stat-card-v2:hover,
    .data-card:hover,
    .ess-widget:hover,
    .timeline-v2-item:hover .timeline-v2-icon {
        transform: none !important;
    }

    .hover-shine::after {
        animation: none !important;
    }

    .gradient-border::before {
        animation: none !important;
    }
}

/* ===== Global Dropdown Overflow Fix ===== */
/* Force native OS dropdown for <select> elements inside scrollable containers.
   When appearance:none is used, custom dropdowns get clipped by overflow:auto/hidden.
   Using appearance:auto ensures the OS-level dropdown popup is NOT clipped. */
.overflow-auto select.form-input,
.overflow-auto select.form-select,
.overflow-auto select.inline-select,
.table-container select.form-input,
.table-container select.form-select,
.table-container select.inline-select,
.table-wrap select.form-input,
.table-wrap select.form-select,
.table-wrap select.inline-select,
.modal-body select.form-input,
.modal-body select.form-select,
[data-overflows] select.form-input,
[data-overflows] select.form-select {
    appearance: auto;
    -webkit-appearance: auto;
    padding-right: 0.875rem;
}

/* ===== Mobile / Responsive Breakpoint Overrides ===== */

/* --- Prevent iOS Safari auto-zoom on form inputs (font-size must be ≥16px) --- */
@media (max-width: 767px) {
    .form-input,
    .form-select,
    select.form-input,
    textarea.form-input,
    .form-group .form-input,
    .form-group select.form-input,
    .form-group textarea.form-input,
    .table-search input {
        font-size: 1rem !important;
    }
}

/* --- Reduce page-content padding on tablets --- */
@media (max-width: 768px) {
    .page-content {
        padding: 1rem;
    }
    .top-bar {
        padding: 0.75rem 1rem;
    }
}

/* --- Collapse form-grid to single column on small screens --- */
@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .card-header {
        padding: 1rem;
    }
    .card-body {
        padding: 1rem;
    }
    .table-search {
        min-width: 0;
    }
}

/* --- Collapse stats-grid to 1 column on very small screens --- */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .toast {
        min-width: 0;
        max-width: calc(100vw - 2rem);
    }
}
