/* ============================================================================
   ERP Financial Dashboard v1 - CSS Styles
   ============================================================================ */

/* CSS Variables - Theme Colors */
:root {
    --primary-color: #0d47a1;
    --primary-dark: #0a3d91;
    --primary-light: #1565c0;
    --primary-deep: #072a66;
    --secondary-color: #00897b;
    --secondary-light: #26a69a;
    --success-color: #4caf50;
    --warning-color: #ffc107;
    --danger-color: #f44336;
    --info-color: #2196f3;
    
    --bg-light: #f5f6fa;
    --bg-white: #ffffff;
    --bg-dark: #1a1a2e;
    
    --text-primary: #212121;
    --text-secondary: #757575;
    --text-light: #9e9e9e;
    --text-white: #ffffff;
    
    --border-color: #e0e0e0;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.12);
    
    --sidebar-width: 270px;
    --alerts-sidebar-width: 300px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================================
   Reset & Base Styles
   ============================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 
                 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.5;
    display: flex;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

button {
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

/* ============================================================================
   Sidebar Styles
   ============================================================================ */

.sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: var(--text-white);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    display: flex !important;
    flex-direction: column;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    transform: none !important;
}

/* Hide sidebar toggle button - sidebar always visible */
.toggle-sidebar-btn {
    display: none !important;
}

.sidebar-header {
    padding: 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.sidebar-logo i {
    font-size: 24px;
    color: var(--secondary-light);
}

.sidebar-subtitle {
    font-size: 12px;
    opacity: 0.85;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.version-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.menu-list {
    list-style: none;
}

.menu-item {
    position: relative;
}

.menu-item.hidden {
    display: none;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

.menu-link i {
    font-size: 16px;
    flex-shrink: 0;
}

.menu-link span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-item:hover .menu-link {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    padding-left: 20px;
}

.menu-item.active .menu-link {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-white);
    border-left: 4px solid var(--secondary-light);
    padding-left: 16px;
}

.menu-item.disabled .menu-link {
    opacity: 0.5;
    cursor: not-allowed;
    color: rgba(255, 255, 255, 0.5);
}

.menu-item.disabled .menu-link:hover {
    background: transparent;
    padding-left: 16px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.1);
    font-size: 12px;
}

.role-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 13px;
}

.role-info i {
    color: var(--secondary-light);
    font-size: 14px;
}

.role-description {
    font-size: 11px;
    opacity: 0.85;
    line-height: 1.4;
}

.user-info-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 13px;
    color: white;
}

.user-info-footer i {
    font-size: 18px;
    color: var(--primary-light);
}

.logout-btn-sidebar {
    width: 100%;
    padding: 10px 12px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.logout-btn-sidebar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.logout-btn-sidebar i {
    font-size: 14px;
}

/* User Info Section in Sidebar */
.user-info-section {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.15);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.user-avatar {
    font-size: 32px;
    color: var(--secondary-light);
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: white;
    margin-bottom: 2px;
}

.user-role {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.75);
    text-transform: capitalize;
}

.btn-logout {
    width: 100%;
    padding: 10px 16px;
    background: rgba(244, 67, 54, 0.9);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: #f44336;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(244, 67, 54, 0.3);
}

.btn-logout:active {
    transform: translateY(0);
}

.btn-logout i {
    font-size: 14px;
}

/* ============================================================================
   Main Content Area
   ============================================================================ */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    margin-right: var(--alerts-sidebar-width);
    background-color: var(--bg-light);
    min-height: 100vh;
    transition: margin-right 0.3s ease;
}

.main-content.alerts-collapsed {
    margin-right: 50px;
}

/* ============================================================================
   Dashboard Header
   ============================================================================ */

.dashboard-header {
    background: var(--bg-white);
    padding: 32px 40px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-left h1 {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.header-logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 12px;
}

.header-logo {
    width: 80px;
    height: 80px;
    background: #f0f4fb;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--primary-color);
    flex-shrink: 0;
    overflow: hidden;
}

.header-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.header-text h1 {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.header-text h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 4px 0 0 0;
}

.header-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.time-period-selector {
    display: flex;
    gap: 8px;
    background: var(--bg-light);
    padding: 6px;
    border-radius: 8px;
}

.period-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    transition: var(--transition);
}

.period-btn:hover {
    background: var(--bg-white);
    color: var(--primary-color);
}

