:root {
    --brand-blue: #3a9fcf;
    --brand-blue-dark: #2563eb;
    --brand-navy: #1e293b;
    --brand-slate: #64748b;
    --brand-bg: #f0f9ff;
    --brand-page-bg: linear-gradient(160deg, #e0f2fe 0%, #f0f9ff 35%, #f8fafc 100%);
    --brand-card: #ffffff;
    --brand-border: #e2e8f0;
    --brand-text: #1e293b;
    --brand-muted: #64748b;
    --brand-success: #10b981;
    --brand-accent: #ff6b35;
    --brand-danger: #ef4444;
    --brand-primary: var(--brand-blue);
    --brand-secondary: var(--brand-accent);
}

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

body.report-app {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--brand-page-bg);
    min-height: 100vh;
    color: var(--brand-text);
    -webkit-font-smoothing: antialiased;
}

.report-topbar {
    background: var(--brand-navy);
    color: #fff;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 4px 20px rgba(30, 41, 59, 0.25);
}

.report-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.report-brand-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.report-brand-text h1 {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
}

.report-brand-text p {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-top: 2px;
}

.report-user-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.report-user-chip {
    text-align: right;
}

.report-user-chip .name {
    font-weight: 600;
    font-size: 0.95rem;
}

.report-user-chip .email {
    color: #94a3b8;
    font-size: 0.8rem;
}

.report-admin-badge {
    display: inline-block;
    margin-top: 4px;
    background: var(--brand-accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 999px;
}

.report-btn,
.report-btn-logout {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    text-decoration: none;
}

.report-btn:hover,
.report-btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.report-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

.report-section {
    margin-bottom: 28px;
}

.report-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--brand-blue);
}

.report-section-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--brand-navy);
}

.report-section-header i {
    color: var(--brand-blue);
}

.report-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.report-card {
    background: var(--brand-card);
    border: 1px solid var(--brand-border);
    border-radius: 14px;
    padding: 24px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    box-shadow: 0 2px 8px rgba(58, 159, 207, 0.08);
    border-left: 4px solid var(--brand-blue);
    text-decoration: none;
    color: inherit;
    display: block;
}

a.report-card:focus-visible {
    outline: 3px solid var(--brand-blue);
    outline-offset: 2px;
}

.report-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.15);
    border-left-color: var(--brand-blue-dark);
}

.report-card.repair { border-left-color: var(--brand-blue-dark); }
.report-card.detection { border-left-color: #0ea5e9; }
.report-card.inventory { border-left-color: var(--brand-slate); }

.report-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-bottom: 14px;
    color: #fff;
}

.report-card.repair .report-card-icon { background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark)); }
.report-card.detection .report-card-icon { background: linear-gradient(135deg, #38bdf8, #0ea5e9); }
.report-card.inventory .report-card-icon { background: linear-gradient(135deg, #94a3b8, var(--brand-slate)); }

.report-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--brand-navy);
}

.report-card p {
    color: var(--brand-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.report-admin-panel {
    background: linear-gradient(135deg, #fff7ed, #fff);
    border: 1px solid #fed7aa;
    border-left: 4px solid var(--brand-accent);
    border-radius: 14px;
    padding: 20px;
}

.report-admin-panel h2 {
    color: #c2410c;
    font-size: 1rem;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-admin-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.report-admin-card {
    background: var(--brand-navy);
    color: #fff;
    border-radius: 10px;
    padding: 18px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    display: block;
}

.report-admin-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(30, 41, 59, 0.3);
}

.report-admin-card i {
    font-size: 1.4rem;
    color: var(--brand-blue);
    margin-bottom: 8px;
}

.report-admin-card h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.report-admin-card p {
    font-size: 0.8rem;
    color: #94a3b8;
}

.report-stats-panel {
    background: var(--brand-card);
    border: 1px solid var(--brand-border);
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(58, 159, 207, 0.08);
}

.report-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
}

.report-stat-tile {
    background: var(--brand-bg);
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
}

.report-stat-tile i {
    color: var(--brand-blue);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.report-stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--brand-blue-dark);
    line-height: 1.2;
}

.report-stat-number.report-stat-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand-navy);
    word-break: break-word;
}

.report-stat-label {
    color: var(--brand-muted);
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 4px;
}

.report-stat-tile.loading .report-stat-number {
    color: #cbd5e1;
}

.report-stat-error {
    color: var(--brand-danger);
    font-size: 0.85rem;
    margin-top: 10px;
    display: none;
}

/* Login / auth pages */
body.report-login-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--brand-page-bg);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
}

