:root {
    --ff-primary: #0f6d5f;
    --ff-primary-dark: #064f45;
    --ff-accent: #f4a51c;
    --ff-ink: #20313b;
    --ff-muted: #6f7f86;
    --ff-bg: #f4f7f8;
    --ff-surface: #ffffff;
    --ff-border: #dbe5e7;
}

body.fixflow-app {
    background: var(--ff-bg);
    color: var(--ff-ink);
    font-family: "Roboto", Arial, sans-serif;
}

.fixflow-navbar {
    background: var(--ff-primary-dark);
    box-shadow: 0 8px 28px rgba(6, 79, 69, .18);
}

.fixflow-navbar .navbar-brand,
.fixflow-navbar .nav-link {
    color: #fff;
    font-weight: 600;
}

.fixflow-navbar .nav-link {
    opacity: .82;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

.fixflow-navbar .nav-link.active,
.fixflow-navbar .nav-link:hover {
    color: #fff;
    opacity: 1;
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ff-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ff-primary-dark);
}

.app-main {
    min-height: calc(100vh - 126px);
}

.fixflow-footer {
    background: #fff;
    border-top: 1px solid var(--ff-border);
    color: var(--ff-muted);
    padding: 18px 0;
    font-size: 14px;
}

.page-heading h1 {
    font-size: clamp(1.6rem, 3vw, 2.45rem);
    font-weight: 800;
    letter-spacing: 0;
}

.page-heading p {
    color: var(--ff-muted);
    max-width: 780px;
}

.theme-card {
    background: var(--ff-surface);
    border: 1px solid var(--ff-border);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(22, 44, 52, .06);
}

.metric-card {
    min-height: 132px;
    padding: 22px;
}

.metric-card .icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 109, 95, .1);
    color: var(--ff-primary);
}

.metric-card .value {
    font-size: 2rem;
    font-weight: 800;
}

.btn-primary,
.btn-success {
    background: var(--ff-primary);
    border-color: var(--ff-primary);
}

.btn-primary:hover,
.btn-success:hover {
    background: var(--ff-primary-dark);
    border-color: var(--ff-primary-dark);
}

.btn-warning {
    background: var(--ff-accent);
    border-color: var(--ff-accent);
    color: #1e2d32;
}

.table {
    vertical-align: middle;
}

.table thead th {
    color: var(--ff-muted);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom-width: 1px;
}

.form-control,
.form-select {
    border-color: var(--ff-border);
    border-radius: 6px;
    min-height: 44px;
}

.auth-shell {
    max-width: 980px;
    margin: 0 auto;
}

.auth-panel {
    overflow: hidden;
}

.auth-copy {
    background: linear-gradient(135deg, var(--ff-primary-dark), var(--ff-primary));
    color: #fff;
    padding: 42px;
}

.auth-copy p {
    color: rgba(255,255,255,.82);
}

.health-ring {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
}

.timeline {
    position: relative;
}

.timeline-item {
    border-left: 3px solid var(--ff-primary);
    padding-left: 18px;
    padding-bottom: 18px;
}

.item-photo {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 8px;
    background: #e7eff0;
}

@media (max-width: 767px) {
    .metric-card { min-height: auto; }
    .auth-copy { padding: 28px; }
}

.pro-search-header {
    border-left: 4px solid var(--ff-primary);
}

.location-chip {
    background: #f7fbfa;
    font-weight: 700;
}

.pro-card {
    border-left: 4px solid transparent;
}

.pro-card:hover {
    border-left-color: var(--ff-primary);
}

.pro-rating {
    color: var(--ff-primary-dark);
    font-weight: 800;
}

.pro-rating .fa-star,
.text-warning {
    color: var(--ff-accent) !important;
}

.pro-meta,
.pro-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pro-meta span {
    background: #f2f7f8;
    border: 1px solid var(--ff-border);
    border-radius: 999px;
    padding: 6px 10px;
    color: var(--ff-muted);
    font-size: .9rem;
}

.pro-badges span {
    background: rgba(15, 109, 95, .1);
    color: var(--ff-primary-dark);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: .82rem;
    font-weight: 800;
}

.pro-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.pro-gallery img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 8px;
    background: #eef5f4;
}

@media (max-width: 767px) {
    .pro-gallery {
        grid-template-columns: 1fr;
    }
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.calendar-legend,
.calendar-filters,
.sync-toggles {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.calendar-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ff-muted);
    font-size: .92rem;
}

.maintenance-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--ff-border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.calendar-weekday {
    padding: 10px;
    background: #f3f8f7;
    color: var(--ff-muted);
    font-weight: 800;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    text-align: center;
}

