/* =============================================
   Modern CSS Reset & Setup
   ============================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #FF6B6B 0%, #556270 100%);
    min-height: 100vh;
    padding: 40px 20px;
    color: #333;
}

.glass-container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.header-banner {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.header-banner h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 5px;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.header-banner p {
    color: #555;
    font-size: 1.1rem;
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.card {
    background: rgba(255, 255, 255, 0.65);
    padding: 22px;
    border-radius: 14px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.card h2 {
    font-size: 1.15rem;
    margin-bottom: 16px;
    color: #e74c3c;
    border-bottom: 2px solid rgba(231, 76, 60, 0.25);
    padding-bottom: 6px;
    display: inline-block;
}

.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.input-group label {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #444;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.97rem;
    font-family: inherit;
    transition: all 0.25s;
    background: rgba(255, 255, 255, 0.9);
}

input:focus,
select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.18);
}

.routeRow {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.routeRow input {
    flex: 1;
}

.section-add-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.entry-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.entry-row {
    display: flex;
    align-items: center;
    background: rgba(241, 196, 15, 0.12);
    border: 1px solid rgba(241, 196, 15, 0.35);
    border-radius: 8px;
    padding: 8px 12px;
    gap: 10px;
}

.entry-label {
    flex: 1;
    font-weight: 500;
    font-size: 0.9rem;
    color: #2c3e50;
}

.entry-amount {
    font-weight: 700;
    color: #e67e22;
    font-size: 0.95rem;
    min-width: 80px;
    text-align: right;
}

.section-total {
    margin-top: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #2c3e50;
    text-align: right;
    padding: 6px 12px;
    background: rgba(44, 62, 80, 0.07);
    border-radius: 6px;
}

.badge-list {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge-item {
    background: #34495e;
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge-remove {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
    line-height: 1;
}

.badge-remove:hover {
    background: rgba(231, 76, 60, 0.7);
}

.driver-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.driver-card {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.08) 0%, rgba(155, 89, 182, 0.06) 100%);
    border: 1px solid rgba(52, 152, 219, 0.25);
    border-radius: 12px;
    padding: 14px 16px;
    transition: box-shadow 0.2s;
}

.driver-card:hover {
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.driver-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.driver-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #2c3e50;
    flex: 1;
}

.driver-salary {
    font-size: 0.9rem;
    font-weight: 600;
    color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
    padding: 3px 10px;
    border-radius: 12px;
}

.driver-advances {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 28px;
    padding: 4px 0;
}

.advance-badge {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.driver-card-footer {
    margin-top: 10px;
    font-size: 0.88rem;
    color: #555;
    border-top: 1px dashed rgba(0, 0, 0, 0.12);
    padding-top: 8px;
}

.driver-card-footer strong {
    color: #e74c3c;
}

.empty-msg {
    font-size: 0.82rem;
    color: #999;
    font-style: italic;
}

.remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.remove-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.charges-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s;
    font-size: 0.95rem;
    white-space: nowrap;
}

.btn:hover {
    transform: scale(1.03);
    filter: brightness(1.08);
}

.btn:active {
    transform: scale(0.97);
}

.btn-sm {
    padding: 5px 14px;
    font-size: 0.82rem;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
    width: 100%;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-info {
    background: #1abc9c;
    color: white;
}

.btn-success {
    background: #2ecc71;
    color: white;
}

.btn-dark {
    background: #2c3e50;
    color: white;
}

.btn-purple {
    background: #9b59b6;
    color: white;
}

.btn-large {
    padding: 14px 32px;
    font-size: 1.08rem;
}

.mt-2 {
    margin-top: 14px;
}

.mt-4 {
    margin-top: 30px;
}

.action-bar {
    text-align: center;
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.result-card {
    margin-top: 24px;
    padding: 18px 24px;
    border-radius: 12px;
    color: white;
    text-align: center;
    font-size: 1.05rem;
}

.result-profit {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 4px 15px rgba(56, 239, 125, 0.35);
}

.result-loss {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.35);
}

.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.styled-table {
    width: 100%;
    border-collapse: collapse;
}

.styled-table thead tr {
    background-color: #2c3e50;
    color: #ffffff;
    text-align: left;
}

.styled-table th,
.styled-table td {
    padding: 12px 15px;
    font-size: 0.9rem;
}

.styled-table tbody tr {
    border-bottom: 1px solid #dddddd;
}

.styled-table tbody tr:nth-of-type(even) {
    background-color: #f7f9fc;
}

.styled-table tbody tr:last-of-type {
    border-bottom: 2px solid #2c3e50;
}

hr {
    border: 0;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 15px 0;
}

@media (max-width: 768px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }

    .card[style*="grid-column"] {
        grid-column: span 1 !important;
    }

    .charges-grid {
        grid-template-columns: 1fr;
    }

    .routeRow {
        flex-direction: column;
    }

    .section-add-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .driver-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
}