:root {
    color-scheme: light;
    --theme-meta-color: #f2f5fb;
    --color-bg-main: #f2f5fb;
    --color-bg-secondary: #e9eef8;
    --color-surface: #ffffff;
    --color-surface-raised: #ffffff;
    --color-surface-muted: #f7f9fc;
    --color-surface-hover: #edf3fc;
    --color-border: #d5deeb;
    --color-border-strong: #b8c5d8;
    --color-text: #172033;
    --color-text-secondary: #627087;
    --color-text-inverse: #f8fafc;
    --color-primary: #2563eb;
    --color-primary-strong: #1d4ed8;
    --color-primary-soft: #dbeafe;
    --color-primary-hover: #1745b4;
    --color-success: #15803d;
    --color-success-soft: #dcfce7;
    --color-success-text: #166534;
    --color-warning: #d97706;
    --color-warning-soft: #fef3c7;
    --color-warning-text: #92400e;
    --color-error: #b42318;
    --color-error-strong: #8f1d15;
    --color-error-soft: #fee2e2;
    --color-error-text: #991b1b;
    --color-info-soft: #e0f2fe;
    --color-info-text: #075985;
    --color-violet-soft: #ede9fe;
    --color-violet-text: #5b21b6;
    --color-cyan-soft: #cffafe;
    --color-cyan-text: #155e75;
    --color-neutral-soft: #e2e8f0;
    --color-neutral-text: #475569;
    --color-field: #ffffff;
    --color-field-disabled: #e8edf5;
    --color-disabled-text: #8995a8;
    --color-focus-ring: rgba(37, 99, 235, 0.28);
    --color-selection: #bfdbfe;
    --color-table-stripe: #f8fafc;
    --color-table-hover: #edf3fc;
    --color-overlay: rgba(15, 23, 42, 0.68);
    --color-sidebar: #ffffff;
    --color-sidebar-muted: #64748b;
    --color-sidebar-text: #1e293b;
    --color-sidebar-border: #d9e2ef;
    --color-sidebar-hover: #edf3fc;
    --color-sidebar-active: #dbeafe;
    --color-sidebar-active-text: #1d4ed8;
    --color-logo-panel: #ffffff;
    --color-logo-surface: #ffffff;
    --shadow-panel: 0 12px 32px rgba(31, 51, 82, 0.08);
    --shadow-raised: 0 18px 38px rgba(31, 51, 82, 0.14);
    --scrollbar-track: #e5ebf4;
    --scrollbar-thumb: #5076c7;
    --scrollbar-thumb-hover: #315ab1;
    --bg: var(--color-bg-main);
    --panel: var(--color-surface);
    --panel-alt: var(--color-surface-muted);
    --text: var(--color-text);
    --muted: var(--color-text-secondary);
    --border: var(--color-border);
    --primary: var(--color-primary);
    --primary-dark: var(--color-primary-strong);
    --primary-soft: var(--color-primary-soft);
    --secondary: var(--color-sidebar-text);
    --secondary-dark: var(--color-text);
    --danger: var(--color-error);
    --danger-dark: var(--color-error-strong);
    --danger-soft: var(--color-error-soft);
    --badge: var(--color-surface-muted);
    --facil: var(--color-success-soft);
    --medio: var(--color-warning-soft);
    --dificil: var(--color-error-soft);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --theme-meta-color: #0b1220;
    --color-bg-main: #0b1220;
    --color-bg-secondary: #101a2b;
    --color-surface: #151f31;
    --color-surface-raised: #1a263a;
    --color-surface-muted: #111b2d;
    --color-surface-hover: #1d2c43;
    --color-border: #334258;
    --color-border-strong: #4a5c75;
    --color-text: #edf3ff;
    --color-text-secondary: #a8b6cc;
    --color-text-inverse: #f8fafc;
    --color-primary: #3b82f6;
    --color-primary-strong: #93c5fd;
    --color-primary-soft: #1b3152;
    --color-primary-hover: #bfdbfe;
    --color-success: #4ade80;
    --color-success-soft: #123524;
    --color-success-text: #86efac;
    --color-warning: #fbbf24;
    --color-warning-soft: #3b2b12;
    --color-warning-text: #fde68a;
    --color-error: #f87171;
    --color-error-strong: #fca5a5;
    --color-error-soft: #421d25;
    --color-error-text: #fecaca;
    --color-info-soft: #12324a;
    --color-info-text: #7dd3fc;
    --color-violet-soft: #2d2450;
    --color-violet-text: #c4b5fd;
    --color-cyan-soft: #123840;
    --color-cyan-text: #67e8f9;
    --color-neutral-soft: #273449;
    --color-neutral-text: #cbd5e1;
    --color-field: #101a2a;
    --color-field-disabled: #202b3e;
    --color-disabled-text: #728097;
    --color-focus-ring: rgba(96, 165, 250, 0.38);
    --color-selection: #1e4f91;
    --color-table-stripe: #111c2e;
    --color-table-hover: #1b2a41;
    --color-overlay: rgba(2, 6, 23, 0.82);
    --color-sidebar: #10192a;
    --color-sidebar-muted: #9fadc2;
    --color-sidebar-text: #e2e8f0;
    --color-sidebar-border: #2a3951;
    --color-sidebar-hover: #192942;
    --color-sidebar-active: #1d3a62;
    --color-sidebar-active-text: #bfdbfe;
    --color-logo-panel: #0a1222;
    --color-logo-surface: #0a1222;
    --shadow-panel: 0 14px 34px rgba(2, 6, 23, 0.3);
    --shadow-raised: 0 22px 44px rgba(2, 6, 23, 0.42);
    --scrollbar-track: #111b2d;
    --scrollbar-thumb: #4169b6;
    --scrollbar-thumb-hover: #5a83d1;
}

* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
}

img,
video,
canvas,
svg {
    max-width: 100%;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    box-shadow: inset 0 0 0 1px var(--color-border);
}

*::-webkit-scrollbar-thumb {
    min-height: 44px;
    border: 2px solid transparent;
    border-radius: 999px;
    background: var(--scrollbar-thumb);
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
    background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
    background: var(--scrollbar-track);
}

*::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top left, var(--color-focus-ring), transparent 30%),
        linear-gradient(180deg, var(--color-bg-main) 0%, var(--color-bg-secondary) 100%);
    color: var(--text);
}

::selection {
    background: var(--color-selection);
    color: var(--color-text);
}

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

.theme-toggle {
    position: fixed;
    top: max(1rem, env(safe-area-inset-top));
    right: max(1rem, env(safe-area-inset-right));
    z-index: 55;
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--color-border-strong);
    border-radius: 12px;
    background: var(--color-surface-raised);
    color: var(--color-text);
    box-shadow: var(--shadow-raised);
    cursor: pointer;
    isolation: isolate;
}

.theme-toggle:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-primary);
    color: var(--color-primary-strong);
}

.theme-toggle:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 3px;
}

.theme-toggle::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 0;
    width: max-content;
    max-width: min(220px, calc(100vw - 2rem));
    padding: 0.48rem 0.65rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface-raised);
    color: var(--color-text);
    box-shadow: var(--shadow-panel);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.25;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.theme-toggle:hover::after,
.theme-toggle:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

.theme-toggle-icon {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-toggle-sun {
    display: none;
}

html[data-theme="dark"] .theme-toggle-moon {
    display: none;
}

html[data-theme="dark"] .theme-toggle-sun {
    display: block;
}

.app-body {
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1100px, calc(100% - 2rem));
    margin: 0 auto;
}

.topbar {
    background: rgba(255, 253, 249, 0.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 5;
}

.topbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
}

.brand {
    display: inline-block;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.subtitle {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.nav a {
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.topbar-side {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.9rem;
    border-radius: 14px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.user-chip span {
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--muted);
}

.page {
    padding: 1.5rem 0 3rem;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    min-height: 100vh;
}

.dashboard-main {
    grid-column: 2;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.dashboard-content {
    min-width: 0;
    padding: 1.5rem;
}

.sidebar-toggle,
.sidebar-backdrop,
.sidebar-mobile-bar,
.sidebar-close {
    display: none;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 290px;
    height: 100vh;
    min-height: 100vh;
    overflow-y: auto;
    padding: 1.4rem;
    background: linear-gradient(180deg, #0f172a 0%, #172554 100%);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    scrollbar-color: #6f98f3 #111b36;
}

.sidebar::-webkit-scrollbar {
    width: 10px;
}

.sidebar::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-corner {
    background: #111b36;
}

.sidebar::-webkit-scrollbar-thumb {
    border-color: #111b36;
    background: linear-gradient(180deg, #7ca5ff 0%, #3e6dd3 100%);
    background-clip: padding-box;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #a8c2ff 0%, #5a88eb 100%);
    background-clip: padding-box;
}

.sidebar .brand {
    color: #fff;
    font-size: 1.7rem;
    line-height: 0.98;
    letter-spacing: 0.055em;
}

.sidebar-brand {
    display: grid;
    gap: 0.8rem;
}

.sidebar-brand-panel {
    position: relative;
    padding: 0.9rem 0.95rem 0.75rem;
    border-radius: 22px;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.22), transparent 42%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(15, 23, 42, 0.1));
    border: 1px solid rgba(191, 219, 254, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 20px 38px rgba(2, 6, 23, 0.28);
}

.sidebar-brand-mark {
    width: min(188px, 100%);
    height: auto;
    display: block;
    filter: drop-shadow(0 16px 22px rgba(15, 23, 42, 0.34));
}

.theme-logo-stack {
    display: grid;
    width: 100%;
    place-items: center;
}

.theme-logo-stack > .theme-logo {
    grid-area: 1 / 1;
    pointer-events: none;
}

.theme-logo-dark {
    visibility: hidden;
    opacity: 0;
}

html[data-theme="dark"] .theme-logo-light {
    visibility: hidden;
    opacity: 0;
}

html[data-theme="dark"] .theme-logo-dark {
    visibility: visible;
    opacity: 1;
}

.sidebar-brand-copy {
    display: grid;
    gap: 0.35rem;
}

.sidebar-brand-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(191, 219, 254, 0.8);
}

.sidebar-brand-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.brand-version {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0.18rem 0.58rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.16);
    border: 1px solid rgba(147, 197, 253, 0.22);
    color: #dbeafe;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.sidebar .subtitle {
    max-width: 23ch;
    color: rgba(226, 232, 240, 0.78);
    line-height: 1.5;
}

.sidebar-mobile-bar {
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.sidebar-mobile-bar strong {
    font-size: 0.92rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(191, 219, 254, 0.92);
}

.sidebar-close {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.sidebar-user {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.09);
}

.sidebar-user > div,
.sidebar-link > span:not(.sidebar-icon):not(.sidebar-badge) {
    min-width: 0;
    overflow-wrap: anywhere;
}

.sidebar-user-link {
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.sidebar-user-link:hover,
.sidebar-user-link:focus-visible {
    background: rgba(255, 255, 255, 0.13);
    border-color: rgba(191, 219, 254, 0.32);
    transform: translateY(-1px);
    outline: none;
}

.sidebar-user p {
    margin: 0.2rem 0;
    color: rgba(226, 232, 240, 0.78);
}

.user-avatar {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%);
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

.session-pill {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(96, 165, 250, 0.18);
    color: #bfdbfe;
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}

.sidebar-nav {
    display: grid;
    gap: 0.55rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    color: #dbeafe;
    transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.sidebar-link:hover,
.sidebar-link.is-active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: translateX(2px);
}

.sidebar-icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
}

.sidebar-actions {
    display: grid;
    gap: 0.75rem;
}

.sidebar-section {
    display: grid;
    gap: 0.7rem;
}

.sidebar-section-label {
    color: rgba(191, 219, 254, 0.78);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sidebar-section-links {
    display: grid;
    gap: 0.55rem;
}

.sidebar-link-compact {
    min-height: 0;
    padding: 0.78rem 0.9rem;
    border-radius: 14px;
}

.sidebar-quick-actions {
    grid-template-columns: 1fr;
}

.sidebar-action-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.72rem 0.9rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #dbeafe;
    font-weight: 700;
    text-align: center;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.sidebar-logout-form {
    margin: 0;
}

.sidebar-logout-form .sidebar-action-link {
    width: 100%;
    cursor: pointer;
    font: inherit;
}

.sidebar-action-link:hover,
.sidebar-action-link.is-active {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e3a8a;
}

.sidebar-action-link.danger {
    background: rgba(180, 35, 24, 0.14);
    border-color: rgba(248, 113, 113, 0.25);
    color: #fecaca;
}

.sidebar-action-link.danger:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.sidebar-button {
    width: 100%;
}

.sidebar-button.button.secondary {
    background: var(--primary-soft);
    border-color: #93c5fd;
    color: var(--primary-dark);
}

.sidebar-button.button.secondary:hover {
    background: #bfdbfe;
    color: #1e3a8a;
}

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    position: sticky;
    top: 0;
    z-index: 4;
}

.toolbar-label {
    color: #475569;
    font-size: 0.95rem;
    font-weight: 600;
}

.admin-toolbar-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.toolbar-link {
    padding: 0.62rem 0.9rem;
    border-radius: 8px;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: #1e293b;
    font-weight: 700;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.toolbar-link.is-active,
.toolbar-link:hover {
    background: var(--primary-soft);
    border-color: #93c5fd;
    color: var(--primary-dark);
    box-shadow: inset 0 -2px 0 var(--primary);
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.95fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 1.35rem;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95) 0%, rgba(30, 64, 175, 0.98) 100%);
    color: #eff6ff;
    box-shadow: 0 24px 46px rgba(37, 99, 235, 0.18);
}

.home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    padding: clamp(1.2rem, 2vw, 1.8rem);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 64, 175, 0.9)),
        linear-gradient(90deg, #0f172a, #1d4ed8);
    color: #f8fafc;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.home-hero h1 {
    margin: 0.35rem 0 0.55rem;
    font-size: clamp(2rem, 4vw, 3.3rem);
    line-height: 1;
}

.home-hero p {
    max-width: 760px;
    margin: 0;
    color: rgba(248, 250, 252, 0.82);
    line-height: 1.6;
}

.home-identity {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 220px;
    padding: 0.85rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.home-identity strong,
.home-identity span {
    display: block;
}

.home-identity span {
    color: rgba(248, 250, 252, 0.72);
}

.home-avatar {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #f8fafc;
    color: #1d4ed8;
    font-weight: 800;
}

.home-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.home-action {
    display: grid;
    gap: 0.45rem;
    min-height: 150px;
    padding: 1rem;
    border-radius: 8px;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.home-action:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.36);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.1);
}

