/* ═══════════════════════════════════════════════════
   QUOTEFLOW AI — Enterprise UI Custom Styles
   ═══════════════════════════════════════════════════ */

/* ── Fonts & Base ── */
html, body {
    font-family: 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #F1F5F9;
    font-size: 14px;
}

/* ── Sidebar (Drawer) overrides ── */
.mud-drawer {
    border-right: none !important;
}

.mud-drawer-content {
    background: #1E293B !important;
}

.mud-nav-link {
    border-radius: 8px !important;
    margin: 2px 8px !important;
    padding: 8px 12px 8px 20px !important;
    color: #CBD5E1 !important;
    transition: all 0.15s ease !important;
    position: relative;
}

.mud-nav-link:hover {
    background: rgba(255,255,255,0.08) !important;
    color: #F1F5F9 !important;
}

.mud-nav-link.active {
    background: rgba(59,130,246,0.18) !important;
    color: #BFDBFE !important;
    font-weight: 600 !important;
    box-shadow: inset 3px 0 0 #3B82F6 !important;
}

/* ── Nav group: child items indent ── */
.mud-nav-group .mud-nav-link {
    padding-left: 44px !important;
}

.mud-nav-group > .mud-nav-link {
    padding-left: 20px !important;
}

.mud-nav-group .mud-nav-link-icon {
    color: #94A3B8 !important;
}

.mud-nav-link .mud-nav-link-icon {
    color: inherit !important;
}

.mud-drawer-header {
    background: #1E293B !important;
    border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}

/* ── AppBar ── */
.mud-appbar {
    background: #1E293B !important;
    border-bottom: 1px solid rgba(255,255,255,0.06) !important;
}

/* ── Main content background ── */
.mud-main-content {
    background: #F1F5F9 !important;
}

/* ── Drawer footer ── */
.drawer-footer {
    padding: 12px 16px;
    font-size: 0.7rem;
    color: #475569;
    border-top: 1px solid rgba(255,255,255,0.06);
    text-align: center;
}

/* ── Page Header (reusable) ── */
.page-header {
    margin-bottom: 24px;
}

.page-header .page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1E293B;
    line-height: 1.2;
    margin: 0;
}

.page-header .page-subtitle {
    color: #64748B;
    font-size: 0.875rem;
    margin-top: 4px;
}

/* ── Stat Cards ── */
.stat-card {
    border-radius: 12px !important;
    transition: box-shadow 0.2s ease, transform 0.15s ease !important;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748B;
    font-weight: 500;
}

/* ── MudTable customizations ── */
.mud-table-container {
    border-radius: 8px !important;
    overflow: hidden;
}

.mud-table-head .mud-table-cell {
    background: #F8FAFC !important;
    color: #64748B !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mud-table-row:hover td {
    background: #EFF6FF !important;
}

/* ── Status Chips ── */
.mud-chip {
    font-size: 0.7rem !important;
    height: 22px !important;
    font-weight: 500 !important;
}

/* ── Form fields ── */
.mud-input-label {
    font-size: 0.85rem;
    color: #64748B;
}

/* ── MudPaper cards ── */
.mud-paper {
    border-radius: 12px !important;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100,116,139,0.4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100,116,139,0.6); }

/* ══ Print styles ══ */
@media print {
    .no-print { display: none !important; }

    body { background: white !important; font-size: 12px; }

    .print-page {
        margin: 0;
        padding: 0;
    }
}

.print-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    background: white;
    font-family: 'Roboto', 'Segoe UI', system-ui, sans-serif;
    font-size: 13px;
    color: #1a1a1a;
}

.print-header {
    border-bottom: 2px solid #1E293B;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.print-garage-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1E293B;
}

.print-garage-sub {
    font-size: 0.8rem;
    color: #64748B;
}

.print-title {
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 8px 0 4px;
    color: #1E293B;
}

.print-ticket-number {
    text-align: center;
    font-size: 0.85rem;
    color: #64748B;
    margin-bottom: 16px;
}

.print-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.print-info-box {
    border: 1px solid #CBD5E1;
    border-radius: 6px;
    padding: 10px 14px;
}

.print-info-box h4 {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748B;
    margin: 0 0 6px;
    border-bottom: 1px solid #E2E8F0;
    padding-bottom: 4px;
}

.print-info-row {
    display: flex;
    gap: 6px;
    margin-bottom: 3px;
    font-size: 0.82rem;
}

.print-info-label {
    color: #64748B;
    min-width: 90px;
    flex-shrink: 0;
}

.print-info-value {
    font-weight: 500;
    word-break: break-word;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
    font-size: 0.82rem;
}

.print-table th {
    background: #F1F5F9;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 7px 10px;
    border: 1px solid #CBD5E1;
    text-align: left;
}

.print-table td {
    padding: 6px 10px;
    border: 1px solid #E2E8F0;
    vertical-align: middle;
}

.print-table td.right { text-align: right; }
.print-table th.right { text-align: right; }

