:root {
    --primary-color: #2c3e50;
    /* Deep Blue */
    --accent-color: #3498db;
    /* Bright Blue */
    --text-light: #ecf0f1;
    --text-dark: #2c3e50;
    --bg-light: #f4f6f9;
    --sidebar-width: 250px;
    --sidebar-width-collapsed: 60px;
    --header-height: 60px;
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    height: 100vh;
    overflow: hidden;
    /* Prevent body scroll, handle in content */
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Utility Classes */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

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

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

/* Expense Page Styles */
.expense-page {
    padding: 20px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

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

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1e293b;
}

.stat-card.highlight {
    border-left: 4px solid #3b82f6;
}

.stat-card.highlight .stat-value {
    color: #2563eb;
}

/* Filter */
.filter-bar {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

/* Dispatch Search Page Styles */
.search-page-container {
    padding: 10px;
}

.search-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.search-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.search-item {
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.search-item label {
    font-size: 0.85rem;
    font-weight: bold;
    color: #666;
}

.search-item input,
.search-item select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.button-row {
    display: flex;
    gap: 10px;
    align-items: center;
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: 10px;
}

.spacer {
    flex: 1;
}

.table-container {
    background: white;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.report-table th {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 12px 10px;
    text-align: left;
}

.report-table td {
    border: 1px solid #e2e8f0;
    padding: 10px;
}

.report-table tr:hover {
    background: #f1f5f9;
    cursor: pointer;
}

.selectable-row.selected {
    background-color: #f1f5f9;
}

.money {
    text-align: right;
    font-weight: bold;
}

.received {
    color: #16a34a;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
}

/* Status Badges */
.badge-待出发 {
    background: #fef3c7;
    color: #92400e;
}

.badge-进行中 {
    background: #dbeafe;
    color: #1e40af;
}

.badge-已完成 {
    background: #dcfce7;
    color: #166534;
}

.badge-异常 {
    background: #fee2e2;
    color: #991b1b;
}

.total-summary {
    background: #f8fafc;
    font-weight: bold;
}

/* Modal General */
.modal,
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto; /* Allow scrolling if modal content is too long */
}

.modal-box {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.detail-grid {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 15px;
}

.detail-label {
    font-weight: bold;
    color: #495057;
}

.detail-value {
    color: #212529;
}

.detail-grid input,
.detail-grid select,
.detail-grid textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-item label {
    font-size: 0.75rem;
    font-weight: bold;
    color: #64748b;
}

.filter-item input {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.9rem;
}

.filter-actions {
    display: flex;
    gap: 10px;
}

/* Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    background: #f1f5f9;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.data-table tr.unverified-row {
    background: #fffcf0;
}

.bold {
    font-weight: bold;
}

.amount {
    text-align: right;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
}

.usd-amount {
    color: #2563eb;
}

.site-tag {
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.remark-cell {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    color: #64748b;
}

.badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-verify {
    color: #22c55e;
}

.btn-verify:hover {
    background: #dcfce7;
}

.btn-delete {
    color: #ef4444;
}

.btn-delete:hover {
    background: #fee2e2;
}

.verify-date {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 3px;
}

.status-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Modal specific tweaks */
.modal-content {
    background: white;
    width: 500px;
    margin: 50px auto;
    border-radius: 8px;
    overflow: hidden;
}

.modal-header {
    padding: 15px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal {
    cursor: pointer;
    font-size: 1.5rem;
    color: #94a3b8;
}

.modal-body {
    padding: 20px;
}

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

.full-width {
    grid-column: span 2;
}

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

.form-group label {
    font-size: 0.85rem;
    font-weight: bold;
    color: #475569;
}

.form-group input,
.form-group textarea {
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}

.required {
    color: #ef4444;
}

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