:root {
    --background: oklch(97.2% .003 250);
    --foreground: oklch(24% .03 250);
    --card: #fff;
    --brand: oklch(42% .078 232);
    --brand-soft: oklch(95% .02 232);
    --muted: oklch(96.2% .004 250);
    --muted-foreground: oklch(55% .02 250);
    --border: oklch(91.5% .006 250);
    --radius: .75rem;
    --success: oklch(52% .13 155);
    --success-soft: oklch(95% .045 155);
    --warning: oklch(60% .15 62);
    --warning-soft: oklch(96% .05 75);
    --danger: oklch(55% .2 25);
    --danger-soft: oklch(95.5% .035 25);
    --info: oklch(53% .12 245);
    --info-soft: oklch(95.5% .03 245);
    --neutral-soft: oklch(94.5% .004 250);
    --orange: oklch(60% .15 40);
    --sidebar-bg: oklch(26% .055 240);
    --sidebar-fg: oklch(85% .01 250);
    --sidebar-muted: oklch(60% .02 250);
    --sidebar-active: oklch(33% .065 235);
    --sidebar-hover: oklch(30% .06 238);
    --sidebar-divider: oklch(33% .055 240);
    --sidebar-width: 256px;
    --topbar-height: 60px;
}

/* ── Reset ─────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    font-size: 14px;
    color: var(--foreground);
    background: var(--background);
    margin: 0;
}

a {
    color: inherit;
}

/* ── App shell ─────────────────────────────── */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1040;
    transition: transform .25s ease;
    scrollbar-width: none;
}

    .sidebar::-webkit-scrollbar {
        display: none;
    }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: 1.125rem 1rem .875rem;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid var(--sidebar-divider);
    margin-bottom: .375rem;
    flex-shrink: 0;
}

    .sidebar-brand:hover {
        color: #fff;
    }

.sidebar-brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.0625rem;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-brand-name {
    font-size: .9375rem;
    font-weight: 700;
    letter-spacing: .05em;
    line-height: 1.15;
}

.sidebar-brand-sub {
    font-size: .6875rem;
    font-weight: 400;
    color: var(--sidebar-muted);
}

.sidebar-nav {
    list-style: none;
    padding: 0 .5rem;
    margin: 0;
    flex: 1;
}

    .sidebar-nav li.nav-section-label {
        font-size: .6rem;
        font-weight: 700;
        letter-spacing: .1em;
        text-transform: uppercase;
        color: var(--sidebar-muted);
        padding: .875rem .625rem .25rem;
        list-style: none;
    }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .5625rem;
    padding: .4375rem .75rem;
    border-radius: .5rem;
    color: var(--sidebar-fg);
    text-decoration: none;
    font-size: .8125rem;
    font-weight: 500;
    margin-bottom: 2px;
    transition: background .12s, color .12s;
}

    .sidebar-link i {
        font-size: .9375rem;
        opacity: .75;
        flex-shrink: 0;
        width: 16px;
        text-align: center;
    }

    .sidebar-link:hover {
        background: var(--sidebar-hover);
        color: #fff;
        text-decoration: none;
    }

        .sidebar-link:hover i {
            opacity: 1;
        }

    .sidebar-link.active {
        background: var(--sidebar-active);
        color: #fff;
    }

        .sidebar-link.active i {
            opacity: 1;
        }

.sidebar-footer {
    padding: .625rem .5rem .875rem;
    border-top: 1px solid var(--sidebar-divider);
    flex-shrink: 0;
}

