/* assets/css/style.css */
/* Premium CSS Framework for Nexus ERP/CRM System */

:root {
    /* Brand Colors - to be overridden inline in header if customized */
    --primary-color: #4f46e5;
    --secondary-color: #0f172a;
    
    /* Default Colors (Light Mode) */
    --bg-base: #f1f5f9;
    --bg-surface: rgba(255, 255, 255, 0.8);
    --bg-surface-solid: #ffffff;
    --border-color: rgba(226, 232, 240, 0.8);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    /* Semantic Colors */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --info: #0ea5e9;
    --info-bg: rgba(14, 165, 233, 0.1);
    
    /* Shadows */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 15px rgba(79, 70, 229, 0.15);
    
    /* Border Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout Sizes */
    --sidebar-width: 270px;
    --sidebar-collapsed-width: 85px;
    --header-height: 70px;
    
    --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Legacy / Component variable mappings */
    --card-bg: var(--bg-surface-solid);
    --text-color: var(--text-primary);
    --border-radius: var(--radius-md);
}

/* Dark Mode Overrides */
html.dark-theme {
    --bg-base: #090d16;
    --bg-surface: rgba(17, 24, 39, 0.8);
    --bg-surface-solid: #111827;
    --border-color: rgba(55, 65, 81, 0.5);
    
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #6b7280;
    
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.35), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 18px rgba(79, 70, 229, 0.25);
    
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning-bg: rgba(245, 158, 11, 0.15);
    --danger-bg: rgba(239, 68, 68, 0.15);
    --info-bg: rgba(14, 165, 233, 0.15);
    
    /* Legacy / Component variable mappings */
    --card-bg: var(--bg-surface-solid);
    --text-color: var(--text-primary);
    --border-radius: var(--radius-md);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select, textarea {
    font-family: inherit;
    color: inherit;
}

/* Main Layout Structure */
#app-layout {
    display: flex;
    min-height: 100vh;
}

#main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-normal);
    padding: 24px;
    min-width: 0;
}

#app-layout.sidebar-collapsed #main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Sleek Floating Sidebar */
aside.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: 16px;
    left: 16px;
    bottom: 16px;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition-normal), transform var(--transition-normal);
}

#app-layout.sidebar-collapsed aside.sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: var(--shadow-glow);
}

.sidebar-brand {
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
    transition: opacity var(--transition-fast);
}

#app-layout.sidebar-collapsed .sidebar-brand {
    opacity: 0;
    pointer-events: none;
}

.sidebar-menu {
    flex-grow: 1;
    padding: 20px 12px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.sidebar-menu-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.sidebar-menu-item.active a,
.sidebar-menu-item a:hover {
    background-color: rgba(79, 70, 229, 0.08);
    color: var(--primary-color);
}

html.dark-theme .sidebar-menu-item.active a {
    background-color: rgba(79, 70, 229, 0.15);
    color: #a5b4fc;
}

.sidebar-menu-item a svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.sidebar-menu-item a:hover svg {
    transform: scale(1.15);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background-color: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity var(--transition-fast);
}

#app-layout.sidebar-collapsed .user-info {
    opacity: 0;
    pointer-events: none;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

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

/* Header/Navbar */
header.app-header {
    position: sticky;
    top: 16px;
    z-index: 100;
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 14px 24px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

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

.page-title p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 2px;
}

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

/* Glassmorphism Cards & Panels */
.card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 24px;
    margin-bottom: 16px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Dashboard Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

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

.stat-icon svg {
    width: 24px;
    height: 24px;
}

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

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    margin-top: 2px;
}

/* Beautiful Forms */
.form-group {
    margin-bottom: 16px;
}

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

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface-solid);
    outline: none;
    font-size: 14px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

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

/* Buttons with micro-animations */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all var(--transition-fast);
}

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

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

.btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background-color: var(--bg-surface-solid);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-base);
    color: var(--text-primary);
}

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

.btn-danger:hover {
    filter: brightness(1.1);
}

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

.btn-success:hover {
    filter: brightness(1.1);
}

.btn-warning {
    background-color: var(--warning);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-warning:hover {
    filter: brightness(1.1);
    box-shadow: var(--shadow-glow);
}

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

/* Elegant Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 390px);
    min-height: 350px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

table.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background-color: var(--bg-surface-solid);
}

table.table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--bg-base);
    padding: 14px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

table.table td {
    padding: 14px 18px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

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

table.table tbody tr:hover {
    background-color: rgba(79, 70, 229, 0.02);
}

/* Badges for status */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

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

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

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

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

/* Login page special styling */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.15) 0%, rgba(9, 13, 22, 0) 90%), var(--bg-base);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    text-align: center;
}

