/**
 * BilYan - Modern Design System
 * Application de facturation pour entreprises marocaines
 * Version 2.0 - UI/UX Moderne
 */

/* ========================================
   CSS VARIABLES - DESIGN TOKENS
======================================== */
:root {
    /* Couleurs principales - Palette moderne */
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --primary-glow: rgba(37, 99, 235, 0.12);

    --secondary: #8b5cf6;
    --secondary-light: #a78bfa;

    /* Couleurs sémantiques */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #06b6d4;
    --info-light: #cffafe;

    /* Backgrounds */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #1e293b;
    --bg-sidebar-hover: #334155;
    --bg-input: #f1f5f9;
    --bg-gradient-start: #f0f4ff;
    --bg-gradient-end: #f0fdf4;

    /* Textes */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-white: #ffffff;
    --text-sidebar: #cbd5e1;

    /* Bordures & Ombres */
    --border-light: #e2e8f0;
    --border-input: #cbd5e1;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.16);
    --shadow-primary: 0 8px 24px rgba(37, 99, 235, 0.24);

    /* Rayons */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.5s ease;

    /* Layout */
    --sidebar-width: 280px;
    --sidebar-collapsed: 80px;
    --header-height: 70px;
}

/* ========================================
   BASE STYLES
======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Icon font normalization for Font Awesome */
.fa,
.fas,
.far,
.fal,
.fab {
    font-style: normal !important;
    line-height: 1 !important;
    display: inline-block;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.fas {
    font-weight: 900 !important;
    font-family: "Font Awesome 5 Free" !important;
}

.far {
    font-weight: 400 !important;
    font-family: "Font Awesome 5 Free" !important;
}

.fab {
    font-weight: 400 !important;
    font-family: "Font Awesome 5 Brands" !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    letter-spacing: -0.3px;
}

h1 {
    font-size: 32px;
    line-height: 1.2;
}

h2 {
    font-size: 28px;
    line-height: 1.25;
}

h3 {
    font-size: 20px;
    line-height: 1.3;
}

/* Transitions globales */
a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

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

button {
    transition: var(--transition);
}

input,
select,
textarea {
    transition: var(--transition);
}

/* ========================================
   LAYOUT - SIDEBAR + MAIN
======================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.sidebar-logo-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.sidebar-logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: -0.5px;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
    /* Hide scrollbar for simpler look */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.sidebar-nav::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-sidebar);
    margin-bottom: 4px;
    transition: var(--transition-fast);
    position: relative;
}

.nav-item:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-white);
}

.nav-item.active {
    background: var(--primary);
    color: var(--text-white);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: var(--primary-light);
    border-radius: 0 4px 4px 0;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

.nav-item-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.nav-badge {
    background: var(--primary-light);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    min-width: 22px;
    text-align: center;
}

/* ========================================
   COMPANY SELECTOR (Multi-Enterprise)
======================================== */
.company-selector {
    position: relative;
    margin: 8px 12px 16px;
}

.company-current {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.company-current:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(139, 92, 246, 0.2));
    border-color: rgba(255, 255, 255, 0.2);
}

.company-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.company-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.company-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.company-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.company-arrow {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.company-selector.open .company-arrow {
    transform: rotate(180deg);
}

.company-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1100;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.company-selector.open .company-dropdown {
    display: block;
    animation: slideDown 0.2s ease;
}

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

.company-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-fast);
    border-left: 3px solid transparent;
}

.company-option:hover {
    background: var(--bg-input);
    border-left-color: var(--primary);
}

.company-option.active {
    background: var(--primary-glow);
    border-left-color: var(--primary);
}

.company-option.active .company-option-name {
    color: var(--primary);
    font-weight: 600;
}

.company-option-name {
    font-size: 13px;
    font-weight: 500;
}

.company-option-role {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: capitalize;
    background: var(--bg-input);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

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

.company-option.company-manage {
    color: var(--primary);
    gap: 8px;
    justify-content: flex-start;
}

.company-option.company-manage svg {
    width: 16px;
    height: 16px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-sidebar-hover);
    border-radius: var(--radius-md);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: white;
    font-size: 14px;
}

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

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

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

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    box-shadow: var(--shadow-md);
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
    color: var(--text-primary);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    min-height: 100vh;
}

.main-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ========================================
   PAGE HEADER
======================================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0;
    font-size: 1.75rem;
}