/* ── Main area ─────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ── Topbar ────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 0 1.25rem;
    z-index: 1030;
}

.topbar-search {
    position: relative;
    flex: 1;
    max-width: 400px;
}

    .topbar-search .search-icon {
        position: absolute;
        left: .625rem;
        top: 50%;
        transform: translateY(-50%);
        color: var(--muted-foreground);
        font-size: .875rem;
        pointer-events: none;
    }

    .topbar-search input {
        width: 100%;
        height: 34px;
        padding: 0 .75rem 0 2.125rem;
        border: 1px solid var(--border);
        border-radius: 999px;
        background: var(--muted);
        font-size: .8125rem;
        color: var(--foreground);
        outline: none;
        font-family: inherit;
        transition: border-color .15s, background .15s;
    }

        .topbar-search input:focus {
            border-color: var(--brand);
            background: #fff;
        }

.demo-badge {
    font-size: .6875rem;
    font-weight: 600;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: var(--warning-soft);
    color: var(--warning);
    white-space: nowrap;
    flex-shrink: 0;
}

.topbar-spacer {
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: .25rem;
}

.topbar-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-foreground);
    font-size: 1.0625rem;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, color .15s;
}

    .topbar-btn:hover {
        background: var(--muted);
        color: var(--foreground);
        text-decoration: none;
    }

.topbar-user {
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    padding: .25rem .5rem;
    border-radius: var(--radius);
    margin-left: .25rem;
    transition: background .15s;
    text-decoration: none;
    color: inherit;
}

    .topbar-user:hover {
        background: var(--muted);
    }

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.user-name {
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1.2;
}

.user-role {
    font-size: .6875rem;
    color: var(--muted-foreground);
    line-height: 1.2;
}

/* ── Page content ──────────────────────────── */
.page-content {
    padding: 1.5rem;
    flex: 1;
}

/* ── Dashboard header ──────────────────────── */
.dash-header {
    margin-bottom: 1.5rem;
}

    .dash-header h1 {
        font-size: 1.375rem;
        font-weight: 700;
        margin: 0 0 .25rem;
        color: var(--foreground);
    }

    .dash-header .subtitle {
        font-size: .8125rem;
        color: var(--muted-foreground);
        margin: 0;
    }

/* ── KPI card ──────────────────────────────── */
.kpi-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.125rem 1.25rem;
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
    transition: border-color .15s, box-shadow .15s;
}

    .kpi-card:hover {
        border-color: var(--brand);
        box-shadow: 0 2px 10px rgba(0,0,0,.06);
        color: inherit;
        text-decoration: none;
    }

.kpi-label {
    font-size: .6875rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted-foreground);
    margin: 0 0 .5rem;
}

.kpi-value {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1;
    margin: 0 0 .375rem;
}

.kpi-trend {
    font-size: .75rem;
    color: var(--muted-foreground);
    margin: 0;
}

/* ── Section card ──────────────────────────── */
.section-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.125rem 1.25rem;
}

.section-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .875rem;
    gap: .5rem;
}

    .section-card-header h2 {
        font-size: .9375rem;
        font-weight: 600;
        margin: 0;
    }

.header-link {
    font-size: .8125rem;
    color: var(--brand);
    text-decoration: none;
    white-space: nowrap;
}

    .header-link:hover {
        text-decoration: underline;
    }

/* ── Ops list ──────────────────────────────── */
.ops-item {
    display: flex;
    gap: .75rem;
    padding: .6875rem 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
}

    .ops-item:first-of-type {
        padding-top: 0;
    }

    .ops-item:last-of-type {
        border-bottom: none;
        padding-bottom: 0;
    }

    .ops-item:hover {
        color: inherit;
        text-decoration: none;
    }

.ops-time {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--muted-foreground);
    min-width: 40px;
    padding-top: .125rem;
    flex-shrink: 0;
}

.ops-body {
    flex: 1;
    min-width: 0;
}

.ops-type-badge {
    display: inline-block;
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    padding: .125rem .4rem;
    border-radius: 4px;
    margin-bottom: .25rem;
}

.badge-entrega {
    background: var(--info-soft);
    color: var(--info);
}

.badge-recogida {
    background: var(--warning-soft);
    color: var(--warning);
}

.badge-mantenimiento {
    background: var(--neutral-soft);
    color: var(--muted-foreground);
}

