/* Dashboard Wrapper */
.sauber-dashboard-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    font-family: 'Inter', sans-serif;
    color: #333;
}

/* Login Card */
.sauber-login-card {
    max-width: 450px;
    margin: 100px auto;
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(88, 49, 155, 0.15);
    border: 1px solid #efebff;
    text-align: center;
}

.sauber-login-card h2 {
    margin-bottom: 30px;
    color: #58319b;
}

.sauber-login-card .form-group {
    text-align: left;
    margin-bottom: 20px;
}

.sauber-login-card input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 15px;
}

.feedback-msg {
    margin-top: 20px;
    font-size: 14px;
    min-height: 20px;
}

.feedback-msg.error {
    color: #dc3545;
}

.feedback-msg.success {
    color: #28a745;
}

/* Dashboard UI */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 0 10px;
}

.dashboard-header h2 {
    margin: 0;
    color: #58319b;
}

.sauber-btn-outline {
    background: transparent;
    border: 2px solid #58319b;
    color: #58319b;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.sauber-btn-outline:hover {
    background: #58319b;
    color: #fff;
}

/* Stats Grid */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-bottom: 4px solid #58319b;
    text-align: center;
}

.stat-card h4 {
    margin: 0 0 10px 0;
    color: #6c757d;
    font-size: 14px;
    text-transform: uppercase;
}

.stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #58319b;
}

/* Table Card */
.dashboard-table-container {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(88, 49, 155, 0.08);
    border: 1px solid #efebff;
    overflow: hidden;
    margin-top: 20px;
}

.table-actions {
    padding: 24px;
    background: #fff;
    border-bottom: 1px solid #f0ecf7;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

#sauber-dashboard-search {
    flex: 1;
    max-width: 400px;
    padding: 12px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fdfcff;
}

#sauber-dashboard-search:focus {
    border-color: #58319b;
    box-shadow: 0 0 0 4px rgba(88, 49, 155, 0.1);
    outline: none;
    background: #fff;
}

.sauber-btn-small {
    background: #58319b;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.sauber-btn-small:hover {
    background: #46267c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(88, 49, 155, 0.2);
}

/* Table & Horizontal Scroll Support */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0 0 16px 16px;
}

#sauber-bookings-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    /* Remove fixed min-width to allow container to control it */
    min-width: 900px;
}

#sauber-bookings-table th {
    background: #f8f7ff;
    color: #58319b;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 16px 20px;
    border-bottom: 2px solid #efebff;
    text-align: left;
    white-space: nowrap;
}

#sauber-bookings-table td {
    padding: 16px 20px;
    vertical-align: middle;
    border-bottom: 1px solid #f2efff;
    color: #495057;
    font-size: 14px;
    transition: background 0.2s ease;
}

/* Column Specific Alignment & Constraints */
#sauber-bookings-table td:nth-child(2) {
    min-width: 150px;
}

/* Customer */
#sauber-bookings-table td:nth-child(3) {
    min-width: 180px;
}

/* Contact */
#sauber-bookings-table td:nth-child(4) {
    min-width: 250px;
}

/* Service & Add-ons */
#sauber-bookings-table td:nth-child(5) {
    min-width: 140px;
}

/* Schedule */

/* Right Align Amount */
#sauber-bookings-table th:nth-child(6),
#sauber-bookings-table td:nth-child(6) {
    text-align: right;
    padding-right: 30px;
}

/* Center Align Badges */
#sauber-bookings-table th:nth-child(7),
#sauber-bookings-table td:nth-child(7),
#sauber-bookings-table th:nth-child(8),
#sauber-bookings-table td:nth-child(8) {
    text-align: center;
}

#sauber-bookings-table td:last-child {
    text-align: center;
    white-space: nowrap;
    width: 120px;
}

#sauber-bookings-table tr:last-child td {
    border-bottom: none;
}

#sauber-bookings-table tr:hover td {
    background: #fbfaff;
}

/* Enhanced Status Badges */
.badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    text-align: center;
    min-width: 90px;
}

.badge-pending {
    background: #fff8e1;
    color: #f57c00;
    border: 1px solid #ffe0b2;
}

.badge-confirmed {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.badge-completed {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.badge-cancelled {
    background: #ffebee;
    color: #d32f2f;
    border: 1px solid #ffcdd2;
}

.badge-paid {
    background: #edf7ed;
    color: #1e4620;
    border: 1px solid #c3e6cb;
}

.badge-unpaid {
    background: #fff4e5;
    color: #663c00;
    border: 1px solid #ffe2b7;
}

/* Modern Action Buttons */
.action-icon {
    width: 38px;
    height: 38px;
    margin-right: 6px;
    cursor: pointer;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fdfcff;
    border: 1px solid #e8e4f0;
    color: #666;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.edit-btn:hover {
    background: #58319b;
    color: #fff;
    border-color: #58319b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 49, 155, 0.2);
}

.delete-btn:hover {
    background: #e53935;
    color: #fff;
    border-color: #e53935;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 57, 53, 0.2);
}

.action-icon i {
    font-size: 20px;
    line-height: 1;
}

#sauber-bookings-table td:last-child {
    white-space: nowrap;
    width: 120px;
}

/* Modal */
.sauber-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 16px;
    width: 600px;
    max-width: 90%;
    position: relative;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #aaa;
}

.close-modal:hover {
    color: #333;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Responsiveness */
@media (max-width: 1024px) {
    .dashboard-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .table-actions {
        flex-direction: column;
        align-items: stretch;
    }

    #sauber-dashboard-search {
        max-width: 100%;
    }
}

@media (max-width: 768px) {

    /* Stack Table into Cards */
    #sauber-bookings-table,
    #sauber-bookings-table thead,
    #sauber-bookings-table tbody,
    #sauber-bookings-table th,
    #sauber-bookings-table td,
    #sauber-bookings-table tr {
        display: block;
    }

    #sauber-bookings-table {
        min-width: 100%;
    }

    #sauber-bookings-table thead {
        display: none;
    }

    #sauber-bookings-table tr {
        margin-bottom: 25px;
        border: 1px solid #efebff;
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 4px 15px rgba(88, 49, 155, 0.05);
        overflow: hidden;
    }

    #sauber-bookings-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 15px 20px;
        border-bottom: 1px solid #f8f9fa;
    }

    #sauber-bookings-table td:last-child {
        border-bottom: none;
        background: #fbfaff;
        justify-content: center;
        padding: 20px;
    }

    #sauber-bookings-table td::before {
        content: attr(data-label);
        font-weight: 700;
        text-transform: uppercase;
        font-size: 10px;
        color: #58319b;
        text-align: left;
        flex: 1;
        margin-right: 15px;
    }

    /* Ensure action icons are visible */
    .action-icon {
        margin: 0 5px;
    }
}