/* =====================================================
 * MINI ACCURATE - MODERN UI THEME
 * Professional Accounting Software Design
 * ===================================================== */

/* === CSS VARIABLES === */
:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-text: #cbd5e1;
    --sidebar-text-hover: #ffffff;
    --sidebar-width: 260px;
    
    --body-bg: #f1f5f9;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === GLOBAL STYLES === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--body-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* === SIDEBAR === */
#sidebar {
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, #0f172a 100%);
    box-shadow: var(--shadow-xl);
    overflow-y: auto;
    overflow-x: hidden;
    transition: var(--transition);
    z-index: 1000;
}

#sidebar::-webkit-scrollbar {
    width: 6px;
}

#sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

#sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

#sidebar .brand-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 1.5rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

#sidebar .brand-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

#sidebar .brand-section h5 {
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#sidebar .brand-section small {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
    position: relative;
    z-index: 1;
}

#sidebar .nav-section-title {
    color: var(--sidebar-text);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem 0.5rem;
    margin-top: 0.5rem;
    opacity: 0.6;
}

#sidebar .nav-link {
    color: var(--sidebar-text);
    padding: 0.625rem 1rem;
    border-radius: 8px;
    margin: 0.125rem 0.5rem;
    transition: var(--transition);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

#sidebar .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

#sidebar .nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-hover);
    transform: translateX(4px);
}

#sidebar .nav-link:hover::before {
    transform: scaleY(1);
}

#sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#sidebar .nav-link.active::before {
    transform: scaleY(1);
}

#sidebar .nav-link i,
#sidebar .nav-link .icon {
    margin-right: 0.75rem;
    font-size: 1.125rem;
    width: 20px;
    text-align: center;
}

/* === MAIN CONTENT === */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

.content-wrapper {
    padding: 2rem;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === TOP NAVBAR === */
.top-navbar {
    background: white;
    box-shadow: var(--shadow-sm);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
    border-bottom: 1px solid var(--border-color);
}

.top-navbar .page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.top-navbar .user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.top-navbar .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

/* === CARDS === */
.card {
    background: var(--card-bg);
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* === STAT CARDS (Dashboard) === */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-card .stat-icon.primary {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

.stat-card .stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.stat-card .stat-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.stat-card .stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* === TABLES === */
.table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table thead {
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, #0f172a 100%);
    color: white;
}

.table thead th {
    border: none;
    padding: 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tbody tr {
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
    transform: scale(1.01);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    font-size: 0.875rem;
}

/* === BUTTONS === */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: var(--transition);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #2563eb 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

/* === FORMS === */
.form-control,
.form-select {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.625rem 1rem;
    transition: var(--transition);
    font-size: 0.875rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* === BADGES === */
.badge {
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
}

.badge-primary {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
}

/* === ALERTS === */
.alert {
    border: none;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-sm);
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.05) 100%);
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    color: var(--info-color);
    border-left: 4px solid var(--info-color);
}

/* === PAGINATION === */
.pagination {
    gap: 0.25rem;
}

.page-link {
    border: none;
    border-radius: 8px;
    padding: 0.5rem 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    transition: var(--transition);
}

.page-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* === MODALS === */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 16px 16px 0 0;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* === LOADING SPINNER === */
.spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.25rem;
}

/* === UTILITIES === */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -100%;
    }
    
    #sidebar.active {
        margin-left: 0;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--body-bg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}



/* === PRINT STYLES === */
@media print {
    #sidebar,
    .top-navbar,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
/* === TOAST NOTIFICATIONS === */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 9999;
    animation: toastSlideIn 0.3s ease;
    border-left: 4px solid;
}

.toast-notification.toast-success {
    border-left-color: var(--success-color);
}

.toast-notification.toast-danger {
    border-left-color: var(--danger-color);
}

.toast-notification.toast-warning {
    border-left-color: var(--warning-color);
}

.toast-notification.toast-info {
    border-left-color: var(--info-color);
}

.toast-notification .toast-content {
    display: flex;
    align-items: center;
    flex: 1;
}

.toast-notification .toast-success .toast-content i {
    color: var(--success-color);
}

.toast-notification .toast-danger .toast-content i {
    color: var(--danger-color);
}

.toast-notification .toast-warning .toast-content i {
    color: var(--warning-color);
}

.toast-notification .toast-info .toast-content i {
    color: var(--info-color);
}

.toast-notification .toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 1rem;
    transition: var(--transition);
}

.toast-notification .toast-close:hover {
    color: var(--text-primary);
    transform: rotate(90deg);
}

.toast-notification.hide {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* === LOADING OVERLAY === */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: fadeIn 0.3s ease;
}

#loading-overlay .loading-spinner {
    text-align: center;
}

/* === DARK MODE (Optional) === */
body.dark-mode {
    --body-bg: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
}

body.dark-mode .card {
    background: var(--card-bg);
}

body.dark-mode .table {
    background: var(--card-bg);
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* === SIDEBAR === */
#sidebar {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
}

#sidebar::-webkit-scrollbar {
    width: 5px;
}

#sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}

#sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Brand */
#sidebar .brand-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.25rem 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

#sidebar .brand-section::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
    animation: brandPulse 5s ease-in-out infinite;
}

@keyframes brandPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.15); opacity: 1; }
}

#sidebar .brand-section h5 {
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 0.15rem;
    position: relative;
    z-index: 1;
}

#sidebar .brand-section small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
    position: relative;
    z-index: 1;
    letter-spacing: 0.5px;
}

/* Section Title */
#sidebar .nav-section-title {
    color: rgba(148, 163, 184, 0.6);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 1rem 1rem 0.35rem;
}

/* Nav Links */
#sidebar .nav-link {
    color: #cbd5e1;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    margin: 1px 0.5rem;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
}

#sidebar .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 60%;
    background: linear-gradient(180deg, #667eea, #764ba2);
    border-radius: 0 3px 3px 0;
    transition: transform 0.25s ease;
}

#sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    transform: translateX(4px);
}

#sidebar .nav-link:hover::before {
    transform: translateY(-50%) scaleY(1);
}

#sidebar .nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.35);
    font-weight: 600;
}

#sidebar .nav-link.active::before {
    transform: translateY(-50%) scaleY(1);
}