.ops-client {
    font-size: .875rem;
    font-weight: 600;
    margin: 0 0 .125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ops-meta {
    font-size: .75rem;
    color: var(--muted-foreground);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ops-status {
    font-size: .75rem;
    font-weight: 600;
    padding-top: .125rem;
    white-space: nowrap;
    flex-shrink: 0;
}

    .ops-status.preparacion {
        color: var(--info);
    }

    .ops-status.en-ruta {
        color: var(--success);
    }

    .ops-status.pendiente {
        color: var(--warning);
    }

    .ops-status.preparada {
        color: var(--success);
    }

/* ── Attention list ────────────────────────── */
.attention-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4375rem 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--foreground);
    font-size: .8125rem;
    transition: color .12s;
}

    .attention-item:last-child {
        border-bottom: none;
    }

    .attention-item:hover {
        text-decoration: none;
    }

    .attention-item i {
        font-size: .9375rem;
        flex-shrink: 0;
    }

    .attention-item.danger i {
        color: var(--danger);
    }

    .attention-item.warning i {
        color: var(--warning);
    }

    .attention-item.info i {
        color: var(--info);
    }

    .attention-item.neutral i {
        color: var(--muted-foreground);
    }

    .attention-item:hover {
        color: var(--brand);
    }

/* ── Fleet bar ─────────────────────────────── */
.fleet-total {
    text-align: center;
    margin-bottom: .625rem;
}

    .fleet-total .fleet-num {
        font-size: 1.75rem;
        font-weight: 700;
        line-height: 1;
    }

    .fleet-total .fleet-label {
        font-size: .8125rem;
        color: var(--muted-foreground);
    }

.fleet-bar {
    display: flex;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: .75rem;
    gap: 2px;
}

.fleet-seg {
    border-radius: 999px;
}

.fl-disponibles {
    background: var(--success);
}

.fl-alquiladas {
    background: var(--brand);
}

.fl-reservadas {
    background: var(--warning);
}

.fl-limpieza {
    background: var(--info);
}

.fl-revision {
    background: var(--orange);
}

.fl-reparacion {
    background: var(--danger);
}

.fleet-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .3rem .5rem;
}

.fleet-legend-item {
    display: flex;
    align-items: center;
    gap: .375rem;
    font-size: .75rem;
}

.fleet-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.fleet-legend-name {
    color: var(--muted-foreground);
    flex: 1;
}

.fleet-legend-count {
    font-weight: 600;
}

/* ── Work orders table ─────────────────────── */
.wo-table {
    width: 100%;
    font-size: .8125rem;
    border-collapse: collapse;
}

    .wo-table th {
        font-size: .6875rem;
        font-weight: 700;
        letter-spacing: .07em;
        text-transform: uppercase;
        color: var(--muted-foreground);
        padding: .375rem .75rem;
        border-bottom: 1px solid var(--border);
        text-align: left;
        white-space: nowrap;
    }

    .wo-table td {
        padding: .5625rem .75rem;
        border-bottom: 1px solid var(--border);
        vertical-align: middle;
    }

    .wo-table tbody tr:last-child td {
        border-bottom: none;
    }

    .wo-table tbody tr:hover td {
        background: oklch(98% .002 250);
    }

.wo-id {
    font-weight: 600;
}

.wo-machine {
    color: var(--muted-foreground);
    font-size: .75rem;
}

.wo-tech {
    color: var(--muted-foreground);
}

.type-badge, .status-badge {
    display: inline-block;
    font-size: .6875rem;
    font-weight: 600;
    padding: .175rem .5rem;
    border-radius: 4px;
    white-space: nowrap;
}

.type-mantenimiento {
    background: var(--neutral-soft);
    color: var(--muted-foreground);
}

.type-incidencia {
    background: var(--danger-soft);
    color: var(--danger);
}

.type-revision {
    background: var(--info-soft);
    color: var(--info);
}

.st-encurso {
    background: var(--info-soft);
    color: var(--info);
}

.st-pendiente {
    background: var(--warning-soft);
    color: var(--warning);
}

.st-finalizado {
    background: var(--success-soft);
    color: var(--success);
}

.st-pendrepuesto {
    background: var(--danger-soft);
    color: var(--danger);
}

.st-asignado {
    background: var(--neutral-soft);
    color: var(--muted-foreground);
}

/* ── Activity feed ─────────────────────────── */
.feed-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feed-item {
    display: flex;
    gap: .625rem;
    padding: .5625rem 0;
    border-bottom: 1px solid var(--border);
}

    .feed-item:last-child {
        border-bottom: none;
    }