.home-action span {
    color: #475569;
    font-weight: 700;
}

.home-action strong {
    font-size: 2rem;
    line-height: 1;
    color: #0f172a;
}

.home-action small {
    align-self: end;
}

.home-action.primary {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.home-action.warning {
    background: #fff7ed;
    border-color: #fed7aa;
}

.engineer-queue {
    margin-bottom: 1.25rem;
    padding: 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.engineer-queue.is-empty {
    background: #f8fafc;
}

.engineer-queue-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(250px, 310px);
    gap: 0.9rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
    padding: 0.25rem 0.1rem 0.35rem;
}

.engineer-device-card {
    scroll-snap-align: start;
    min-height: 330px;
    display: grid;
    grid-template-rows: 155px 1fr;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #dbe3ee;
    color: #0f172a;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.engineer-device-card:hover,
.engineer-device-card:focus-visible {
    transform: translateY(-2px);
    border-color: #93c5fd;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.12);
    outline: none;
}

.engineer-device-card.is-priority {
    border-color: #fca5a5;
    box-shadow: inset 0 0 0 2px rgba(180, 35, 24, 0.08), 0 14px 30px rgba(180, 35, 24, 0.12);
}

.engineer-device-media {
    position: relative;
    min-width: 0;
    background: #e2e8f0;
}

.engineer-device-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.engineer-device-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 0.4rem;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(15, 23, 42, 0.08)),
        #f1f5f9;
    color: #1e3a8a;
}

.engineer-device-placeholder span {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #dbeafe;
    font-size: 1.8rem;
    font-weight: 800;
}

.engineer-device-placeholder small {
    color: #475569;
    font-weight: 700;
}

.engineer-priority-ribbon {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.35rem 0.55rem;
    border-radius: 8px;
    background: #b42318;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(127, 29, 29, 0.24);
}

.engineer-device-copy {
    display: grid;
    gap: 0.55rem;
    align-content: start;
    padding: 0.9rem;
}

.engineer-device-topline,
.engineer-device-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
}

.engineer-device-topline strong {
    color: #1e3a8a;
}

.engineer-device-topline span {
    flex-shrink: 0;
    padding: 0.2rem 0.45rem;
    border-radius: 8px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.78rem;
    font-weight: 800;
}

.engineer-device-card.is-priority .engineer-device-topline span {
    background: #fee2e2;
    color: #991b1b;
}

.engineer-device-copy h3 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.25;
}

.engineer-device-copy p {
    margin: 0;
    color: #475569;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.engineer-device-meta {
    margin-top: 0.2rem;
    color: #64748b;
    font-size: 0.82rem;
}

.engineer-device-meta span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-workbench,
.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.home-panel {
    min-height: 260px;
}

.home-link-list {
    display: grid;
    gap: 0.65rem;
}

.home-link-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 0.95rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    font-weight: 700;
}

.home-link-list a:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.home-priority {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.home-priority span,
.home-priority p {
    color: #475569;
}

.home-priority strong {
    display: block;
    margin-top: 0.3rem;
    font-size: 2.4rem;
    color: #b42318;
}

.profile-intro {
    align-items: center;
}

.profile-badge {
    min-width: 210px;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.profile-badge strong,
.profile-badge span {
    display: block;
}

.profile-badge span {
    color: #475569;
}

.hero-panel h1,
.page-intro h1 {
    margin: 0.2rem 0 0.5rem;
    font-size: 2rem;
}

.hero-panel p {
    margin: 0;
    color: rgba(239, 246, 255, 0.85);
    line-height: 1.6;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #dbeafe;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.hero-stat {
    padding: 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-stat strong {
    display: block;
    font-size: 1.6rem;
}

.hero-stat span {
    color: rgba(239, 246, 255, 0.82);
}

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

.module-card {
    min-width: 0;
}

.module-card-link {
    display: grid;
    gap: 1rem;
    padding: 1.2rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.module-card-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 26px 46px rgba(15, 23, 42, 0.12);
    border-color: rgba(37, 99, 235, 0.28);
}

.module-card-link:active {
    transform: translateY(-1px) scale(0.995);
}

.module-copy h2 {
    margin: 0 0 0.45rem;
    font-size: 1.4rem;
}

.module-copy p,
.module-cta {
    margin: 0;
    color: #475569;
    line-height: 1.6;
}

.module-cta {
    font-weight: 700;
    color: #1d4ed8;
}

.module-visual,
.placeholder-visual {
    position: relative;
    min-height: 190px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: linear-gradient(145deg, #dbeafe 0%, #eff6ff 100%);
}

.visual-knowledge {
    background: radial-gradient(circle at top left, rgba(96, 165, 250, 0.45), transparent 40%),
        linear-gradient(145deg, #eff6ff 0%, #dbeafe 100%);
}

.visual-support {
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.3), transparent 38%),
        linear-gradient(145deg, #eef2ff 0%, #dbeafe 100%);
}

.visual-orb {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.18);
    top: -24px;
    right: -16px;
    filter: blur(0.4px);
}

.visual-lines {
    position: absolute;
    inset: 24px;
    display: grid;
    align-content: center;
    gap: 0.75rem;
}

.visual-lines span {
    display: block;
    height: 14px;
    border-radius: 999px;
    background: rgba(30, 64, 175, 0.14);
    animation: pulse-bars 1.8s ease-in-out infinite;
}

.visual-lines span:nth-child(2) {
    width: 78%;
    animation-delay: 0.15s;
}

.visual-lines span:nth-child(3) {
    width: 56%;
    animation-delay: 0.3s;
}

.visual-caption {
    position: absolute;
    left: 24px;
    bottom: 22px;
    font-size: 0.9rem;
    color: #1d4ed8;
    font-weight: 700;
}

@keyframes pulse-bars {
    0%, 100% { transform: scaleX(1); opacity: 0.75; }
    50% { transform: scaleX(1.04); opacity: 1; }
}

.page-intro {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.page-intro-copy {
    flex: 1 1 0;
    min-width: 0;
}

.page-intro h1,
.panel-heading h1,
.panel-heading h2,
.card h2,
.card h3,
.device-card h3,
.physical-summary-fields strong,
.device-grid strong {
    overflow-wrap: anywhere;
}

.page-intro-copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.knowledge-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.filter-panel {
    position: sticky;
    top: 88px;
}

.mobile-filter-shell {
    overflow: hidden;
}

.mobile-filter-toggle {
    display: none;
}

.mobile-filter-body {
    display: block;
}

.panel-heading.compact {
    margin-bottom: 0.75rem;
}

.filters-stack {
    grid-template-columns: 1fr;
}

.filters-stack .field,
.filters-stack .field.grow {
    grid-column: 1 / -1;
}

.results-header {
    margin-bottom: 1rem;
}

.card-elevated h3 {
    margin: 0.6rem 0 0.75rem;
}

.placeholder-panel {
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
    gap: 1rem;
    align-items: center;
}

.placeholder-copy h2 {
    margin-top: 0;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.25rem;
    box-shadow: 0 12px 32px rgba(36, 31, 26, 0.06);
    margin-bottom: 1.25rem;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-heading h1,
.panel-heading h2,
.detail-block h3 {
    margin: 0 0 0.35rem;
}

.panel-heading p,
.muted {
    margin: 0;
    color: var(--muted);
}

.filters-grid,
.form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1rem;
}

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

.editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(280px, 0.95fr);
    gap: 1rem;
    align-items: start;
}

.editor-main,
.editor-sidebar {
    margin-bottom: 0;
}

.stat-card {
    padding: 1rem 1.1rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #fffdf9 0%, #f8f4ec 100%);
}

.stat-label {
    display: block;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 2rem;
    line-height: 1;
}

.field {
    grid-column: span 3;
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0.35rem;
}

.field.grow {
    grid-column: span 12;
}

.field.full,
.actions-inline.full {
    grid-column: 1 / -1;
}

label {
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font: inherit;
}

textarea {
    resize: vertical;
}

small {
    color: var(--muted);
}

.actions-inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 42px;
    max-width: 100%;
    padding: 0.72rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    color: var(--secondary);
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.16s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.24);
    outline-offset: 2px;
}

.button.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.button.primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.button.secondary {
    background: #fff;
    border-color: #cbd5e1;
    color: var(--secondary);
}

.button.secondary:hover {
    background: #f8fafc;
    border-color: #64748b;
    color: var(--secondary-dark);
}

.button.danger {
    background: #fff;
    border-color: #fca5a5;
    color: var(--danger);
}

.button.danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.button-small {
    min-height: 36px;
    padding: 0.52rem 0.75rem;
    font-size: 0.9rem;
}

.cards-list {
    display: grid;
    gap: 1rem;
}

.card {
    background: rgba(255, 253, 249, 0.98);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 8px 18px rgba(36, 31, 26, 0.05);
}

.card h2 {
    margin: 0.6rem 0 0.8rem;
}

.card p {
    margin: 0.45rem 0;
    line-height: 1.55;
}

.meta-line {
    color: var(--muted);
}

.card-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.card-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.text-link {
    color: var(--primary-dark);
    font-weight: 600;
}

.tag-list,
.helper-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: var(--badge);
    color: #5f513e;
    font-size: 0.9rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-right: 0.5rem;
}