.report-login-shell {
    width: 100%;
    max-width: 420px;
}

.report-login-card {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--brand-border);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(58, 159, 207, 0.15);
    width: 100%;
    max-width: 420px;
}

.report-login-header {
    text-align: center;
    margin-bottom: 28px;
}

.report-login-logo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.report-login-logo {
    width: 88px;
    height: 88px;
    object-fit: contain;
    background: #fff;
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 4px 16px rgba(58, 159, 207, 0.2);
    border: 1px solid var(--brand-border);
}

.report-login-header h1 {
    color: var(--brand-navy);
    font-size: 1.6rem;
    font-weight: 700;
}

.report-login-header p {
    color: var(--brand-muted);
    font-size: 0.95rem;
}

.report-form-tabs {
    display: flex;
    margin-bottom: 22px;
    background: var(--brand-bg);
    border-radius: 10px;
    padding: 4px;
    border: 1px solid #bae6fd;
}

.report-tab-button {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    color: var(--brand-muted);
}

.report-tab-button.active {
    background: #fff;
    color: var(--brand-blue-dark);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.report-form-group {
    margin-bottom: 18px;
}

.report-form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--brand-navy);
    font-weight: 600;
    font-size: 0.9rem;
}

.report-form-group input,
.report-form-group select,
.report-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--brand-border);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: #fff;
    font-family: inherit;
}

.report-form-group input:focus,
.report-form-group select:focus,
.report-form-group textarea:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(58, 159, 207, 0.15);
}

.report-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark));
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.report-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.report-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 0.9rem;
    font-weight: 500;
}

.report-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.report-alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.report-form-content {
    display: none;
}

.report-form-content.active {
    display: block;
}

/* Admin dashboard */
.report-admin-page .report-nav-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.report-admin-page .report-nav-tab {
    padding: 12px 20px;
    background: var(--brand-card);
    border: 1px solid var(--brand-border);
    border-radius: 10px;
    color: var(--brand-navy);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.report-admin-page .report-nav-tab:hover {
    border-color: var(--brand-blue);
    color: var(--brand-blue-dark);
}

.report-admin-page .report-nav-tab.active {
    background: var(--brand-navy);
    color: #fff;
    border-color: var(--brand-navy);
}

.report-tab-content {
    display: none;
    background: var(--brand-card);
    border: 1px solid var(--brand-border);
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(58, 159, 207, 0.08);
}

.report-tab-content.active {
    display: block;
}

.report-admin-stat-card {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark));
    color: #fff;
    padding: 22px;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
}

.report-admin-stat-card h3 {
    font-size: 2rem;
    margin-bottom: 6px;
}

.report-admin-stat-card p {
    font-size: 0.95rem;
    opacity: 0.92;
}

.report-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.report-btn-primary {
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark));
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.report-btn-primary:hover {
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.report-btn-secondary {
    background: var(--brand-slate);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.report-btn-success {
    background: var(--brand-success);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.report-btn-danger {
    background: var(--brand-danger);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.report-table-wrap {
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.report-type-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.report-type-badge.detection {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #7dd3fc;
}

.report-type-badge.repair {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}

.report-site-footer {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px 40px;
    text-align: center;
    color: var(--brand-muted);
    font-size: 0.85rem;
    line-height: 1.6;
}

.report-site-footer a {
    color: var(--brand-blue-dark);
    text-decoration: none;
}

.report-site-footer a:hover {
    text-decoration: underline;
}

.report-site-footer-name {
    font-weight: 700;
    color: var(--brand-navy);
    margin-bottom: 6px;
}

.report-site-footer-muted {
    margin-top: 8px;
    font-size: 0.78rem;
}

body.report-login-page .report-site-footer {
    padding-top: 0;
    margin-top: -8px;
}

.report-login-tagline {
    color: var(--brand-blue);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 6px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
}

.report-table th,
.report-table td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid var(--brand-border);
}

.report-table th {
    background: var(--brand-bg);
    font-weight: 600;
    color: var(--brand-navy);
}

.report-table tr:hover {
    background: #f8fafc;
}

.report-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--brand-blue-dark);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 16px;
}

.report-back-link:hover {
    color: var(--brand-blue);
}

.report-panel {
    background: var(--brand-card);
    border: 1px solid var(--brand-border);
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(58, 159, 207, 0.08);
}

.report-empty-state {
    color: var(--brand-muted);
    text-align: center;
    padding: 32px 16px;
}

.report-modal-content {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--brand-border);
}

.report-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.report-modal-header h3 {
    color: var(--brand-navy);
    font-size: 1.15rem;
}

.report-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--brand-muted);
    line-height: 1;
}