.feed-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    margin-top: .3125rem;
    flex-shrink: 0;
}

    .feed-dot.live {
        background: var(--success);
        animation: dot-pulse 2s infinite;
    }

@keyframes dot-pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: .35;
    }
}

.feed-body {
    flex: 1;
    min-width: 0;
}

.feed-text {
    font-size: .8125rem;
    color: var(--foreground);
    margin: 0 0 .125rem;
    line-height: 1.35;
}

.feed-meta {
    font-size: .75rem;
    color: var(--muted-foreground);
    margin: 0;
}

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .6875rem;
    font-weight: 700;
    color: var(--success);
    background: var(--success-soft);
    padding: .175rem .5rem;
    border-radius: 999px;
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: dot-pulse 2s infinite;
}

/* ── Upcoming list ─────────────────────────── */
.upcoming-item {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .5rem 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: color .12s;
}

    .upcoming-item:last-child {
        border-bottom: none;
    }

    .upcoming-item:hover {
        color: var(--brand);
        text-decoration: none;
    }

.upcoming-date {
    font-size: .75rem;
    font-weight: 600;
    color: var(--muted-foreground);
    white-space: nowrap;
    min-width: 80px;
}

.upcoming-title {
    font-size: .8125rem;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.up-badge {
    font-size: .6875rem;
    font-weight: 600;
    padding: .175rem .45rem;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.up-entregada {
    background: var(--success-soft);
    color: var(--success);
}

.up-recogida {
    background: var(--info-soft);
    color: var(--info);
}

.up-incidencia {
    background: var(--danger-soft);
    color: var(--danger);
}

.up-pendiente {
    background: var(--neutral-soft);
    color: var(--muted-foreground);
}

/* ── Page header (título + botón acción) ────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header-text h1 {
    font-size: 1.375rem;
    font-weight: 700;
    margin: 0 0 .2rem;
}

.page-header-text p {
    font-size: .8125rem;
    color: var(--muted-foreground);
    margin: 0;
}

.btn-primary-brand {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1rem;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: .8125rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity .15s;
}

    .btn-primary-brand:hover {
        opacity: .88;
        color: #fff;
        text-decoration: none;
    }

/* ── Mini KPI row ──────────────────────────── */
.mini-kpi {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

    .mini-kpi .mk-value {
        font-size: 1.625rem;
        font-weight: 700;
        line-height: 1;
        margin: 0 0 .2rem;
    }

    .mini-kpi .mk-label {
        font-size: .75rem;
        color: var(--muted-foreground);
        margin: 0;
    }

/* ── Filter bar ────────────────────────────── */
.filter-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: .875rem;
}

.filter-search {
    position: relative;
    margin-bottom: .875rem;
}

    .filter-search .search-icon {
        position: absolute;
        left: .75rem;
        top: 50%;
        transform: translateY(-50%);
        color: var(--muted-foreground);
        font-size: .875rem;
        pointer-events: none;
    }

    .filter-search input {
        width: 100%;
        height: 38px;
        padding: 0 .875rem 0 2.25rem;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: var(--muted);
        font-size: .8125rem;
        color: var(--foreground);
        font-family: inherit;
        outline: none;
        transition: border-color .15s, background .15s;
    }

        .filter-search input:focus {
            border-color: var(--brand);
            background: #fff;
        }

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
}

.pill-btn {
    display: inline-block;
    padding: .3rem .75rem;
    border-radius: 999px;
    font-size: .8125rem;
    font-weight: 500;
    cursor: pointer;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--foreground);
    transition: border-color .12s, background .12s, color .12s;
    text-decoration: none;
    line-height: 1.4;
}

    .pill-btn:hover {
        border-color: var(--brand);
        color: var(--brand);
        text-decoration: none;
    }

    .pill-btn.active {
        background: var(--brand);
        border-color: var(--brand);
        color: #fff;
    }

/* ── Extended status badges ────────────────── */
.st-activo {
    background: var(--success-soft);
    color: var(--success);
}

.st-confirmado {
    background: var(--info-soft);
    color: var(--info);
}

.st-reserva {
    background: var(--warning-soft);
    color: var(--warning);
}