.login-logo {
    display: inline-flex;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    background-color: var(--primary-color);
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 28px;
    box-shadow: var(--shadow-glow);
    margin-bottom: 20px;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Alerts / Notifications */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-success {
    background-color: var(--success-bg);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-error {
    background-color: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Tabs UI pattern */
.tabs-header {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    list-style: none;
}

.tab-link {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-link:hover,
.tab-link.active {
    color: var(--primary-color);
}

.tab-link.active {
    border-bottom-color: var(--primary-color);
}

.tab-pane {
    display: none;
}

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

/* Profile header component */
.profile-banner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px;
    border-radius: var(--radius-lg);
    background-color: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.profile-avatar-wrapper {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: var(--bg-base);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-placeholder {
    font-size: 40px;
    font-weight: 800;
    color: var(--text-muted);
}

.profile-meta h2 {
    font-size: 22px;
    font-weight: 700;
}

.profile-meta p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Voucher PDF Styling / Print-friendly card */
.voucher-box {
    background: white;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 30px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
}

.voucher-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.voucher-title {
    text-align: right;
}

.voucher-title h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-color);
}

.voucher-title p {
    font-size: 12px;
    color: #64748b;
}

.voucher-company h3 {
    font-size: 18px;
    font-weight: 700;
}

.voucher-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
    background-color: #f8fafc;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.voucher-details-grid div {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed #e2e8f0;
    padding-bottom: 4px;
}

.voucher-details-grid div span:first-child {
    font-weight: 600;
    color: #64748b;
}

.voucher-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.voucher-table th {
    background-color: #f1f5f9;
    padding: 10px;
    font-size: 12px;
    font-weight: 700;
    border-bottom: 2px solid #cbd5e1;
    text-align: left;
}

.voucher-table td {
    padding: 12px 10px;
    font-size: 13px;
    border-bottom: 1px solid #e2e8f0;
}

.voucher-total-row {
    font-weight: 700;
    font-size: 15px;
    background-color: #f8fafc;
}

.voucher-signatures {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 80px;
    margin-top: 60px;
    text-align: center;
    font-size: 12px;
}

.voucher-sig-line {
    border-top: 1px solid #cbd5e1;
    padding-top: 8px;
    color: #64748b;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Theme Switcher Button */
.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.theme-toggle-btn svg {
    width: 20px;
    height: 20px;
}

/* Utility classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mr-2 { margin-right: 8px; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.w-full { width: 100%; }

/* Custom premium modal styles */
.custom-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}
.custom-modal.show,
.custom-modal.active {
    display: flex;
    opacity: 1;
}
.swal2-container {
    z-index: 999999 !important;
}
.custom-modal-content {
    background-color: var(--bg-surface-solid, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-lg, 12px);
    width: 95%;
    max-width: 500px;
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));
    transform: translateY(-20px);
    transition: transform 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}
.custom-modal.show .custom-modal-content,
.custom-modal.active .custom-modal-content {
    transform: translateY(0);
}
.custom-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}
.custom-modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary, #0f172a);
}
.custom-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted, #64748b);
    line-height: 1;
}
.custom-modal-close:hover {
    color: var(--text-primary, #0f172a);
}
.custom-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1 1 auto; /* grows to fill space, shrinks to allow header/footer to stay visible */
}
.custom-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color, #e2e8f0);
    flex-shrink: 0; /* never shrink — always visible */
    background: var(--bg-surface-solid, #ffffff);
    border-radius: 0 0 var(--radius-lg, 12px) var(--radius-lg, 12px);
}
.custom-modal-header {
    flex-shrink: 0; /* always visible */
}
.custom-modal-lg .custom-modal-content {
    max-width: 950px;
}
/* Extra-wide modal for forms with many fields */
.custom-modal-xl .custom-modal-content,
.custom-modal-content.custom-modal-xl {
    max-width: min(1200px, 96vw);
    width: 96vw;
}

/* Sidebar Submenu Grouping (Talento Humano) */
.sidebar-menu-group {
    display: flex;
    flex-direction: column;
}

.sidebar-menu-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
}

.sidebar-menu-group-header:hover,
.sidebar-menu-group-header.active-group {
    background-color: rgba(79, 70, 229, 0.08);
    color: var(--primary-color);
}

html.dark-theme .sidebar-menu-group-header.active-group {
    background-color: rgba(79, 70, 229, 0.15);
    color: #a5b4fc;
}

.sidebar-menu-group-header .group-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.sidebar-menu-group-header:hover .group-icon {
    transform: scale(1.15);
}

.sidebar-menu-group-header .chevron-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform var(--transition-normal);
}

.sidebar-menu-group.open .sidebar-menu-group-header .chevron-icon {
    transform: rotate(180deg);
}

.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 4px 0 0 0;
    display: none;
    flex-direction: column;
    gap: 4px;
}

.sidebar-menu-group.open .sidebar-submenu {
    display: flex;
}

.sidebar-submenu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px 10px 32px; /* Indent subitems */
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}