.report-loading {
    text-align: center;
    padding: 20px;
    color: var(--brand-muted);
}

.report-loading i {
    font-size: 2rem;
    color: var(--brand-blue);
    animation: report-brand-spin 1s linear infinite;
}

@keyframes report-brand-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.report-table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.report-btn-discard {
    background: transparent;
    color: var(--brand-danger);
    border: 1px solid #fecaca;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.report-btn-discard:hover {
    background: #fef2f2;
}

.report-btn-discard:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.report-install-btn {
    border-color: rgba(255, 255, 255, 0.35);
}

.report-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.report-modal-content {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--brand-border);
}

@media (max-width: 768px) {
    .report-topbar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .report-brand {
        justify-content: center;
    }

    .report-user-bar {
        justify-content: center;
    }

    .report-user-chip {
        text-align: center;
    }

    .report-brand-logo {
        width: 56px;
        height: 56px;
    }

    .report-cards,
    .report-stats-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 480px) {
    .report-login-card {
        padding: 28px 20px;
    }

    .report-admin-page .report-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Dashboard resume banner */
.report-resume-banner {
    background: linear-gradient(135deg, rgba(58, 159, 207, 0.12), rgba(37, 99, 235, 0.08));
    border: 2px solid var(--brand-blue);
}

.report-resume-banner-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.report-resume-banner h2 {
    margin: 0 0 6px;
    font-size: 1.15rem;
    color: var(--brand-navy);
}

.report-resume-banner p {
    margin: 0;
    color: var(--brand-slate);
}

.report-resume-meta {
    font-size: 0.9rem;
    opacity: 0.85;
}

.report-resume-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.report-card-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4em;
    height: 1.4em;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--brand-blue);
    color: #fff;
    font-size: 0.75rem;
    vertical-align: middle;
}

/* Previous jobs search + mobile cards */
.report-draft-search-wrap {
    margin-bottom: 16px;
}

.report-draft-search {
    width: 100%;
    max-width: 420px;
    padding: 12px 14px;
    font-size: 16px;
    border: 2px solid var(--brand-border);
    border-radius: 10px;
    box-sizing: border-box;
}

.report-draft-cards {
    display: none;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.report-draft-card {
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    padding: 16px;
}

.report-draft-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.report-draft-card-meta {
    margin: 0 0 12px;
    font-size: 0.9rem;
    color: var(--brand-slate);
}

.report-draft-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.report-draft-no-results {
    text-align: center;
    color: var(--brand-slate);
    padding: 20px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Job form helpers */
.report-customer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.report-navigate-btn,
.report-call-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
}

.report-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    background: #fff;
    border: 2px solid var(--brand-border);
    color: var(--brand-navy);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.report-quick-templates {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(58, 159, 207, 0.06);
    border-radius: 10px;
}

.report-quick-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand-slate);
    margin-right: 4px;
}

.report-quick-btn {
    padding: 8px 12px;
    border: 1px solid var(--brand-blue);
    border-radius: 8px;
    background: #fff;
    color: var(--brand-blue-dark);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.report-quick-btn:active {
    background: var(--brand-blue);
    color: #fff;
}

.report-draft-status {
    display: block;
    width: 100%;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--brand-slate);
    text-align: center;
}

@media (max-width: 768px) {
    .report-draft-table-desktop {
        display: none;
    }

    .report-draft-cards {
        display: flex;
    }

    .report-resume-banner-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .report-resume-actions {
        flex-direction: column;
    }

    .report-resume-actions .report-btn-primary,
    .report-resume-actions .report-btn-secondary {
        justify-content: center;
        text-align: center;
    }
}