.page-title-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-glow);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-title-icon svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.page-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ========================================
   CARDS
======================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    margin-bottom: 24px;
}

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

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-light);
    gap: 16px;
}

.card-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
}

.card-header-title svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.card-body {
    padding: 24px;
}

.card-body.p-0 {
    padding: 0;
}

/* ========================================
   MODERN CARD & SECTION STYLES
======================================== */

/* Section moderne */
.section-header {
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

/* Card moderne avec gradient subtle */
.modern-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.modern-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.modern-card.gradient {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
}

/* Grid moderne */
.modern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* Card avec icône et statistique */
.stat-card-modern {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

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

.stat-card-modern:hover::before {
    transform: scaleX(1);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: var(--shadow-primary);
    flex-shrink: 0;
}

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

.stat-card-icon.success {
    background: linear-gradient(135deg, var(--success), #059669);
}

.stat-card-icon.warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
}

.stat-card-icon.danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
}

.stat-card-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.stat-card-change {
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    display: inline-block;
}

.stat-card-change.positive {
    color: var(--success);
    background: var(--success-light);
}

.stat-card-change.negative {
    color: var(--danger);
    background: var(--danger-light);
}

/* Table moderne */
.table-modern {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.table-modern thead {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.table-modern th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.9);
}

.table-modern tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

.table-modern tbody tr:hover {
    background: var(--bg-main);
}

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

.table-modern td {
    padding: 16px 20px;
    color: var(--text-primary);
    font-size: 14px;
}

/* Badge moderne */
.badge-modern {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-modern.success {
    background: var(--success-light);
    color: #047857;
}

.badge-modern.warning {
    background: var(--warning-light);
    color: #92400e;
}

.badge-modern.danger {
    background: var(--danger-light);
    color: #991b1b;
}

.badge-modern.info {
    background: var(--info-light);
    color: #0e7490;
}

/* Button moderne */
.btn-modern {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-modern.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-modern.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.3);
}

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

.btn-modern.secondary:hover {
    background: var(--border-light);
}

.btn-modern.danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-modern.danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

/* Info Box moderne */
.info-box {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    border-left: 4px solid var(--primary);
    padding: 20px 24px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.info-box.success {
    border-left-color: var(--success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(16, 185, 129, 0.02));
}

.info-box.warning {
    border-left-color: var(--warning);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(245, 158, 11, 0.02));
}

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

.stats-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.stats-card:hover::before {
    transform: scaleX(1);
}

.stats-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stats-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.stats-icon.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.stats-icon.success {
    background: linear-gradient(135deg, var(--success), #059669);
}

.stats-icon.warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
}

.stats-icon.info {
    background: linear-gradient(135deg, var(--info), #0891b2);
}

.stats-icon.danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
}

.stats-content {
    flex: 1;
}

.stats-number {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stats-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.stats-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary);
    margin-top: 12px;
}

.stats-link:hover {
    gap: 10px;
}

.stats-link svg {
    width: 16px;
    height: 16px;
}

/* ========================================
   FINANCIAL CARDS - PROJECT VIEW
======================================== */

.financial-cards {
    margin-bottom: 32px;
}

.financial-card {
    background: white;
    border: 2px solid;
    border-radius: var(--radius-lg);
    padding: 28px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.financial-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0%, transparent 70%);
    transform: scale(0);
    transition: transform 0.5s ease;
}

.financial-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.financial-card:hover::before {
    transform: scale(1);
}

.financial-card.expenses {
    border-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(239, 68, 68, 0.02) 100%);
}

.financial-card.expenses .card-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

.financial-card.income {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.02) 100%);
}

.financial-card.income .card-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.financial-card.balance {
    border-color: #2563eb;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(37, 99, 235, 0.02) 100%);
}

.financial-card.balance .card-icon {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

.financial-card.balance.negative {
    border-color: #ef4444;
}

.financial-card.balance.negative .card-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.card-icon {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    transition: var(--transition);
}

.card-icon svg {
    width: 40px;
    height: 40px;
    color: white;
    stroke-width: 1.5;
}

.card-icon i {
    font-size: 36px;
    color: white;
}

.financial-card h6 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin: 0 0 12px 0;
}

.financial-card h3 {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    font-family: 'Outfit', sans-serif;
    line-height: 1.2;
}

.financial-card h3 i {
    margin-right: 8px;
    font-size: 28px;
}