.sidebar-submenu-item.active a,
.sidebar-submenu-item a:hover {
    background-color: rgba(79, 70, 229, 0.08);
    color: var(--primary-color);
}

html.dark-theme .sidebar-submenu-item.active a {
    background-color: rgba(79, 70, 229, 0.15);
    color: #a5b4fc;
}

.sidebar-submenu-item a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.sidebar-submenu-item a:hover svg {
    transform: scale(1.1);
}

/* Collapsed Sidebar Styling for Submenu */
#app-layout.sidebar-collapsed .sidebar-menu-group-header .chevron-icon {
    display: none;
}

#app-layout.sidebar-collapsed .sidebar-submenu-item a {
    padding-left: 16px; /* Align icons in collapsed state */
}

#app-layout.sidebar-collapsed .sidebar-menu-group-header span,
#app-layout.sidebar-collapsed .sidebar-submenu-item a span,
#app-layout.sidebar-collapsed .sidebar-menu-item a span {
    display: none;
    opacity: 0;
    pointer-events: none;
}

/* Button Tabs Styling */
.tabs-header-buttons {
    border-bottom: none;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 8px;
}

.tabs-header-buttons .tab-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: var(--bg-surface-solid, #f1f5f9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color); /* override standard border-bottom */
}

/* Dark theme inactive tabs background */
html.dark-theme .tabs-header-buttons .tab-link {
    background-color: rgba(255, 255, 255, 0.05);
}

.tabs-header-buttons .tab-link:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.tabs-header-buttons .tab-link.active {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
    border-color: var(--primary-color) !important;
    box-shadow: var(--shadow-glow);
}

.tabs-header-buttons .tab-link.active:hover {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
}

/* Filter row layout */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    width: 100%;
}

.filter-row > .form-group {
    flex: 1 1 200px;
    margin-bottom: 0;
    min-width: 0;
}

.filter-row > .filter-buttons {
    flex: 0 0 auto;
    min-width: max-content;
}

.filter-row select.form-control {
    width: 100%;
    min-width: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

/* Print styling */
@media print {
    body {
        background-color: white !important;
        color: black !important;
    }
    aside.sidebar, header.app-header, .btn, .no-print {
        display: none !important;
    }
    #main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .voucher-box {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        max-width: 100% !important;
    }
}

/* Select2 theme integration */
.select2-container--open {
    z-index: 99999 !important;
}

.select2-container--default .select2-selection--single {
    background-color: var(--bg-input, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--border-radius, 8px);
    height: 40px;
    display: flex;
    align-items: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary, #0f172a);
    font-size: 14px;
    line-height: 40px;
    padding-left: 12px;
    padding-right: 32px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
    right: 8px;
}
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--primary-color, #4f46e5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
    outline: none;
}
.select2-dropdown {
    background-color: var(--bg-surface-solid, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--border-radius, 8px);
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0,0,0,0.1));
    font-size: 14px;
    z-index: 99999;
}
.select2-container--default .select2-results__option {
    color: var(--text-primary, #0f172a);
    padding: 8px 14px;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--primary-color, #4f46e5);
    color: #ffffff;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: var(--bg-input, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 6px;
    color: var(--text-primary, #0f172a);
    padding: 6px 10px;
}
.dark-theme .select2-container--default .select2-selection--single {
    background-color: var(--bg-input, #1e293b);
    border-color: var(--border-color, #334155);
}
.dark-theme .select2-dropdown {
    background-color: var(--bg-surface-solid, #1e293b);
    border-color: var(--border-color, #334155);
}
.dark-theme .select2-container--default .select2-results__option {
    color: var(--text-primary, #f1f5f9);
}
.dark-theme .select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: var(--bg-input, #0f172a);
    border-color: var(--border-color, #334155);
    color: var(--text-primary, #f1f5f9);
}

/* Select2 Multiple styling overrides */
.select2-container--default .select2-selection--multiple {
    background-color: var(--bg-input, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--border-radius, 8px);
    min-height: 40px;
    transition: border-color 0.2s, box-shadow 0.2s;
    padding: 2px 6px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}
.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: var(--primary-color, #4f46e5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
    outline: none;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--bg-base, #e2e8f0);
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 4px;
    color: var(--text-primary, #0f172a);
    padding: 2px 8px;
    font-size: 13px;
    margin: 2px 0;
    display: inline-flex;
    align-items: center;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--danger, #ef4444);
    margin-right: 6px;
    border-right: 1px solid var(--border-color, #cbd5e1);
    padding-right: 6px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    background: none;
    color: #b91c1c;
}
.dark-theme .select2-container--default .select2-selection--multiple {
    background-color: var(--bg-input, #1e293b);
    border-color: var(--border-color, #334155);
}
.dark-theme .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--bg-input, #0f172a);
    border-color: var(--border-color, #334155);
    color: var(--text-primary, #f1f5f9);
}
.dark-theme .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    border-right-color: var(--border-color, #334155);
}
