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

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

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .main-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }

    .main-header h1 {
        font-size: 20px;
    }

    .main-nav {
        width: 100%;
        flex-wrap: wrap;
    }

    .nav-btn {
        flex: 1;
        min-width: 120px;
        font-size: 12px;
        padding: 8px 12px;
    }

    .action-buttons {
        width: 100%;
        flex-wrap: wrap;
    }

    .action-buttons .btn {
        flex: 1;
        min-width: 100px;
        font-size: 12px;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 10px 15px 10px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-card h3 {
        font-size: 12px;
    }

    .stat-card p {
        font-size: 18px;
    }

    .charts-container {
        grid-template-columns: 1fr;
        padding: 0 10px 15px 10px;
    }

    .table-container {
        overflow-x: auto;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px 6px;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 5vh auto;
    }

    .modal-body {
        padding: 15px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    .form-group label {
        font-size: 13px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 14px;
        padding: 8px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .dashboard-filters select {
        width: 100%;
    }
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header h1 {
    font-size: 28px;
    font-weight: 600;
}

.menu-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-secondary {
    background-color: #2196F3;
    color: white;
}

.btn-secondary:hover {
    background-color: #0b7dda;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-danger {
    background: #f5576c;
    color: white;
}

.btn-danger:hover {
    background: #e64a5f;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-edit {
    background-color: #ffc107;
    color: #333;
    padding: 4px 8px;
    font-size: 11px;
}

.btn-edit:hover {
    background-color: #e0a800;
}

.btn-delete {
    background-color: #dc3545;
    color: white;
    padding: 4px 8px;
    font-size: 11px;
}

.btn-delete:hover {
    background-color: #c82333;
}

/* Table Controls */
.table-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
    padding: 0 30px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #667eea;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.icon-btn i {
    pointer-events: none;
}

/* Table */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 0 30px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

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

th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    position: relative;
}

th:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sort-icon {
    margin-left: 5px;
    opacity: 0.5;
    font-size: 10px;
}

th.sorted-asc .sort-icon,
th.sorted-desc .sort-icon {
    opacity: 1;
    color: #fff;
}

td {
    padding: 6px 10px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 12px;
    vertical-align: middle;
}

tbody tr {
    vertical-align: middle;
}

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

tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

tbody tr:nth-child(even):hover {
    background-color: #f0f0f0;
}

td.actions {
    text-align: center;
}

/* Expandable Row Styles */
.main-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.main-row:hover {
    background-color: #f0f0f0;
}

.main-row.expanded {
    background-color: #e8f4fd;
}

.detail-row {
    background-color: #f9f9f9;
}

.detail-row.hidden {
    display: none;
}

.detail-content {
    padding: 15px 20px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

/* Cash Settled Icons */
.cash-settled-icon {
    display: inline-block;
    margin-left: 5px;
    color: #28a745;
    font-weight: bold;
    font-size: 14px;
}

.cash-pending-icon {
    display: inline-block;
    margin-left: 5px;
    color: #dc3545;
    font-weight: bold;
    font-size: 14px;
}

/* Main Header */
.main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px 10px 0 0;
    flex-wrap: wrap;
    gap: 15px;
}

.main-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.main-nav {
    display: flex;
    gap: 10px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.action-buttons .btn {
    padding: 8px 16px;
    font-size: 13px;
}

.nav-btn {
    padding: 10px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.nav-btn.active {
    background: white;
    color: #667eea;
    font-weight: 600;
    border-color: white;
}

/* Section Content */
.section-content {
    display: none;
}

.section-content.active {
    display: block;
}

/* Sub Menu */
.sub-menu {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 15px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.sub-menu h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
    font-weight: 600;
}

.sub-menu-buttons {
    display: flex;
    gap: 10px;
}

/* View Content */
.view-content {
    display: none;
}

.view-content.active {
    display: block;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 30px;
}

.dashboard-header h2 {
    margin: 0;
    color: #333;
}

.dashboard-filters {
    display: flex;
    gap: 10px;
}

.dashboard-filters select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
    padding: 0 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    position: relative;
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 10px;
}

.stat-card h3 {
    margin: 0;
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.info-icon {
    font-size: 14px;
    color: #667eea;
    cursor: pointer;
    transition: color 0.3s ease;
}

.info-icon:hover {
    color: #764ba2;
}

.stat-card p {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

.tooltip {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 1000;
    min-width: 200px;
    margin-top: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tooltip.show {
    display: block;
}

.tooltip p {
    margin: 5px 0;
    font-size: 12px;
    color: white;
    font-weight: normal;
}

.tooltip-close {
    position: absolute;
    top: 5px;
    right: 10px;
    cursor: pointer;
    font-size: 16px;
    color: #999;
}

.tooltip-close:hover {
    color: white;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    padding: 0 30px 30px 30px;
}

.chart-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chart-card.primary-chart {
    grid-column: 1 / -1;
}

.chart-card h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.chart-card canvas {
    max-height: 300px;
}

.chart-card.primary-chart canvas {
    max-height: 400px;
}

/* Filter Modal */
.filter-modal {
    max-width: 400px;
}

.filter-body {
    padding: 20px;
}

.filter-body .form-group {
    margin-bottom: 15px;
}

.filter-body .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 14px;
    color: #333;
}

.filter-body .form-group input,
.filter-body .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 10px;
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #f0f0f0;
}

/* Form */
form {
    padding: 15px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

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

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

.form-group label {
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 12px;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

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

.form-group input[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    position: sticky;
    bottom: 0;
    background: white;
    z-index: 10;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
    }

    .menu-buttons {
        justify-content: center;
    }

    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .filters {
        flex-direction: column;
    }

    .filters input,
    .filters select {
        min-width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px 10px;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #666;
}

.empty-state p {
    font-size: 16px;
}

/* Status indicators */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
}

.status-badge.pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-badge.paid {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.partial {
    background-color: #cce5ff;
    color: #004085;
}

.status-badge.assigned {
    background-color: #e3f2fd;
    color: #0d47a1;
}

.status-badge.trip-started {
    background-color: #fff3e0;
    color: #e65100;
}

.status-badge.trip-completed {
    background-color: #e8f5e9;
    color: #1b5e20;
}

.status-badge.cancelled {
    background-color: #ffebee;
    color: #c62828;
}