.pill-facil {
    background: var(--facil);
}

.pill-medio {
    background: var(--medio);
}

.pill-dificil {
    background: var(--dificil);
}

.date {
    color: var(--muted);
    font-size: 0.9rem;
}

.detail-grid {
    display: grid;
    gap: 1rem;
}

.detail-block {
    background: var(--panel-alt);
    border-radius: 14px;
    padding: 1rem;
    border: 1px solid var(--border);
}

.detail-block p {
    margin: 0;
    line-height: 1.65;
    white-space: pre-wrap;
}

.detail-image,
.image-inline img {
    display: block;
    max-width: 100%;
    border-radius: 14px;
    border: 1px solid var(--border);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 0.75rem;
}

.gallery-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.75rem;
}

.gallery-card-button {
    appearance: none;
    width: 100%;
    text-align: left;
    cursor: zoom-in;
}

.gallery-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    margin-bottom: 0.65rem;
}

.gallery-zoom-hint {
    display: inline-flex;
    color: #1d4ed8;
    font-size: 0.85rem;
    font-weight: 600;
}

.lightbox-open {
    overflow: hidden;
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
}

.lightbox-overlay[hidden] {
    display: none !important;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.82);
    cursor: zoom-out;
}

.lightbox-dialog {
    position: relative;
    z-index: 1;
    width: min(92vw, 1100px);
    max-height: 90vh;
    padding: 1rem;
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.94);
    box-shadow: 0 22px 70px rgba(15, 23, 42, 0.35);
}

.lightbox-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.85rem;
    padding-right: 3.25rem;
    flex-wrap: wrap;
}

.lightbox-toolbar-group {
    display: inline-flex;
    gap: 0.55rem;
    align-items: center;
    flex-wrap: wrap;
}

.lightbox-tool {
    min-width: 44px;
    min-height: 44px;
    padding: 0.55rem 0.85rem;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
}

.lightbox-tool-reset {
    font-size: 0.95rem;
    font-weight: 600;
}

.lightbox-tip {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.88rem;
}

.lightbox-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.lightbox-stage {
    overflow: hidden;
    border-radius: 14px;
    touch-action: none;
    cursor: grab;
    user-select: none;
}

.lightbox-stage.is-zoomed {
    cursor: grab;
}

.lightbox-stage.is-zoomed:active {
    cursor: grabbing;
}

.lightbox-image {
    display: block;
    width: 100%;
    max-height: calc(90vh - 2rem);
    object-fit: contain;
    border-radius: 14px;
    transform-origin: center center;
    transition: transform 0.12s ease-out;
    will-change: transform;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.upload-dropzone {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 150px;
    padding: 1.25rem;
    border: 2px dashed #93c5fd;
    border-radius: 16px;
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    overflow: hidden;
}

.upload-dropzone.is-active {
    border-color: #1d4ed8;
    background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
    transform: translateY(-1px);
}

.upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.upload-copy {
    text-align: center;
    display: grid;
    gap: 0.35rem;
    color: #1e3a8a;
    pointer-events: none;
}

.upload-copy strong {
    font-size: 1rem;
}

.upload-copy span {
    font-size: 0.95rem;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.9rem;
    margin-top: 0.9rem;
}

.preview-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.65rem;
    background: #fff;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.08);
}

.preview-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
    margin-bottom: 0.5rem;
}

.preview-card span {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
    word-break: break-word;
}

.preview-card .actions-inline {
    margin-top: 0.5rem;
}

.upload-feedback {
    margin-top: 0.75rem;
    color: var(--muted);
    min-height: 1.25rem;
}

.upload-feedback.is-error {
    color: var(--danger);
}

.client-compression-status {
    min-height: 1.15rem;
    margin-top: 0.4rem;
    color: #166534;
    font-size: 0.82rem;
    line-height: 1.35;
}

.draft-status {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1e40af;
    font-size: 0.9rem;
}

.draft-list {
    display: grid;
    gap: 0.85rem;
}

.draft-item {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.9rem;
    background: #fff;
}

.draft-item h3 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
}

