:root {
    /* Brand Colors (derived from dark blue/cyan corporate feel) */
    --primary: #1F497D;
    --primary-hover: #16365C;
    --secondary: #4BA6C3;
    
    /* Neutral Colors */
    --bg-color: #F8FAFC;
    --sidebar-bg: #FFFFFF;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --border: #E2E8F0;
    
    /* Utility */
    --success: #10B981;
    --danger: #EF4444;
    --white: #FFFFFF;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 8px;
    
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    z-index: 10;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.logo-container {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
}

.brand-logo {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
}

.nav-menu {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: var(--radius);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.nav-item i {
    font-style: normal;
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    background-color: #F1F5F9;
    color: var(--primary);
}

.nav-item.active {
    background-color: var(--primary);
    color: var(--white);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.top-header {
    background-color: var(--white);
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.top-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
}

.content-wrapper {
    padding: 32px;
    flex: 1;
    overflow-y: auto;
}

/* Cards & Forms */
.card {
    background-color: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

input, select {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(75, 166, 195, 0.2);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    transition: all 0.2s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

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

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

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

.btn-secondary:hover {
    background-color: #F8FAFC;
    border-color: #CBD5E1;
}

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

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background-color: var(--white);
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    padding: 32px;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    text-align: center;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-icon {
    font-size: 3rem;
    color: var(--success);
    margin-bottom: 16px;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.modal-text {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-actions .btn {
    width: 100%;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th {
    background-color: #F8FAFC;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tr:hover td {
    background-color: #F8FAFC;
}

.actions-cell {
    display: flex;
    gap: 8px;
}

.action-btn {
    text-decoration: none;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    background-color: #EEF2F6;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background-color: #E2E8F0;
}

.badge {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-cash {
    background-color: #DEF7EC;
    color: #03543F;
}

.badge-check {
    background-color: #E1EFFE;
    color: #1E429F;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    border-top: 4px solid var(--primary);
}

.stat-title {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-value.total {
    color: var(--primary);
}

/* Filters */
.filters-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filters-bar .form-group {
    flex: 1;
    min-width: 150px;
}

/* Printing logic */
@media print {
    body {
        background-color: transparent;
    }
    .d-print-none, .sidebar, .top-header, .filters-bar {
        display: none !important;
    }
    .main-content {
        margin: 0;
        padding: 0;
    }
    .content-wrapper {
        padding: 0;
    }
    .card {
        border: none;
        box-shadow: none;
    }
    @page { margin: 0; }
}