.financial-card.expenses h3 {
    color: #dc2626;
}

.financial-card.income h3 {
    color: #059669;
}

.financial-card.balance h3 {
    color: #1d4ed8;
}

.financial-card.balance.negative h3 {
    color: #dc2626;
}

/* ========================================
   EXPENSES & INCOMES TABLE
======================================== */

.transactions-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.transactions-header h5 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.transactions-header i {
    font-size: 24px;
}

.transactions-card {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.transactions-header-bar {
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.transactions-header-bar.expenses {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.transactions-header-bar.income {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.transactions-header-bar h5 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 18px;
}

.transactions-header-bar i {
    font-size: 24px;
}

.transactions-body {
    padding: 0;
    overflow-x: auto;
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.transactions-table thead {
    background: #f8fafc;
    border-bottom: 2px solid var(--border-light);
}

.transactions-table th {
    padding: 16px 24px;
    text-align: left;
    font-weight: 700;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.transactions-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

.transactions-table tbody tr:hover {
    background: var(--bg-main);
}

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

.transactions-table td {
    padding: 18px 24px;
    color: var(--text-primary);
    font-size: 14px;
}

.transaction-amount {
    font-weight: 700;
    font-size: 15px;
    font-family: 'Outfit', sans-serif;
}

.transaction-amount.expense {
    color: #dc2626;
}

.transaction-amount.income {
    color: #059669;
}

/* ========================================
   ADD BUTTON
======================================== */

.add-transaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.add-transaction-btn.expenses {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.add-transaction-btn.expenses:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.add-transaction-btn.income {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.add-transaction-btn.income:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, #059669, #047857);
}

.add-transaction-btn i {
    font-size: 18px;
}

/* Action buttons (print, edit, back) */
.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 15px;
    color: #ffffff;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    white-space: nowrap;
    overflow: visible;
    cursor: pointer;
}

.action-btn i {
    font-size: 16px;
    flex-shrink: 0;
}

.action-btn.print {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.action-btn.print:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}

.action-btn.edit {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.action-btn.edit:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #d97706, #b45309);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
}

.action-btn.back {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    box-shadow: 0 4px 14px rgba(75, 85, 99, 0.3);
}

.action-btn.back:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #4b5563, #374151);
    box-shadow: 0 8px 24px rgba(75, 85, 99, 0.4);
}

/* Generic variants for action buttons */
.action-btn.primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.action-btn.primary:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}

.action-btn.info {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.action-btn.info:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #0891b2, #0e7490);
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.4);
}

.action-btn.secondary {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    box-shadow: 0 4px 14px rgba(75, 85, 99, 0.3);
}

.action-btn.secondary:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #4b5563, #374151);
    box-shadow: 0 8px 24px rgba(75, 85, 99, 0.4);
}

.action-btn.success {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.action-btn.success:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

/* Base button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Font Awesome icons inside standard buttons */
.btn i {
    font-size: 16px;
    line-height: 1;
    vertical-align: middle;
}

.btn-sm i {
    font-size: 14px;
}

.btn-lg i {
    font-size: 18px;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

/* Primary Button */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(145deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-primary);
    font-weight: 600;
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(145deg, var(--primary-light), var(--primary));
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
    color: white;
}

/* Secondary Button */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    border: none;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(75, 85, 99, 0.2);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    color: white;
    box-shadow: 0 6px 20px rgba(75, 85, 99, 0.3);
}

/* Success Button */
.btn-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(145deg, var(--success), #059669);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
    font-weight: 600;
    border: none;
}

.btn-success:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
    color: white;
}

/* Danger Button */
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(145deg, var(--danger), #dc2626);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
    font-weight: 600;
    border: none;
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
    color: white;
}

/* Info Button */
.btn-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(145deg, var(--info), #0891b2);
    color: white;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.25);
    font-weight: 600;
    border: none;
}

.btn-info:hover {
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.35);
    color: white;
}

/* Warning Button */
.btn-warning {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(145deg, var(--warning), #d97706);
    color: white;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
    font-weight: 600;
    border: none;
}

.btn-warning:hover {
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
    color: white;
}

/* Outline Buttons */
.btn-outline-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    font-weight: 600;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-outline-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    color: #6b7280;
    border: 2px solid #d1d5db;
    font-weight: 600;
}