.print-table tr:nth-child(even) td { background: #F8FAFC; }

.print-totals {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.print-totals table {
    border-collapse: collapse;
    min-width: 260px;
    font-size: 0.85rem;
}

.print-totals td {
    padding: 4px 10px;
}

.print-totals .total-label { color: #64748B; }

.print-totals .grand-total td {
    font-size: 1rem;
    font-weight: 700;
    border-top: 2px solid #1E293B;
    padding-top: 6px;
    color: #1E293B;
}

.print-notes {
    border: 1px solid #CBD5E1;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 0.82rem;
}

.print-notes h4 {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748B;
    margin: 0 0 4px;
}

.print-signatures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 24px;
    text-align: center;
    font-size: 0.8rem;
}

.print-sig-label {
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 40px;
}

.print-sig-line {
    border-top: 1px solid #94A3B8;
    margin-top: 4px;
    padding-top: 4px;
    color: #64748B;
    font-size: 0.72rem;
}

.print-footer {
    margin-top: 20px;
    border-top: 1px solid #E2E8F0;
    padding-top: 8px;
    text-align: center;
    font-size: 0.72rem;
    color: #94A3B8;
}

/* ── Blazor error UI ── */
#blazor-error-ui {
    background: #FEF2F2;
    bottom: 0;
    box-shadow: 0 -1px 3px rgba(0,0,0,0.1);
    color: #B91C1C;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .reload {
    color: #1D4ED8;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ── Inline Search ────────────────────────────────────────────────────────── */

.inline-search {
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    display: flex;
    gap: 8px;
    height: 38px;
    max-width: 520px;
    min-width: 420px;
    padding: 0 10px;
    position: relative;
    transition: background 0.15s, border-color 0.15s;
}

.inline-search:focus-within {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(255, 255, 255, 0.25);
}

.inline-search-icon {
    color: #94A3B8;
    flex-shrink: 0;
}

.inline-search-input {
    background: transparent;
    border: none;
    color: #F1F5F9;
    flex: 1;
    font-size: 0.875rem;
    outline: none;
    width: 100%;
}

.inline-search-input::placeholder {
    color: #94A3B8;
}

.inline-search-clear {
    background: none;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    display: flex;
    flex-shrink: 0;
    padding: 0;
}

.inline-search-clear:hover {
    color: #F1F5F9;
}

.inline-search-dropdown {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.18);
    left: 0;
    max-height: 440px;
    min-width: 100%;
    overflow-y: auto;
    position: absolute;
    top: calc(100% + 6px);
    z-index: 1300;
}

.inline-search-dropdown .is-empty {
    align-items: center;
    color: #64748B;
    display: flex;
    justify-content: center;
    padding: 1.25rem 1rem;
}

.inline-search-dropdown .is-group {
    border-bottom: 1px solid #F1F5F9;
}

.inline-search-dropdown .is-group:last-child {
    border-bottom: none;
}

.inline-search-dropdown .is-group-title {
    color: #94A3B8;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 0.6rem 1rem 0.3rem;
    text-transform: uppercase;
}

.inline-search-dropdown .is-hit {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 10px;
    padding: 0.5rem 1rem;
}

.inline-search-dropdown .is-hit:hover {
    background: #EFF6FF;
}

.inline-search-dropdown .is-hit-icon {
    color: #3B82F6;
    flex-shrink: 0;
}

.inline-search-dropdown .is-hit-main {
    min-width: 0;
}

.inline-search-dropdown .is-hit-title {
    color: #1E293B;
    font-size: 0.875rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inline-search-dropdown .is-hit-sub {
    color: #64748B;
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.inline-search-dropdown mark.is-mark {
    background: #FEF3C7;
    border-radius: 2px;
    color: #92400E;
    font-weight: 600;
    padding: 0 1px;
}

@media (max-width: 900px) {
    .inline-search {
        min-width: 240px;
    }
}

/* ── Notification Bell ────────────────────────────────────────────────────── */

.notif-bell {
    position: relative;
}

.notif-trigger {
    cursor: pointer;
    outline: none;
}

.notif-dropdown {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.18);
    min-width: 320px;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 1300;
}

.notif-header {
    align-items: center;
    border-bottom: 1px solid #F1F5F9;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    padding: 14px 16px 12px;
}

.notif-empty {
    align-items: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 1rem;
}

.notif-list {
    max-height: 360px;
    overflow-y: auto;
}

.notif-item {
    align-items: flex-start;
    cursor: pointer;
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    transition: background .1s;
}

.notif-item:hover {
    background: #F8FAFC;
}

.notif-item-icon {
    align-items: center;
    border-radius: 8px;
    display: flex;
    flex-shrink: 0;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.notif-color-info    { background: #DBEAFE; color: #3B82F6; }
.notif-color-error   { background: #FEE2E2; color: #EF4444; }
.notif-color-warning { background: #FEF3C7; color: #F59E0B; }
.notif-color-success { background: #D1FAE5; color: #10B981; }

.notif-item-body {
    flex: 1;
    min-width: 0;
}

.notif-item-title {
    color: #1E293B;
    font-size: .875rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notif-item-sub {
    color: #64748B;
    font-size: .75rem;
    margin-top: 2px;
}

.notif-footer {
    border-top: 1px solid #F1F5F9;
    padding: 10px 16px;
    text-align: center;
}