.st-pend-recogida {
    background: oklch(96% .05 75);
    color: oklch(55% .18 55);
}

.st-finalizado-alt {
    background: var(--neutral-soft);
    color: var(--muted-foreground);
}

/* Modalidad text color */
.mod-mensual {
    color: var(--info);
    font-weight: 500;
}

.mod-evento {
    color: var(--muted-foreground);
}

.mod-temporada {
    color: var(--success);
    font-weight: 500;
}

/* ── Placeholder section ───────────────────── */
.placeholder-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    color: var(--muted-foreground);
    gap: 1rem;
}

    .placeholder-section i {
        font-size: 3rem;
        opacity: .3;
    }

    .placeholder-section h1 {
        font-size: 1.25rem;
        font-weight: 600;
        color: var(--foreground);
        margin: 0;
    }

    .placeholder-section p {
        font-size: .875rem;
        margin: 0;
    }

/* ── Priority badges ───────────────────────── */
.prio-badge {
    display: inline-block;
    font-size: .6875rem;
    font-weight: 700;
    padding: .175rem .45rem;
    border-radius: 4px;
    white-space: nowrap;
}

.prio-urgente {
    background: var(--danger-soft);
    color: var(--danger);
}

.prio-alta {
    background: var(--warning-soft);
    color: var(--warning);
}

.prio-normal {
    background: var(--neutral-soft);
    color: var(--muted-foreground);
}

.prio-baja {
    background: var(--info-soft);
    color: var(--info);
}

/* ── Alert banner ──────────────────────────── */
.alert-banner {
    display: flex;
    align-items: flex-start;
    gap: .875rem;
    padding: .875rem 1.125rem;
    border-radius: var(--radius);
    border: 1px solid;
    margin-bottom: 1rem;
}

    .alert-banner.danger {
        background: var(--danger-soft);
        border-color: oklch(80% .12 25);
    }

    .alert-banner.warning {
        background: var(--warning-soft);
        border-color: oklch(82% .1 62);
    }

    .alert-banner i {
        font-size: 1.25rem;
        margin-top: .1rem;
        flex-shrink: 0;
    }

    .alert-banner.danger i {
        color: var(--danger);
    }

    .alert-banner.warning i {
        color: var(--warning);
    }

.alert-banner-body {
    flex: 1;
    min-width: 0;
}

.alert-banner-title {
    font-weight: 700;
    font-size: .875rem;
    margin: 0 0 .15rem;
    color: var(--foreground);
}

.alert-banner-sub {
    font-size: .8125rem;
    color: var(--muted-foreground);
    margin: 0;
}

.alert-banner-pill {
    font-size: .6875rem;
    font-weight: 700;
    padding: .2rem .5rem;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    flex-shrink: 0;
}

/* ── Parte card (Mi trabajo) ───────────────── */
.parte-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: .5rem;
}

.parte-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .375rem;
    flex-wrap: wrap;
}

.parte-card-id {
    font-size: .8125rem;
    font-weight: 700;
}

.parte-card-client {
    font-size: .9375rem;
    font-weight: 600;
    margin: 0 0 .2rem;
}

.parte-card-desc {
    font-size: .8125rem;
    color: var(--muted-foreground);
    margin: 0 0 .5rem;
}

.parte-card-meta {
    display: flex;
    gap: .875rem;
    font-size: .75rem;
    color: var(--muted-foreground);
    flex-wrap: wrap;
    margin-bottom: .625rem;
}

    .parte-card-meta i {
        font-size: .875rem;
    }

.parte-card-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

/* ── Small buttons ─────────────────────────── */
.btn-sm {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .325rem .75rem;
    border-radius: .5rem;
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
    transition: opacity .12s;
    line-height: 1.4;
}

    .btn-sm:hover {
        opacity: .85;
        text-decoration: none;
    }

    .btn-sm.brand {
        background: var(--brand);
        color: #fff;
        border-color: var(--brand);
    }

    .btn-sm.outline {
        background: transparent;
        color: var(--foreground);
        border-color: var(--border);
    }

        .btn-sm.outline:hover {
            border-color: var(--brand);
            color: var(--brand);
            opacity: 1;
        }

    .btn-sm.ghost {
        background: transparent;
        color: var(--muted-foreground);
        border-color: transparent;
    }

        .btn-sm.ghost:hover {
            background: var(--muted);
            color: var(--foreground);
            opacity: 1;
        }