.period-btn.active {
    background: var(--primary-color);
    color: var(--text-white);
}

/* ============================================================================
   KPI Section
   ============================================================================ */

.kpi-section {
    padding: 32px 40px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.kpi-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    border: 1px solid transparent;
    border-top: 4px solid var(--primary-color);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kpi-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.kpi-header h3 {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-icon {
    font-size: 20px;
    color: var(--primary-color);
    opacity: 0.7;
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.kpi-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-value {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-value i {
    font-size: 12px;
}

.stat-value.positive {
    color: var(--success-color);
}

.stat-value.negative {
    color: var(--danger-color);
}

/* ============================================================================
   Charts Section
   ============================================================================ */

.charts-section {
    padding: 0 40px 40px;
}

.charts-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.chart-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    border: 1px solid transparent;
    border-top: 4px solid var(--primary-color);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.chart-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h3 {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-controls {
    display: flex;
    gap: 8px;
}

.chart-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: var(--bg-light);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 14px;
}

.chart-btn:hover {
    background: var(--primary-color);
    color: var(--text-white);
}

.chart-container {
    position: relative;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.chart-container canvas {
    max-height: 100%;
    width: 100%;
}

/* Donut Chart Wrapper */
.donut-wrapper {
    position: relative;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.donut-wrapper canvas {
    max-height: 100%;
    width: 100%;
}

.donut-center {
    position: absolute;
    text-align: center;
    pointer-events: none;
}

.donut-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

.donut-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Gauge Chart Wrapper */
.gauge-wrapper {
    position: relative;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.gauge-wrapper canvas {
    max-height: 100%;
    width: 100%;
}

/* Aging Bars */
.aging-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.aging-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.aging-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 100px;
}

.bar-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 40px;
    text-align: right;
}

.bar {
    flex: 1;
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.bar::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--percentage, 0%);
    background: var(--color, var(--primary-color));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Trend Info */
.trend-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.trend-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.trend-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.trend-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.trend-value i {
    font-size: 12px;
}

.trend-value.positive {
    color: var(--success-color);
}

.trend-value.negative {
    color: var(--danger-color);
}

/* ============================================================================
   Scrollbar Styles
   ============================================================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ============================================================================
   Responsive Styles
   ============================================================================ */

@media (max-width: 1400px) {
    .charts-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    
    .chart-card.full-width {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
        --alerts-sidebar-width: 100%;
        font-size: 15px;
    }
    
    .sidebar {
        position: fixed !important;
        left: 0 !important;
        transform: none !important;
        transition: none !important;
        z-index: 1001;
        display: flex !important;
    }
    
    .sidebar.active {
        transform: none !important;
        left: 0 !important;
    }
    
    .main-content {
        margin-left: var(--sidebar-width);
        margin-right: 0;
    }
    
    .alerts-sidebar {
        width: 100%;
        transform: translateX(100%);
    }
    
    .alerts-sidebar:not(.collapsed) {
        transform: translateX(0);
    }
    
    .alerts-sidebar.collapsed {
        transform: translateX(calc(100% - 50px));
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
        gap: 16px;
    }
    
    .header-logo-section {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-logo {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }
    
    .header-left h1 {
        font-size: 22px;
    }
    
    .header-text h2 {
        font-size: 16px;
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 16px;
    }
    
    .kpi-card {
        min-height: 200px;
        padding: 16px;
    }
    
    .kpi-section {
        padding: 0;
    }
    
    .charts-section {
        padding: 0 20px 20px;
    }
    
    .charts-row {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 16px;
    }
    
    .chart-card {
        padding: 16px;
        border-top: 3px solid var(--primary-color);
        min-height: 200px;
    }
    
    .chart-header h3 {
        font-size: 12px;
    }
    
    .chart-container {
        height: 200px;
    }
    
    .time-period-selector {
        flex-direction: column;
        width: 100%;
    }
    
    .period-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .kpi-card {
        padding: 16px;
    }
    
    .kpi-value {
        font-size: 24px;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .stat-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .time-period-selector {
        flex-direction: row;
        width: auto;
    }
}

/* ============================================================================
   Alerts Sidebar
   ============================================================================ */

.alerts-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    width: var(--alerts-sidebar-width);
    background: var(--bg-white);
    border-left: 1px solid var(--border-color);
    z-index: 999;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.alerts-sidebar.collapsed {
    transform: translateX(calc(var(--alerts-sidebar-width) - 50px));
}

.alerts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 32px 40px;
    min-height: 124px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.alerts-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.alerts-title h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.alerts-title i {
    font-size: 20px;
}

.alerts-count {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.alerts-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.alerts-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.alerts-sidebar.collapsed .alerts-toggle i {
    transform: rotate(180deg);
}

.alerts-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.alerts-filter {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 6px 16px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.mark-all-read {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 12px;
    color: var(--text-secondary);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.mark-all-read:hover {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
}

.alerts-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 32px;
}

.alerts-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-light);
    text-align: center;
}

.alerts-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.alerts-empty p {
    font-size: 14px;
}

.alert-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    background: white;
}

.alert-item:hover {
    background: var(--bg-light);
}

.alert-item.unread {
    background: #e3f2fd;
    border-left: 4px solid var(--primary-color);
}

.alert-item.unread:hover {
    background: #bbdefb;
}

.alert-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.alert-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.alert-icon.invoice {
    background: #e8f5e9;
    color: var(--success-color);
}

.alert-icon.warning {
    background: #fff3e0;
    color: var(--warning-color);
}

.alert-icon.error {
    background: #ffebee;
    color: var(--danger-color);
}

.alert-icon.info {
    background: #e3f2fd;
    color: var(--info-color);
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.alert-message {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.alert-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.alert-time {
    font-size: 12px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 4px;
}

.alert-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.alert-badge.unread {
    background: var(--primary-color);
    color: white;
}

.alert-badge.read {
    background: var(--bg-light);
    color: var(--text-light);
}

/* ============================================================================
   Loading & Animation States
   ============================================================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.kpi-card,
.chart-card {
    animation: fadeIn 0.5s ease-out;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.chart-btn.loading i {
    animation: spin 1s linear infinite;
}

/* ============================================================================
   Receipt Vouchers Dashboard Section
   ============================================================================ */

.receipt-dashboard-section {
    margin-top: 40px;
    animation: fadeIn 0.5s ease-out;
}

.receipt-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 0 5px;
}

.receipt-section-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.receipt-section-header h2 i {
    color: var(--secondary-color);
    font-size: 24px;
}

.section-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-light));
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(0, 137, 123, 0.15);
}

.section-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 137, 123, 0.25);
}

.receipt-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.receipt-stat-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    cursor: pointer;
}

.receipt-stat-card:hover {
    box-shadow: var(--card-shadow-hover);
    border-color: var(--secondary-color);
}

.receipt-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.receipt-stat-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.receipt-stat-header i {
    font-size: 24px;
    color: var(--secondary-color);
    opacity: 0.8;
}

.receipt-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.receipt-stat-footer {
    font-size: 12px;
    color: var(--text-light);
}

.receipt-recent-table {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.receipt-table-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.receipt-table-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.receipt-count-badge {
    background: var(--info-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.receipt-table-container {
    overflow-x: auto;
}

.receipt-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.receipt-summary-table thead {
    background: var(--bg-light);
    border-bottom: 2px solid var(--border-color);
}

.receipt-summary-table th {
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.receipt-summary-table td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.receipt-summary-table tbody tr:hover {
    background: var(--bg-light);
}

.receipt-summary-table tbody tr:last-child td {
    border-bottom: none;
}

.receipt-status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.receipt-status-badge.paid {
    background: #d4edda;
    color: #155724;
}

.receipt-status-badge.due {
    background: #fff3cd;
    color: #856404;
}

/* ============================================================================
   Watermark Styles
   ============================================================================ */
.watermark-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    max-width: 800px;
    height: auto;
    z-index: 0;
    pointer-events: none;
    opacity: 0.08;
    display: flex;
    align-items: center;
    justify-content: center;
}

.watermark-container img {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    filter: grayscale(30%);
}

/* Ensure main content is above watermark */
.main-content {
    position: relative;
    z-index: 1;
}

.sidebar {
    z-index: 1000;
}

/* Print Styles */
@media print {
    .sidebar,
    .dashboard-header,
    .chart-controls {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .chart-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .watermark-container {
        opacity: 0.05;
    }
}

/* ============================================================================
   FORCE SIDEBAR ALWAYS VISIBLE - OVERRIDE ALL OTHER RULES
   ============================================================================ */
.sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    width: var(--sidebar-width) !important;
}

.main-content {
    margin-left: var(--sidebar-width) !important;
}