.calendar-day {
    min-height: 112px;
    border: 0;
    border-top: 1px solid var(--ff-border);
    border-right: 1px solid var(--ff-border);
    background: #fff;
    padding: 10px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calendar-day:nth-child(7n) {
    border-right: 0;
}

.calendar-day:hover,
.calendar-day.active {
    background: #f7fbfa;
    box-shadow: inset 0 0 0 2px rgba(15, 109, 95, .22);
}

.calendar-day.muted {
    background: #f8fafb;
    color: #9ba8ad;
}

.calendar-date {
    font-weight: 800;
}

.calendar-dots {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.calendar-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.calendar-dot.scheduled {
    background: #21a67a;
}

.calendar-dot.due_soon {
    background: #f1b731;
}

.calendar-dot.overdue {
    background: #d94b4b;
}

.calendar-details-pane {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 110%);
    width: min(980px, calc(100% - 24px));
    max-height: 72vh;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--ff-border);
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -18px 48px rgba(22, 44, 52, .18);
    padding: 18px;
    z-index: 1070;
    transition: transform .18s ease;
}

.calendar-details-pane.open {
    transform: translate(-50%, 0);
}

.details-handle {
    width: 58px;
    height: 5px;
    border-radius: 999px;
    background: #ccd8db;
    margin: 0 auto 14px;
}

.details-task {
    border: 1px solid var(--ff-border);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
    background: #fbfdfd;
}

.details-task-main {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.details-task-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: rgba(15, 109, 95, .1);
    color: var(--ff-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.details-task-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.inline-action-form {
    display: none;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.inline-action-form.open {
    display: flex;
}

@media (max-width: 767px) {
    .maintenance-calendar {
        font-size: .88rem;
    }
    .calendar-day {
        min-height: 82px;
        padding: 8px;
    }
    .calendar-weekday {
        padding: 8px 4px;
        font-size: .7rem;
    }
}

.chat-shell {
    overflow: hidden;
}

.chat-messages {
    min-height: 520px;
    max-height: 68vh;
    overflow-y: auto;
    padding: 22px;
    background: linear-gradient(180deg, #f8fbfb, #eef5f4);
}

.chat-composer {
    padding: 18px;
    background: #fff;
    border-top: 1px solid var(--ff-border);
}

.user-message,
.assistant-message {
    max-width: 900px;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 10px 22px rgba(22, 44, 52, .06);
}

.user-message {
    margin-left: auto;
    background: var(--ff-primary);
    color: #fff;
}

.assistant-message {
    background: #fff;
    border: 1px solid var(--ff-border);
}

.message-label {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 800;
    color: var(--ff-muted);
    margin-bottom: 8px;
}

.user-message .message-label {
    color: rgba(255,255,255,.78);
}

.diagnostic-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.diagnostic-section {
    border: 1px solid var(--ff-border);
    border-radius: 8px;
    padding: 14px;
    background: #fbfdfd;
}

.diagnostic-section h3 {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.safety-note {
    border-left: 4px solid var(--ff-accent);
    background: #fff8e9;
    padding: 10px 12px;
    border-radius: 6px;
    color: #5d4515;
}

.quick-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.diagnostic-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

@media (max-width: 991px) {
    .diagnostic-grid {
        grid-template-columns: 1fr;
    }
    .chat-messages {
        min-height: 420px;
        max-height: none;
    }
}

.chooser-button {
    min-height: 180px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    text-align: center;
    text-decoration: none;
    color: var(--ff-ink);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.chooser-button:hover {
    transform: translateY(-3px);
    color: var(--ff-primary);
    border-color: rgba(15, 109, 95, .35);
    box-shadow: 0 18px 36px rgba(22, 44, 52, .1);
}

.chooser-button i {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(15, 109, 95, .1);
    color: var(--ff-primary);
    font-size: 28px;
}

.chooser-button span {
    font-size: 1.05rem;
    font-weight: 800;
}

.tip-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #fff8e9;
    color: var(--ff-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.scanner-card {
    overflow: hidden;
}

.scanner-viewport {
    position: relative;
    min-height: 460px;
    background: #102b31;
}

.scanner-viewport video,
.scanner-viewport canvas,
.scanner-viewport img {
    width: 100%;
    height: 100%;
    min-height: 460px;
    display: block;
    object-fit: cover;
}

.scanner-box {
    position: absolute;
    inset: 22% 14%;
    border: 3px solid var(--ff-accent);
    border-radius: 8px;
    box-shadow: 0 0 0 999px rgba(0,0,0,.28);
    pointer-events: none;
}

.scanner-status {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,.92);
    color: var(--ff-ink);
    font-weight: 700;
}

.scanner-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 16px;
    background: #fff;
    border-top: 1px solid var(--ff-border);
}

.result-sheet {
    position: sticky;
    top: 18px;
}

@media (max-width: 767px) {
    .scanner-viewport,
    .scanner-viewport video,
    .scanner-viewport canvas,
    .scanner-viewport img {
        min-height: 340px;
    }
}