/* ── Operation card ────────────────────────── */
.op-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: .5rem;
    display: flex;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s, box-shadow .15s;
}

    .op-card:hover {
        border-color: var(--brand);
        box-shadow: 0 2px 8px rgba(0,0,0,.05);
        text-decoration: none;
        color: inherit;
    }

.op-time {
    font-size: .9375rem;
    font-weight: 700;
    color: var(--muted-foreground);
    min-width: 46px;
    padding-top: .25rem;
}

.op-body {
    flex: 1;
    min-width: 0;
}

.op-date-line {
    font-size: .75rem;
    color: var(--muted-foreground);
    margin-bottom: .25rem;
    display: flex;
    gap: .5rem;
    align-items: center;
}

.op-client {
    font-size: .9375rem;
    font-weight: 600;
    margin: 0 0 .25rem;
}

.op-machines {
    font-size: .8125rem;
    color: var(--muted-foreground);
    margin: 0 0 .375rem;
}

.op-footer {
    display: flex;
    gap: 1rem;
    font-size: .75rem;
    color: var(--muted-foreground);
    flex-wrap: wrap;
}

.op-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .375rem;
}

.op-count {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--muted-foreground);
    white-space: nowrap;
}

/* ── Almacén card ──────────────────────────── */
.almacen-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .875rem 1.125rem;
    display: flex;
    align-items: center;
    gap: .875rem;
    margin-bottom: .5rem;
}

.almacen-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--neutral-soft);
    color: var(--muted-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.almacen-body {
    flex: 1;
    min-width: 0;
}

.almacen-model {
    font-size: .875rem;
    font-weight: 600;
    margin: 0 0 .15rem;
}

.almacen-meta {
    font-size: .75rem;
    color: var(--muted-foreground);
    margin: 0;
}

/* ── Maintenance upcoming ──────────────────── */
.mant-upcoming {
    display: flex;
    gap: .75rem;
    margin-bottom: .5rem;
    align-items: flex-start;
    padding: .625rem 0;
    border-bottom: 1px solid var(--border);
}

    .mant-upcoming:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }

.mant-date-box {
    min-width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--brand-soft);
    border: 1px solid oklch(88% .025 232);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mant-day {
    font-size: 1rem;
    font-weight: 700;
    color: var(--brand);
    line-height: 1;
}

.mant-mon {
    font-size: .5625rem;
    font-weight: 700;
    color: var(--brand);
    text-transform: uppercase;
}

.mant-sn {
    font-size: .8125rem;
    font-weight: 600;
    margin: 0 0 .15rem;
}

.mant-desc {
    font-size: .75rem;
    color: var(--muted-foreground);
    margin: 0;
}

/* ── Agenda ────────────────────────────────── */
.agenda-week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: .375rem;
}

.agenda-day-header {
    text-align: center;
    padding: .375rem .25rem .5rem;
}

.agenda-day-name {
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted-foreground);
}

.agenda-day-num {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.1;
}

.agenda-day-count {
    font-size: .625rem;
    color: var(--muted-foreground);
}

.agenda-today .agenda-day-num {
    color: var(--brand);
}

.agenda-event {
    border-radius: 5px;
    padding: .275rem .4rem;
    margin-bottom: 3px;
    font-size: .6rem;
    line-height: 1.35;
    overflow: hidden;
}

.agenda-event-time {
    font-weight: 700;
    display: block;
}

.agenda-event-type {
    font-weight: 600;
    display: block;
}