.draft-item p {
    margin: 0.2rem 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.draft-item .actions-inline {
    margin-top: 0.65rem;
}

.image-inline {
    margin-top: 0.75rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.image-inline img {
    width: min(320px, 100%);
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-inline input {
    width: auto;
}

.suggestion-list {
    display: grid;
    gap: 1rem;
}

.suggestion-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem;
    background: var(--panel-alt);
}

.suggestion-card p {
    margin: 0.65rem 0;
    white-space: pre-wrap;
}

.suggestion-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.status-pendiente {
    background: #fff1c2;
}

.status-aplicada {
    background: #d1fae5;
}

.status-descartada {
    background: #fee2e2;
}

.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

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

th,
td {
    padding: 0.9rem 0.8rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 0.9rem;
}

.client-summary {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.flash-stack {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.flash {
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.flash-success {
    background: #eafaf1;
    border-color: #b7e4c7;
}

.flash-error {
    background: #fff0f0;
    border-color: #f0b7b7;
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--panel);
    border: 1px dashed var(--border);
    border-radius: 18px;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.login-shell {
    width: min(560px, calc(100% - 2rem));
}

.login-panel {
    padding: 1.5rem 1.35rem 1.4rem;
    background:
        radial-gradient(circle at top center, rgba(37, 99, 235, 0.08), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 251, 245, 0.96));
    border-radius: 22px;
    box-shadow:
        0 24px 54px rgba(37, 99, 235, 0.08),
        0 10px 28px rgba(36, 31, 26, 0.08);
}

.login-brand-block {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.login-brand-panel {
    width: min(100%, 360px);
    display: grid;
    place-items: center;
    padding: 1.1rem 1rem 0.95rem;
    border-radius: 22px;
    background:
        radial-gradient(circle at top center, rgba(37, 99, 235, 0.16), transparent 55%),
        linear-gradient(180deg, #ffffff 0%, #f5f8ff 100%);
    border: 1px solid rgba(59, 130, 246, 0.18);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 14px 32px rgba(37, 99, 235, 0.1);
}

.login-brand-mark {
    width: min(280px, 86%);
    height: auto;
    display: block;
    filter: drop-shadow(0 16px 28px rgba(30, 64, 175, 0.18));
}

.login-kicker {
    max-width: 32rem;
    margin: 0;
    font-size: clamp(0.95rem, 2.4vw, 1.08rem);
    font-weight: 650;
    line-height: 1.35;
    letter-spacing: 0;
    color: #475569;
}

.login-brand-version {
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-panel h1 {
    margin-top: 0;
    margin-bottom: 0;
    font-size: clamp(2.15rem, 7vw, 3rem);
    line-height: 0.98;
    letter-spacing: 0.045em;
}

.login-panel .muted {
    max-width: 32ch;
    line-height: 1.55;
}

.login-panel .flash-stack {
    margin-bottom: 1.25rem;
}

.login-panel .flash {
    border-radius: 14px;
}

.login-panel .form-grid {
    gap: 1.15rem;
}

.login-panel label {
    color: #332b24;
    font-size: 0.98rem;
}

.login-panel input {
    min-height: 54px;
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        background 0.16s ease;
}

.login-panel input:focus {
    border-color: rgba(37, 99, 235, 0.42);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    background: #fff;
    outline: none;
}

.login-panel .actions-inline.full {
    justify-content: center;
}

.login-panel .button.primary {
    min-width: 180px;
    min-height: 46px;
    border-radius: 12px;
    padding-inline: 1.25rem;
}

.login-help {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    border-radius: 12px;
}

@media screen and (max-width: 860px) {
    .dashboard-layout,
    .hero-panel,
    .home-hero,
    .module-grid,
    .knowledge-layout,
    .placeholder-panel,
    .home-workbench,
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-main {
        grid-column: auto;
    }

    .login-shell {
        width: min(100%, calc(100% - 1rem));
    }

    .login-panel {
        padding: 1.25rem 1rem 1.2rem;
    }

    .login-brand-panel {
        width: 100%;
        padding-inline: 0.85rem;
    }

    .admin-toolbar,
    .topbar-content,
    .panel-heading,
    .card-header,
    .suggestion-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .field {
        grid-column: 1 / -1;
    }

    .nav {
        width: 100%;
    }

    .topbar-side,
    .user-chip {
        width: 100%;
    }

    .editor-layout {
        grid-template-columns: 1fr;
    }

    .filter-panel {
        position: static;
        top: auto;
        margin-bottom: 1rem;
    }

    .page-intro {
        flex-direction: column;
    }

    .page-intro .actions-inline {
        width: 100%;
    }

    .mobile-filter-shell {
        padding: 0;
    }

    .mobile-filter-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: 1rem 1.15rem;
        cursor: pointer;
        list-style: none;
        font-weight: 700;
        color: #1e3a8a;
    }

    .mobile-filter-toggle::-webkit-details-marker {
        display: none;
    }

    .mobile-filter-toggle::after {
        content: "+";
        width: 2rem;
        height: 2rem;
        border-radius: 999px;
        display: grid;
        place-items: center;
        background: #dbeafe;
        color: #1d4ed8;
        font-size: 1.2rem;
        flex-shrink: 0;
    }

    .mobile-filter-shell[open] .mobile-filter-toggle::after {
        content: "âˆ’";
    }

    .mobile-filter-body {
        display: none;
        padding: 0 1.15rem 1.15rem;
        border-top: 1px solid rgba(148, 163, 184, 0.16);
    }

    .mobile-filter-shell[open] .mobile-filter-body {
        display: block;
    }

    .mobile-filter-body .panel-heading.compact {
        padding-top: 0.9rem;
    }

    .dashboard-content {
        padding: 1rem;
    }

    .home-identity {
        min-width: 0;
    }

    .engineer-queue {
        padding: 0.85rem;
    }

    .engineer-queue-track {
        grid-auto-columns: minmax(235px, 82vw);
    }

    .engineer-device-card {
        min-height: 315px;
        grid-template-rows: 140px 1fr;
    }

    .device-card {
        grid-template-columns: 1fr;
        gap: 0.85rem;
        padding: 0.9rem;
    }

    .device-card-media,
    .device-card-placeholder {
        min-height: 0;
        height: auto;
        aspect-ratio: 16 / 9;
        width: 100%;
    }

    .device-card-body {
        gap: 0.8rem;
    }

    .device-card .attention-chip {
        width: fit-content;
    }
}

.sidebar-badge {
    margin-left: auto;
    min-width: 1.5rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.78rem;
    text-align: center;
    font-weight: 700;
}

.module-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1rem 0 1.25rem;
}

.subnav-link {
    min-width: 0;
    padding: 0.68rem 0.95rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.32);
    color: var(--secondary);
    font-weight: 700;
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.subnav-link:hover,
.subnav-link.is-active {
    background: var(--primary-soft);
    border-color: #93c5fd;
    color: var(--primary-dark);
    box-shadow: inset 0 -2px 0 var(--primary);
    transform: translateY(-1px);
}

.physical-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.summary-card {
    display: grid;
    gap: 0.35rem;
}

.summary-card span {
    color: #64748b;
    font-size: 0.92rem;
}

.summary-card strong {
    font-size: 1.8rem;
    color: #0f172a;
}

.device-card-list {
    display: grid;
    gap: 1rem;
}

.history-live-search {
    display: grid;
    grid-template-columns: minmax(260px, 720px) minmax(220px, 1fr);
    gap: 0.8rem;
    align-items: end;
    padding: 0.85rem 1rem;
}

.history-live-search .field {
    max-width: none;
}

.history-search-tools {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.history-search-count {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.history-advanced-filters {
    position: relative;
}

.history-advanced-filters summary {
    min-height: 36px;
    padding: 0.52rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: var(--secondary);
    cursor: pointer;
    font-weight: 700;
    list-style: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.history-advanced-filters summary::-webkit-details-marker {
    display: none;
}

.history-filter-grid {
    position: absolute;
    right: 0;
    z-index: 5;
    width: min(920px, calc(100vw - 2rem));
    margin-top: 0.5rem;
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 0.75rem;
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.16);
}

.history-filter-grid .actions-inline {
    align-self: end;
    grid-column: span 2;
}

.history-table-panel {
    padding: 0;
    overflow: hidden;
}

.history-table-wrap {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    min-width: 1380px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.history-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.65rem 0.75rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    color: #475569;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
}

.history-table td {
    padding: 0.68rem 0.75rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    vertical-align: top;
}

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

.history-table td strong,
.history-table td span,
.history-table td small {
    display: block;
}

.history-table td span,
.history-table td small {
    margin-top: 0.18rem;
    color: #475569;
}

.history-table-issue {
    width: 34%;
}

.history-table-issue strong,
.history-table-issue span {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
}

.history-table-issue strong {
    -webkit-line-clamp: 2;
}

.history-table-issue span {
    -webkit-line-clamp: 1;
}

.history-table-actions {
    text-align: right;
    white-space: nowrap;
}

.history-row-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.history-row-actions form {
    margin: 0;
}

.history-empty-state[hidden],
[data-history-row][hidden] {
    display: none;
}

.device-card {
    display: grid;
    grid-template-columns: minmax(170px, 210px) minmax(0, 1fr);
    gap: 1rem;
    overflow: hidden;
}

.device-card.is-priority {
    border-color: #fca5a5;
    box-shadow: inset 0 0 0 2px rgba(180, 35, 24, 0.08), 0 14px 30px rgba(180, 35, 24, 0.12);
}

.device-card-media {
    position: relative;
    min-height: 190px;
    border-radius: 8px;
    overflow: hidden;
    background: #e2e8f0;
}

.device-card-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.device-card-placeholder {
    width: 100%;
    height: 100%;
    min-height: 190px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 0.45rem;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(15, 23, 42, 0.08)),
        #f1f5f9;
    color: #1e3a8a;
}

.device-card-placeholder span {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #dbeafe;
    font-size: 1.8rem;
    font-weight: 800;
}

.device-card-placeholder small {
    color: #475569;
    font-weight: 700;
}

.device-priority-ribbon {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.35rem 0.55rem;
    border-radius: 8px;
    background: #b42318;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(127, 29, 29, 0.24);
}

.device-card-body {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.device-card-top,
.device-card-actions,
.device-card-admin {
    display: flex;
    justify-content: space-between;
    gap: 0.9rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.device-folio-row {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    flex-wrap: wrap;
}

.device-folio-row h3,
.image-category h3 {
    margin: 0;
}

.device-meta,
.device-issue {
    margin: 0;
    color: #475569;
}

.device-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

.field-label {
    display: block;
    color: #64748b;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
}

.badge-status,
.badge-priority {
    color: #0f172a;
}

.status-recibido { background: #e0f2fe; }
.status-asignado { background: #dbeafe; }
.status-en_diagnostico { background: #ede9fe; }
.status-en_reparacion { background: #fee2e2; }
.status-esperando_refaccion,
.status-esperando_autorizacion_cliente { background: #fef3c7; }
.status-en_pruebas { background: #dcfce7; }
.status-listo_para_entrega { background: #cffafe; }
.status-entregado,
.status-finalizado { background: #d1fae5; }
.status-cancelado { background: #f1f5f9; }

.priority-baja { background: #e2e8f0; }
.priority-normal { background: #dbeafe; }
.priority-alta { background: #fde68a; }
.priority-urgente { background: #fdba74; }
.priority-critica { background: #fecaca; }

.attention-chip {
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 600;
}

.attention-low { background: #dcfce7; color: #166534; }
.attention-medium { background: #fef3c7; color: #92400e; }
.attention-high { background: #fde68a; color: #92400e; }
.attention-critical { background: #fee2e2; color: #991b1b; }

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

.inline-form-stretch {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.6rem;
    width: 100%;
}

.physical-form-stack,
.stack-section,
.device-text-stack {
    display: grid;
    gap: 1rem;
}

.compact-form-grid {
    display: grid;
    gap: 0.85rem;
}

.upload-grid,
.image-category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.compact-evidence-panel {
    padding: 1rem;
}

.compact-evidence-panel .image-category-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.75rem;
}

.compact-evidence-panel .image-category {
    margin: 0;
    padding: 0.75rem;
    box-shadow: none;
}

.compact-evidence-panel .image-category h3 {
    font-size: 0.9rem;
}

.simple-preview-grid,
.detail-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 0.85rem;
}

.simple-preview-card,
.detail-image-card {
    display: grid;
    gap: 0.4rem;
    position: relative;
    padding: 0.7rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #dbeafe;
}

.compact-evidence-panel .detail-image-grid {
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 0.45rem;
    margin-top: 0.55rem;
}

.compact-evidence-panel .detail-image-card {
    padding: 0.45rem;
}

.simple-preview-remove {
    justify-self: end;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff1f2;
    color: #991b1b;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.35rem 0.55rem;
}

.simple-preview-remove:hover {
    background: #ffe4e6;
    border-color: #fca5a5;
}

.simple-preview-card img,
.detail-image-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
}

.compact-evidence-panel .detail-image-card img {
    height: 78px;
    border-radius: 8px;
}

.simple-preview-card span,
.detail-image-card figcaption {
    color: #475569;
    font-size: 0.82rem;
    word-break: break-word;
}

.compact-evidence-panel .detail-image-card figcaption {
    font-size: 0.68rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr);
    gap: 1rem;
    margin: 1rem 0;
}

.physical-detail-hero {
    margin-bottom: 0.8rem;
}

.physical-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.72fr);
    gap: 1rem;
    align-items: start;
}

.physical-detail-grid.is-single {
    grid-template-columns: 1fr;
}

.physical-detail-summary,
.physical-admin-panel,
.physical-evidence-panel {
    border-radius: 8px;
    padding: 1rem;
}

.physical-detail-summary {
    max-width: 1040px;
}

.physical-summary-fields {
    display: grid;
    grid-template-columns: repeat(6, minmax(105px, 1fr));
    gap: 0.75rem 1rem;
}

.physical-summary-fields .field-label {
    margin-bottom: 0.18rem;
    font-size: 0.7rem;
    line-height: 1.15;
}

.physical-summary-fields strong {
    display: block;
    font-size: 0.92rem;
    line-height: 1.25;
}

.physical-summary-notes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem 1rem;
    margin-top: 1rem;
}

.physical-summary-notes p {
    margin: 0;
    color: #475569;
    line-height: 1.35;
}

.physical-admin-stack {
    display: grid;
    gap: 0.85rem;
}

.physical-admin-form {
    display: grid;
    gap: 0.65rem;
    align-items: end;
}

.physical-admin-form.two-columns {
    grid-template-columns: minmax(120px, 0.75fr) minmax(160px, 1fr);
}

.physical-admin-form.three-columns {
    grid-template-columns: repeat(3, minmax(110px, 1fr));
}

.physical-admin-form .full,
.physical-admin-form button {
    grid-column: 1 / -1;
}

.physical-evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.8rem;
}

.physical-evidence-card {
    padding: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 8px;
    background: #f8fafc;
}

.physical-evidence-card h3 {
    margin: 0 0 0.55rem;
    font-size: 0.92rem;
}

.physical-evidence-images,
.physical-timeline-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 0.55rem;
}

.physical-evidence-button {
    appearance: none;
    display: grid;
    gap: 0.35rem;
    width: 100%;
    padding: 0.45rem;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    text-align: left;
    cursor: zoom-in;
}

.physical-evidence-button:hover,
.physical-evidence-button:focus-visible {
    border-color: #93c5fd;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.1);
    outline: none;
}

.physical-evidence-button img {
    width: 100%;
    height: 145px;
    display: block;
    object-fit: cover;
    border-radius: 6px;
}

.physical-evidence-button span {
    font-size: 0.74rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.physical-evidence-button.compact img {
    height: 96px;
}

.physical-timeline-images {
    margin-top: 0.75rem;
}

.physical-timeline-panel {
    border-radius: 8px;
    padding: 1rem;
}

.timeline-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.9rem;
    align-items: center;
    margin: 0 0 0.85rem;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.24);
}

.timeline-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
}

.timeline-dot,
.timeline-node {
    display: inline-block;
    border-radius: 999px;
    flex-shrink: 0;
}

.timeline-dot {
    width: 0.72rem;
    height: 0.72rem;
}

.timeline-dot.is-done,
.timeline-card.is-done .timeline-node {
    background: #16a34a;
}

.timeline-dot.is-delivered,
.timeline-card.is-delivered .timeline-node {
    background: #2563eb;
}

.timeline-dot.is-progress,
.timeline-card.is-progress .timeline-node {
    background: #f59e0b;
}

.timeline-dot.is-unreviewed,
.timeline-card.is-unreviewed .timeline-node {
    background: #94a3b8;
}

.timeline-dot.is-critical,
.timeline-card.is-critical .timeline-node {
    background: #dc2626;
}

.timeline-dot.is-waiting,
.timeline-card.is-waiting .timeline-node {
    background: #7c3aed;
}

.timeline-carousel {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(285px, 360px);
    gap: 0.9rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
    padding: 0.25rem 0.1rem 0.45rem;
}

.timeline-card {
    position: relative;
    display: grid;
    grid-template-rows: 28px 1fr;
    scroll-snap-align: start;
    min-height: 245px;
}

.timeline-card-line {
    position: relative;
    display: flex;
    align-items: center;
}

.timeline-card-line::before {
    content: "";
    position: absolute;
    left: 0;
    right: -0.9rem;
    height: 3px;
    border-radius: 999px;
    background: #dbe3ee;
}

.timeline-node {
    position: relative;
    z-index: 1;
    width: 18px;
    height: 18px;
    border: 3px solid #fff;
    box-shadow: 0 0 0 5px rgba(148, 163, 184, 0.18);
}

.timeline-card.is-done .timeline-node {
    box-shadow: 0 0 0 5px rgba(22, 163, 74, 0.16);
}

.timeline-card.is-delivered .timeline-node {
    box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.16);
}

.timeline-card.is-progress .timeline-node {
    box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.18);
}

.timeline-card.is-critical .timeline-node {
    box-shadow: 0 0 0 5px rgba(220, 38, 38, 0.16);
}

.timeline-card.is-waiting .timeline-node {
    box-shadow: 0 0 0 5px rgba(124, 58, 237, 0.16);
}

.timeline-card-body {
    display: grid;
    align-content: start;
    gap: 0.5rem;
    min-width: 0;
    padding: 0.85rem;
    border: 1px solid #dbe3ee;
    border-top: 4px solid #94a3b8;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.timeline-card.is-done .timeline-card-body {
    border-top-color: #16a34a;
    background: #f0fdf4;
}

.timeline-card.is-delivered .timeline-card-body {
    border-top-color: #2563eb;
    background: #eff6ff;
}

.timeline-card.is-progress .timeline-card-body {
    border-top-color: #f59e0b;
    background: #fffbeb;
}

.timeline-card.is-critical .timeline-card-body {
    border-top-color: #dc2626;
    background: #fff1f2;
}

.timeline-card.is-waiting .timeline-card-body {
    border-top-color: #7c3aed;
    background: #f5f3ff;
}

.timeline-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    color: #475569;
    font-size: 0.76rem;
    font-weight: 800;
}

.timeline-card-meta span {
    text-transform: uppercase;
}

.timeline-card-meta time {
    text-align: right;
    color: #64748b;
    font-weight: 700;
}

.timeline-card h3 {
    margin: 0;
    color: #0f172a;
    font-size: 1rem;
    line-height: 1.25;
}

.timeline-count {
    display: inline-flex;
    width: fit-content;
    padding: 0.28rem 0.45rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.7);
    color: #991b1b;
    font-size: 0.76rem;
    font-weight: 800;
}

.timeline-card p {
    margin: 0;
    color: #334155;
    line-height: 1.38;
}

.detail-grid-compact {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.65fr);
    align-items: start;
}

.detail-grid-single {
    grid-template-columns: 1fr;
}

.detail-summary-panel {
    padding: 1rem;
}

.detail-summary-panel .device-grid {
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 0.75rem 1rem;
}

.detail-summary-panel .field-label {
    margin-bottom: 0.18rem;
    font-size: 0.72rem;
}

.detail-summary-panel .device-grid strong {
    display: block;
    font-size: 0.92rem;
    line-height: 1.25;
}

.detail-notes-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem 1rem;
    margin-top: 0.85rem;
}

.detail-notes-grid p {
    margin: 0;
    color: #475569;
    line-height: 1.35;
}

.panel-soft {
    background: rgba(241, 245, 249, 0.7);
}

.timeline-list {
    display: grid;
    gap: 1rem;
}

.timeline-item {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 0.75rem;
}

.timeline-point {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #2563eb;
    margin-top: 0.35rem;
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.14);
}

.timeline-body {
    padding: 1rem;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #dbeafe;
}

.timeline-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.notification-card.is-read {
    opacity: 0.75;
}

.push-status {
    max-width: 960px;
    margin: -0.35rem 0 1rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.check-row {
    display: inline-flex;
    gap: 0.7rem;
    align-items: center;
}

.service-sheet-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.service-sheet {
    position: relative;
    box-sizing: border-box;
    width: 8.5in;
    min-height: 11in;
    max-width: calc(100vw - 3rem);
    margin: 0 auto 2rem;
    padding: 0.42in;
    overflow: hidden;
    background:
        linear-gradient(90deg, #1d4ed8 0, #1d4ed8 0.18in, transparent 0.18in),
        #fff;
    border: 1px solid #b9c4d0;
    color: #0f172a;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    font-size: 0.88rem;
}

.service-sheet-watermark {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: grid;
    place-items: center;
    transform: rotate(-32deg);
    color: rgba(185, 28, 28, 0.12);
    font-size: 5.8rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    pointer-events: none;
    text-transform: uppercase;
    white-space: nowrap;
}

.service-sheet > *:not(.service-sheet-watermark) {
    position: relative;
    z-index: 1;
}

.service-sheet-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2.35in;
    gap: 0.24in;
    align-items: center;
    padding-bottom: 0.2in;
    border-bottom: 2px solid #1d4ed8;
}

.service-sheet-header h1 {
    margin: 0.04in 0 0;
    font-size: 1.35rem;
    line-height: 1.05;
}

.service-sheet-header p {
    margin: 0;
    color: #475569;
    font-size: 0.84rem;
}

.service-sheet-brand {
    display: flex;
    gap: 0.18in;
    align-items: center;
}

.service-sheet-brand img {
    width: 1.35in;
    height: auto;
    display: block;
}

.service-sheet-folio {
    padding: 0.14in 0.18in;
    border: 1px solid #93a4b8;
    background: #f8fafc;
    text-align: right;
}

.service-sheet-kicker,
.service-sheet-grid span,
.service-sheet-strip span,
.service-sheet-notes span,
.service-sheet-folio span {
    display: block;
    color: #475569;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.service-sheet-strip,
.service-sheet-grid {
    display: grid;
    gap: 0.08in;
}

.service-sheet-strip {
    grid-template-columns: 1.15fr 1fr 1fr;
    margin: 0.18in 0;
    padding: 0.1in;
    border: 1px solid #b9c4d0;
    background: #eef4ff;
}

.service-sheet-codes {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1.15in;
    gap: 0.14in;
    align-items: center;
    margin-bottom: 0.12in;
}

.service-sheet-codes > div {
    padding: 0.08in;
    border: 1px solid #cbd5e1;
    background: rgba(255, 255, 255, 0.92);
}

.service-sheet-codes span {
    display: block;
    margin-bottom: 0.03in;
    color: #475569;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.service-sheet-codes img {
    display: block;
    max-width: 100%;
    height: 0.58in;
    object-fit: contain;
}

.service-sheet-codes > div:last-child img {
    width: 0.86in;
    height: 0.86in;
    margin: 0 auto;
}

.service-sheet-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-sheet-grid-compact {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.service-sheet-grid-compact > div {
    grid-column: span 2;
}

.service-sheet-section {
    display: grid;
    gap: 0.09in;
    padding: 0.11in 0;
    border-top: 1px solid #e2e8f0;
}

.service-sheet-section h2 {
    margin: 0;
    padding-left: 0.09in;
    border-left: 0.08in solid #1d4ed8;
    font-size: 0.95rem;
    color: #1e3a8a;
    line-height: 1.1;
}

.service-sheet-grid > div,
.service-sheet-notes > div {
    min-height: 0.62in;
    padding: 0.08in;
    border: 1px solid #cbd5e1;
    background: rgba(255, 255, 255, 0.92);
}

.service-sheet-grid strong,
.service-sheet-strip strong {
    display: block;
    margin-top: 0.03in;
    line-height: 1.35;
    word-break: break-word;
}

.service-sheet-notes {
    display: grid;
    gap: 0.08in;
}

.service-sheet-notes-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.service-sheet-notes p {
    min-height: 0.38in;
    margin: 0.04in 0 0;
    line-height: 1.34;
    white-space: pre-wrap;
}

.service-report-hero {
    border-top: 4px solid #2558d9;
}

.service-report-auto-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.service-report-auto-grid > div {
    min-width: 0;
    padding: 0.85rem;
    border: 1px solid #dbe5f4;
    border-radius: 12px;
    background: #f8fbff;
}

.service-report-auto-grid span,
.service-report-subtotal span,
.service-report-total span {
    display: block;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.service-report-auto-grid strong {
    display: block;
    margin-top: 0.25rem;
    color: #0f172a;
    overflow-wrap: anywhere;
}

.service-report-items {
    display: grid;
    gap: 0.65rem;
}

.service-report-item {
    overflow: hidden;
    border: 1px solid #cbd8ea;
    border-radius: 11px;
    background: #fbfdff;
    box-shadow: 0 4px 14px rgba(30, 64, 175, 0.05);
}

.service-report-item-heading {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: linear-gradient(90deg, #eff6ff, #f8fafc);
    border-bottom: 1px solid #dbe5f4;
}

.service-report-item-number {
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 6px;
    background: #2558d9;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 900;
}

.service-report-remove {
    padding: 0.35rem 0.55rem;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff;
    color: #b91c1c;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 800;
}

.service-report-remove:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.service-report-item-grid {
    display: grid;
    grid-template-columns:
        minmax(260px, 2fr)
        minmax(120px, 0.7fr)
        minmax(190px, 1.25fr)
        minmax(120px, 0.7fr)
        minmax(105px, 0.55fr);
    align-items: end;
    gap: 0.55rem;
    padding: 0.6rem;
}

.service-report-work-field {
    min-width: 0;
}

.service-report-item-grid .field {
    gap: 0.25rem;
}

.service-report-item-grid label {
    font-size: 0.78rem;
    line-height: 1.15;
}

.service-report-item-grid input,
.service-report-item-grid textarea {
    min-height: 40px;
    padding: 0.58rem 0.65rem;
    border-radius: 9px;
}

.service-report-item-grid textarea {
    height: 40px;
    max-height: 96px;
    overflow-y: auto;
    resize: none;
}

.money-input {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}

.money-input:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.money-input > span {
    padding-left: 0.8rem;
    color: #475569;
    font-weight: 900;
}

.money-input input {
    border: 0;
    box-shadow: none;
}

.money-input input:focus {
    box-shadow: none;
}

.service-report-subtotal {
    display: grid;
    align-content: center;
    min-height: 40px;
    padding: 0.2rem 0.45rem;
    border-left: 1px dashed #cbd5e1;
}

.service-report-subtotal strong {
    color: #173ea5;
    font-size: 0.98rem;
    white-space: nowrap;
}

.service-report-closing {
    display: grid;
    gap: 1rem;
}

.service-report-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: 2px solid #173ea5;
    border-radius: 12px;
    background: linear-gradient(135deg, #eff6ff, #fff);
}

.service-report-total strong {
    color: #0f172a;
    font-size: clamp(1.45rem, 3vw, 2rem);
}

.service-report-ticket-header img {
    width: 46mm !important;
}

.service-report-ticket-header p {
    margin: 0;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.service-report-ticket-meta div {
    grid-template-columns: 22mm minmax(0, 1fr);
}

.service-report-ticket-items {
    display: grid;
    gap: 2mm;
}

.service-report-ticket-item {
    display: grid;
    grid-template-columns: 8mm minmax(0, 1fr);
    gap: 2mm;
    padding: 2mm 0;
    border-bottom: 1px solid #cbd5e1;
    break-inside: avoid;
}

.service-report-ticket-number {
    display: grid;
    place-items: center;
    width: 7mm;
    height: 7mm;
    border: 1px solid #111827;
    font-size: 12px;
    font-weight: 900;
}

.service-report-ticket-item > div > strong {
    display: block;
    font-size: 12px;
    line-height: 1.3;
}

.service-report-ticket-item dl {
    display: grid;
    gap: 0.5mm;
    margin: 1.3mm 0 0;
}

.service-report-ticket-item dl div {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2mm;
}

.service-report-ticket-item dt,
.service-report-ticket-item dd {
    margin: 0;
    font-size: 10.5px;
}

.service-report-ticket-item dd {
    font-weight: 800;
    text-align: right;
}

.service-report-ticket-subtotal {
    padding-top: 0.8mm;
    border-top: 1px dashed #94a3b8;
}

.service-report-ticket-summary {
    margin-top: 3mm;
}

.service-report-ticket-total {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 1mm 3mm;
    margin-top: 3mm;
    padding: 3mm;
    border: 1.5px solid #111827;
}

.service-report-ticket-total span {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.service-report-ticket-total strong {
    font-size: 21px;
    line-height: 1;
}

.service-report-ticket-total small {
    grid-column: 2;
    font-size: 10px;
    font-weight: 900;
    text-align: right;
}

.ticket-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    width: min(100%, 760px);
    margin: 0 auto 1rem;
    flex-wrap: wrap;
}

.ticket-body {
    min-height: 100vh;
    padding: 1rem;
    background: #e5e7eb;
}

.ticket-print-page .dashboard-layout {
    display: block;
    min-height: 100vh;
}

.ticket-print-page .dashboard-main,
.ticket-print-page .dashboard-content {
    display: block;
}

.service-ticket {
    position: relative;
    width: var(--ticket-width, 80mm);
    max-width: calc(100vw - 2rem);
    margin: 0 auto 2rem;
    padding: 4mm 3mm;
    overflow: hidden;
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #111827;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    font-family: Arial, Helvetica, "Liberation Sans", sans-serif;
    font-variant-ligatures: none;
    text-rendering: geometricPrecision;
}

.ticket-watermark {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: grid;
    place-items: center;
    transform: rotate(-34deg);
    color: rgba(185, 28, 28, 0.13);
    font-size: 18mm;
    font-weight: 900;
    letter-spacing: 0.08em;
    pointer-events: none;
}

.service-ticket > *:not(.ticket-watermark) {
    position: relative;
    z-index: 1;
}

.ticket-header {
    display: grid;
    justify-items: center;
    gap: 1.5mm;
    text-align: center;
}

.ticket-header img {
    width: 70mm;
    height: auto;
}

.ticket-header h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.05;
    text-transform: uppercase;
}

.ticket-header strong {
    font-size: 18px;
}

.ticket-rule {
    margin: 3mm 0;
    border-top: 1px dashed #111827;
}

.ticket-section-title {
    margin: 2.5mm 0 1.3mm;
    padding: 1.3mm 1.6mm;
    background: #111827;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
}

.ticket-lines {
    display: grid;
    gap: 0;
    margin: 0;
    border-top: 1px solid #d1d5db;
}

.ticket-lines div {
    display: grid;
    grid-template-columns: 22mm minmax(0, 1fr);
    gap: 1.5mm;
    padding: 1.4mm 0;
    border-bottom: 1px solid #e5e7eb;
}

.ticket-lines dt,
.ticket-block h2 {
    margin: 0;
    color: #111827;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.ticket-lines dd {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    word-break: break-word;
}

.ticket-block {
    margin-top: 3mm;
    padding: 1.8mm;
    border: 1px solid #d1d5db;
}

.ticket-block h2 {
    padding-bottom: 1mm;
    border-bottom: 1px solid #e5e7eb;
}

.ticket-block p,
.ticket-footer p {
    margin: 1mm 0 0;
    font-size: 13px;
    line-height: 1.35;
}

.ticket-codes {
    display: grid;
    gap: 2mm;
    justify-items: center;
    margin-top: 4mm;
}

.ticket-barcode {
    width: 100%;
    max-height: 18mm;
    object-fit: contain;
}

.ticket-qr {
    width: 24mm;
    height: 24mm;
}

.ticket-footer {
    margin-top: 4mm;
    text-align: center;
}

.ticket-signature {
    margin-top: 10mm;
    padding-top: 2mm;
    border-top: 1px solid #111827;
    font-size: 10px;
    text-transform: uppercase;
}

.print-settings-panel small {
    line-height: 1.35;
}

.scanner-page {
    max-width: 820px;
}

.scanner-shell {
    display: grid;
    gap: 1rem;
    overflow: hidden;
    padding: 1.1rem;
    border-radius: 22px;
}

.scanner-header {
    display: grid;
    gap: 0.45rem;
}

.scanner-header h1 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    line-height: 1.05;
}

.scanner-header p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.scanner-eyebrow {
    display: inline-flex;
    width: fit-content;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: #e0e7ff;
    color: #1e3a8a;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.scanner-badges {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
}

.scanner-badge {
    display: grid;
    gap: 0.18rem;
    padding: 0.85rem 0.95rem;
    border-radius: 16px;
    border: 1px solid #dbe4f0;
    background: #f8fafc;
}

.scanner-badge small {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.scanner-badge strong {
    color: #0f172a;
    font-size: 0.96rem;
}

.scanner-guidance {
    margin: 0;
    padding: 0.95rem 1rem;
    border-radius: 16px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    line-height: 1.45;
    font-weight: 600;
}

.scanner-stage {
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid #dbe4f0;
    background: #0f172a;
}

.scanner-toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
    padding: 0.9rem 1rem;
    background: #111827;
    color: #f8fafc;
}

.scanner-toolbar label {
    font-weight: 800;
}

.scanner-toolbar select {
    background: #1f2937;
    border-color: #374151;
    color: #fff;
}

.scanner-viewport {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background:
        radial-gradient(circle at top, rgba(96, 165, 250, 0.16), transparent 45%),
        #0f172a;
}

.scanner-viewport video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-reticle {
    position: absolute;
    inset: 17%;
    border: 2px solid rgba(248, 113, 113, 0.95);
    border-radius: 18px;
    box-shadow: 0 0 0 999px rgba(15, 23, 42, 0.26);
}

.scanner-beam {
    position: absolute;
    left: 14%;
    right: 14%;
    top: 50%;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(248, 113, 113, 0), #fb7185, rgba(248, 113, 113, 0));
    box-shadow: 0 0 18px rgba(251, 113, 133, 0.65);
    animation: scanner-beam-move 2.4s ease-in-out infinite;
}

.scanner-mode {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.85rem 1rem;
    background: rgba(15, 23, 42, 0.9);
    color: #a7f3d0;
    font-weight: 800;
    text-align: center;
}

@keyframes scanner-beam-move {
    0%, 100% { transform: translateY(-70px); opacity: 0.7; }
    50% { transform: translateY(70px); opacity: 1; }
}

.scanner-viewport-disabled {
    background:
        linear-gradient(rgba(15, 23, 42, 0.38), rgba(15, 23, 42, 0.38)),
        #475569;
}

.scanner-viewport-disabled video,
.scanner-viewport-disabled .scanner-beam {
    display: none;
}

.scanner-viewport-disabled::before {
    content: "QR";
    position: absolute;
    inset: 17%;
    display: grid;
    place-items: center;
    border: 2px dashed rgba(226, 232, 240, 0.85);
    border-radius: 18px;
    color: #f8fafc;
    font-size: 2.6rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.scanner-status {
    margin: 0;
    color: #334155;
    font-weight: 600;
}

.scanner-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.scanner-actions .button,
.scanner-photo-button {
    width: 100%;
    justify-content: center;
    min-height: 48px;
}

.scanner-divider {
    height: 1px;
    background: #e2e8f0;
}

.scanner-manual {
    display: grid;
    gap: 0.7rem;
}

.scanner-manual label {
    color: #475569;
    font-weight: 700;
}

.scanner-manual-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
}

.scanner-footnote {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.45;
}

.visually-hidden-file {
    width: 1px;
    height: 1px;
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

@media screen and (max-width: 1200px) {
    .physical-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .device-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-summary-panel .device-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .physical-summary-fields {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .detail-notes-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .physical-summary-notes {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 980px) {
    .service-report-item-grid {
        grid-template-columns: minmax(0, 1fr) repeat(2, minmax(120px, 150px));
    }

    .service-report-work-field,
    .service-report-subtotal {
        grid-column: 1 / -1;
    }

    .service-report-subtotal {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.55rem;
        min-height: 0;
        padding-top: 0.35rem;
        border-top: 1px dashed #cbd5e1;
        border-left: 0;
    }

    .history-live-search {
        grid-template-columns: 1fr;
    }

    .history-search-tools {
        align-items: flex-start;
    }

    .history-filter-grid {
        left: 0;
        right: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .history-filter-grid .actions-inline {
        grid-column: 1 / -1;
    }
}

@media screen and (max-width: 880px) {
    .detail-grid,
    .physical-detail-grid,
    .upload-grid,
    .image-category-grid,
    .physical-summary-grid,
    .service-sheet-strip,
    .service-sheet-grid,
    .service-sheet-grid-compact,
    .service-sheet-notes-two,
    .service-sheet-codes,
    .service-report-auto-grid,
    .scan-layout {
        grid-template-columns: 1fr;
    }

    .service-sheet {
        padding: 1rem;
    }

    .service-sheet-header {
        grid-template-columns: 1fr;
    }

    .service-sheet-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .service-sheet-brand {
        align-items: flex-start;
    }

    .detail-notes-grid,
    .detail-summary-panel .device-grid,
    .physical-summary-fields,
    .physical-summary-notes,
    .physical-admin-form.two-columns,
    .physical-admin-form.three-columns {
        grid-template-columns: 1fr;
    }

    .physical-evidence-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .physical-evidence-images,
    .physical-timeline-images {
        grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
    }

    .physical-evidence-button img {
        height: 82px;
    }

    .timeline-carousel {
        grid-auto-columns: minmax(245px, 82vw);
    }

    .timeline-card {
        min-height: 230px;
    }

    .service-sheet-folio {
        width: 100%;
        text-align: left;
    }

    .service-sheet-codes > div:last-child img {
        margin: 0;
    }
}

@media screen and (max-width: 640px) {
    .module-subnav {
        overflow-x: auto;
        padding-bottom: 0.35rem;
    }

    .page-intro .actions-inline {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .page-intro .actions-inline .button {
        width: 100%;
        min-height: 46px;
    }

    .device-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .device-card-top,
    .device-card-actions,
    .device-card-admin {
        flex-direction: column;
        align-items: stretch;
    }

    .device-folio-row h3 {
        font-size: 1.15rem;
        line-height: 1.2;
    }

    .device-meta,
    .device-issue,
    .device-grid p {
        line-height: 1.35;
    }

    .device-grid .field-label {
        font-size: 0.72rem;
    }

    .device-grid strong {
        font-size: 0.95rem;
        line-height: 1.25;
    }

    .scanner-shell {
        padding: 1rem;
        border-radius: 18px;
    }

    .scanner-actions {
        grid-template-columns: 1fr;
    }

    .scanner-manual-row {
        grid-template-columns: 1fr;
    }

    .simple-preview-card img,
    .detail-image-card img {
        height: 150px;
    }

    .ticket-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .service-report-item-heading {
        grid-template-columns: auto 1fr auto;
    }

    .service-report-remove {
        justify-self: auto;
    }

    .service-report-item-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .service-report-work-field,
    .service-report-part-field,
    .service-report-subtotal {
        grid-column: 1 / -1;
    }

    .service-report-service-cost {
        grid-column: 1;
        grid-row: 2;
    }

    .service-report-part-cost {
        grid-column: 2;
        grid-row: 2;
    }

    .service-report-part-field {
        grid-row: 3;
    }

    .service-report-total {
        align-items: flex-start;
        flex-direction: column;
    }

    .history-filter-grid {
        grid-template-columns: 1fr;
    }

    .timeline-legend {
        gap: 0.45rem;
    }

    .timeline-legend span {
        font-size: 0.76rem;
    }
}

@media screen and (max-width: 860px) {
    body.sidebar-open {
        overflow: hidden;
    }

    .module-subnav {
        width: 100%;
        max-width: 100%;
        flex-wrap: nowrap;
        gap: 0.55rem;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scroll-snap-type: inline proximity;
        -webkit-overflow-scrolling: touch;
        padding: 0.1rem 0 0.45rem;
    }

    .module-subnav::-webkit-scrollbar {
        height: 6px;
    }

    .module-subnav::-webkit-scrollbar-track {
        background: transparent;
        box-shadow: none;
    }

    .subnav-link {
        flex: 0 0 auto;
        white-space: nowrap;
        scroll-snap-align: start;
    }

    .admin-toolbar {
        position: static;
        overflow: hidden;
        padding: 0.9rem 1rem;
    }

    .admin-toolbar-links {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        padding-bottom: 0.3rem;
    }

    .toolbar-link {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .dashboard-layout {
        grid-template-columns: 1fr;
        background:
            radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 22%),
            linear-gradient(180deg, #eff4fb 0%, #f6f8fc 100%);
    }

    .sidebar-toggle {
        position: fixed;
        top: max(0.9rem, env(safe-area-inset-top));
        left: 0.9rem;
        z-index: 40;
        min-width: 98px;
        height: 48px;
        padding: 0 0.95rem;
        border: 0;
        border-radius: 999px;
        background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
        box-shadow: 0 14px 32px rgba(15, 23, 42, 0.24);
        display: inline-flex !important;
        flex-direction: row;
        align-items: center;
        gap: 0.65rem;
        cursor: pointer;
        opacity: 1;
        transition: opacity 0.18s ease, transform 0.18s ease;
    }

    body.sidebar-open .sidebar-toggle {
        opacity: 0;
        pointer-events: none;
        transform: translateY(-0.5rem);
    }

    .sidebar-toggle-icon {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        gap: 0.28rem;
    }

    .sidebar-toggle-icon span {
        width: 19px;
        height: 2px;
        border-radius: 999px;
        background: #f8fafc;
    }

    .sidebar-toggle-label {
        color: #f8fafc;
        font-size: 0.92rem;
        font-weight: 800;
        letter-spacing: 0.03em;
        text-transform: uppercase;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 28;
        border: 0;
        background: rgba(15, 23, 42, 0.5);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.22s ease;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 35;
        width: min(320px, 84vw);
        height: 100dvh;
        min-height: 100dvh;
        overflow-y: auto;
        padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
        gap: 0.9rem;
        border-right: 1px solid rgba(255, 255, 255, 0.08);
        border-bottom: 0;
        border-radius: 0 24px 24px 0;
        box-shadow: 0 18px 38px rgba(15, 23, 42, 0.34);
        transform: translateX(calc(-100% - 1rem));
        transition: transform 0.24s ease;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-brand {
        display: grid;
        gap: 0.35rem;
    }

    .sidebar .brand {
        font-size: clamp(1.15rem, 5vw, 1.55rem);
        line-height: 1.08;
    }

    .sidebar .subtitle {
        max-width: 38ch;
        font-size: 0.93rem;
    }

    .sidebar-user {
        padding: 0.95rem;
        border-radius: 22px;
        background: rgba(255, 255, 255, 0.1);
    }

    .sidebar-mobile-bar,
    .sidebar-close {
        display: flex;
    }

    .sidebar-nav {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .sidebar-link {
        min-height: 0;
        align-items: center;
        justify-content: flex-start;
        padding: 0.95rem;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.07);
    }

    .sidebar-link:last-child {
        grid-column: auto;
    }

    .sidebar-icon {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        font-size: 0.82rem;
        font-weight: 800;
        letter-spacing: 0.04em;
    }

    .sidebar-badge {
        margin-left: auto;
        align-self: center;
    }

    .sidebar-actions {
        grid-template-columns: 1fr;
    }

    .sidebar-action-link {
        min-height: 48px;
        border-radius: 16px;
    }

    .dashboard-main {
        grid-column: auto;
    }

    .dashboard-content {
        padding: calc(4.5rem + env(safe-area-inset-top)) 1rem max(1.35rem, env(safe-area-inset-bottom));
    }

    .home-hero,
    .home-workbench,
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .home-hero {
        gap: 1rem;
        margin-bottom: 1rem;
        padding: 1.15rem;
        border-radius: 24px;
    }

    .home-hero h1 {
        font-size: clamp(1.9rem, 7vw, 2.8rem);
    }

    .home-identity {
        min-width: 0;
        width: 100%;
        padding: 0.9rem;
        border-radius: 18px;
    }

    .home-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .home-action {
        min-height: 138px;
        padding: 0.95rem;
        border-radius: 20px;
    }

    .home-action strong {
        font-size: 1.7rem;
    }

    .engineer-queue {
        padding: 0.9rem;
        border-radius: 22px;
    }

    .engineer-queue-track {
        grid-auto-columns: minmax(240px, 78vw);
    }

    .lightbox-dialog {
        width: calc(100vw - 1rem);
        max-height: calc(100dvh - 1rem);
        overflow-y: auto;
        padding: 0.8rem;
        border-radius: 16px;
    }

    .lightbox-image {
        max-height: calc(100dvh - 8.5rem);
    }

    .lightbox-toolbar {
        min-width: 0;
        gap: 0.6rem;
        padding-right: 3rem;
    }
}

@media screen and (max-width: 640px) {
    .sidebar-toggle {
        top: max(0.75rem, env(safe-area-inset-top));
        left: 0.75rem;
        min-width: 92px;
        height: 46px;
        padding: 0 0.85rem;
    }

    .sidebar .subtitle {
        display: none;
    }

    .sidebar {
        width: min(300px, 86vw);
        padding: max(0.9rem, env(safe-area-inset-top)) 0.9rem max(0.9rem, env(safe-area-inset-bottom));
        border-radius: 0 20px 20px 0;
    }

    .sidebar-user {
        padding: 0.85rem;
    }

    .sidebar-action-link {
        min-height: 46px;
    }

    .dashboard-content {
        padding: calc(4.2rem + env(safe-area-inset-top)) 0.9rem max(1.1rem, env(safe-area-inset-bottom));
    }

    .panel {
        padding: 1rem;
        border-radius: 14px;
    }

    .page-intro h1,
    .panel-heading h1 {
        font-size: clamp(1.45rem, 7.5vw, 2rem);
        line-height: 1.12;
    }

    .hero-kicker {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .actions-inline.full,
    .physical-form-stack > .actions-inline,
    .service-report-form > .actions-inline {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .actions-inline.full > *,
    .physical-form-stack > .actions-inline > *,
    .service-report-form > .actions-inline > * {
        width: 100%;
    }

    .inline-form-stretch {
        grid-template-columns: 1fr;
    }

    .inline-form-stretch .button {
        width: 100%;
    }

    .history-search-tools,
    .history-advanced-filters {
        width: 100%;
    }

    .history-advanced-filters summary {
        width: 100%;
        text-align: center;
    }

    .history-filter-grid {
        position: static;
        width: 100%;
        margin-top: 0.55rem;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
    }

    .physical-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    .summary-card {
        margin-bottom: 0;
        padding: 0.85rem;
    }

    .summary-card strong {
        font-size: 1.45rem;
    }

    .profile-badge {
        width: 100%;
        min-width: 0;
    }

    .service-sheet {
        width: 100%;
        max-width: 100%;
        min-height: 0;
        margin-bottom: 1rem;
        padding: 0.8rem;
    }

    .service-sheet-brand {
        flex-direction: column;
        gap: 0.55rem;
    }

    .service-sheet-brand img {
        width: min(1.2in, 45%);
    }

    .service-sheet-watermark {
        font-size: clamp(2.4rem, 16vw, 4.2rem);
    }

    .home-hero {
        padding: 1rem;
    }

    .home-action-grid {
        grid-template-columns: 1fr;
    }

    .home-action {
        min-height: 124px;
    }

    .scanner-badges {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .scanner-guidance {
        padding: 0.85rem 0.9rem;
    }

    .scanner-toolbar {
        grid-template-columns: 1fr;
        gap: 0.55rem;
        padding: 0.8rem;
    }
}

@media screen and (max-width: 380px) {
    .device-grid {
        grid-template-columns: 1fr;
    }

    .timeline-carousel,
    .engineer-queue-track {
        grid-auto-columns: minmax(230px, 86vw);
    }

    .lightbox-tip {
        display: none;
    }
}

/* Tema global RSeT: las superficies reutilizan exclusivamente tokens semanticos. */
.dashboard-layout {
    background: transparent;
}

@media screen and (min-width: 861px) {
    body.app-body .dashboard-content,
    body.public-status-body .dashboard-content {
        padding-top: 4.75rem;
    }
}

.topbar,
.admin-toolbar {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
}

.panel,
.card,
.module-card-link,
.home-action,
.engineer-queue,
.engineer-device-card,
.gallery-card,
.preview-card,
.draft-item,
.subnav-link,
.history-advanced-filters summary,
.physical-evidence-card,
.physical-evidence-button,
.timeline-legend,
.timeline-card-body,
.timeline-body,
.scanner-badge,
.service-report-item,
.service-report-auto-grid > div {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
    box-shadow: var(--shadow-panel);
}

.stat-card,
.detail-block,
.home-link-list a,
.home-priority,
.engineer-queue.is-empty,
.panel-soft,
.simple-preview-card,
.detail-image-card,
.client-summary,
.suggestion-card {
    background: var(--color-surface-muted);
    border-color: var(--color-border);
    color: var(--color-text);
}

.home-action:hover,
.module-card-link:hover,
.engineer-device-card:hover,
.engineer-device-card:focus-visible,
.home-link-list a:hover,
.physical-evidence-button:hover,
.physical-evidence-button:focus-visible {
    background: var(--color-surface-hover);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-raised);
}

.home-action.primary,
.profile-badge,
.draft-status,
.scanner-guidance,
.upload-dropzone {
    background: var(--color-primary-soft);
    border-color: var(--color-primary);
    color: var(--color-primary-strong);
}

.upload-dropzone.is-active {
    background: var(--color-surface-hover);
    border-color: var(--color-primary);
}

.upload-copy {
    color: var(--color-primary-strong);
}

.client-compression-status {
    color: var(--color-success-text);
}

.home-action.warning {
    background: var(--color-warning-soft);
    border-color: var(--color-warning);
    color: var(--color-warning-text);
}

.home-action span,
.home-action strong,
.engineer-device-topline strong,
.engineer-device-copy p,
.engineer-device-meta,
.home-link-list a,
.home-priority span,
.home-priority p,
.profile-badge span,
.module-copy p,
.summary-card span,
.summary-card strong,
.history-table th,
.history-table td span,
.history-table td small,
.device-meta,
.device-issue,
.field-label,
.simple-preview-card span,
.detail-image-card figcaption,
.physical-summary-notes p,
.timeline-legend span,
.timeline-card-meta,
.timeline-card-meta time,
.timeline-card h3,
.timeline-card p,
.detail-notes-grid p,
.scanner-badge small,
.scanner-badge strong,
.scanner-status,
.scanner-manual label,
.scanner-footnote {
    color: var(--color-text-secondary);
}

.home-action strong,
.summary-card strong,
.timeline-card h3,
.scanner-badge strong {
    color: var(--color-text);
}

.text-link,
.module-cta,
.gallery-zoom-hint,
.login-brand-version,
.mobile-filter-toggle,
.scanner-guidance {
    color: var(--color-primary-strong);
}

.page-intro .hero-kicker,
.scanner-eyebrow {
    background: var(--color-primary-soft);
    color: var(--color-primary-strong);
}

input,
select,
textarea,
.money-input {
    background: var(--color-field);
    border-color: var(--color-border);
    color: var(--color-text);
}

input::placeholder,
textarea::placeholder {
    color: var(--color-text-secondary);
    opacity: 0.82;
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--color-border-strong);
}

input:focus,
select:focus,
textarea:focus,
.money-input:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px var(--color-focus-ring);
    outline: none;
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled,
.button:disabled,
[aria-disabled="true"] {
    background: var(--color-field-disabled);
    border-color: var(--color-border);
    color: var(--color-disabled-text);
    cursor: not-allowed;
    opacity: 0.78;
}

select option {
    background: var(--color-field);
    color: var(--color-text);
}

.button {
    border-color: var(--color-border-strong);
}

.button.primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-text-inverse);
}

.button.primary:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: var(--color-text-inverse);
}

.button.secondary {
    background: var(--color-surface-raised);
    border-color: var(--color-border-strong);
    color: var(--color-text);
}

.button.secondary:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-primary);
    color: var(--color-primary-strong);
}

.button.danger,
.service-report-remove,
.simple-preview-remove {
    background: var(--color-error-soft);
    border-color: var(--color-error);
    color: var(--color-error-text);
}

.button.danger:hover,
.service-report-remove:hover,
.simple-preview-remove:hover {
    background: var(--color-error);
    border-color: var(--color-error);
    color: var(--color-text-inverse);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 3px;
}

tbody tr:nth-child(even) {
    background: var(--color-table-stripe);
}

tbody tr:hover,
.history-table tr:hover td {
    background: var(--color-table-hover);
}

th,
td,
.history-table th,
.history-table td {
    border-color: var(--color-border);
}

.history-table th {
    background: var(--color-surface-muted);
}

.history-filter-grid,
.mobile-filter-body {
    background: var(--color-surface-raised);
    border-color: var(--color-border);
    box-shadow: var(--shadow-raised);
}

.mobile-filter-toggle::after,
.sidebar-badge {
    background: var(--color-primary-soft);
    color: var(--color-primary-strong);
}

.badge {
    background: var(--color-surface-muted);
    color: var(--color-text);
}

.badge-status,
.badge-priority {
    color: var(--color-text);
}

.status-recibido,
.status-listo_para_entrega {
    background: var(--color-info-soft);
    color: var(--color-info-text);
}

.status-asignado,
.priority-normal {
    background: var(--color-primary-soft);
    color: var(--color-primary-strong);
}

.status-en_diagnostico {
    background: var(--color-violet-soft);
    color: var(--color-violet-text);
}

.status-en_reparacion,
.status-cancelado,
.priority-critica {
    background: var(--color-error-soft);
    color: var(--color-error-text);
}

.status-esperando_refaccion,
.status-esperando_autorizacion_cliente,
.priority-alta,
.priority-urgente {
    background: var(--color-warning-soft);
    color: var(--color-warning-text);
}

.status-en_pruebas,
.status-entregado,
.status-finalizado,
.status-aplicada {
    background: var(--color-success-soft);
    color: var(--color-success-text);
}

.priority-baja,
.status-descartada {
    background: var(--color-neutral-soft);
    color: var(--color-neutral-text);
}

.status-pendiente {
    background: var(--color-warning-soft);
    color: var(--color-warning-text);
}

.attention-low {
    background: var(--color-success-soft);
    color: var(--color-success-text);
}

.attention-medium,
.attention-high {
    background: var(--color-warning-soft);
    color: var(--color-warning-text);
}

.attention-critical {
    background: var(--color-error-soft);
    color: var(--color-error-text);
}

.flash-success {
    background: var(--color-success-soft);
    border-color: var(--color-success);
    color: var(--color-success-text);
}

.flash-error {
    background: var(--color-error-soft);
    border-color: var(--color-error);
    color: var(--color-error-text);
}

.notification-card.is-read {
    background: var(--color-surface-muted);
}

.device-card-media,
.engineer-device-media {
    background: var(--color-neutral-soft);
}

.device-card-placeholder,
.engineer-device-placeholder {
    background:
        linear-gradient(135deg, var(--color-primary-soft), transparent),
        var(--color-surface-muted);
    color: var(--color-primary-strong);
}

.device-card-placeholder span,
.engineer-device-placeholder span {
    background: var(--color-primary-soft);
}

.physical-evidence-button,
.simple-preview-card,
.detail-image-card {
    border-color: var(--color-border);
}

.timeline-card-line::before {
    background: var(--color-border-strong);
}

.timeline-node {
    border-color: var(--color-surface);
}

.timeline-card.is-done .timeline-card-body {
    background: var(--color-success-soft);
}

.timeline-card.is-delivered .timeline-card-body {
    background: var(--color-primary-soft);
}

.timeline-card.is-progress .timeline-card-body {
    background: var(--color-warning-soft);
}

.timeline-card.is-critical .timeline-card-body {
    background: var(--color-error-soft);
}

.timeline-card.is-waiting .timeline-card-body {
    background: var(--color-violet-soft);
}

.timeline-count {
    background: var(--color-surface-raised);
    color: var(--color-error-text);
}

.login-panel {
    background:
        radial-gradient(circle at top center, var(--color-focus-ring), transparent 44%),
        var(--color-surface);
    border-color: var(--color-border);
    box-shadow: var(--shadow-raised);
}

.login-brand-panel {
    background: var(--color-logo-surface);
    border-color: var(--color-primary-soft);
}

.login-panel label,
.login-kicker {
    color: var(--color-text-secondary);
}

.login-panel input,
.login-panel input:focus {
    background: var(--color-field);
    color: var(--color-text);
}

.sidebar {
    background: var(--color-sidebar);
    border-color: var(--color-sidebar-border);
    color: var(--color-sidebar-text);
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.sidebar::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-corner {
    background: var(--scrollbar-track);
}

.sidebar::-webkit-scrollbar-thumb {
    border-color: var(--scrollbar-track);
    background: var(--scrollbar-thumb);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

.sidebar-brand-panel {
    background:
        radial-gradient(circle at top left, var(--color-focus-ring), transparent 46%),
        var(--color-logo-panel);
    border-color: var(--color-sidebar-border);
    box-shadow: var(--shadow-panel);
}

.sidebar .brand {
    color: var(--color-sidebar-text);
}

.sidebar-brand-eyebrow,
.sidebar .subtitle,
.sidebar-mobile-bar strong,
.sidebar-user p,
.sidebar-section-label {
    color: var(--color-sidebar-muted);
}

.brand-version,
.session-pill {
    background: var(--color-primary-soft);
    border-color: var(--color-primary);
    color: var(--color-primary-strong);
}

.sidebar-close,
.sidebar-user,
.sidebar-action-link,
.sidebar-link,
.sidebar-icon {
    background: var(--color-surface-muted);
    border-color: var(--color-sidebar-border);
    color: var(--color-sidebar-text);
}

.sidebar-user-link:hover,
.sidebar-user-link:focus-visible,
.sidebar-link:hover,
.sidebar-action-link:hover {
    background: var(--color-sidebar-hover);
    border-color: var(--color-primary);
    color: var(--color-primary-strong);
}

.sidebar-link.is-active,
.sidebar-action-link.is-active {
    background: var(--color-sidebar-active);
    border-color: var(--color-primary);
    color: var(--color-sidebar-active-text);
}

.sidebar-action-link.danger {
    background: var(--color-error-soft);
    border-color: var(--color-error);
    color: var(--color-error-text);
}

.sidebar-action-link.danger:hover {
    background: var(--color-error);
    border-color: var(--color-error);
    color: var(--color-text-inverse);
}

.sidebar-toggle {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    box-shadow: var(--shadow-raised);
}

.sidebar-toggle-icon span {
    background: var(--color-text-inverse);
}

.sidebar-toggle-label {
    color: var(--color-text-inverse);
}

.sidebar-backdrop {
    background: var(--color-overlay);
}

.toolbar-label {
    color: var(--color-text-secondary);
}

.toolbar-link {
    background: var(--color-surface-raised);
    border-color: var(--color-border);
    color: var(--color-text);
}

.toolbar-link.is-active,
.toolbar-link:hover,
.subnav-link:hover,
.subnav-link.is-active {
    background: var(--color-primary-soft);
    border-color: var(--color-primary);
    color: var(--color-primary-strong);
}

.lightbox-backdrop {
    background: var(--color-overlay);
}

.lightbox-dialog {
    border: 1px solid var(--color-border-strong);
    background: var(--color-bg-main);
    box-shadow: var(--shadow-raised);
}

.lightbox-tool,
.lightbox-close {
    background: var(--color-surface-raised);
    color: var(--color-text);
}

.lightbox-tip {
    color: var(--color-text-secondary);
}

.scanner-divider {
    background: var(--color-border);
}

.service-report-hero {
    border-top-color: var(--color-primary);
}

.service-report-item-heading {
    background: var(--color-surface-muted);
    border-color: var(--color-border);
}

.service-report-item-number {
    background: var(--color-primary);
    color: var(--color-text-inverse);
}

.money-input > span,
.service-report-auto-grid span,
.service-report-subtotal span,
.service-report-total span {
    color: var(--color-text-secondary);
}

.service-report-auto-grid strong,
.service-report-total strong {
    color: var(--color-text);
}

.service-report-subtotal {
    border-color: var(--color-border-strong);
}

.service-report-subtotal strong {
    color: var(--color-primary-strong);
}

.service-report-total {
    background: var(--color-primary-soft);
    border-color: var(--color-primary);
}

.theme-ready body,
.theme-ready .sidebar,
.theme-ready .panel,
.theme-ready .card,
.theme-ready .home-action,
.theme-ready .module-card-link,
.theme-ready input,
.theme-ready select,
.theme-ready textarea,
.theme-ready .button,
.theme-ready .theme-toggle,
.theme-ready th,
.theme-ready td {
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease;
}

@media (prefers-reduced-motion: reduce) {
    .theme-ready body,
    .theme-ready .sidebar,
    .theme-ready .panel,
    .theme-ready .card,
    .theme-ready .home-action,
    .theme-ready .module-card-link,
    .theme-ready input,
    .theme-ready select,
    .theme-ready textarea,
    .theme-ready .button,
    .theme-ready .theme-toggle,
    .theme-ready th,
    .theme-ready td,
    .theme-toggle::after {
        transition: none;
    }
}

@media print {
    @page {
        size: letter;
        margin: 0;
    }

    * {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    body {
        background: #fff;
    }

    .no-print,
    .sidebar,
    .admin-toolbar,
    .flash-stack {
        display: none !important;
    }

    .dashboard-layout,
    .dashboard-main {
        display: block;
        min-height: 0;
    }

    .dashboard-content {
        padding: 0;
    }

    .service-sheet {
        box-sizing: border-box;
        width: 8.5in;
        height: 11in;
        max-width: none;
        margin: 0;
        padding: 0.3in 0.34in 0.24in;
        border: 0;
        border-left: 0.18in solid #1d4ed8;
        box-shadow: none;
        font-size: 0.8rem;
        page-break-after: auto;
    }

    .service-sheet-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 2.35in;
        break-after: avoid;
    }

    .service-sheet-strip {
        display: grid;
        grid-template-columns: 1.15fr 1fr 1fr;
    }

    .service-sheet-codes {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 1.15in;
    }

    .service-sheet-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .service-sheet-grid-compact {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .service-sheet-notes-two {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .service-sheet-section,
    .service-sheet-strip {
        break-inside: avoid;
    }

    .ticket-actions {
        display: none !important;
    }

    html.ticket-print-page,
    html.ticket-print-page body {
        width: var(--ticket-width, 80mm) !important;
        min-width: var(--ticket-width, 80mm) !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: #fff !important;
    }

    .ticket-print-page .dashboard-layout,
    .ticket-print-page .dashboard-main,
    .ticket-print-page .dashboard-content {
        display: block !important;
        width: var(--ticket-width, 80mm) !important;
        min-width: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .service-ticket {
        width: var(--ticket-width, 80mm) !important;
        max-width: none;
        margin: 0;
        padding: 2.5mm;
        border: 0;
        box-shadow: none;
        font-size: 12px;
        page-break-after: avoid;
        break-after: avoid;
    }

    .service-ticket .ticket-header img {
        width: 68mm;
    }

    .service-ticket .ticket-header h1 {
        margin: 0;
        font-size: 20px;
        line-height: 1.05;
        text-transform: uppercase;
    }

    .service-ticket .ticket-header strong {
        font-size: 17px;
    }

    .ticket-lines dt,
    .ticket-block h2 {
        font-size: 10.5px;
    }

    .ticket-lines dd,
    .ticket-block p,
    .ticket-footer p {
        font-size: 12px;
    }

    .ticket-qr {
        width: 23mm;
        height: 23mm;
    }
}
