/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-y: auto;
}

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

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

.sidebar-brand .brand-text {
    font-size: 20px;
    font-weight: bold;
    color: white;
}

.sidebar-toggle {
    font-size: 18px;
    cursor: pointer;
    color: white;
}

.sidebar-menu {
    padding: 20px 0;
}

.nav {
    list-style: none;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border-left: 4px solid #fff;
}

.nav-link i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

.nav-section-title {
    padding: 15px 20px 10px;
    font-size: 12px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-subsection-title {
    padding: 10px 20px 5px;
    font-size: 11px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-submenu {
    list-style: none;
    margin-left: 20px;
}

.nav-submenu .nav-link {
    padding: 8px 20px;
    font-size: 14px;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Header */
.top-header {
    background: white;
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-left {
    display: flex;
    align-items: center;
}

.sidebar-toggle-mobile {
    font-size: 20px;
    color: #666;
    cursor: pointer;
    display: none;
}

.header-center {
    flex: 1;
    max-width: 500px;
    margin: 0 30px;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.header-right {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-icons i {
    font-size: 18px;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
}

.header-icons i:hover {
    color: #667eea;
}

.user-dropdown {
    position: relative;
}

.user-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
    min-width: 180px;
    display: none;
    z-index: 1000;
}

.user-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 8px 16px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s ease;
    margin: 0;
    line-height: 1.5;
}

.dropdown-menu a:hover {
    background-color: #f8f9fa;
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 30px;
    background-color: #f8f9fa;
}

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    border: none;
    margin-bottom: 30px;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #e9ecef;
    padding: 20px 25px;
}

.card-body {
    padding: 25px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 0;
}

/* Dashboard Specific Styles */
.dashboard-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12);
}

.stats-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
    border-left: 4px solid;
}

.stats-card.success {
    border-left-color: #28a745;
}

.stats-card.info {
    border-left-color: #17a2b8;
}

.stats-card.warning {
    border-left-color: #ffc107;
}

.stats-card.danger {
    border-left-color: #dc3545;
}

/* KASA Card - Special styling for cash display */
.cash-card {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(40, 167, 69, 0.3);
    margin-bottom: 30px;
}

.cash-card h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.cash-card .amount {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 0;
}

/* Tables */
.table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.table thead th {
    background-color: #f8f9fa;
    border: none;
    padding: 15px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.table tbody td {
    padding: 15px;
    border: none;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Status Badges */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-pending {
    background-color: #ffc107;
    color: #212529;
}

.badge-approved {
    background-color: #28a745;
    color: white;
}

.badge-rejected {
    background-color: #dc3545;
    color: white;
}

.badge-processing {
    background-color: #17a2b8;
    color: white;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%);
    color: white;
}

.btn-outline-primary {
    border: 2px solid #667eea;
    color: #667eea;
    background: transparent;
}

.btn-outline-primary:hover {
    background: #667eea;
    color: white;
}

/* Forms */
.form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 8px;
}

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* Pagination */
.pagination {
    justify-content: center;
    margin-top: 30px;
}

.page-link {
    border: none;
    color: #667eea;
    padding: 10px 15px;
    margin: 0 2px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.page-link:hover {
    background-color: #667eea;
    color: white;
}

.page-item.active .page-link {
    background-color: #667eea;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle-mobile {
        display: block;
        margin-right: 15px;
    }
    
    .header-left {
        display: flex;
        align-items: center;
    }
    
    .header-center {
        margin: 0 15px;
    }
    
    .page-content {
        padding: 20px 15px;
    }
    
    .cash-card .amount {
        font-size: 28px;
    }
    
    /* Sidebar overlay for mobile */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
}

/* Animation */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Custom Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 20px 25px;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 20px 25px;
}

/* Utility Classes */
.text-primary {
    color: #667eea !important;
}

.bg-primary {
    background-color: #667eea !important;
}

.border-primary {
    border-color: #667eea !important;
}

.shadow-sm {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
}

.shadow {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12) !important;
}

.shadow-lg {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.16) !important;
}

.rounded-lg {
    border-radius: 12px !important;
}

.rounded-xl {
    border-radius: 15px !important;
}

/* Dark Mode Styles */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3d3d3d;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #888888;
    --border-color: #404040;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .sidebar {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    border-right: 1px solid var(--border-color);
}

[data-theme="dark"] .sidebar-header {
    background: linear-gradient(135deg, #3d3d3d 0%, #2d2d2d 100%);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .sidebar-header h3 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .sidebar-header a {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .nav-link {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
    background: rgba(102, 126, 234, 0.2);
    color: var(--text-primary) !important;
}

[data-theme="dark"] .nav-submenu .nav-link {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .nav-submenu .nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--text-primary) !important;
}

[data-theme="dark"] .top-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .header-icons i {
    color: var(--text-secondary);
}

[data-theme="dark"] .header-icons i:hover {
    color: var(--text-primary);
}

[data-theme="dark"] .user-dropdown .dropdown-menu {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 25px var(--shadow-color);
}

[data-theme="dark"] .user-dropdown .dropdown-menu a {
    color: var(--text-secondary);
}

[data-theme="dark"] .user-dropdown .dropdown-menu a:hover {
    background: rgba(102, 126, 234, 0.2);
    color: var(--text-primary);
}

.user-dropdown .dropdown-menu form button,
.logout-btn {
    width: 100% !important;
    text-align: left !important;
    padding: 8px 16px !important;
    border: none !important;
    background: none !important;
    color: inherit !important;
    cursor: pointer;
    text-decoration: none !important;
    display: block !important;
    margin: 0 !important;
    line-height: 1.5 !important;
    font-size: inherit !important;
    box-shadow: none !important;
}

.user-dropdown .dropdown-menu form button:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

[data-theme="dark"] .user-dropdown .dropdown-menu form button:hover {
    background: rgba(102, 126, 234, 0.2);
    color: var(--text-primary);
}

[data-theme="dark"] .card {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 4px 20px var(--shadow-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .card-header {
    background: var(--bg-tertiary) !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .card-body {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .dashboard-card {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 4px 20px var(--shadow-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .table {
    color: var(--text-primary);
}

[data-theme="dark"] .table th {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .table td {
    border-color: var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .table tbody tr {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .table tbody tr:hover {
    background-color: var(--bg-tertiary);
}

[data-theme="dark"] .table tbody tr td {
    background-color: inherit;
    color: var(--text-primary);
}

[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .form-control {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .form-control:focus {
    background: var(--bg-tertiary);
    border-color: #667eea;
    color: var(--text-primary);
}

[data-theme="dark"] .btn-outline-primary {
    color: #667eea;
    border-color: #667eea;
}

[data-theme="dark"] .btn-outline-primary:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

[data-theme="dark"] .badge {
    color: var(--text-primary);
}

[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .text-primary {
    color: var(--text-primary) !important;
}

[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3, 
[data-theme="dark"] h4, [data-theme="dark"] h5, [data-theme="dark"] h6 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .table th {
    color: var(--text-primary) !important;
    background: var(--bg-tertiary) !important;
}

[data-theme="dark"] .table td {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .nav-link {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .nav-link:hover {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .nav-link.active {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .text-secondary {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .page-content {
    background: var(--bg-primary);
}

/* Dark Mode Icon Animation */
.theme-toggle {
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(20deg);
}

[data-theme="dark"] .fa-moon::before {
    content: "\f185"; /* Sun icon */
    color: #ffd700;
}