/* Basic reset and styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #1a1a1a;
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.sidebar-header {
    padding: 20px 0 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.sidebar-logo {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    border-radius: 0;
    transform: scale(0.88);
    transform-origin: center top;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255,255,255,0.92);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.nav-item.active {
    background-color: rgba(255,255,255,0.15);
    border-left-color: #3498db;
    color: white;
}

.nav-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.nav-text {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255,255,255,0.95);
}

.nav-group .nav-children {
    display: none;
}

.nav-group.open .nav-children {
    display: block;
}

.nav-parent {
    cursor: pointer;
}

.nav-arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.2s;
}

.nav-group.open .nav-arrow {
    transform: rotate(90deg);
}

.nav-child {
    padding-left: 56px;
    font-size: 14px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background-color: #121212;
}

.user-info {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 10px;
    background-color: rgba(255,255,255,0.05);
    border-radius: 6px;
}

.user-icon {
    font-size: 20px;
    margin-right: 10px;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: white;
}

.user-role {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 4px;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background-color: rgba(231, 76, 60, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 14px;
}

.logout-btn:hover {
    background-color: rgba(231, 76, 60, 0.3);
}

.logout-btn span {
    margin-right: 8px;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 20px;
    width: calc(100% - 260px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Flash messages */
.flash-messages {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 20px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Login page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    max-width: 200px;
    height: auto;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 24px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Accounting page */
.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.form-inline {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

.form-inline .form-group {
    flex: 0 0 auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

tr:last-child td {
    border-bottom: none;
}

.text-right {
    text-align: right;
}

/* Error pages */
.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    text-align: center;
}

.error-box h1 {
    font-size: 72px;
    color: #dc3545;
    margin-bottom: 20px;
}

.error-box h2 {
    font-size: 24px;
    margin-bottom: 15px;
}

.error-box p {
    color: #666;
    margin-bottom: 30px;
}

/* Daily breakdown table - smaller font for better fit */
.table-scroll-wrapper {
    overflow-x: auto;
    margin-top: 15px;
}

.daily-breakdown-table {
    font-size: 12px;
    min-width: 1400px;
}

.daily-breakdown-table th,
.daily-breakdown-table td {
    padding: 6px 8px;
}

.daily-breakdown-table .amount {
    white-space: nowrap;
}

/* Export section */
.export-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.export-section h3 {
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

.export-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-export {
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-excel {
    background: #217346;
    color: white;
}

.btn-excel:hover {
    background: #1a5c37;
}

.btn-csv {
    background: #0078D4;
    color: white;
}

.btn-csv:hover {
    background: #005a9e;
}

.btn-pdf {
    background: #D83B01;
    color: white;
}

.btn-pdf:hover {
    background: #a52d01;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1100;
    background: #2c3e50;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.mobile-overlay.active {
    display: block;
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    /* Sidebar hidden by default on mobile */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* Main content takes full width on mobile */
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 70px 15px 15px 15px;
    }

    /* Smaller sidebar width on mobile */
    .sidebar {
        width: 240px;
        overflow-y: auto;
    }

    .sidebar-header h2 {
        font-size: 16px;
    }

    .nav-text {
        font-size: 14px;
    }

    .user-name {
        font-size: 13px;
    }

    /* Login page adjustments */
    .login-box {
        padding: 30px 20px;
        margin: 0 15px;
    }

    /* Form inline becomes vertical on mobile */
    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .form-inline .form-group {
        width: 100%;
    }

    /* Table responsive */
    .table-scroll-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 13px;
    }

    th, td {
        padding: 8px 6px;
    }
}
