/* ============================================
   WORKSHOP DASHBOARD — Keegz Auto Care
   ============================================ */

:root {
    --bg: #0a0a0a;
    --bg-card: #111111;
    --bg-button: #1a1a1a;
    --text: #ffffff;
    --text-dim: #888888;
    --text-muted: #555555;
    --accent: #00b4d8;
    --accent-glow: rgba(0, 180, 216, 0.25);
    --border: #222222;
    --border-light: #2a2a2a;
    --radius: 12px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

/* --- Layout --- */
.dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px 60px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* --- Header --- */
.dash-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.dash-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 3px;
}

.dash-subtitle {
    font-size: 14px;
    color: var(--text-dim);
}

.btn-new-booking {
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 700;
    background: var(--accent);
    color: #000;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}
.btn-new-booking:hover { opacity: 0.85; }

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.stats-grid-secondary {
    grid-template-columns: repeat(5, 1fr);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-card .stat-icon {
    display: none;
}

.stat-number {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-card-secondary .stat-number {
    font-size: 20px;
}

/* --- Section Titles --- */
.section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

/* --- Today's Schedule --- */
.today-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.today-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.today-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.15s ease;
}

.today-item:hover {
    border-color: var(--accent);
}

.today-time {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
    min-width: 60px;
    white-space: nowrap;
}

.today-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.today-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.today-detail {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.today-view {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-button);
    border: 1px solid var(--border);
    color: var(--text-dim);
    transition: all 0.2s ease;
    white-space: nowrap;
}
.today-view:hover { border-color: var(--accent); color: var(--accent); }

.dash-empty-small {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 12px 0;
}

/* --- Controls Bar --- */
.controls-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-wrap {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease;
}
.search-input:focus { outline: none; border-color: var(--accent); }
.search-input::placeholder { color: var(--text-muted); }

.filter-row, .date-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn, .date-btn {
    padding: 8px 18px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-button);
    border: 1px solid var(--border);
    color: var(--text-dim);
    transition: all 0.2s ease;
}
.filter-btn:hover, .date-btn:hover { border-color: var(--border-light); color: var(--text); }
.filter-btn.active, .date-btn.active { background: var(--accent); border-color: var(--accent); color: #000; }

/* --- Table --- */
.dash-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.dash-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.dash-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-dim);
    vertical-align: middle;
}

.booking-row { cursor: pointer; transition: background 0.15s ease; }
.booking-row:hover { background: var(--bg-card); }

.td-name { font-weight: 600; color: var(--text); }
.td-price { font-weight: 700; color: var(--accent); white-space: nowrap; }
.td-location { max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-pending { background: rgba(240, 173, 78, 0.15); color: #f0ad4e; border: 1px solid rgba(240, 173, 78, 0.3); }
.status-confirmed { background: rgba(92, 184, 92, 0.15); color: #5cb85c; border: 1px solid rgba(92, 184, 92, 0.3); }
.status-completed { background: rgba(100, 100, 100, 0.15); color: var(--text-muted); border: 1px solid rgba(100, 100, 100, 0.3); }
.status-deleted { background: rgba(220, 50, 50, 0.1); color: #e55; border: 1px solid rgba(220, 50, 50, 0.3); }

.view-btn {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-button);
    border: 1px solid var(--border);
    color: var(--text-dim);
    transition: all 0.2s ease;
}
.view-btn:hover { border-color: var(--accent); color: var(--accent); }

.dash-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    padding: 40px 0;
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}
.modal-overlay:not([hidden]) { display: flex; }

.modal {
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 24px;
    color: var(--text-muted);
    transition: color 0.2s ease;
    line-height: 1;
}
.modal-close:hover { color: var(--text); }

.modal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    padding-right: 32px;
}

.modal-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent);
    white-space: nowrap;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.modal-field { display: flex; flex-direction: column; gap: 4px; }
.modal-field-full { grid-column: 1 / -1; }

.modal-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-value { font-size: 14px; color: var(--text-dim); }

.modal-actions {
    display: flex;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.modal-btn {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.modal-btn-confirm { background: rgba(92, 184, 92, 0.15); border: 1px solid rgba(92, 184, 92, 0.3); color: #5cb85c; }
.modal-btn-confirm:hover { background: rgba(92, 184, 92, 0.25); }
.modal-btn-complete { background: rgba(100, 100, 100, 0.15); border: 1px solid rgba(100, 100, 100, 0.3); color: var(--text-dim); }
.modal-btn-complete:hover { background: rgba(100, 100, 100, 0.25); }
.modal-btn-delete { background: rgba(220, 50, 50, 0.1); border: 1px solid rgba(220, 50, 50, 0.3); color: #e55; }
.modal-btn-delete:hover { background: rgba(220, 50, 50, 0.2); }
.modal-btn-cancel { background: var(--bg-button); border: 1px solid var(--border); color: var(--text-dim); }
.modal-btn-cancel:hover { border-color: var(--border-light); color: var(--text); }

/* --- Form Inputs --- */
.form-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease;
}
.form-input:focus { outline: none; border-color: var(--accent); }

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-textarea { resize: vertical; min-height: 60px; }

.radio-row { display: flex; gap: 8px; }

.radio-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--bg-button);
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.radio-pill input[type="radio"] { display: none; }
.radio-pill:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #000; }

.form-error { color: #e55; font-size: 13px; font-weight: 600; padding: 8px 0; }

/* --- Responsive --- */
@media (max-width: 900px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid-secondary { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
    .dashboard { padding: 20px 12px 40px; gap: 16px; }

    .dash-header-row { flex-direction: column; gap: 12px; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid-secondary { grid-template-columns: repeat(2, 1fr); }

    .stat-number { font-size: 20px; }

    .today-item { flex-wrap: wrap; gap: 8px; }
    .today-time { min-width: auto; }

    .filter-row, .date-row { gap: 6px; }
    .filter-btn, .date-btn { padding: 6px 14px; font-size: 12px; }

    .dash-table th:nth-child(4),
    .dash-table td:nth-child(4),
    .dash-table th:nth-child(6),
    .dash-table td:nth-child(6) { display: none; }

    .modal-grid { grid-template-columns: 1fr; }
    .modal-actions { flex-direction: column; }
}