.agenda-event-detail {
    opacity: .8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.ev-entrega {
    background: var(--info-soft);
    color: var(--info);
}

.ev-recogida {
    background: var(--warning-soft);
    color: var(--warning);
}

.ev-mantenimiento {
    background: var(--neutral-soft);
    color: var(--muted-foreground);
}

.ev-revision {
    background: var(--success-soft);
    color: var(--success);
}

.ev-parte {
    background: var(--brand-soft);
    color: var(--brand);
}

.ev-incidencia {
    background: var(--danger-soft);
    color: var(--danger);
}

.ev-tarea {
    background: oklch(96% .02 280);
    color: oklch(42% .07 280);
}

.ev-comercial {
    background: oklch(96% .035 330);
    color: oklch(42% .09 330);
}

/* ── Config card ───────────────────────────── */
.config-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: border-color .15s, box-shadow .15s;
}

    .config-card:hover {
        border-color: var(--brand);
        box-shadow: 0 2px 8px rgba(0,0,0,.06);
        text-decoration: none;
        color: inherit;
    }

.config-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: .75rem;
}

.config-card h3 {
    font-size: .9375rem;
    font-weight: 600;
    margin: 0 0 .3rem;
}

.config-card p {
    font-size: .8125rem;
    color: var(--muted-foreground);
    margin: 0;
}

/* ── View toggle ───────────────────────────── */
.view-toggle {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: .5rem;
    overflow: hidden;
    background: var(--muted);
}

.view-toggle-btn {
    padding: .3rem .75rem;
    font-size: .8125rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
    font-family: inherit;
    transition: background .12s, color .12s;
}

    .view-toggle-btn.active {
        background: #fff;
        color: var(--foreground);
        box-shadow: 0 1px 3px rgba(0,0,0,.1);
    }

/* ── Extra status badges ───────────────────── */
.st-abierta {
    background: var(--danger-soft);
    color: var(--danger);
}

.st-reservado {
    background: var(--warning-soft);
    color: var(--warning);
}

.st-presupuesto {
    background: var(--neutral-soft);
    color: var(--muted-foreground);
}

.st-vencido {
    background: var(--danger-soft);
    color: var(--danger);
}

.st-pagado {
    background: var(--success-soft);
    color: var(--success);
}

.st-fianza {
    background: var(--brand-soft);
    color: var(--brand);
}

.st-inactivo {
    background: var(--neutral-soft);
    color: var(--muted-foreground);
}

.st-bloqueado {
    background: var(--danger-soft);
    color: var(--danger);
}

.st-pago-pend {
    background: var(--warning-soft);
    color: var(--warning);
}

.st-incid-abierta {
    background: var(--danger-soft);
    color: var(--danger);
}

.st-en-ruta {
    background: var(--info-soft);
    color: var(--info);
}

.st-preparacion {
    background: var(--info-soft);
    color: var(--info);
}

.st-en-limpieza {
    background: var(--info-soft);
    color: var(--info);
}

.st-en-reparacion {
    background: var(--danger-soft);
    color: var(--danger);
}

.st-en-revision {
    background: var(--warning-soft);
    color: var(--warning);
}

.st-disponible {
    background: var(--success-soft);
    color: var(--success);
}

.st-no-disp {
    background: var(--neutral-soft);
    color: var(--muted-foreground);
}

.st-pend-limpieza {
    background: var(--neutral-soft);
    color: var(--muted-foreground);
}

.st-pend-revision {
    background: var(--warning-soft);
    color: var(--warning);
}

.st-alquilada {
    background: var(--brand-soft);
    color: var(--brand);
}

.st-reservada {
    background: var(--warning-soft);
    color: var(--warning);
}

/* ── Cliente cell ──────────────────────────── */
.cliente-nombre {
    font-weight: 600;
    font-size: .875rem;
    display: block;
    margin-bottom: .125rem;
}

.cliente-cif {
    font-size: .75rem;
    color: var(--muted-foreground);
}

/* ── Mobile sidebar ────────────────────────── */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1035;
}

    .sidebar-backdrop.show {
        display: block;
    }

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

        .sidebar.show {
            transform: translateX(0);
            box-shadow: 4px 0 24px rgba(0,0,0,.25);
        }

    .main-content {
        margin-left: 0;
    }

    .topbar-search {
        max-width: none;
    }

    .demo-badge {
        display: none;
    }

    .user-name, .user-role {
        display: none;
    }
}

@media (min-width: 769px) {
    .topbar-hamburger {
        display: none !important;
    }
}

.row-clickable {
    cursor: pointer;
}
