/* ============================================================
   MOBILE REPAIR ADMIN PANEL — Design System
   Font: Inter (body), Plus Jakarta Sans (headings)
   Palette: Deep Navy sidebar, White canvas, Indigo accents
   ============================================================ */

:root {
    --sidebar-bg:     #0f172a;
    --sidebar-hover:  #1e293b;
    --sidebar-active: #6366f1;
    --sidebar-text:   #94a3b8;
    --sidebar-width:  260px;

    --primary:        #6366f1;
    --primary-dark:   #4f46e5;
    --primary-light:  #eef2ff;
    --success:        #10b981;
    --success-light:  #d1fae5;
    --warning:        #f59e0b;
    --warning-light:  #fef3c7;
    --danger:         #ef4444;
    --danger-light:   #fee2e2;
    --info:           #3b82f6;
    --info-light:     #dbeafe;

    --bg:             #f8fafc;
    --surface:        #ffffff;
    --border:         #e2e8f0;
    --text:           #0f172a;
    --text-muted:     #64748b;
    --text-light:     #94a3b8;

    --radius-sm:      6px;
    --radius:         10px;
    --radius-lg:      14px;
    --shadow-sm:      0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow:         0 4px 16px rgba(0,0,0,.08);
    --shadow-lg:      0 10px 40px rgba(0,0,0,.12);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

/* ── Layout ──────────────────────────────────────────────── */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-body {
    padding: 24px 28px;
    flex: 1;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-logo {
    padding: 22px 20px 18px;
    border-bottom: 1px solid #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo .logo-icon {
    width: 38px; height: 38px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-logo .logo-text {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.sidebar-logo .logo-sub {
    font-size: 11px;
    color: var(--sidebar-text);
    font-weight: 400;
}

.sidebar-section {
    padding: 20px 12px 8px;
}

.sidebar-section-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #475569;
    padding: 0 10px;
    margin-bottom: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all .15s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-item .nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 20px;
    min-width: 18px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px 12px;
    border-top: 1px solid #1e293b;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
}

.admin-avatar {
    width: 34px; height: 34px;
    background: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.admin-name  { font-size: 13px; font-weight: 600; color: #fff; }
.admin-role  { font-size: 11px; color: var(--sidebar-text); }

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
    height: 62px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.topbar-actions { display: flex; align-items: center; gap: 12px; }

/* ── Page header ─────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.page-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Stat cards ──────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.stat-icon {
    width: 46px; height: 46px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.indigo  { background: var(--primary-light); color: var(--primary); }
.stat-icon.green   { background: var(--success-light); color: var(--success); }
.stat-icon.amber   { background: var(--warning-light); color: var(--warning); }
.stat-icon.red     { background: var(--danger-light);  color: var(--danger);  }
.stat-icon.blue    { background: var(--info-light);    color: var(--info);    }

.stat-value {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 3px;
}

/* ── Card ────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.card-body { padding: 20px; }

/* ── Table ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

thead th {
    background: #f8fafc;
    padding: 11px 14px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text);
    vertical-align: middle;
}

tbody tr:hover { background: #f8fafc; }
tbody tr:last-child td { border-bottom: none; }

/* ── Badge / Status ──────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
}

.badge-success  { background: var(--success-light); color: #065f46; }
.badge-danger   { background: var(--danger-light);  color: #991b1b; }
.badge-warning  { background: var(--warning-light); color: #92400e; }
.badge-info     { background: var(--info-light);    color: #1e40af; }
.badge-muted    { background: #f1f5f9;              color: var(--text-muted); }
.badge-primary  { background: var(--primary-light); color: #3730a3; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover  { background: var(--primary-dark); }
.btn-success  { background: var(--success); color: #fff; }
.btn-success:hover  { background: #059669; }
.btn-danger   { background: var(--danger);  color: #fff; }
.btn-danger:hover   { background: #dc2626; }
.btn-warning  { background: var(--warning); color: #fff; }
.btn-warning:hover  { background: #d97706; }
.btn-outline  { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover  { background: var(--primary-light); }
.btn-ghost    { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-ghost:hover    { background: var(--bg); color: var(--text); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-xs { padding: 3px 8px;  font-size: 11px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-control, .form-select {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color .15s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.form-control::placeholder { color: var(--text-light); }

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

.form-row { display: grid; gap: 16px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn .2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-16px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-lg { max-width: 700px; }

.modal-header {
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 16px;
    font-weight: 700;
}

.modal-close {
    background: none; border: none; cursor: pointer;
    font-size: 20px; color: var(--text-muted);
    padding: 2px 6px; border-radius: 4px;
}
.modal-close:hover { background: var(--bg); }

.modal-body   { padding: 20px 22px; }
.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ── Search & filters ────────────────────────────────────── */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 320px;
}

.search-box .bi-search {
    position: absolute;
    left: 11px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.search-box input {
    padding-left: 34px;
}

.filter-btn {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    transition: all .15s;
}

.filter-btn.active, .filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
}

.page-btn {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    transition: all .15s;
}

.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn:hover:not(.active) { border-color: var(--primary); color: var(--primary); }

/* ── Toast ───────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    min-width: 300px;
    max-width: 420px;
    padding: 14px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    font-weight: 500;
    animation: toastIn .25s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

.toast-success { background: #022c22; color: #6ee7b7; border-left: 4px solid var(--success); }
.toast-error   { background: #1f0707; color: #fca5a5; border-left: 4px solid var(--danger); }
.toast-warning { background: #1c1006; color: #fcd34d; border-left: 4px solid var(--warning); }
.toast-info    { background: #0c1a33; color: #93c5fd; border-left: 4px solid var(--info); }

/* ── Login page ──────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    background: var(--sidebar-bg);
}

.login-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    max-width: 480px;
}

.login-right {
    flex: 1;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-right::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.login-card {
    background: #1e293b;
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.login-logo-icon {
    width: 48px; height: 48px;
    background: var(--primary);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    color: #fff;
}

.login-logo-text {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}

.login-logo-sub { font-size: 12px; color: var(--sidebar-text); }

.login-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
}

.login-subtitle { font-size: 14px; color: var(--sidebar-text); margin-bottom: 28px; }

.login-card .form-label    { color: #cbd5e1; }
.login-card .form-control  { background: #0f172a; border-color: #334155; color: #fff; }
.login-card .form-control:focus { border-color: var(--primary); }
.login-card .form-control::placeholder { color: #475569; }

.login-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
    margin-top: 8px;
    font-family: inherit;
}
.login-btn:hover    { background: var(--primary-dark); }
.login-btn:disabled { opacity: .6; cursor: not-allowed; }

.login-error {
    background: #450a0a;
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Empty state ─────────────────────────────────────────── */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; opacity: .4; }
.empty-state .empty-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state .empty-sub   { font-size: 13px; }

/* ── Loading ─────────────────────────────────────────────── */
.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-row td { text-align: center; padding: 40px; color: var(--text-muted); }

/* ── Misc ────────────────────────────────────────────────── */
.text-muted    { color: var(--text-muted); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.text-warning  { color: var(--warning); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: 12px; }
.mt-3 { margin-top: 12px; }

#blazor-error-ui {
    background: lightyellow;
    bottom: 0; left: 0; right: 0;
    box-shadow: 0 -1px 0 rgba(0,0,0,.2);
    display: none;
    overflow: hidden;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