.btn-outline-secondary:hover {
    background: #6b7280;
    color: white;
    border-color: #6b7280;
}

/* Button Sizes */
.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    gap: 6px;
}

.btn-sm svg {
    width: 16px;
    height: 16px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

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

.btn-block {
    width: 100%;
}

/* Button Group */
.btn-group {
    display: inline-flex;
    gap: 8px;
}

.btn-group-sm .btn {
    padding: 6px 10px;
}

/* Icon Button */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

.btn-icon i {
    font-size: 16px;
    line-height: 1;
}

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

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

.form-label.required::after {
    content: ' *';
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 15px;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled {
    background: var(--bg-input);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Textarea */
textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* Select */
select.form-control {
    appearance: none;
    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='%2364748b' 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 12px center;
    padding-right: 40px;
}

/* Form Text / Help */
.form-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Input Group */
.input-group {
    display: flex;
    align-items: stretch;
}

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

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

/* ========================================
   TABLES
======================================== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table thead {
    background: var(--bg-main);
}

.table th {
    padding: 14px 16px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.table tbody tr:hover {
    background: var(--primary-glow);
}

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

/* ========================================
   BADGES
======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.badge-success {
    background: var(--success-light);
    color: #065f46;
}

.badge-warning {
    background: var(--warning-light);
    color: #92400e;
}

.badge-danger {
    background: var(--danger-light);
    color: #991b1b;
}

.badge-info {
    background: var(--info-light);
    color: #0e7490;
}

.badge-secondary {
    background: var(--bg-input);
    color: var(--text-secondary);
}

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

/* ========================================
   ALERTS
======================================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-warning {
    background: var(--warning-light);
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: var(--info-light);
    color: #0e7490;
    border: 1px solid #a5f3fc;
}

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

.alert-dismissible .close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.5;
    transition: var(--transition-fast);
}

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

/* ========================================
   LIST GROUP
======================================== */
.list-group {
    display: flex;
    flex-direction: column;
}

.list-group-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item:hover {
    background: var(--primary-glow);
}

.list-group-item svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

/* ========================================
   MODALS
======================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-main);
}

/* ========================================
   DOCUMENT STYLES (Invoices, Quotes, etc.)
======================================== */
.document-container {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.document-header {
    margin-bottom: 30px;
}

.document-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--primary-glow);
}

.document-info {
    background: var(--bg-main);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.document-summary {
    background: var(--bg-main);
    padding: 20px;
    border-radius: var(--radius-md);
}

.amount-in-words {
    font-style: italic;
    padding: 16px;
    background: var(--primary-glow);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
    margin: 20px 0;
}

.signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    gap: 40px;
}

.signature-block {
    flex: 1;
    text-align: center;
    padding-top: 60px;
    border-top: 1px solid var(--border-light);
}

.company-logo {
    max-height: 80px;
    max-width: 100%;
}

/* ========================================
   LOGIN PAGE
======================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

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

.login-logo-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}

.login-logo-icon svg {
    width: 36px;
    height: 36px;
    color: white;
}

.login-logo h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin: 0 0 8px;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

.login-form {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.login-form .form-group {
    margin-bottom: 24px;
}

.login-form .form-label {
    color: var(--text-primary);
}

.login-form .btn {
    margin-top: 8px;
}

/* ========================================
   ANIMATIONS
======================================== */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.scale-in {
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Staggered animations for lists */
.stagger-1 {
    animation-delay: 0.05s;
}

.stagger-2 {
    animation-delay: 0.1s;
}

.stagger-3 {
    animation-delay: 0.15s;
}

.stagger-4 {
    animation-delay: 0.2s;
}

.stagger-5 {
    animation-delay: 0.25s;
}

/* ========================================
   UTILITIES
======================================== */
.text-center {
    text-align: center;
}

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

.text-left {
    text-align: left;
}

.text-primary {
    color: var(--primary);
}

.text-secondary {
    color: var(--text-secondary);
}

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

.text-success {
    color: var(--success);
}

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

.text-warning {
    color: var(--warning);
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.mb-4 {
    margin-bottom: 32px;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mt-4 {
    margin-top: 32px;
}

.mr-2 {
    margin-right: 16px;
}

.ml-2 {
    margin-left: 16px;
}

.my-2 {
    margin-top: 16px;
    margin-bottom: 16px;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.p-0 {
    padding: 0;
}

.p-2 {
    padding: 16px;
}

.p-3 {
    padding: 24px;
}

.p-4 {
    padding: 32px;
}

.d-flex {
    display: flex;
}

.d-block {
    display: block;
}

.d-inline-flex {
    display: inline-flex;
}

.d-none {
    display: none;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-center {
    justify-content: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-2 {
    gap: 16px;
}

.gap-3 {
    gap: 24px;
}

.w-100 {
    width: 100%;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -12px;
}

.col-md-2,
.col-md-3,
.col-md-4,
.col-md-6,
.col-md-8,
.col-md-12 {
    padding: 0 12px;
    width: 100%;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (min-width: 768px) {
    .col-md-2 {
        width: 16.666667%;
    }

    .col-md-3 {
        width: 25%;
    }

    .col-md-4 {
        width: 33.333333%;
    }

    .col-md-6 {
        width: 50%;
    }

    .col-md-8 {
        width: 66.666667%;
    }

    .col-md-12 {
        width: 100%;
    }
}

@media (max-width: 991px) {
    :root {
        --sidebar-width: 260px;
    }

    .main-content {
        padding: 24px;
    }
}

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

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

    .mobile-menu-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding: 80px 16px 24px;
    }

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

    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        flex: 1;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stats-card {
        flex-direction: column;
        text-align: center;
    }

    .signatures {
        flex-direction: column;
    }

    .signature-block {
        width: 100%;
        margin-bottom: 32px;
    }

    .document-container {
        padding: 20px;
    }

    .login-form {
        padding: 24px;
    }

    .col-md-2,
    .col-md-3,
    .col-md-4,
    .col-md-6,
    .col-md-8 {
        width: 100%;
        margin-bottom: 16px;
    }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.show {
    display: block;
}

/* ========================================
   PRINT STYLES
======================================== */
@media print {

    .sidebar,
    .mobile-menu-toggle,
    .no-print,
    .page-actions {
        display: none !important;
    }

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

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

    .document-container {
        box-shadow: none;
        padding: 0;
    }

    body {
        background: white;
    }
}

/* ========================================
   DROPDOWN (for forms)
======================================== */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    min-width: 200px;
    z-index: 1000;
    display: none;
}

.dropdown-menu.show {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

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

.dropdown-item svg {
    width: 18px;
    height: 18px;
}

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

/* Definition Lists (for details pages) */
dl.row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 0;
}

dl.row dt {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
}

dl.row dd {
    color: var(--text-primary);
    margin-bottom: 12px;
}

.col-sm-4 {
    width: 33.333%;
    padding: 0 12px;
}

.col-sm-8 {
    width: 66.666%;
    padding: 0 12px;
}

@media (max-width: 576px) {

    .col-sm-4,
    .col-sm-8 {
        width: 100%;
    }

    dl.row dt {
        margin-bottom: 4px;
    }
}

/* ========================================
   MODAL OVERLAY (Product Search, etc.)
======================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex !important;
}

.modal-overlay .modal {
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-overlay .modal-header {
    background: var(--bg-main);
}

.modal-overlay .modal-body {
    max-height: 60vh;
    overflow-y: auto;
}

/* ========================================
   SEARCH RESULTS (for Product Search)
======================================== */
.search-results {
    margin-top: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    display: block;
    padding: 16px;
    background: var(--bg-main);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.search-result-item:hover {
    border-color: var(--primary);
    background: var(--primary-glow);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    transform: translateY(-2px);
}

.search-result-item:last-child {
    margin-bottom: 0;
}

.search-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.search-result-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.search-result-price {
    font-weight: 700;
    font-size: 16px;
    color: var(--success);
}

.search-result-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.search-result-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.no-results svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.no-results p {
    margin: 0;
}

/* ========================================
   DELETE / REMOVE BUTTON
======================================== */
.action-btn.delete,
.btn-delete,
.remove-row {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-btn.delete:hover,
.btn-delete:hover,
.remove-row:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.action-btn.delete:active,
.btn-delete:active,
.remove-row:active {
    transform: scale(0.95);
}

.action-btn.delete svg,
.btn-delete svg,
.remove-row svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Actions column centered */
.table td.actions-column,
.table td:last-child:has(.remove-row) {
    text-align: center;
    vertical-align: middle;
}

/* Form Rows for items */
.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

/* Item row inputs */
.item-row input.form-control-sm {
    padding: 8px 12px;
    font-size: 14px;
}

.item-row .item-total {
    font-weight: 600;
    color: var(--text-primary);
}

/* Bootstrap compatibility for old pages */
.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-3 {
    margin-bottom: 16px;
}

.mb-4 {
    margin-bottom: 24px;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 16px;
}

.mt-4 {
    margin-top: 24px;
}

.pb-0 {
    padding-bottom: 0;
}

.p-0 {
    padding: 0;
}

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

.text-center {
    text-align: center;
}

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

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

.font-weight-bold {
    font-weight: 700;
}

/* Grid columns */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -12px;
}

.col-md-4 {
    width: 33.333%;
    padding: 0 12px;
}

.col-md-6 {
    width: 50%;
    padding: 0 12px;
}

.col-md-8 {
    width: 66.666%;
    padding: 0 12px;
}

.col-md-12 {
    width: 100%;
    padding: 0 12px;
}

@media (max-width: 768px) {

    .col-md-4,
    .col-md-6,
    .col-md-8 {
        width: 100%;
    }
}

/* Card footer */
.card-footer {
    padding: 20px 24px;
    background: var(--bg-main);
    border-top: 1px solid var(--border-light);
}

/* Page Header old style */
h1.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    margin-bottom: 24px;
}

h1.page-header i,
h1.page-header svg {
    color: var(--primary);
}

/* Input group append */
.input-group-append {
    display: flex;
}

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

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    color: var(--text-muted);
}

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

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

.input-group .form-control:last-child,
.input-group .btn:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.input-group-prepend+.form-control {
    border-left: none;
}

/* ========================================
   DISABLE ALL HOVER EFFECTS
======================================== */
/* Remove all hover transformations and animations */
*:hover {
    transform: none !important;
}

/* Cards - no hover effect */
.card:hover,
.stats-card:hover {
    transform: none !important;
    box-shadow: var(--shadow-sm) !important;
}

/* Buttons - no hover effect */
.btn:hover,
.btn-primary:hover,
.btn-secondary:hover,
.btn-success:hover,
.btn-danger:hover,
.btn-info:hover,
.btn-warning:hover,
.btn-outline-primary:hover {
    transform: none !important;
}

/* Navigation - keep functional hover for visibility */
.nav-item:hover {
    transform: none !important;
}

/* Table rows - no hover effect */
.table-hover tbody tr:hover {
    background-color: transparent !important;
}

/* Links - keep color change but no animation */
a:hover {
    transform: none !important;
}

/* Stats link - no gap change */
.stats-link:hover {
    gap: 6px !important;
}

/* ========================================
   DISABLE ALL ANIMATIONS & TRANSITIONS
======================================== */
/* Global reset for all animations and transitions */
*,
*::before,
*::after {
    animation: none !important;
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition: none !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
}

/* Remove fade-in class effect */
.fade-in,
.slide-in {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
}

/* Remove loading spinners animation */
.spinner,
.loading,
.loader {
    animation: none !important;
}

/* ========================================
   BILYAN LOGO STYLING
======================================== */
/* Logo highlight - YAN in blue tech */
.logo-highlight {
    color: var(--primary) !important;
    font-weight: 700;
}

/* Sidebar logo text - BIL in white */
.sidebar-logo-text {
    color: var(--text-white);
    font-weight: 700;
}

.sidebar-logo-text .logo-highlight {
    color: var(--primary-light) !important;
}

/* Login page title */
.login-title {
    color: var(--text-primary);
    font-weight: 700;
    margin: 0;
}

.login-title .logo-highlight {
    color: var(--primary) !important;
}

/* ========================================
   DELETE MODAL - SIMPLE ET MODERNE
======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9998;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-backdrop.show {
    opacity: 1;
}

.modal-dialog {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: auto;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.delete-modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    background: white;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.95) translateY(-20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.delete-modal-body {
    padding: 48px 40px;
    text-align: center;
}

.delete-modal-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.delete-modal-icon svg {
    width: 32px;
    height: 32px;
    color: #dc2626;
    stroke-width: 2;
}

.delete-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 12px 0;
}

.delete-message {
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 12px 0;
    line-height: 1.6;
    font-weight: 500;
}

.delete-warning {
    font-size: 14px;
    color: #d97706;
    background: #fef3c7;
    padding: 10px 16px;
    border-radius: 8px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}

.delete-warning:before {
    content: '⚠️';
    font-size: 16px;
}

.delete-modal-footer {
    border-top: 1px solid #e5e7eb;
    padding: 20px 40px;
    display: flex;
    gap: 12px;
    justify-content: center;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}

.delete-modal-footer .btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.delete-modal-footer .btn-outline {
    background: white;
    color: #6b7280;
    border: 1.5px solid #d1d5db;
}

.delete-modal-footer .btn-outline:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.delete-modal-footer .btn-danger-solid {
    background: #dc2626;
    color: white;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.delete-modal-footer .btn-danger-solid:hover {
    background: #b91c1c;
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.35);
    transform: translateY(-1px);
}

.delete-modal-footer .btn-danger-solid:active {
    transform: translateY(0);
}

@media (max-width: 576px) {
    .delete-modal-body {
        padding: 32px 24px;
    }

    .delete-modal-footer {
        padding: 16px 24px;
        flex-direction: column-reverse;
    }

    .delete-modal-footer .btn {
        width: 100%;
        min-width: auto;
    }

    .delete-modal-icon {
        width: 56px;
        height: 56px;
    }

    .delete-modal-icon svg {
        width: 28px;
        height: 28px;
    }
}

/* Responsif mobile */
@media (max-width: 576px) {
    .delete-modal-content {
        min-width: auto;
        max-width: 95vw;
    }

    .delete-modal-header {
        padding: 20px;
        gap: 12px;
    }

    .delete-modal-icon {
        width: 48px;
        height: 48px;
    }

    .delete-modal-icon svg {
        width: 28px;
        height: 28px;
    }

    .delete-modal-title {
        font-size: 18px;
        min-width: 100%;
    }

    .delete-modal-header .close {
        position: absolute;
        right: 15px;
        top: 10px;
    }

    .delete-modal-body {
        padding: 24px 20px;
    }

    .delete-message {
        font-size: 15px;
    }

    .delete-modal-footer {
        padding: 16px 20px;
        flex-direction: column-reverse;
    }

    .delete-modal-footer .btn {
        width: 100%;
        min-width: auto;
    }
}

/* ========================================
   PAGINATION STYLES
======================================== */
.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: var(--radius-md);
    gap: 4px;
}

.page-item .page-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    margin-left: -1px;
    line-height: 1.25;
    color: var(--primary);
    background-color: white;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: var(--transition);
}

.page-item:first-child .page-link {
    margin-left: 0;
}

.page-item.active .page-link {
    z-index: 3;
    color: white;
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.page-item.disabled .page-link {
    color: var(--text-muted);
    pointer-events: none;
    cursor: auto;
    background-color: var(--bg-main);
    border-color: var(--border-light);
}

.page-item:not(.active):not(.disabled) .page-link:hover {
    z-index: 2;
    color: var(--primary-dark);
    background-color: var(--bg-main);
    border-color: var(--primary-light);
    transform: translateY(-1px);
}

/* ========================================
   PRINT STYLES (Expert Mode)
======================================== */
@media print {

    /* Hide UI Elements */
    .sidebar,
    .mobile-menu-toggle,
    .page-actions,
    .filter-bar,
    .pagination,
    .no-print,
    .btn,
    .card-header form,
    .alert {
        display: none !important;
    }

    /* Reset Layout */
    body,
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        width: 100% !important;
    }

    .main-container {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Card Styling for Print */
    .card {
        border: none !important;
        box-shadow: none !important;
        margin-bottom: 0 !important;
    }

    .card-header {
        border-bottom: 2px solid #000 !important;
        padding-left: 0 !important;
    }

    /* Table Styling */
    .table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    .table th,
    .table td {
        border: 1px solid #ddd !important;
        padding: 8px !important;
        font-size: 12px !important;
        color: #000 !important;
    }

    .table th {
        background-color: #f8f9fa !important;
        font-weight: bold !important;
    }

    /* Badges to Text */
    .badge {
        border: none !important;
        background: none !important;
        color: #000 !important;
        padding: 0 !important;
        font-weight: bold;
    }

    /* Page Break */
    tr {
        page-break-inside: avoid;
    }

    /* Title Override */
    .page-title::before {
        content: "Impression : " attr(data-print-date);
        display: block;
        font-size: 10px;
        color: #666;
        margin-bottom: 5px;
    }
}