:root {
    --bg: #08111f;
    --panel: #101d31;
    --panel-soft: #16253d;
    --panel-strong: #0d182a;
    --border: rgba(148, 163, 184, 0.16);
    --text: #e5eef9;
    --muted: #91a4be;
    --accent: #22d3ee;
    --critical: #ef4444;
    --warning: #f59e0b;
    --success: #22c55e;
    --info: #60a5fa;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top right, rgba(34, 211, 238, 0.08), transparent 25%),
        linear-gradient(180deg, #07111d 0%, #0a1424 100%);
    color: var(--text);
    font-family: "Segoe UI", sans-serif;
}

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

.hidden {
    display: none !important;
}

.text-link,
.inline-link,
.table-link,
.card-link {
    color: var(--accent);
}

.text-link:hover,
.inline-link:hover,
.table-link:hover,
.card-link:hover {
    text-decoration: underline;
}

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    align-items: start;
    text-transform: uppercase;
}

.layout input,
.layout textarea,
.layout select,
.layout button {
    text-transform: uppercase;
}

.layout input::placeholder,
.layout textarea::placeholder {
    text-transform: uppercase;
}

.layout input.case-sensitive-input,
.layout input.case-sensitive-input::placeholder {
    text-transform: none;
}

.sidebar {
    position: sticky;
    top: 0;
    z-index: 60;
    min-height: 58px;
    padding: 6px 14px;
    background: rgba(5, 11, 20, 0.88);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.brand {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    margin-bottom: 0;
}

.brand-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    color: #03111e;
    font-size: 18px;
    font-weight: 800;
}

.brand-text {
    display: none;
}

.nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    margin: 0 auto 0 0;
    min-width: 0;
    width: auto;
}

.dashboard-page .nav {
    margin: 0;
}

.dashboard-toolbar-status {
    margin-left: auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 auto;
}

.dashboard-toolbar-status .dashboard-connection-status {
    width: 100%;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}

.dashboard-toolbar-status .dashboard-connection-status::-webkit-scrollbar {
    display: none;
}

.nav-link {
    position: relative;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 12px;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(34, 211, 238, 0.10);
    color: var(--text);
}

.nav-link svg,
.sidebar-logout svg,
.sidebar-notification-toggle svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-link::after,
.sidebar-logout::after,
.sidebar-user-badge::after,
.sidebar-notification-toggle::after {
    content: attr(title);
    position: absolute;
    left: 50%;
    top: calc(100% + 10px);
    transform: translateX(-50%) translateY(-4px);
    padding: 7px 10px;
    border-radius: 10px;
    background: rgba(8, 17, 31, 0.96);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 30;
}

.nav-link:hover::after,
.sidebar-logout:hover::after,
.sidebar-user-badge:hover::after,
.sidebar-notification-toggle:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

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

.content {
    min-width: 0;
    padding: 12px 16px 18px;
}

.global-alarm-indicator {
    position: fixed;
    top: 66px;
    right: 18px;
    z-index: 140;
    min-width: 240px;
    max-width: min(360px, calc(100vw - 36px));
    padding: 12px 14px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(248, 113, 113, 0.38);
    background: linear-gradient(180deg, rgba(66, 18, 28, 0.985), rgba(40, 11, 18, 0.985));
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
    color: #ffe7ea;
    opacity: 1;
    backdrop-filter: blur(12px) saturate(1.06);
}

.global-alarm-indicator:hover {
    transform: translateY(-1px);
    border-color: rgba(248, 113, 113, 0.42);
}

.global-alarm-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    color: #ffe4e6;
    flex: 0 0 auto;
}

.global-alarm-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.global-alarm-copy {
    display: grid;
    min-width: 0;
}

.global-alarm-copy strong {
    font-size: 14px;
    line-height: 1.1;
    color: #fff7f8;
}

.global-alarm-copy small {
    margin-top: 4px;
    color: #ffe1e5;
    font-size: 12px;
    line-height: 1.2;
}

.global-alarm-count {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.14);
    color: #fff5f5;
    font-size: 13px;
    font-weight: 800;
    flex: 0 0 auto;
}

.global-alarm-indicator.is-blinking {
    border-color: rgba(248, 113, 113, 0.56);
    box-shadow: 0 18px 44px rgba(239, 68, 68, 0.22);
}

@keyframes globalAlarmPulse {
    0%,
    100% {
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
        border-color: rgba(239, 68, 68, 0.26);
    }
    50% {
        box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.14), 0 18px 44px rgba(239, 68, 68, 0.26);
        border-color: rgba(248, 113, 113, 0.56);
    }
}

.sidebar-tools {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.sidebar-sound-toggle {
    width: 34px;
    height: 34px;
    border-radius: 12px;
}

.sidebar-user {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    flex: 0 0 auto;
}

.sidebar-user-badge,
.sidebar-logout,
.sidebar-notification-toggle {
    position: relative;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-weight: 800;
}

.sidebar-user-badge {
    background: rgba(34, 211, 238, 0.10);
    border-color: rgba(34, 211, 238, 0.18);
    color: var(--accent);
}

.sidebar-notification-toggle {
    color: var(--muted);
}

.sidebar-notification-toggle:hover,
.sidebar-notification-toggle.is-enabled {
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.32);
    background: rgba(34, 197, 94, 0.10);
}

.sidebar-notification-toggle.is-blocked {
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(239, 68, 68, 0.08);
}

.sidebar-logout:hover {
    color: #ffb3bb;
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(239, 68, 68, 0.08);
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 78px 1fr;
    }

    .sidebar {
        padding: 14px 8px;
    }

    .nav-link {
        width: 46px;
        height: 46px;
        border-radius: 14px;
    }

    .content {
        padding: 18px;
    }

    .global-alarm-indicator {
        top: 10px;
        right: 12px;
        left: auto;
        max-width: min(320px, calc(100vw - 24px));
    }
}

.page-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.page-header-with-stats {
    align-items: flex-start;
}

.page-header-with-stats > :first-child {
    flex: 1 1 280px;
    min-width: 0;
}

.page-header h1 {
    margin: 4px 0 0;
    font-size: 26px;
    line-height: 1.04;
}

.page-subtitle {
    margin: 4px 0 0;
    color: var(--muted);
    max-width: 720px;
    font-size: 12px;
    line-height: 1.35;
}

.dashboard-header-simple {
    align-items: center;
}

.dashboard-hero-label {
    margin: 0;
    font-size: 15px;
    letter-spacing: 0.22em;
}

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

.dashboard-header-actions {
    align-items: flex-start;
}

.system-status-panel {
    display: grid;
    gap: 10px;
    min-width: 420px;
}

.system-status-title {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    text-align: right;
}

.system-status-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.system-status-item {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    min-width: 0;
}

.system-status-name {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
}

.system-status-value {
    font-size: 15px;
    line-height: 1;
}

.system-status-detail {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.system-status-item.on {
    border-color: rgba(34, 197, 94, 0.24);
    background: rgba(34, 197, 94, 0.08);
}

.system-status-item.on .system-status-value {
    color: #9ff0b2;
}

.system-status-item.off {
    border-color: rgba(239, 68, 68, 0.24);
    background: rgba(239, 68, 68, 0.08);
}

.system-status-item.off .system-status-value {
    color: #ffb3bb;
}

.page-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: -2px 0 18px;
    padding: 6px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}

.page-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 12px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
    font-weight: 700;
    transition: 0.2s ease;
}

.page-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.page-tab.active {
    color: var(--text);
    background: rgba(34, 211, 238, 0.12);
    border: 1px solid rgba(34, 211, 238, 0.22);
}

.content-tabs-shell {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.compact-page-tabs {
    gap: 8px;
    margin: 0;
    padding: 5px;
    border-radius: 16px;
}

.compact-page-tabs .page-tab {
    min-height: 36px;
    padding: 8px 13px;
    border-radius: 10px;
    font-size: 12px;
}

.content-tab-panel.hidden {
    display: none !important;
}

.eyebrow {
    margin: 0;
    color: var(--accent);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 700;
}

button {
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    color: white;
    padding: 12px 16px;
    font-weight: 700;
    cursor: pointer;
}

.ghost-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
}

.ghost-button {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text);
}

.ghost-button.is-active {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.34);
}

.sound-toggle-button {
    width: 54px;
    height: 54px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
}

.sound-toggle-button svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sound-toggle-button.is-active {
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.16);
}

.sidebar-sound-toggle.sound-toggle-button {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.sidebar-sound-toggle.sound-toggle-button svg {
    width: 17px;
    height: 17px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stats-grid-large {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.minimal-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.minimal-stats-grid-below {
    margin-top: -2px;
    margin-bottom: 20px;
}

.stat-card,
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}

.stat-card {
    padding: 18px;
}

.stat-card span {
    color: var(--muted);
    font-size: 14px;
}

.stat-card strong {
    display: block;
    margin-top: 10px;
    font-size: 34px;
}

.minimal-stats-grid .stat-card strong {
    font-size: 30px;
}

.stat-card.critical {
    border-color: rgba(239, 68, 68, 0.30);
}

.stat-card.warning {
    border-color: rgba(245, 158, 11, 0.30);
}

.stat-card.success {
    border-color: rgba(34, 197, 94, 0.30);
}

.stat-card.info-card {
    border-color: rgba(96, 165, 250, 0.30);
}

.inline-page-stats {
    display: flex;
    flex: 1 1 460px;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin: 0;
}

.inline-page-stats .stat-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 0;
    padding: 8px 10px;
    border-radius: 14px;
    box-shadow: none;
    background: rgba(12, 21, 38, 0.92);
}

.inline-page-stats .stat-card span {
    max-width: 124px;
    font-size: 10px;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.inline-page-stats .stat-card strong {
    display: inline;
    margin: 0;
    font-size: 18px;
    line-height: 1;
    white-space: nowrap;
}

.inline-page-stats.hidden {
    display: none !important;
}

.panel {
    padding: 18px;
}

.panel-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.panel-head h2 {
    margin: 6px 0 0;
    font-size: 26px;
}

.live-status {
    color: var(--muted);
    font-size: 13px;
}

.filters-panel {
    margin-bottom: 18px;
}

.filters {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}

.filters-wide {
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
}

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

.filters-events {
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr 1fr auto;
}

.filters-clients {
    grid-template-columns: minmax(240px, 1.8fr) repeat(4, minmax(150px, 1fr)) auto;
}

.field {
    display: grid;
    gap: 6px;
}

.field label {
    font-size: 13px;
    color: var(--muted);
}

.field-help {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.45;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    background: var(--panel-soft);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    outline: none;
}

.field input[data-field-fit="content"],
.field select[data-field-fit="content"] {
    width: min(
        100%,
        clamp(
            var(--field-fit-min-width, 11rem),
            calc((var(--field-fit-ch, 16) * 1ch) + 3.4rem),
            var(--field-fit-max-width, 26rem)
        )
    );
    justify-self: start;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.workflow-form-row input:focus,
.workflow-form-row textarea:focus {
    border-color: rgba(34, 211, 238, 0.45);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.08);
}

.field-button {
    display: flex;
}

.board-panel {
    margin-bottom: 10px;
}

.dashboard-board-topbar {
    position: sticky;
    top: 0;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    padding: 0 0 6px;
    background: linear-gradient(180deg, rgba(16, 29, 49, 0.98), rgba(16, 29, 49, 0.92));
    border-bottom: 1px solid rgba(148, 163, 184, 0.10);
}

.dashboard-board-topbar-copy {
    min-width: 0;
}

.dashboard-board-topbar-actions {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

.dashboard-board-topbar-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.dashboard-whatsapp-extension-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(10, 18, 31, 0.84);
    color: #d8e9f7;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.dashboard-whatsapp-extension-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.16);
    flex: 0 0 auto;
}

.dashboard-whatsapp-extension-indicator.is-connected {
    border-color: rgba(34, 197, 94, 0.32);
    background: rgba(17, 46, 32, 0.78);
    color: #dffbea;
}

.dashboard-whatsapp-extension-indicator.is-connected .dashboard-whatsapp-extension-dot {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

.dashboard-whatsapp-extension-indicator.is-disconnected {
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(68, 20, 24, 0.72);
    color: #ffd9dd;
}

.dashboard-whatsapp-extension-indicator.is-disconnected .dashboard-whatsapp-extension-dot {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.dashboard-whatsapp-extension-indicator.is-checking {
    border-color: rgba(71, 188, 255, 0.24);
    background: rgba(13, 37, 60, 0.78);
    color: #d7efff;
}

.dashboard-whatsapp-extension-indicator.is-checking .dashboard-whatsapp-extension-dot {
    background: #47bcff;
    box-shadow: 0 0 0 3px rgba(71, 188, 255, 0.16);
}

.dashboard-whatsapp-extension-test {
    min-height: 32px;
}

.settings-integrations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.settings-integration-card {
    display: grid;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(13, 24, 41, 0.76);
}

.settings-integration-card.online {
    border-color: rgba(34, 197, 94, 0.26);
    background: rgba(18, 44, 31, 0.44);
}

.settings-integration-card.warning {
    border-color: rgba(245, 158, 11, 0.26);
    background: rgba(58, 38, 10, 0.40);
}

.settings-integration-card.offline {
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(62, 18, 24, 0.42);
}

.settings-integration-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.settings-integration-title {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.settings-integration-icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    flex: 0 0 auto;
}

.settings-integration-icon svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.settings-integration-copy {
    display: grid;
    gap: 3px;
}

.settings-integration-copy strong {
    font-size: 13px;
    line-height: 1.2;
}

.settings-integration-copy small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
}

.settings-integration-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.settings-integration-card.online .settings-integration-badge {
    border-color: rgba(34, 197, 94, 0.24);
    color: #bbf7d0;
}

.settings-integration-card.warning .settings-integration-badge {
    border-color: rgba(245, 158, 11, 0.24);
    color: #fde68a;
}

.settings-integration-card.offline .settings-integration-badge {
    border-color: rgba(239, 68, 68, 0.24);
    color: #fecdd3;
}

.settings-integration-body {
    display: grid;
    gap: 6px;
}

.settings-integration-meta,
.settings-integration-detail {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.settings-integration-detail {
    color: rgba(226, 232, 240, 0.88);
}

.settings-integration-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.settings-integration-note {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.settings-integration-restart {
    min-height: 32px;
    padding: 0 12px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.settings-integration-restart svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.settings-integration-restart.is-busy svg {
    animation: dashboardRestartSpin 0.85s linear infinite;
}

.settings-whatsapp-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.settings-whatsapp-actions {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.settings-whatsapp-details {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.settings-whatsapp-details .detail-item {
    padding: 12px 14px;
}

.settings-subtabs-shell {
    margin-top: 4px;
}

.settings-subtabs {
    margin-bottom: 12px;
}

.settings-whatsapp-template-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.settings-whatsapp-template-head strong {
    display: block;
    font-size: 14px;
    line-height: 1.2;
}

.settings-whatsapp-template-note {
    margin-top: 4px;
    margin-bottom: 0;
    font-size: 11px;
}

.settings-whatsapp-template-actions {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.settings-whatsapp-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 12px;
}

.settings-whatsapp-template-card {
    display: grid;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(13, 24, 41, 0.76);
}

.settings-whatsapp-template-copy {
    display: grid;
    gap: 4px;
}

.settings-whatsapp-template-copy strong {
    font-size: 13px;
    line-height: 1.2;
}

.settings-whatsapp-template-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.settings-whatsapp-template-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.settings-whatsapp-template-fields .field-full {
    grid-column: 1 / -1;
}

.settings-whatsapp-template-fields .field span {
    font-size: 11px;
}

.settings-whatsapp-template-fields input,
.settings-whatsapp-template-fields textarea {
    min-height: 38px;
}

.settings-whatsapp-template-fields textarea {
    min-height: 150px;
    resize: vertical;
}

.settings-whatsapp-template-placeholders {
    display: grid;
    gap: 6px;
}

.settings-whatsapp-template-placeholders > span {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
}

.settings-whatsapp-placeholder-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.settings-whatsapp-placeholder-list code {
    padding: 5px 8px;
    border-radius: 10px;
    border: 1px solid rgba(59, 130, 246, 0.18);
    background: rgba(37, 99, 235, 0.12);
    color: #bfdbfe;
    font-size: 11px;
}

.settings-dashboard-monitoring-grid {
    display: grid;
    gap: 12px;
}

.settings-dashboard-toggle-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(34, 211, 238, 0.12);
    background: rgba(12, 22, 38, 0.78);
}

.settings-dashboard-toggle-card strong {
    display: block;
    color: #f8fafc;
    font-size: 12px;
}

.settings-dashboard-toggle-card small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.45;
}

.settings-dashboard-toggle-card input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.settings-dashboard-monitoring-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 12px;
}

.settings-dashboard-monitoring-statuses {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.dashboard-runtime-settings-button {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dashboard-runtime-settings-button svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dashboard-runtime-settings-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 260px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(8, 17, 31, 0.98);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.32);
    z-index: 18;
}

.dashboard-runtime-settings-option {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
}

.dashboard-runtime-settings-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.dashboard-runtime-settings-secondary-row {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.dashboard-runtime-settings-help {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.35;
}

.dashboard-connection-status {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}

.dashboard-connection-indicator {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 5px 8px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.dashboard-toolbar-status .dashboard-connection-indicator {
    min-height: 34px;
    padding: 6px 9px;
}

.dashboard-connection-icon {
    width: 18px;
    height: 18px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    flex: 0 0 auto;
}

.dashboard-connection-icon svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dashboard-connection-copy {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.dashboard-connection-indicator.has-action {
    padding-right: 7px;
}

.dashboard-connection-copy strong {
    font-size: 9px;
    line-height: 1;
}

.dashboard-connection-copy small {
    color: var(--muted);
    font-size: 8px;
    line-height: 1;
}

.dashboard-connection-meta {
    color: rgba(226, 232, 240, 0.76);
    font-size: 7px;
    line-height: 1.15;
    white-space: nowrap;
}

.dashboard-connection-light {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.36);
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.12);
    flex: 0 0 auto;
}

.dashboard-connection-restart {
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: inherit;
    flex: 0 0 auto;
}

.dashboard-connection-restart svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dashboard-connection-restart:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(34, 211, 238, 0.28);
}

.dashboard-connection-restart.is-busy svg {
    animation: dashboardRestartSpin 0.85s linear infinite;
}

.dashboard-connection-restart:disabled {
    opacity: 0.72;
    cursor: wait;
}

@keyframes dashboardRestartSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.dashboard-connection-indicator.online {
    border-color: rgba(34, 197, 94, 0.24);
    background: rgba(34, 197, 94, 0.08);
    color: #c7ffd3;
}

.dashboard-connection-indicator.online .dashboard-connection-light {
    background: #6df198;
    box-shadow:
        0 0 0 1px rgba(109, 241, 152, 0.18),
        0 0 12px rgba(109, 241, 152, 0.52);
}

.dashboard-connection-indicator.warning {
    border-color: rgba(245, 158, 11, 0.24);
    background: rgba(245, 158, 11, 0.08);
    color: #ffe1a8;
}

.dashboard-connection-indicator.warning .dashboard-connection-light {
    background: #fbbf24;
    box-shadow:
        0 0 0 1px rgba(251, 191, 36, 0.16),
        0 0 10px rgba(251, 191, 36, 0.34);
}

.dashboard-connection-indicator.offline {
    border-color: rgba(239, 68, 68, 0.24);
    background: rgba(239, 68, 68, 0.08);
    color: #ffb8c0;
}

.dashboard-connection-indicator.offline .dashboard-connection-light {
    background: #fb7185;
    box-shadow:
        0 0 0 1px rgba(251, 113, 133, 0.18),
        0 0 10px rgba(251, 113, 133, 0.28);
}

@keyframes dashboardConnectionPulse {
    0%,
    100% {
        transform: scale(0.92);
        opacity: 0.82;
    }
    50% {
        transform: scale(1.18);
        opacity: 1;
    }
}

.workflow-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.workflow-column {
    background: var(--panel-strong);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0 7px 7px;
    min-height: 360px;
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.workflow-column.is-over {
    border-color: rgba(34, 211, 238, 0.5);
    transform: translateY(-2px);
}

.workflow-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 4;
    margin: 0 -7px 8px;
    padding: 9px 10px;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
    border-bottom: 1px solid rgba(34, 211, 238, 0.14);
    background:
        linear-gradient(180deg, rgba(7, 18, 32, 0.98), rgba(10, 24, 43, 0.94)),
        radial-gradient(circle at left top, rgba(34, 211, 238, 0.12), transparent 58%);
    backdrop-filter: blur(10px);
}

.workflow-head h3 {
    margin: 0;
    font-size: 13px;
    color: #f8fbff;
    letter-spacing: 0.06em;
}

.workflow-column[data-status="pendente"] .workflow-head {
    border-bottom-color: rgba(245, 158, 11, 0.18);
    background:
        linear-gradient(180deg, rgba(20, 16, 9, 0.96), rgba(30, 23, 12, 0.92)),
        radial-gradient(circle at left top, rgba(245, 158, 11, 0.14), transparent 58%);
}

.workflow-column[data-status="atendido"] .workflow-head {
    border-bottom-color: rgba(34, 197, 94, 0.16);
    background:
        linear-gradient(180deg, rgba(8, 21, 20, 0.96), rgba(10, 29, 28, 0.92)),
        radial-gradient(circle at left top, rgba(34, 197, 94, 0.12), transparent 58%);
}

.workflow-column[data-status="viatura_deslocada"] .workflow-head {
    border-bottom-color: rgba(59, 130, 246, 0.16);
    background:
        linear-gradient(180deg, rgba(8, 16, 30, 0.96), rgba(10, 22, 42, 0.92)),
        radial-gradient(circle at left top, rgba(59, 130, 246, 0.12), transparent 58%);
}

.workflow-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pending-attention-button {
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    border-color: rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.03);
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.pending-attention-button svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.pending-attention-button:hover {
    transform: translateY(-1px);
    color: #f8fafc;
    border-color: rgba(34, 211, 238, 0.34);
}

.pending-attention-button:disabled {
    opacity: 0.45;
    cursor: default;
    transform: none;
    box-shadow: none;
}

.pending-attention-button.is-active {
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.42);
    background: rgba(127, 29, 29, 0.35);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.08);
}

.pending-attention-button.is-urgent {
    color: #ffd7d7;
    border-color: rgba(239, 68, 68, 0.52);
    background: linear-gradient(180deg, rgba(140, 24, 32, 0.55), rgba(86, 19, 28, 0.35));
}

.pending-attention-button.is-blinking {
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.18), 0 0 18px rgba(239, 68, 68, 0.22);
}

@keyframes pendingBellPulse {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.00);
    }
    40% {
        transform: scale(1.04);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.00), 0 0 0 1px rgba(239, 68, 68, 0.12);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.24), 0 0 18px rgba(239, 68, 68, 0.30);
    }
}

.workflow-count {
    min-width: 28px;
    padding: 3px 7px;
    border-radius: 999px;
    border: 1px solid rgba(34, 211, 238, 0.16);
    background: rgba(14, 31, 54, 0.92);
    color: #9deaff;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
}

.workflow-dropzone {
    display: grid;
    gap: 6px;
    align-content: start;
    min-height: 0;
}

.dashboard-page {
    overflow: hidden;
}

.dashboard-page .layout {
    min-height: 100vh;
    height: 100vh;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}

.dashboard-page .sidebar {
    height: auto;
    min-height: 58px;
}

.dashboard-page .content {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 0;
    height: calc(100vh - 58px);
    padding: 10px 16px 14px;
    overflow: hidden;
}

.dashboard-page .page-header {
    flex: 0 0 auto;
    margin-bottom: 0;
    justify-content: flex-end;
}

.dashboard-page .dashboard-hero-label {
    font-size: 16px;
}

.dashboard-page .board-panel {
    flex: 1 1 auto;
    min-height: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    padding-top: 4px;
    overflow: hidden;
}

.dashboard-page .panel-head {
    margin-bottom: 8px;
}

.dashboard-page .workflow-board {
    flex: 1 1 auto;
    min-height: 0;
    padding-top: 0;
}

.dashboard-page .workflow-column {
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dashboard-page .workflow-dropzone {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 211, 238, 0.42) rgba(8, 17, 31, 0.88);
}

.dashboard-page .workflow-dropzone.is-virtualized {
    display: block;
}

.workflow-virtual-shell {
    display: block;
    min-height: 100%;
}

.workflow-virtual-body {
    display: grid;
    gap: 6px;
    align-content: start;
}

.workflow-virtual-spacer {
    width: 100%;
    min-height: 0;
    pointer-events: none;
}

.dashboard-page .workflow-dropzone::-webkit-scrollbar {
    width: 10px;
}

.dashboard-page .workflow-dropzone::-webkit-scrollbar-track {
    background: rgba(8, 17, 31, 0.92);
    border-left: 1px solid rgba(34, 211, 238, 0.08);
    border-radius: 999px;
}

.dashboard-page .workflow-dropzone::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(34, 211, 238, 0.48), rgba(37, 99, 235, 0.42));
    border: 2px solid rgba(8, 17, 31, 0.92);
    border-radius: 999px;
}

.dashboard-page .workflow-dropzone::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(34, 211, 238, 0.62), rgba(59, 130, 246, 0.54));
}

.workflow-account-group {
    display: grid;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(148, 163, 184, 0.10);
    cursor: grab;
    transition: border-color 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.workflow-account-group.is-syncing {
    border-color: rgba(59, 130, 246, 0.32);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.08);
}

.workflow-account-group.is-retrying {
    border-color: rgba(245, 158, 11, 0.34);
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.09);
}

.workflow-account-group.is-locked-by-sync {
    cursor: default;
}

.workflow-account-group.dragging {
    opacity: 0.5;
    transform: scale(0.985);
    border-color: rgba(34, 211, 238, 0.28);
}

.workflow-account-group.attention-jump {
    box-shadow:
        inset 0 0 0 1px rgba(34, 211, 238, 0.18),
        0 0 0 1px rgba(34, 211, 238, 0.24),
        0 0 28px rgba(34, 211, 238, 0.18);
    transform: translateY(-1px);
}

.workflow-account-group.alarm-pending {
    background: linear-gradient(180deg, rgba(80, 16, 24, 0.60), rgba(42, 12, 18, 0.48));
    border-color: rgba(239, 68, 68, 0.44);
    box-shadow:
        inset 0 0 0 1px rgba(239, 68, 68, 0.12),
        0 0 0 1px rgba(239, 68, 68, 0.08);
}

.workflow-account-group.alarm-pending .workflow-account-head strong,
.workflow-account-group.alarm-pending .workflow-account-head strong a,
.workflow-account-group.alarm-pending .workflow-account-number {
    color: #ffe3e7;
}

.workflow-account-group.alarm-pending .workflow-account-head span {
    color: #ffc6ce;
}

.workflow-account-group.alarm-acknowledged {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(239, 68, 68, 0.44);
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.12);
}

.workflow-account-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 0;
    border-bottom: 0;
}

.workflow-account-titleblock {
    min-width: 0;
    flex: 1;
}

.workflow-account-head strong {
    display: block;
    margin-bottom: 2px;
    font-size: 12px;
    line-height: 1.2;
}

.workflow-account-head span {
    color: var(--muted);
    font-size: 10px;
}

.workflow-account-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    align-items: center;
}

.workflow-account-number {
    color: #dce7f7;
    font-weight: 700;
}

.workflow-account-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.workflow-transport-badges {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.workflow-transport-badge {
    min-height: 24px;
    padding: 4px 8px;
    gap: 5px;
    font-size: 10px;
    font-weight: 800;
}

.workflow-transport-badge.icon-only {
    width: 24px;
    min-width: 24px;
    min-height: 24px;
    padding: 0;
    gap: 0;
    justify-content: center;
}

.workflow-transport-badge svg {
    width: 12px;
    height: 12px;
}

.workflow-note-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.workflow-note-toggle {
    width: 24px;
    min-width: 24px;
    min-height: 24px;
    padding: 0;
    justify-content: center;
    border-radius: 8px;
    color: #8df6ff;
    border-color: rgba(34, 211, 238, 0.28);
    background: rgba(34, 211, 238, 0.10);
    box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.10);
}

.workflow-note-toggle svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.workflow-note-wrap.is-open .workflow-note-toggle,
.workflow-note-toggle:hover {
    color: #dffcff;
    border-color: rgba(34, 211, 238, 0.42);
    background: rgba(34, 211, 238, 0.16);
}

.workflow-note-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 12;
    width: min(340px, 72vw);
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(34, 211, 238, 0.20);
    background: rgba(8, 15, 29, 0.98);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.36);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.workflow-note-popover.is-floating,
.workflow-security-popover.is-floating {
    position: fixed;
    right: auto;
    z-index: 4400;
    max-width: calc(100vw - 24px);
}

.workflow-note-popover strong {
    font-size: 13px;
    color: #f8fbff;
}

.workflow-note-popover small {
    color: #8ea4c3;
    font-size: 11px;
}

.workflow-note-popover-body {
    font-size: 12px;
    line-height: 1.5;
    color: #d9e7fa;
    white-space: normal;
}

.workflow-note-popover-body.is-empty {
    color: #9eb2cc;
    font-style: italic;
}

.workflow-note-attachment-link {
    align-self: flex-start;
    font-size: 12px;
    font-weight: 700;
}

.workflow-transport-badge.is-internet.transport-online {
    color: #9ff0b2;
    border-color: rgba(34, 197, 94, 0.34);
    background: rgba(34, 197, 94, 0.10);
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.14);
}

.workflow-transport-badge.is-internet.transport-offline {
    color: #ffb4bf;
    border-color: rgba(239, 68, 68, 0.34);
    background: rgba(239, 68, 68, 0.10);
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.14);
}

.workflow-security-indicator {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.04);
}

.workflow-security-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.workflow-security-toggle {
    padding: 0;
    cursor: pointer;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.workflow-security-wrap.is-open .workflow-security-toggle,
.workflow-security-toggle:hover {
    transform: translateY(-1px);
}

.workflow-security-indicator svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.workflow-security-indicator.is-armed {
    color: #ffb3bb;
    border-color: rgba(239, 68, 68, 0.30);
    background: rgba(239, 68, 68, 0.08);
}

.workflow-security-indicator.is-disarmed {
    color: #9ff0b2;
    border-color: rgba(34, 197, 94, 0.30);
    background: rgba(34, 197, 94, 0.08);
}

.workflow-security-indicator.is-unknown {
    color: #d3deed;
    border-color: rgba(148, 163, 184, 0.22);
    background: rgba(148, 163, 184, 0.08);
}

.workflow-security-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 14;
    width: min(320px, 78vw);
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(56, 189, 248, 0.18);
    background: rgba(8, 15, 29, 0.98);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.workflow-security-popover-head {
    display: grid;
    gap: 2px;
}

.workflow-security-popover-head strong {
    font-size: 13px;
    color: #f8fbff;
}

.workflow-security-popover-head small,
.workflow-security-popover-helper {
    color: #8ea4c3;
    font-size: 11px;
    line-height: 1.35;
}

.workflow-security-popover-loading,
.workflow-security-popover-empty {
    font-size: 12px;
    color: #d9e7fa;
    line-height: 1.45;
}

.workflow-security-popover-empty {
    color: #9eb2cc;
    font-style: italic;
}

.workflow-security-popover-feedback {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1.35;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(148, 163, 184, 0.10);
    color: #dce7f5;
}

.workflow-security-popover-feedback.is-success {
    color: #b8ffd2;
    border-color: rgba(34, 197, 94, 0.28);
    background: rgba(34, 197, 94, 0.12);
}

.workflow-security-popover-feedback.is-error {
    color: #ffc0c6;
    border-color: rgba(239, 68, 68, 0.30);
    background: rgba(239, 68, 68, 0.12);
}

.workflow-security-partition-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(340px, 48vh);
    overflow-y: auto;
    padding-right: 2px;
}

.workflow-security-partition-card {
    display: grid;
    gap: 8px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.04);
}

.workflow-security-partition-card.is-armed {
    border-color: rgba(239, 68, 68, 0.26);
    background: rgba(239, 68, 68, 0.08);
}

.workflow-security-partition-card.is-disarmed {
    border-color: rgba(34, 197, 94, 0.24);
    background: rgba(34, 197, 94, 0.08);
}

.workflow-security-partition-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.workflow-security-partition-copy {
    display: grid;
    gap: 3px;
}

.workflow-security-partition-copy strong {
    font-size: 12px;
    color: #f8fbff;
    line-height: 1.2;
}

.workflow-security-partition-copy span {
    font-size: 11px;
    line-height: 1.2;
    color: #d7e4f8;
}

.workflow-security-partition-copy small {
    font-size: 10px;
    line-height: 1.2;
    color: #8ea4c3;
}

.workflow-security-partition-card.is-armed .workflow-security-partition-copy span {
    color: #ffbec5;
}

.workflow-security-partition-card.is-disarmed .workflow-security-partition-copy span {
    color: #b6ffd0;
}

.workflow-security-partition-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.workflow-security-action {
    min-height: 28px;
    padding: 5px 6px;
    justify-content: center;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.workflow-security-action.status {
    color: #dce8ff;
    border-color: rgba(59, 130, 246, 0.28);
    background: rgba(59, 130, 246, 0.10);
}

.workflow-security-action.arm {
    color: #ffd0d6;
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(239, 68, 68, 0.12);
}

.workflow-security-action.disarm {
    color: #d4ffe2;
    border-color: rgba(34, 197, 94, 0.28);
    background: rgba(34, 197, 94, 0.12);
}

.workflow-security-action:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.workflow-security-client-link {
    align-self: flex-start;
    font-size: 12px;
    font-weight: 700;
}

.workflow-group-count {
    min-width: 24px;
    min-height: 24px;
    padding: 4px 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.16);
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

.workflow-sync-chip {
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid rgba(96, 165, 250, 0.28);
    background: rgba(96, 165, 250, 0.10);
    color: #bfdbfe;
}

.workflow-sync-chip.is-retrying {
    border-color: rgba(245, 158, 11, 0.28);
    background: rgba(245, 158, 11, 0.10);
    color: #ffd78f;
}

.workflow-new-events-badge {
    min-width: 24px;
    min-height: 24px;
    padding: 4px 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.26);
    color: #ffd48a;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    box-shadow: inset 0 0 0 1px rgba(255, 209, 102, 0.06);
}

.workflow-account-group.alarm-pending .workflow-new-events-badge {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff0c7;
}

.account-bulk-icon {
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #bfdbfe;
    border-color: rgba(96, 165, 250, 0.28);
    background: rgba(96, 165, 250, 0.08);
}

.account-bulk-icon svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.account-bulk-icon.is-disabled-by-sync,
.workflow-event-icon.is-disabled-by-sync,
.workflow-event-whatsapp-button.is-disabled-by-sync {
    opacity: 0.62;
    pointer-events: none;
}

.workflow-account-events {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.workflow-event-action-stack {
    position: relative;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
}

.workflow-event-action-stack.is-syncing::after,
.workflow-event-action-stack.is-retrying::after {
    content: "";
    position: absolute;
    right: -2px;
    top: -2px;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    border: 2px solid rgba(15, 23, 42, 0.9);
    background: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
    z-index: 3;
}

.workflow-event-action-stack.is-retrying::after {
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.workflow-event-icon {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    flex: 0 0 auto;
    cursor: pointer;
    position: relative;
    overflow: visible;
}

.workflow-account-group.is-syncing .workflow-event-icon,
.workflow-account-group.is-syncing .workflow-event-whatsapp-button {
    transition: opacity 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.workflow-event-action-stack .workflow-event-icon {
    position: absolute;
    left: 0;
    top: 0;
}

.workflow-event-whatsapp-button {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 15px;
    height: 15px;
    min-width: 15px;
    padding: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 12px rgba(2, 6, 23, 0.32);
    z-index: 2;
}

.workflow-event-whatsapp-button svg {
    width: 8px;
    height: 8px;
    stroke-width: 2.2;
}

.workflow-event-icon svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.workflow-event-tooltip-overlay {
    position: fixed;
    left: 0;
    top: 0;
    width: max-content;
    max-width: calc(100vw - 20px);
    padding: 7px 10px;
    border-radius: 9px;
    background: rgba(5, 8, 12, 0.96);
    color: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 10px 26px rgba(2, 6, 23, 0.45);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, calc(-100% - 6px));
    transition: opacity 0.14s ease, visibility 0.14s ease, transform 0.14s ease;
    z-index: 9999;
}

.workflow-event-tooltip-overlay::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    margin-left: -6px;
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: rgba(5, 8, 12, 0.96) transparent transparent transparent;
}

.workflow-event-tooltip-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.workflow-event-tooltip-overlay.is-below {
    transform: translate(-50%, 6px);
}

.workflow-event-tooltip-overlay.is-below::after {
    top: auto;
    bottom: 100%;
    border-width: 0 6px 6px 6px;
    border-color: transparent transparent rgba(5, 8, 12, 0.96) transparent;
}

.workflow-event-icon.dragging {
    opacity: 0.45;
}

.workflow-event-icon.category-disparo {
    color: #ffb3bb;
    border-color: rgba(239, 68, 68, 0.32);
    background: rgba(239, 68, 68, 0.10);
}

.workflow-event-icon.category-falha {
    color: #ffd78f;
    border-color: rgba(245, 158, 11, 0.30);
    background: rgba(245, 158, 11, 0.08);
}

.workflow-event-icon.category-falha-arme {
    color: #ffd24d;
    border-color: rgba(245, 158, 11, 0.36);
    background: rgba(245, 158, 11, 0.10);
}

.workflow-event-icon.category-arme {
    color: #ffb3bb;
    border-color: rgba(239, 68, 68, 0.30);
    background: rgba(239, 68, 68, 0.08);
}

.workflow-event-icon.category-desarme {
    color: #9ff0b2;
    border-color: rgba(34, 197, 94, 0.30);
    background: rgba(34, 197, 94, 0.08);
}

.workflow-event-icon.category-restauracao {
    color: #9ff0b2;
    border-color: rgba(34, 197, 94, 0.30);
    background: rgba(34, 197, 94, 0.08);
}

.workflow-event-icon.category-configuracao,
.workflow-event-icon.category-sistema,
.workflow-event-icon.category-evento {
    color: #bfdbfe;
    border-color: rgba(96, 165, 250, 0.28);
    background: rgba(96, 165, 250, 0.08);
}

.account-toggle-counter {
    min-width: 0;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    background: rgba(34, 211, 238, 0.08);
    border-color: rgba(34, 211, 238, 0.16);
}

.account-toggle-counter.is-active {
    background: rgba(34, 211, 238, 0.12);
    border-color: rgba(34, 211, 238, 0.24);
    color: #8be9f9;
}

.workflow-account-extra {
    display: grid;
    gap: 12px;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px dashed rgba(148, 163, 184, 0.14);
}

.workflow-empty {
    padding: 22px 16px;
    border: 1px dashed var(--border);
    border-radius: 16px;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

.workflow-card {
    padding: 10px;
    background: linear-gradient(180deg, rgba(22, 37, 61, 0.98), rgba(13, 24, 42, 0.98));
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: grab;
}

.workflow-card.category-disparo {
    border-color: rgba(239, 68, 68, 0.45);
    box-shadow: inset 3px 0 0 rgba(239, 68, 68, 0.75);
}

.workflow-card.category-falha {
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: inset 3px 0 0 rgba(245, 158, 11, 0.75);
}

.workflow-card.category-restauracao {
    border-color: rgba(34, 197, 94, 0.35);
    box-shadow: inset 3px 0 0 rgba(34, 197, 94, 0.75);
}

.workflow-card.category-routine {
    border-color: rgba(96, 165, 250, 0.35);
    box-shadow: inset 3px 0 0 rgba(96, 165, 250, 0.75);
}

.workflow-card.category-evento {
    border-color: rgba(148, 163, 184, 0.35);
    box-shadow: inset 3px 0 0 rgba(148, 163, 184, 0.75);
}

.workflow-card.tone-blue {
    border-color: rgba(59, 130, 246, 0.42);
    box-shadow: inset 3px 0 0 rgba(59, 130, 246, 0.86);
    background: linear-gradient(180deg, rgba(16, 36, 67, 0.98), rgba(10, 24, 46, 0.98));
}

.workflow-card.tone-red {
    border-color: rgba(239, 68, 68, 0.42);
    box-shadow: inset 3px 0 0 rgba(239, 68, 68, 0.88);
    background: linear-gradient(180deg, rgba(56, 20, 30, 0.98), rgba(32, 14, 21, 0.98));
}

.workflow-card.tone-amber {
    border-color: rgba(245, 158, 11, 0.42);
    box-shadow: inset 3px 0 0 rgba(245, 158, 11, 0.88);
    background: linear-gradient(180deg, rgba(54, 38, 18, 0.98), rgba(30, 23, 12, 0.98));
}

.workflow-card.tone-green {
    border-color: rgba(34, 197, 94, 0.42);
    box-shadow: inset 3px 0 0 rgba(34, 197, 94, 0.86);
    background: linear-gradient(180deg, rgba(17, 44, 33, 0.98), rgba(12, 28, 22, 0.98));
}

.workflow-card.tone-purple {
    border-color: rgba(168, 85, 247, 0.42);
    box-shadow: inset 3px 0 0 rgba(168, 85, 247, 0.86);
    background: linear-gradient(180deg, rgba(42, 24, 58, 0.98), rgba(24, 15, 36, 0.98));
}

.workflow-card.sla-warning {
    box-shadow:
        inset 3px 0 0 rgba(245, 158, 11, 0.8),
        0 0 0 1px rgba(245, 158, 11, 0.16);
}

.workflow-card.sla-critical {
    box-shadow:
        inset 3px 0 0 rgba(239, 68, 68, 0.85),
        0 0 0 1px rgba(239, 68, 68, 0.22);
}

.workflow-card.dragging {
    opacity: 0.45;
}

.workflow-card-top,
.workflow-card-bottom,
.workflow-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.workflow-card-top {
    align-items: start;
    margin-bottom: 6px;
}

.workflow-card-meta {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 11px;
}

.workflow-card p {
    margin: 0 0 10px;
    font-size: 12px;
    line-height: 1.35;
}

.workflow-action-bar {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.workflow-action-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.action-icon-button {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.action-icon-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.action-attend {
    color: #9ff0b2;
    border-color: rgba(34, 197, 94, 0.28);
    background: rgba(34, 197, 94, 0.08);
}

.action-dispatch {
    color: #ffd78f;
    border-color: rgba(245, 158, 11, 0.30);
    background: rgba(245, 158, 11, 0.08);
}

.action-finalize {
    color: #bfdbfe;
    border-color: rgba(96, 165, 250, 0.28);
    background: rgba(96, 165, 250, 0.08);
}

.action-whatsapp {
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.32);
    background: rgba(34, 197, 94, 0.12);
}

.action-whatsapp:hover {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(34, 197, 94, 0.18);
}

.workflow-assignment {
    display: grid;
    gap: 4px;
    margin-bottom: 8px;
    color: #cddcf0;
    font-size: 11px;
}

.workflow-note {
    margin-bottom: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: #d5e0ef;
    font-size: 12px;
    line-height: 1.35;
}

.sla-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.workflow-card-bottom {
    align-items: center;
}

.workflow-card-bottom small {
    color: var(--muted);
}

.workflow-editor {
    margin-top: 12px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.workflow-editor summary {
    cursor: pointer;
    color: var(--accent);
    font-size: 13px;
    list-style: none;
}

.workflow-editor summary::-webkit-details-marker {
    display: none;
}

.workflow-form {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.workflow-form-row {
    display: grid;
    gap: 6px;
}

.workflow-form-row label {
    color: var(--muted);
    font-size: 12px;
}

.workflow-form-row input,
.workflow-form-row textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    outline: none;
    font-family: inherit;
}

.workflow-form-note textarea {
    resize: vertical;
    min-height: 82px;
}

.workflow-form-actions {
    display: flex;
    justify-content: flex-end;
}

.small-button {
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 12px;
}

.card-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.table-wrap {
    overflow: auto;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.data-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
    background: var(--panel-soft);
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.clients-table {
    min-width: 920px;
}

.clients-page-header {
    margin-bottom: 18px;
}

.clients-create-shell {
    margin-bottom: 14px;
}

.clients-create-shell .detail-grid {
    align-items: start;
}

.clients-live-status {
    font-size: 14px;
}

.client-list-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.clients-page .content {
    padding: 10px 14px 16px;
}

.clients-page .page-header {
    gap: 12px;
    margin-bottom: 14px;
}

.clients-page .page-header h1 {
    margin-top: 4px;
    font-size: 26px;
}

.clients-page .page-subtitle {
    margin-top: 6px;
    max-width: 640px;
    font-size: 13px;
}

.clients-page .stats-grid {
    gap: 10px;
    margin-bottom: 14px;
}

.clients-page .stat-card {
    padding: 14px 16px;
    border-radius: 16px;
}

.clients-page .stat-card span {
    font-size: 12px;
}

.clients-page .stat-card strong {
    margin-top: 6px;
    font-size: 28px;
}

.clients-page .panel {
    padding: 14px 16px;
    border-radius: 16px;
}

.clients-page .panel-head {
    gap: 12px;
    margin-bottom: 12px;
}

.clients-page .panel-head h2 {
    margin-top: 4px;
    font-size: 22px;
}

.clients-table-manage th:last-child,
.clients-table-manage td:last-child {
    width: 72px;
    text-align: right;
}

.clients-page .table-actions-inline {
    justify-content: flex-end;
}

.clients-page .panel-note {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.4;
}

.clients-page .live-status {
    font-size: 12px;
}

.clients-page .filters-panel {
    margin-bottom: 14px;
}

.clients-page .filters {
    gap: 10px;
}

.clients-page .field {
    gap: 4px;
}

.clients-page .field label {
    font-size: 12px;
}

.clients-page .field input,
.clients-page .field select,
.clients-page .field textarea {
    padding: 10px 12px;
    font-size: 13px;
}

.clients-page .field-button button {
    padding: 10px 14px;
    font-size: 13px;
}

.clients-page .table-wrap {
    border-radius: 14px;
}

.clients-page .data-table th,
.clients-page .data-table td {
    padding: 11px 12px;
}

.clients-page .data-table th {
    font-size: 11px;
}

.clients-page .client-name-meta {
    font-size: 11px;
}

.clients-page .client-partitions,
.clients-page .client-origin-badges {
    gap: 6px;
}

.clients-page .badge,
.clients-page .client-partition-badge {
    padding: 5px 9px;
    font-size: 11px;
}

.clients-page .client-origin-badge {
    gap: 6px;
    min-height: 28px;
    padding: 5px 10px;
    font-size: 11px;
}

.clients-page .client-origin-badge svg {
    width: 12px;
    height: 12px;
}

.receptor-connections-page .page-subtitle {
    max-width: 760px;
}

.receptor-connections-page .connection-source-tabs {
    display: inline-flex;
    gap: 8px;
    margin-bottom: 16px;
}

.receptor-connections-page .connection-source-tabs .page-tab {
    min-width: 118px;
}

.receptor-connections-page .stats-grid {
    margin-bottom: 14px;
}

.receptor-connections-page .table-wrap {
    border-radius: 14px;
}

.receptor-connections-table {
    min-width: 1080px;
}

.receptor-connection-row.is-online:hover {
    background: rgba(34, 197, 94, 0.05);
}

.receptor-connection-row.is-offline:hover {
    background: rgba(239, 68, 68, 0.05);
}

.receptor-connection-note-stack {
    display: grid;
    gap: 6px;
}

.receptor-connections-page .badge.warning {
    border-color: rgba(245, 158, 11, 0.32);
}

.clients-panel-note {
    margin-top: 6px;
}

.client-row {
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.client-row:hover {
    background: rgba(34, 211, 238, 0.05);
}

.client-row:focus-within,
.client-row:focus {
    outline: none;
    background: rgba(37, 99, 235, 0.09);
}

.client-name-stack {
    display: grid;
    gap: 4px;
}

.client-name-meta {
    color: var(--muted);
    font-size: 12px;
}

.client-central-status-stack {
    display: grid;
    gap: 6px;
}

.client-central-status {
    display: grid;
    gap: 2px;
    padding: 6px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.12);
    min-width: 0;
}

.client-central-status small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.2;
    white-space: normal;
}

.client-central-status strong {
    font-size: 12px;
    line-height: 1.2;
}

.client-central-status span {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
}

.client-central-status.is-armed strong {
    color: #ffb3bb;
}

.client-central-status.is-disarmed strong {
    color: #9ff0b2;
}

.client-central-status.is-unknown strong {
    color: #d3deed;
}

.client-partitions,
.client-origin-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.client-partition-badge {
    gap: 6px;
    padding: 7px 10px;
    text-transform: none;
}

.client-partition-code {
    font-weight: 800;
}

.client-partition-state {
    opacity: 0.94;
}

.client-origin-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.client-origin-badge svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

.client-origin-badge.is-phone {
    color: #ffd78f;
    border-color: rgba(245, 158, 11, 0.28);
    background: rgba(245, 158, 11, 0.10);
}

.client-origin-badge.is-internet {
    color: #9ed8ff;
    border-color: rgba(96, 165, 250, 0.28);
    background: rgba(96, 165, 250, 0.10);
}

.client-security-since {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.client-security-since strong {
    font-size: 12px;
    line-height: 1.2;
}

.client-security-since span {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
}

.client-security-since.is-armed strong {
    color: #ffb3bb;
}

.client-security-since.is-disarmed strong {
    color: #9ff0b2;
}

.client-security-since.is-unknown strong {
    color: #d3deed;
}

.client-security-since.is-mixed strong {
    color: #ffd78f;
}

.events-table {
    min-width: 0;
    table-layout: fixed;
}

.events-table th,
.events-table td {
    padding: 9px 10px;
}

.events-table th:nth-child(1),
.events-table td:nth-child(1) {
    width: 22%;
}

.events-table th:nth-child(2),
.events-table td:nth-child(2) {
    width: 42%;
}

.events-table th:nth-child(3),
.events-table td:nth-child(3) {
    width: 16%;
}

.events-table th:nth-child(4),
.events-table td:nth-child(4) {
    width: 20%;
}

.events-table td {
    overflow-wrap: anywhere;
}

.events-main-row td {
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.events-client-inline,
.events-classification-inline,
.events-time-inline {
    display: grid;
    gap: 3px;
}

.events-event-inline {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    margin-bottom: 2px;
}

.events-event-code {
    flex: 0 0 auto;
    font-weight: 700;
}

.events-event-description {
    min-width: 0;
    color: var(--text);
    font-weight: 600;
}

.events-classification-inline .badge {
    margin-bottom: 0;
    justify-content: center;
    width: fit-content;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge.critical {
    background: rgba(239, 68, 68, 0.16);
    color: #ffb3bb;
}

.badge.warning {
    background: rgba(245, 158, 11, 0.16);
    color: #ffd78f;
}

.badge.success {
    background: rgba(34, 197, 94, 0.16);
    color: #9ff0b2;
}

.badge.info {
    background: rgba(96, 165, 250, 0.16);
    color: #b7d6ff;
}

.badge.neutral {
    background: rgba(148, 163, 184, 0.14);
    color: #d3deed;
}

.event-meta {
    display: block;
    margin-top: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.3;
}

.event-customization-desc-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.event-customization-desc-copy {
    min-width: 0;
    flex: 1 1 auto;
}

.event-customization-profile {
    display: grid;
    gap: 4px;
    min-width: 160px;
}

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

.client-detail-stats {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.client-detail-page .content {
    padding: 6px 10px 10px;
}

.client-detail-page .page-header {
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
    align-items: center;
}

.client-detail-page .page-header > :first-child {
    min-width: 0;
}

.client-detail-page .client-header-identity {
    flex: 0 1 300px;
    min-width: 0;
}

.client-detail-page .page-header h1 {
    margin-top: 1px;
    font-size: 18px;
    line-height: 1.02;
}

.client-detail-page .client-title-row {
    display: flex;
    align-items: center;
    gap: 9px;
}

.client-load-feedback {
    margin-top: 10px;
    max-width: 720px;
}

.client-detail-page .client-header-status-button {
    width: 26px;
    min-width: 26px;
    height: 26px;
    padding: 0;
    margin-left: 2px;
    border-radius: 8px;
    color: #9ed8ff;
    border-color: rgba(96, 165, 250, 0.28);
    background: rgba(96, 165, 250, 0.10);
}

.client-detail-page .client-header-status-button svg {
    width: 13px;
    height: 13px;
}

.client-detail-page .client-connectivity-dot {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.5);
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
}

.client-detail-page .client-connectivity-dot.is-online {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

.client-detail-page .client-connectivity-dot.is-offline {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
}

.client-detail-page .client-connectivity-dot.is-phone {
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14);
}

.client-detail-page .client-header-partitions {
    flex: 1 1 520px;
    min-width: 260px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    align-self: stretch;
}

.client-detail-page .client-header-partitions.is-empty {
    display: none;
}

.client-detail-page .client-header-partition-card {
    flex: 0 0 210px;
    width: 210px;
    max-width: 210px;
    min-width: 0;
    display: block;
    padding: 9px 10px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 11px;
    background: rgba(15, 23, 42, 0.58);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.client-detail-page .client-header-partition-card.is-armed {
    border-color: rgba(239, 68, 68, 0.38);
    background: linear-gradient(180deg, rgba(127, 29, 29, 0.28) 0%, rgba(68, 14, 14, 0.2) 100%);
}

.client-detail-page .client-header-partition-card.is-disarmed {
    border-color: rgba(34, 197, 94, 0.38);
    background: linear-gradient(180deg, rgba(20, 83, 45, 0.28) 0%, rgba(5, 46, 22, 0.2) 100%);
}

.client-detail-page .client-header-partition-card.is-unknown {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.56) 0%, rgba(15, 23, 42, 0.5) 100%);
}

.client-detail-page .client-header-partition-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 66px;
    gap: 6px;
    align-items: stretch;
}

.client-detail-page .client-header-partition-main {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.client-detail-page .client-header-partition-code {
    color: #67e8f9;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.client-detail-page .client-header-partition-top {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
}

.client-detail-page .client-header-partition-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    align-content: start;
    justify-items: stretch;
}

.client-detail-page .client-header-partition-action {
    min-width: 0;
    width: 100%;
    min-height: 23px;
    padding: 2px 5px;
    border-radius: 7px;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    justify-content: center;
}

.client-detail-page .client-header-partition-action.arm {
    color: #f8fafc;
    border-color: rgba(254, 202, 202, 0.28);
    background: rgba(239, 68, 68, 0.28);
}

.client-detail-page .client-header-partition-action.disarm {
    color: #f8fafc;
    border-color: rgba(187, 247, 208, 0.26);
    background: rgba(34, 197, 94, 0.24);
}

.client-detail-page .client-header-partition-action.status {
    color: #dbeafe;
    border-color: rgba(59, 130, 246, 0.28);
    background: rgba(37, 99, 235, 0.16);
}

.client-detail-page .client-header-partition-name {
    color: #f8fafc;
    font-size: 12px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.client-detail-page .client-header-partition-state-label {
    color: rgba(226, 232, 240, 0.76);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.client-detail-page .client-header-partition-state {
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.client-detail-page .client-header-partition-card.is-armed .client-header-partition-state {
    color: #fecaca;
}

.client-detail-page .client-header-partition-card.is-disarmed .client-header-partition-state {
    color: #bbf7d0;
}

.client-detail-page .client-header-partition-meta {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.2;
    white-space: normal;
}

.client-detail-page .eyebrow {
    font-size: 10px;
    letter-spacing: 0.14em;
}

.client-detail-page .page-subtitle {
    margin-top: 2px;
    font-size: 11px;
}

.client-detail-page .header-actions {
    flex: 0 0 auto;
    gap: 4px;
    justify-content: flex-end;
    align-items: center;
}

.client-detail-page .ghost-button {
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 9px;
}

.client-detail-page .ghost-button.client-header-partition-action {
    min-width: 0;
    width: 100%;
    min-height: 21px;
    padding: 2px 6px;
    border-radius: 7px;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.06em;
}

.client-detail-page .client-header-icon-button {
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 10px;
}

.client-detail-page .client-header-icon-button svg {
    width: 14px;
    height: 14px;
}

.client-detail-page .stats-grid {
    gap: 8px;
    margin-bottom: 10px;
}

.client-detail-page .client-detail-stats {
    grid-template-columns: repeat(6, minmax(110px, 1fr));
}

.client-detail-page .stat-card {
    padding: 10px 12px;
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.client-detail-page .stat-card span {
    font-size: 11px;
}

.client-detail-page .stat-card strong {
    margin-top: 4px;
    font-size: 20px;
    line-height: 1.15;
}

.client-detail-page .stat-text {
    font-size: 13px;
    line-height: 1.25;
}

.client-detail-page .client-detail-tabs {
    flex: 0 0 auto;
    margin-bottom: 6px;
}

.client-detail-page .client-detail-tab-panel {
    margin-bottom: 6px;
}

.client-detail-page .page-tabs {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    margin: 0 0 4px;
    padding: 3px;
    border-radius: 12px;
}

.client-detail-page .page-tab {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 9px;
    font-size: 11px;
}

.client-detail-page .client-summary-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

.client-detail-page .client-summary-sidebar {
    position: static;
    gap: 10px;
}

.client-detail-page .client-edit-shell {
    display: grid;
    gap: 12px;
}

.client-detail-page .client-edit-groups {
    display: grid;
    gap: 12px;
}

.client-detail-page .client-edit-group {
    padding: 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}

.client-detail-page .client-edit-group-head {
    margin-bottom: 10px;
}

.client-detail-page .client-edit-group-head h3 {
    margin: 4px 0 0;
    font-size: 16px;
}

.client-detail-page #client-edit-account[readonly] {
    opacity: 0.75;
    cursor: default;
}

.client-detail-page #client-edit-procedure-notes {
    min-height: 108px;
    resize: vertical;
}

.client-detail-page .client-summary-hero h2 {
    margin-top: 4px;
    font-size: 22px;
}

.client-detail-page .client-summary-account {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.35;
}

.client-detail-page .client-secondary-tabs {
    flex: 0 0 auto;
    margin-bottom: 10px;
}

.client-detail-page .client-summary-main {
    width: 100%;
}

.client-detail-page .panel {
    padding: 12px 14px;
    border-radius: 14px;
}

.client-detail-page .panel-head {
    gap: 10px;
    margin-bottom: 10px;
}

.client-detail-page .panel-head h2 {
    margin-top: 4px;
    font-size: 18px;
}

.client-detail-page .detail-grid {
    gap: 12px;
    margin-bottom: 12px;
}

.client-detail-page .detail-list,
.client-detail-page .event-client-box,
.client-detail-page .client-detail-stack,
.client-detail-page .stack-form {
    gap: 10px;
}

.client-detail-page .detail-item {
    padding: 10px 12px;
    border-radius: 12px;
}

.client-detail-page .detail-item span {
    font-size: 10px;
    margin-bottom: 4px;
}

.client-detail-page .detail-item strong {
    font-size: 13px;
    line-height: 1.3;
}

.client-detail-page .table-wrap {
    border-radius: 12px;
}

.client-detail-page .data-table th,
.client-detail-page .data-table td {
    padding: 10px 12px;
}

.client-detail-page .data-table th {
    font-size: 11px;
}

.client-detail-page .client-events-wrap,
.client-detail-page .client-raw-wrap {
    max-height: none;
}

.client-detail-page .detail-grid-span-2 {
    grid-column: span 2;
}

.client-registration-shell {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    min-height: 0;
}

.client-operation-shell {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.client-operation-tabs {
    margin-bottom: 0;
}

.client-operation-panel:not(.hidden) {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.support-chat-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
    gap: 14px;
    align-items: start;
}

.support-chat-column,
.support-chat-sidebar {
    min-width: 0;
}

.support-chat-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.support-chat-contact,
.support-chat-form {
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255, 255, 255, 0.02);
}

.support-chat-contact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.support-chat-contact strong {
    display: block;
    font-size: 15px;
}

.support-chat-contact small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.support-chat-context {
    display: grid;
    gap: 12px;
}

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

.support-chat-context-card {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255, 255, 255, 0.02);
}

.support-chat-context-card strong {
    font-size: 14px;
}

.support-chat-context-card small {
    color: var(--muted);
    font-size: 11px;
}

.support-chat-recent {
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01)),
        rgba(8, 17, 31, 0.24);
}

.support-chat-recent-head {
    margin-bottom: 8px;
}

.support-chat-recent-list {
    display: grid;
    gap: 8px;
}

.support-chat-recent-item {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.10);
    background: rgba(255, 255, 255, 0.03);
}

.support-chat-recent-item strong {
    font-size: 12px;
    color: var(--text);
}

.support-chat-recent-item small {
    font-size: 11px;
    color: var(--muted);
}

.support-chat-messages {
    min-height: 340px;
    max-height: 560px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01)),
        rgba(8, 17, 31, 0.38);
}

.support-chat-message {
    max-width: 88%;
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
}

.support-chat-message.incoming {
    align-self: flex-start;
    border-color: rgba(96, 165, 250, 0.18);
    background: linear-gradient(180deg, rgba(96, 165, 250, 0.10), rgba(96, 165, 250, 0.04));
}

.support-chat-message.outgoing {
    align-self: flex-end;
    border-color: rgba(34, 197, 94, 0.20);
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.14), rgba(34, 197, 94, 0.06));
}

.support-chat-message-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-size: 11px;
}

.support-chat-message-meta strong {
    color: var(--text);
    font-size: 12px;
}

.support-chat-message-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.support-chat-message-body {
    font-size: 13px;
    line-height: 1.45;
    color: #dce7f4;
    word-break: break-word;
}

.support-chat-message-extra {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 11px;
}

.support-chat-sidebar {
    display: grid;
    gap: 10px;
}

.support-chat-form {
    display: grid;
    gap: 10px;
}

.support-chat-form-head h3 {
    margin: 2px 0 0;
    font-size: 16px;
}

@media (max-width: 980px) {
    .support-chat-shell {
        grid-template-columns: 1fr;
    }

    .support-chat-context-grid {
        grid-template-columns: 1fr;
    }
}

.client-registration-tabs {
    margin-bottom: 0;
}

.client-registration-panel:not(.hidden) {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    min-height: 0;
}

.client-registration-layout {
    display: grid;
    gap: 10px;
}

.client-registration-editor,
.client-registration-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.client-registration-editor-head {
    margin-bottom: 6px;
}

.client-registration-editor-head h2 {
    margin: 2px 0 0;
    font-size: 16px;
}

.client-registration-editor {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255, 255, 255, 0.02);
    min-height: 0;
    overflow: auto;
}

.client-registration-list {
    min-height: 0;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(255, 255, 255, 0.02);
}

.client-registration-form {
    gap: 8px;
}

.client-registration-form .detail-grid {
    gap: 10px;
    margin-bottom: 8px;
}

.client-registration-form .field {
    gap: 4px;
}

.client-registration-form .field label {
    font-size: 12px;
}

.client-registration-form .field input {
    padding: 9px 12px;
    font-size: 13px;
}

.client-registration-user-grid {
    grid-template-columns: 88px minmax(0, 1.4fr) 132px 86px minmax(0, 1fr);
}

.client-registration-form .card-actions {
    gap: 10px;
    margin-top: 4px;
}

.client-registration-form .card-actions button,
.client-registration-form .card-actions .ghost-button {
    padding: 9px 12px;
    font-size: 13px;
}

.client-registration-wrap {
    min-height: 0;
    height: 100%;
}

.client-note-layout {
    grid-template-columns: minmax(320px, 1fr) minmax(280px, 0.9fr);
}

.client-dashboard-note-preview {
    height: 100%;
}

.client-dashboard-note-preview-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.client-dashboard-note-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.client-dashboard-note-text {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(34, 211, 238, 0.12);
    background: rgba(34, 211, 238, 0.05);
    color: #e7f5ff;
    font-size: 13px;
    line-height: 1.55;
}

.client-dashboard-note-text.is-empty {
    color: #9bb0cb;
    font-style: italic;
}

.client-registration-table {
    min-width: 0;
    table-layout: auto;
}

.client-registration-table th,
.client-registration-table td {
    padding: 6px 8px;
    font-size: 11px;
    line-height: 1.2;
    vertical-align: middle;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-overflow: clip;
    white-space: normal;
}

.client-registration-table th {
    font-size: 10px;
    letter-spacing: 0.07em;
    white-space: nowrap;
}

.registration-users-table th:nth-child(1),
.registration-users-table td:nth-child(1),
.registration-zones-table th:nth-child(1),
.registration-zones-table td:nth-child(1),
.registration-partitions-table th:nth-child(1),
.registration-partitions-table td:nth-child(1),
.registration-alarms-table th:nth-child(1),
.registration-alarms-table td:nth-child(1) {
    width: 54px;
}

.registration-cameras-table th:nth-child(1),
.registration-cameras-table td:nth-child(1) {
    width: 64px;
}

.registration-cameras-table th:nth-child(2),
.registration-cameras-table td:nth-child(2) {
    width: 64px;
}

.registration-users-table th:nth-child(3),
.registration-users-table td:nth-child(3) {
    width: 108px;
}

.registration-users-table th:nth-child(4),
.registration-users-table td:nth-child(4),
.registration-zones-table th:nth-child(3),
.registration-zones-table td:nth-child(3) {
    width: 62px;
}

.registration-users-table th:nth-child(6),
.registration-users-table td:nth-child(6),
.registration-zones-table th:nth-child(5),
.registration-zones-table td:nth-child(5),
.registration-partitions-table th:nth-child(4),
.registration-partitions-table td:nth-child(4),
.registration-alarms-table th:nth-child(7),
.registration-alarms-table td:nth-child(7),
.registration-cameras-table th:nth-child(7),
.registration-cameras-table td:nth-child(7) {
    width: 108px;
}

.registration-users-table th:last-child,
.registration-users-table td:last-child,
.registration-zones-table th:last-child,
.registration-zones-table td:last-child,
.registration-partitions-table th:last-child,
.registration-partitions-table td:last-child,
.registration-alarms-table th:last-child,
.registration-alarms-table td:last-child,
.registration-cameras-table th:last-child,
.registration-cameras-table td:last-child {
    width: 62px;
}

.registration-users-table td:nth-child(1),
.registration-users-table td:nth-child(3),
.registration-users-table td:nth-child(4),
.registration-zones-table td:nth-child(1),
.registration-zones-table td:nth-child(3),
.registration-partitions-table td:nth-child(1),
.registration-alarms-table td:nth-child(1),
.registration-alarms-table td:nth-child(3),
.registration-alarms-table td:nth-child(4),
.registration-cameras-table td:nth-child(1),
.registration-cameras-table td:nth-child(2) {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}

.registration-users-table td:nth-child(6),
.registration-zones-table td:nth-child(5),
.registration-partitions-table td:nth-child(4),
.registration-alarms-table td:nth-child(7),
.registration-cameras-table td:nth-child(7) {
    font-size: 10px;
    line-height: 1.15;
}

.registration-alarms-table th:nth-child(3),
.registration-alarms-table td:nth-child(3) {
    width: 140px;
}

.registration-alarms-table th:nth-child(4),
.registration-alarms-table td:nth-child(4) {
    width: 68px;
}

.registration-alarms-table .table-actions-cell {
    min-width: 188px;
}

.alarm-diagnostic-panel {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(8, 18, 32, 0.92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.alarm-diagnostic-panel.is-ok {
    border-color: rgba(34, 197, 94, 0.34);
}

.alarm-diagnostic-panel.is-error {
    border-color: rgba(239, 68, 68, 0.36);
}

.alarm-diagnostic-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.alarm-diagnostic-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.alarm-diagnostic-head h3 {
    margin: 2px 0 0;
    font-size: 15px;
    line-height: 1.2;
}

.alarm-diagnostic-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.14);
    color: #bbf7d0;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.alarm-diagnostic-panel.is-error .alarm-diagnostic-state {
    background: rgba(239, 68, 68, 0.14);
    color: #fecdd3;
}

.alarm-diagnostic-close {
    min-height: 24px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.alarm-diagnostic-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.alarm-diagnostic-card {
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 12px;
    background: rgba(15, 34, 56, 0.78);
}

.alarm-diagnostic-card span {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.alarm-diagnostic-card strong {
    display: block;
    margin-top: 4px;
    color: var(--text);
    font-size: 12px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.alarm-diagnostic-response {
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(239, 68, 68, 0.18);
    border-radius: 12px;
    background: rgba(69, 10, 10, 0.16);
}

.alarm-diagnostic-panel.is-ok .alarm-diagnostic-response {
    border-color: rgba(34, 197, 94, 0.2);
    background: rgba(20, 83, 45, 0.12);
}

.alarm-diagnostic-response span {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.alarm-diagnostic-response strong {
    display: block;
    margin-top: 5px;
    color: var(--text);
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
    white-space: normal;
}

.alarm-diagnostic-block {
    margin-top: 12px;
}

.alarm-diagnostic-block h4 {
    margin: 0 0 8px;
    color: #a9d6ff;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.alarm-diagnostic-attempts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.alarm-diagnostic-attempts span {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 5px 8px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 999px;
    background: rgba(15, 34, 56, 0.72);
    color: #dbeafe;
    font-size: 10px;
    font-weight: 800;
}

.alarm-diagnostic-attempts span.ok {
    border-color: rgba(34, 197, 94, 0.28);
    color: #bbf7d0;
}

.alarm-diagnostic-attempts span.fail {
    border-color: rgba(239, 68, 68, 0.28);
    color: #fecdd3;
}

.alarm-diagnostic-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
    max-height: 260px;
    overflow: auto;
}

.alarm-diagnostic-step {
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 12px;
    background: rgba(7, 15, 27, 0.72);
}

.alarm-diagnostic-step strong,
.alarm-diagnostic-step span,
.alarm-diagnostic-step small {
    display: block;
}

.alarm-diagnostic-step strong {
    margin-bottom: 5px;
    color: #67e8f9;
    font-size: 11px;
}

.alarm-diagnostic-step span,
.alarm-diagnostic-step small {
    color: #cbd5e1;
    font-family: Consolas, "Liberation Mono", monospace;
    font-size: 10px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.alarm-diagnostic-step small {
    margin-top: 5px;
    color: var(--muted);
}

@media (max-width: 900px) {
    .alarm-diagnostic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .alarm-diagnostic-head {
        flex-direction: column;
    }

    .alarm-diagnostic-grid {
        grid-template-columns: 1fr;
    }
}

.camera-open-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    margin-right: 6px;
    padding: 3px 9px;
    border: 1px solid rgba(34, 211, 238, 0.42);
    border-radius: 999px;
    background: rgba(8, 145, 178, 0.2);
    color: #67e8f9;
    font: inherit;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
}

.camera-open-link:hover {
    border-color: rgba(34, 211, 238, 0.75);
    background: rgba(8, 145, 178, 0.34);
    color: #e0faff;
}

.camera-open-link.is-cloud {
    border-color: rgba(74, 222, 128, 0.44);
    background: rgba(22, 163, 74, 0.20);
    color: #bbf7d0;
}

.camera-open-link.is-cloud:hover {
    border-color: rgba(74, 222, 128, 0.75);
    background: rgba(22, 163, 74, 0.34);
    color: #f0fdf4;
}

.camera-panel-actions {
    margin: 8px 0 10px;
}

.camera-preview-panel {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid rgba(34, 211, 238, 0.18);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(8, 29, 45, 0.88), rgba(8, 18, 32, 0.92));
}

.camera-preview-head,
.camera-preview-device-head,
.camera-preview-shot-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.camera-preview-head h3 {
    margin: 2px 0 0;
    font-size: 16px;
}

.camera-preview-head > span,
.camera-preview-device-head small {
    color: #a9d6ff;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.camera-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.camera-preview-device {
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 14px;
    background: rgba(15, 34, 56, 0.72);
}

.camera-preview-device.is-ok {
    border-color: rgba(34, 197, 94, 0.24);
}

.camera-preview-device.is-error {
    border-color: rgba(239, 68, 68, 0.26);
}

.camera-preview-device-head strong {
    display: block;
    color: var(--accent);
    font-size: 13px;
}

.camera-preview-device-head span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.camera-preview-error {
    margin: 10px 0 0;
    color: #fecdd3;
    font-size: 12px;
}

.camera-preview-shots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.camera-preview-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 96px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 12px;
    background: rgba(2, 8, 23, 0.72);
}

.camera-preview-frame img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 180px;
    object-fit: cover;
}

.camera-preview-frame span {
    padding: 10px;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.camera-preview-shot-meta {
    margin-top: 5px;
    font-size: 10px;
}

.camera-preview-shot-meta strong {
    color: var(--text);
}

.camera-preview-shot-meta span {
    color: var(--muted);
}

.camera-live-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.camera-live-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 210px;
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid rgba(34, 211, 238, 0.16);
    border-radius: 14px;
    background: #020817;
}

.camera-live-frame video {
    display: block;
    width: 100%;
    min-height: 210px;
    max-height: 360px;
    background: #020817;
}

.camera-live-frame span {
    padding: 14px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.camera-live-meta {
    align-items: flex-start;
    gap: 12px;
}

.camera-live-meta span {
    overflow-wrap: anywhere;
    text-align: right;
}

.camera-live-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.client-registration-wrap .data-table th,
.client-registration-wrap .data-table td {
    vertical-align: middle;
}

.table-actions-cell {
    width: 1%;
    white-space: nowrap;
}

.table-actions-inline {
    display: inline-flex;
    flex-direction: row;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.table-mini-button {
    padding: 6px 8px;
    font-size: 11px;
    min-height: 0;
}

.table-icon-button {
    width: 26px;
    min-width: 26px;
    height: 26px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.table-icon-button svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.table-mini-button.danger {
    border-color: rgba(239, 68, 68, 0.25);
    color: #ffb7bd;
}

.table-mini-button.danger:hover {
    border-color: rgba(239, 68, 68, 0.45);
    color: #ffd3d7;
}

@media (min-width: 1024px) {
    .client-detail-page {
        overflow: hidden;
    }

    .client-detail-page .layout {
        min-height: 100vh;
        height: 100vh;
        grid-template-rows: auto minmax(0, 1fr);
        overflow: hidden;
    }

    .client-detail-page .content {
        display: flex;
        flex-direction: column;
        gap: 0;
        min-height: 0;
        height: calc(100vh - 58px);
        overflow: hidden;
    }

    .client-detail-page .client-detail-tab-panel:not(.hidden) {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
        margin-bottom: 0;
    }

    .client-detail-page .client-detail-tab-panel:not(.hidden) > * {
        min-height: 0;
    }

    .client-detail-page .client-summary-layout {
        height: 100%;
        min-height: 0;
    }

    .client-detail-page .client-edit-shell {
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
        padding-right: 4px;
    }

    .client-detail-page .client-summary-main {
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .client-detail-page .client-summary-panel:not(.hidden) {
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
    }

    .client-detail-page .client-detail-stack {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        flex: 1 1 auto;
        min-height: 0;
    }

    .client-detail-page [data-tab-panel="operacao"] .panel,
    .client-detail-page [data-tab-panel="eventos"] .panel,
    .client-detail-page [data-tab-panel="importacao"] .panel {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
        overflow: auto;
    }

    .client-detail-page .client-events-wrap,
    .client-detail-page .client-raw-wrap,
    .client-detail-page .client-registration-wrap {
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
    }

    .client-detail-page [data-tab-panel="cadastros"] .panel {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
        padding: 8px 10px 10px;
    }

    .client-detail-page .client-registration-tabs {
        margin-bottom: 2px;
    }

    .client-registration-layout {
        grid-template-columns: minmax(236px, 272px) minmax(0, 1fr);
        align-items: stretch;
        flex: 1 1 auto;
        height: 100%;
        min-height: 0;
        gap: 6px;
    }

    .client-registration-editor {
        position: sticky;
        top: 0;
        align-self: start;
        max-height: 100%;
        overflow: auto;
        padding: 8px 10px;
    }

    .client-registration-list {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
        padding: 4px 6px 6px;
    }

    .client-registration-form {
        gap: 6px;
    }

    .client-registration-form .detail-grid {
        gap: 8px;
        margin-bottom: 6px;
    }

    .client-registration-form .field input {
        padding: 7px 10px;
        font-size: 12px;
    }

    .client-registration-form .card-actions {
        gap: 8px;
        margin-top: 2px;
    }

    .client-registration-form .card-actions button,
    .client-registration-form .card-actions .ghost-button {
        padding: 7px 10px;
        font-size: 12px;
    }

    .client-registration-wrap {
        flex: 1 1 auto;
        height: 100%;
    }

    .client-registration-table th,
    .client-registration-table td {
        padding: 5px 7px;
        font-size: 10px;
        line-height: 1.12;
    }

    .client-registration-table th {
        position: sticky;
        top: 0;
        z-index: 1;
        background: rgba(16, 29, 49, 0.98);
    }
}

.client-detail-tabs {
    margin-bottom: 20px;
}

.client-detail-tab-panel {
    margin-bottom: 20px;
}

.client-summary-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    align-items: start;
}

.client-summary-main {
    min-width: 0;
}

.client-secondary-tabs {
    margin-bottom: 16px;
}

.client-summary-panel {
    margin-bottom: 0;
}

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

.client-detail-stack {
    display: grid;
    gap: 18px;
}

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

.client-events-wrap {
    max-height: 73vh;
}

.client-events-filter-form {
    display: grid;
    gap: 5px;
    margin-bottom: 6px;
}

.client-events-filter-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(220px, 0.9fr) auto;
    align-items: center;
    gap: 8px 10px;
}

.client-events-filter-form .field {
    position: relative;
}

.client-events-filter-form .field label {
    margin-bottom: 2px;
    font-size: 9px;
}

.client-events-filter-form .field input,
.client-events-filter-form .field select {
    min-height: 36px;
    padding-top: 7px;
    padding-bottom: 7px;
    font-size: 12px;
}

.client-events-filter-actions-field {
    min-width: 0;
}

.client-events-filter-actions {
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.client-events-filter-actions button {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 11px;
}

.client-events-filter-actions .panel-note {
    margin-left: auto;
    white-space: nowrap;
    font-size: 10px;
    letter-spacing: 0.03em;
}

@media (min-width: 901px) {
    .client-events-filter-form .field label {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        border: 0;
        white-space: nowrap;
    }
}

.client-raw-wrap {
    max-height: 62vh;
    overflow: auto;
    padding-right: 4px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.detail-grid-two {
    margin-bottom: 20px;
}

.compact-grid {
    margin-bottom: 0;
}

.detail-list,
.event-client-box {
    display: grid;
    gap: 12px;
}

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

.schedule-status-grid .detail-item {
    min-height: 100%;
}

.schedule-status-grid .detail-item strong {
    font-size: 14px;
}

.schedule-status-grid .detail-item:nth-child(2) {
    border-color: rgba(34, 211, 238, 0.22);
    background: rgba(34, 211, 238, 0.06);
}

.partition-operation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}

.partition-operation-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.58);
}

.partition-operation-card.is-armed {
    border-color: rgba(239, 68, 68, 0.30);
}

.partition-operation-card.is-disarmed {
    border-color: rgba(34, 197, 94, 0.30);
}

.partition-operation-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.partition-operation-head strong {
    display: block;
    color: #22d3ee;
    font-size: 13px;
    text-transform: uppercase;
}

.partition-operation-head span,
.partition-operation-meta span {
    display: block;
    color: #bfdbfe;
    font-size: 11px;
    line-height: 1.35;
}

.partition-state-chip {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 5px 8px;
    background: rgba(148, 163, 184, 0.12);
    color: #e2e8f0;
    font-weight: 800;
    text-transform: uppercase;
}

.partition-operation-card.is-armed .partition-state-chip {
    background: rgba(239, 68, 68, 0.18);
    color: #fecaca;
}

.partition-operation-card.is-disarmed .partition-state-chip {
    background: rgba(34, 197, 94, 0.18);
    color: #bbf7d0;
}

.partition-operation-actions {
    gap: 8px;
}

.detail-item {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}

.detail-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.detail-item strong {
    display: block;
    line-height: 1.45;
}

.stat-text {
    font-size: 18px;
    line-height: 1.4;
}

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

.raw-card {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}

.raw-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 8px;
}

.raw-card strong {
    line-height: 1.45;
}

.history-timeline {
    display: grid;
    gap: 16px;
}

.history-item {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 14px;
    align-items: start;
}

.history-point {
    width: 14px;
    height: 14px;
    margin-top: 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), #2563eb);
    box-shadow: 0 0 0 6px rgba(34, 211, 238, 0.10);
}

.history-content {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}

.history-content p,
.history-content small {
    display: block;
    margin: 8px 0 0;
    color: #d8e4f3;
}

.history-content small {
    color: var(--muted);
}

.history-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.history-head span {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.history-empty {
    padding: 20px;
    border: 1px dashed var(--border);
    border-radius: 16px;
    color: var(--muted);
    text-align: center;
}

.schedule-days-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
}

.checkbox-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.checkbox-chip.active {
    border-color: rgba(34, 211, 238, 0.36);
    background: rgba(34, 211, 238, 0.10);
    box-shadow: 0 10px 22px rgba(3, 105, 161, 0.14);
    transform: translateY(-1px);
}

.checkbox-chip input {
    width: 16px;
    height: 16px;
    accent-color: #22d3ee;
}

.form-helper {
    margin: 10px 2px 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.attachment-list {
    display: grid;
    gap: 12px;
}

.attachment-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}

.attachment-card strong,
.attachment-card span {
    display: block;
}

.attachment-card span {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 12% 18%, rgba(34, 211, 238, 0.14), transparent 22%),
        radial-gradient(circle at 88% 16%, rgba(37, 99, 235, 0.16), transparent 24%),
        linear-gradient(180deg, #050c17 0%, #091322 100%);
}

.auth-card {
    width: min(920px, 100%);
    display: grid;
    grid-template-columns: 1.15fr 0.95fr;
    gap: 24px;
    padding: 28px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(16, 29, 49, 0.96), rgba(10, 20, 36, 0.96));
    border: 1px solid var(--border);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.30);
}

.auth-copy {
    display: grid;
    align-content: start;
}

.auth-copy h1 {
    margin: 8px 0 14px;
    font-size: 40px;
    line-height: 1.08;
}

.auth-copy p:last-child {
    color: var(--muted);
    line-height: 1.6;
}

.auth-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 24px;
}

.auth-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: #d9e7f6;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.auth-feature-grid {
    display: grid;
    gap: 14px;
}

.auth-feature {
    padding: 16px 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--border);
}

.auth-feature strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

.auth-feature span {
    color: var(--muted);
    line-height: 1.55;
    font-size: 14px;
}

.mobile-client-app-page .auth-shell {
    padding: 18px;
}

.mobile-app-shell {
    width: min(780px, 100%);
}

.mobile-app-card {
    display: grid;
    gap: 16px;
    padding: 18px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(16, 29, 49, 0.96), rgba(10, 20, 36, 0.96));
    border: 1px solid var(--border);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.30);
}

.mobile-app-topbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.mobile-app-topbar h1 {
    margin: 6px 0 0;
    font-size: 32px;
    line-height: 1.08;
}

.mobile-app-topbar-actions {
    display: inline-flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.mobile-app-section {
    display: grid;
    gap: 16px;
}

.mobile-app-hero {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}

.mobile-app-hero strong {
    font-size: 18px;
}

.mobile-app-hero span {
    color: var(--muted);
    line-height: 1.5;
}

.mobile-choice-grid {
    display: grid;
    gap: 12px;
}

.mobile-role-button {
    width: 100%;
    display: grid;
    gap: 6px;
    text-align: left;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    color: var(--text);
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.mobile-role-button:hover {
    transform: translateY(-1px);
    border-color: rgba(34, 211, 238, 0.35);
    background: linear-gradient(180deg, rgba(34, 211, 238, 0.12), rgba(255, 255, 255, 0.03));
}

.mobile-role-kicker {
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.mobile-role-button strong {
    font-size: 22px;
}

.mobile-role-button small {
    color: var(--muted);
    line-height: 1.5;
    font-size: 13px;
}

.mobile-app-role-pill {
    display: inline-flex;
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(34, 211, 238, 0.25);
    background: rgba(34, 211, 238, 0.08);
    color: #d9f7fb;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mobile-request-form {
    display: grid;
    gap: 12px;
}

.mobile-request-grid,
.mobile-status-grid,
.mobile-client-summary-grid,
.mobile-home-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.mobile-request-actions {
    justify-content: space-between;
}

.mobile-status-note {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border);
}

.mobile-status-note strong {
    font-size: 14px;
}

.mobile-status-note p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.mobile-app-home-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.mobile-app-home-head h2 {
    margin: 6px 0 4px;
    font-size: 28px;
    line-height: 1.1;
}

.mobile-home-account {
    color: var(--muted);
    font-size: 14px;
}

.mobile-home-actions {
    display: inline-flex;
    gap: 8px;
}

.mobile-client-preferences-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.mobile-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    font-size: 14px;
    font-weight: 700;
}

.mobile-toggle-row input {
    margin: 0;
}

.mobile-support-card {
    display: grid;
    gap: 12px;
}

.mobile-vehicle-action-bar {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
}

.mobile-vehicle-action-bar button {
    min-width: 190px;
}

.mobile-partition-list,
.mobile-event-list {
    display: grid;
    gap: 12px;
}

.mobile-partition-card,
.mobile-event-card {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.mobile-partition-card strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}

.mobile-partition-card span {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 700;
}

.mobile-partition-card small {
    color: var(--muted);
    line-height: 1.45;
}

.mobile-partition-card.state-armado {
    border-color: rgba(239, 68, 68, 0.24);
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.12), rgba(255, 255, 255, 0.03));
}

.mobile-partition-card.state-desarmado {
    border-color: rgba(34, 197, 94, 0.24);
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.12), rgba(255, 255, 255, 0.03));
}

.mobile-app-hero-critical {
    background: linear-gradient(180deg, rgba(166, 46, 72, 0.22), rgba(255, 255, 255, 0.03));
    border-color: rgba(244, 114, 182, 0.24);
}

.mobile-blocked-actions {
    justify-content: flex-start;
}

.mobile-event-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.mobile-event-head strong {
    font-size: 12px;
    color: var(--muted);
}

.mobile-event-card h4 {
    margin: 0 0 8px;
    font-size: 16px;
    line-height: 1.35;
}

.mobile-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
}

.mobile-vehicle-dispatch-list {
    display: grid;
    gap: 12px;
}

.mobile-vehicle-dispatch-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(59, 130, 246, 0.18);
    background: linear-gradient(180deg, rgba(16, 31, 56, 0.78), rgba(9, 18, 34, 0.9));
}

.mobile-vehicle-dispatch-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.mobile-vehicle-dispatch-head strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}

.mobile-vehicle-dispatch-head span:not(.badge) {
    color: var(--muted);
    font-size: 12px;
}

.mobile-vehicle-dispatch-card h4 {
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
}

.mobile-vehicle-dispatch-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
    font-size: 12px;
}

.mobile-vehicle-dispatch-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mobile-technician-order-items {
    display: grid;
    gap: 8px;
}

.mobile-technician-order-item {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(59, 130, 246, 0.12);
}

.mobile-technician-order-item strong {
    font-size: 13px;
}

.mobile-technician-order-item span {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.mobile-device-card {
    gap: 14px;
}

.mobile-device-note {
    margin-top: -4px;
}

.mobile-device-head {
    align-items: flex-start;
}

.mobile-device-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.mobile-device-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.mobile-device-summary {
    display: grid;
    gap: 10px;
}

.mobile-device-link {
    width: fit-content;
}

.mobile-device-license-form {
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.18);
    background: rgba(20, 35, 58, 0.52);
}

.mobile-device-license-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
}

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

.occurrence-dispatch-panel {
    display: grid;
    gap: 10px;
    margin-top: -4px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(59, 130, 246, 0.16);
    background: rgba(17, 28, 45, 0.48);
}

.occurrence-dispatch-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.occurrence-dispatch-panel-head label {
    display: block;
    margin: 0 0 4px;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.occurrence-dispatch-panel-head small {
    color: var(--muted);
    line-height: 1.45;
}

.occurrence-vehicle-selection {
    display: grid;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

.occurrence-vehicle-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.025);
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.occurrence-vehicle-option:hover {
    transform: translateY(-1px);
}

.occurrence-vehicle-option.is-available {
    border-color: rgba(34, 197, 94, 0.18);
}

.occurrence-vehicle-option.is-unavailable {
    border-color: rgba(148, 163, 184, 0.14);
}

.occurrence-vehicle-option.is-selected {
    border-color: rgba(59, 130, 246, 0.38);
    background: rgba(59, 130, 246, 0.12);
}

.occurrence-vehicle-option input {
    margin: 0;
}

.occurrence-vehicle-option-main {
    display: grid;
    gap: 3px;
}

.occurrence-vehicle-option-main strong {
    font-size: 13px;
}

.occurrence-vehicle-option-main small {
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 768px) {
    .mobile-client-app-page .auth-shell {
        padding: 12px;
    }

    .mobile-app-card {
        padding: 14px;
        border-radius: 22px;
    }

    .mobile-app-topbar,
    .mobile-app-home-head {
        flex-direction: column;
        align-items: stretch;
    }

    .mobile-app-topbar h1 {
        font-size: 28px;
    }

    .mobile-app-topbar-actions,
    .mobile-home-actions {
        width: 100%;
        justify-content: stretch;
    }

    .mobile-app-topbar-actions button,
    .mobile-home-actions button {
        flex: 1 1 0;
    }

    .mobile-vehicle-action-bar button {
        width: 100%;
        min-width: 0;
    }

    .mobile-vehicle-dispatch-head,
    .occurrence-dispatch-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .mobile-request-grid,
    .mobile-status-grid,
    .mobile-client-summary-grid,
    .mobile-home-details,
    .mobile-client-preferences-grid {
        grid-template-columns: 1fr;
    }

    .mobile-device-license-grid {
        grid-template-columns: 1fr;
    }
}

.auth-form-panel {
    padding: 22px;
    border-radius: 22px;
    background: rgba(6, 14, 26, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.auth-panel-header {
    margin-bottom: 18px;
}

.auth-panel-tag {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.12);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.auth-panel-header h2 {
    margin: 14px 0 8px;
    font-size: 28px;
}

.auth-panel-header p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.auth-form {
    display: grid;
    gap: 16px;
    align-content: center;
}

.form-alert {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.24);
    color: #ffc2c7;
}

.form-help {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.form-feedback {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.form-feedback.error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.24);
    color: #ffc2c7;
}

.form-feedback.success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.24);
    color: #a8efba;
}

.form-feedback.info {
    background: rgba(96, 165, 250, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.24);
    color: #bfdbfe;
}

.registration-feedback-toast {
    position: fixed;
    top: 86px;
    right: 18px;
    z-index: 165;
    min-width: 280px;
    max-width: min(420px, calc(100vw - 36px));
    padding: 12px 14px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(148, 163, 184, 0.20);
    background: linear-gradient(180deg, rgba(13, 24, 42, 0.96), rgba(8, 17, 31, 0.96));
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
    color: var(--text);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.registration-feedback-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.registration-feedback-toast.success {
    border-color: rgba(34, 197, 94, 0.26);
    color: #d6ffe1;
}

.registration-feedback-toast.error {
    border-color: rgba(239, 68, 68, 0.30);
    color: #ffd7dc;
}

.registration-feedback-toast.info {
    border-color: rgba(96, 165, 250, 0.30);
    color: #d7e8ff;
}

.registration-feedback-toast-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.06);
}

.registration-feedback-toast.success .registration-feedback-toast-icon {
    color: #9ff0b2;
}

.registration-feedback-toast.error .registration-feedback-toast-icon {
    color: #ffb4bd;
}

.registration-feedback-toast.info .registration-feedback-toast-icon {
    color: #bfdbfe;
}

.registration-feedback-toast-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.registration-feedback-toast-copy {
    min-width: 0;
    font-size: 13px;
    line-height: 1.35;
}

.stack-form {
    display: grid;
    gap: 14px;
}

.operator-rules {
    display: grid;
    gap: 12px;
}

.rule-card,
.operator-card {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}

.rule-card strong {
    display: block;
    margin-bottom: 8px;
}

.rule-card span {
    color: var(--muted);
    line-height: 1.5;
}

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

.operator-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
    margin-bottom: 12px;
}

.operator-card-head strong {
    display: block;
    font-size: 18px;
    margin-bottom: 4px;
}

.operator-card-head span {
    color: var(--muted);
    font-size: 13px;
}

.operator-meta {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 12px;
}

.service-order-card.profit {
    border-color: rgba(34, 197, 94, 0.30);
}

.service-order-card.tight {
    border-color: rgba(245, 158, 11, 0.32);
}

.service-order-card.loss {
    border-color: rgba(239, 68, 68, 0.34);
}

.service-order-finance-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.45);
    font-size: 11px;
}

.service-order-finance-strip span {
    color: #dbeafe;
}

.service-order-finance-strip.profit {
    border-color: rgba(34, 197, 94, 0.26);
    background: rgba(22, 101, 52, 0.14);
}

.service-order-finance-strip.tight {
    border-color: rgba(245, 158, 11, 0.28);
    background: rgba(146, 64, 14, 0.14);
}

.service-order-finance-strip.loss {
    border-color: rgba(239, 68, 68, 0.30);
    background: rgba(127, 29, 29, 0.16);
}

.service-order-financial-preview {
    display: grid;
    gap: 4px;
    min-height: 54px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.45);
}

.service-order-financial-preview strong {
    font-size: 13px;
}

.service-order-financial-preview span {
    color: #dbeafe;
    font-size: 11px;
    line-height: 1.45;
}

.service-order-financial-preview.profit {
    border-color: rgba(34, 197, 94, 0.26);
    background: rgba(22, 101, 52, 0.14);
}

.service-order-financial-preview.tight {
    border-color: rgba(245, 158, 11, 0.28);
    background: rgba(146, 64, 14, 0.14);
}

.service-order-financial-preview.loss {
    border-color: rgba(239, 68, 68, 0.30);
    background: rgba(127, 29, 29, 0.16);
}

.service-order-financial-preview.neutral {
    border-color: rgba(59, 130, 246, 0.20);
    background: rgba(30, 41, 59, 0.42);
}

.service-order-mode-banner {
    display: grid;
    gap: 4px;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.42);
}

.service-order-mode-banner strong {
    font-size: 13px;
}

.service-order-mode-banner span {
    color: #dbeafe;
    font-size: 11px;
    line-height: 1.45;
}

.service-order-mode-service_order {
    border-color: rgba(59, 130, 246, 0.24);
    background: rgba(30, 64, 175, 0.10);
}

.service-order-mode-visit {
    border-color: rgba(34, 197, 94, 0.24);
    background: rgba(21, 128, 61, 0.10);
}

.service-order-mode-budget {
    border-color: rgba(245, 158, 11, 0.28);
    background: rgba(146, 64, 14, 0.13);
}

.service-order-entry-stack {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 12px;
}

.service-order-entry-row {
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.38);
}

.service-order-entry-row.profit {
    border-color: rgba(34, 197, 94, 0.24);
}

.service-order-entry-row.tight {
    border-color: rgba(245, 158, 11, 0.26);
}

.service-order-entry-row.loss {
    border-color: rgba(239, 68, 68, 0.30);
}

.service-order-entry-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: start;
}

.service-order-entry-head strong {
    font-size: 13px;
}

.service-order-entry-head span,
.service-order-entry-meta span {
    color: #bfdbfe;
    font-size: 11px;
    line-height: 1.4;
}

.service-order-entry-meta {
    display: grid;
    gap: 4px;
}

.service-order-entry-note {
    margin: 0;
    font-size: 11px;
    color: var(--muted);
    line-height: 1.45;
}

.service-order-entry-items {
    display: grid;
    gap: 6px;
}

.service-order-entry-item {
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.025);
}

.service-order-entry-item span {
    color: #93c5fd;
    font-size: 10px;
    line-height: 1.35;
}

.service-order-entry-item strong {
    font-size: 12px;
    color: var(--text);
}

.compact-form {
    margin-bottom: 14px;
}

.checkbox-line {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 14px;
}

.checkbox-line input {
    width: 18px;
    height: 18px;
}

.operator-password-box {
    display: grid;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.panel-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.panel-note.text-danger {
    color: #fca5a5;
}

.mobile-apps-page .stats-grid {
    gap: 10px;
    margin-bottom: 14px;
}

.mobile-apps-page .panel {
    padding: 14px 16px;
}

.mobile-apps-page .page-subtitle {
    margin-bottom: 0;
}

.mobile-apps-page .operator-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.mobile-device-head {
    margin-bottom: 10px;
}

.mobile-device-badges {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.mobile-device-meta {
    margin-bottom: 12px;
}

.mobile-device-summary {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 12px;
}

.mobile-device-summary span strong,
.mobile-device-meta span strong {
    color: var(--text);
    font-weight: 600;
}

.mobile-device-action-form {
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.mobile-device-note {
    margin-top: 0;
    margin-bottom: 12px;
}

.mobile-device-link {
    width: fit-content;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.topics-shell {
    margin-top: 20px;
}

.topics-stack {
    display: grid;
    gap: 12px;
}

.topic-item {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

.topic-item summary {
    cursor: pointer;
    padding: 18px 20px;
    font-size: 16px;
    font-weight: 700;
    list-style: none;
}

.topic-item summary::-webkit-details-marker {
    display: none;
}

.topic-item[open] summary {
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.topic-body {
    display: grid;
    gap: 16px;
    padding: 18px;
}

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

.topic-divider {
    height: 1px;
    background: var(--border);
}

.compact-head {
    margin-bottom: 0;
}

.compact-head h3 {
    margin: 6px 0 0;
    font-size: 18px;
}

.shortcut-grid,
.health-grid,
.signal-grid,
.list-grid {
    display: grid;
    gap: 14px;
}

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

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

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

.shortcut-card,
.health-card,
.signal-card,
.list-row,
.map-client-card {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}

.shortcut-card {
    display: grid;
    gap: 8px;
}

.shortcut-card strong,
.health-card strong,
.list-row strong,
.map-client-card strong {
    font-size: 16px;
}

.shortcut-card span,
.health-card small,
.list-row span,
.map-client-card span,
.map-client-card small {
    color: var(--muted);
    line-height: 1.5;
}

.health-card {
    display: grid;
    gap: 8px;
}

.health-card span {
    font-size: 24px;
    font-weight: 800;
}

.health-card.warning {
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: inset 3px 0 0 rgba(245, 158, 11, 0.75);
}

.health-card.critical {
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow: inset 3px 0 0 rgba(239, 68, 68, 0.78);
}

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

.signal-card.critical-card {
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow: inset 3px 0 0 rgba(239, 68, 68, 0.78);
}

.signal-card.warning-card {
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: inset 3px 0 0 rgba(245, 158, 11, 0.75);
}

@media (max-width: 900px) {
    .signal-grid,
    .health-grid,
    .health-grid-large {
        grid-template-columns: 1fr;
    }
}

.list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.list-row span {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}

.priority-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.workflow-card.priority-urgent {
    box-shadow:
        inset 3px 0 0 rgba(239, 68, 68, 0.9),
        0 0 0 1px rgba(239, 68, 68, 0.28);
}

.workflow-card.priority-high,
.workflow-card.priority-communication {
    box-shadow:
        inset 3px 0 0 rgba(245, 158, 11, 0.85),
        0 0 0 1px rgba(245, 158, 11, 0.18);
}

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 24px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 8, 16, 0.72);
    backdrop-filter: blur(4px);
}

.modal-card {
    position: relative;
    width: min(760px, 100%);
    max-height: 90vh;
    overflow: auto;
    padding: 18px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(16, 29, 49, 0.98), rgba(10, 20, 36, 0.98));
    border: 1px solid var(--border);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.modal-card-wide {
    width: min(1200px, calc(100% - 20px));
}

.whatsapp-compose-modal-card {
    width: min(1320px, calc(100% - 16px));
    max-height: min(94vh, 980px);
    overflow: hidden;
    padding: 14px;
}

.whatsapp-compose-layout {
    display: grid;
    grid-template-rows: auto minmax(250px, 0.84fr) minmax(320px, 1.16fr);
    gap: 10px;
    margin-top: 4px;
    height: min(86vh, 860px);
}

.whatsapp-compose-header,
.whatsapp-compose-selection-grid,
.whatsapp-compose-preview-panel {
    min-width: 0;
}

.whatsapp-compose-header,
.whatsapp-compose-preview-panel {
    display: grid;
    gap: 8px;
    align-content: start;
}

.whatsapp-compose-title-block {
    display: grid;
    gap: 3px;
}

.whatsapp-compose-title-block .eyebrow {
    margin-bottom: 0;
    font-size: 11px;
    letter-spacing: 0.16em;
}

.whatsapp-compose-title-block h2 {
    margin: 0;
    font-size: clamp(18px, 2vw, 22px);
}

.whatsapp-compose-title-block .page-subtitle {
    margin: 0;
    font-size: 12px;
    line-height: 1.35;
}

.whatsapp-compose-header .form-feedback {
    margin: 0;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 11px;
    line-height: 1.35;
}

.whatsapp-compose-selection-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
    min-height: 0;
}

.whatsapp-compose-box {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(17, 31, 52, 0.68);
}

.whatsapp-compose-box-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 8px;
}

.whatsapp-compose-box-head strong {
    display: block;
    font-size: 13px;
    margin-bottom: 1px;
}

.whatsapp-compose-box-head small {
    color: var(--muted);
    font-size: 11px;
}

.whatsapp-compose-box-head .ghost-button {
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 12px;
    font-size: 12px;
}

.whatsapp-compose-checklist {
    display: grid;
    gap: 6px;
    min-height: 0;
    height: 100%;
    max-height: none;
    overflow: auto;
    padding-right: 4px;
}

.whatsapp-compose-checklist-item {
    display: grid;
    gap: 3px;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    padding: 9px 10px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(255, 255, 255, 0.03);
}

.whatsapp-compose-checklist-item input {
    margin-top: 3px;
}

.whatsapp-compose-checklist-item strong {
    display: block;
    font-size: 12px;
    line-height: 1.3;
}

.whatsapp-compose-checklist-item small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.4;
}

.whatsapp-compose-checklist-item.is-disabled {
    opacity: 0.62;
}

.whatsapp-compose-checklist-item.is-selected {
    border-color: rgba(34, 197, 94, 0.28);
    background: rgba(34, 197, 94, 0.08);
}

.whatsapp-compose-empty {
    padding: 12px;
    border-radius: 12px;
    border: 1px dashed rgba(148, 163, 184, 0.18);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.02);
}

.whatsapp-compose-drafts {
    display: grid;
    gap: 10px;
    min-height: 0;
    max-height: none;
    overflow: auto;
    padding-right: 4px;
}

.whatsapp-compose-drafts.is-single-draft {
    grid-template-columns: minmax(0, 1fr);
}

.whatsapp-compose-draft-card {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    gap: 8px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(17, 31, 52, 0.72);
}

.whatsapp-compose-draft-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 10px;
}

.whatsapp-compose-draft-head strong {
    display: block;
    font-size: 13px;
}

.whatsapp-compose-draft-head small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
}

.whatsapp-compose-draft-text {
    width: 100%;
    min-height: 220px;
    height: 100%;
    resize: vertical;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    outline: none;
    font-size: 12px;
    line-height: 1.45;
}

.whatsapp-compose-preview-panel .form-help {
    margin: 0;
    font-size: 11px;
    line-height: 1.35;
}

.whatsapp-compose-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.whatsapp-compose-preview-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.whatsapp-compose-preview-copy strong {
    font-size: 13px;
    line-height: 1.2;
}

.whatsapp-compose-preview-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.whatsapp-compose-action-button {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.whatsapp-compose-action-button-primary {
    border-color: rgba(16, 185, 129, 0.6);
    background: rgba(5, 150, 105, 0.24);
    color: #ecfdf5;
}

.whatsapp-compose-preview-panel > #whatsapp-compose-preview-summary {
    display: none;
}

.modal-close-button {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    text-transform: uppercase;
}

.modal-card .compact-form {
    margin-top: 8px;
}

.occurrence-layout {
    display: grid;
    grid-template-columns: minmax(236px, 0.58fr) minmax(0, 1.42fr);
    gap: 14px;
    margin-top: 8px;
}

.occurrence-main-column,
.occurrence-history-column {
    min-width: 0;
}

.occurrence-main-column {
    display: grid;
    align-content: start;
}

.occurrence-client-summary {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    margin-bottom: 14px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(17, 31, 52, 0.82);
}

.occurrence-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
}

.occurrence-client-name {
    font-size: 22px;
    line-height: 1.15;
    color: var(--text);
}

.occurrence-client-account {
    color: var(--muted);
    font-size: 14px;
}

.occurrence-history-column {
    display: grid;
    gap: 12px;
}

.occurrence-history-header {
    display: grid;
    gap: 4px;
    padding-top: 4px;
}

.occurrence-history-header strong {
    font-size: 18px;
    color: var(--text);
}

.occurrence-history-table {
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(9, 20, 35, 0.7);
}

.occurrence-history-columns,
.occurrence-history-row {
    display: grid;
    grid-template-columns: 68px minmax(0, 1.6fr) 68px 62px minmax(90px, 1fr) 126px;
    gap: 10px;
    align-items: start;
}

.occurrence-history-columns {
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.occurrence-history-list {
    max-height: 460px;
    overflow: auto;
}

.occurrence-history-row {
    padding: 13px 14px;
    font-size: 13px;
    color: var(--text-soft);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.occurrence-history-row:first-child {
    border-top: 0;
}

.occurrence-history-row.is-current {
    background: rgba(18, 43, 72, 0.92);
    box-shadow: inset 2px 0 0 rgba(34, 197, 94, 0.95);
}

.occurrence-history-cell {
    min-width: 0;
}

.occurrence-history-code {
    color: var(--accent);
    font-weight: 700;
}

.occurrence-history-description,
.occurrence-history-time,
.occurrence-history-user {
    color: var(--text);
}

.occurrence-history-description {
    font-weight: 600;
}

.occurrence-history-user {
    font-size: 12px;
    line-height: 1.35;
}

.occurrence-history-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--muted);
}

.modal-card .card-actions {
    margin-top: 16px;
}

.modal-card .occurrence-action-row {
    gap: 10px;
    align-items: center;
}

.modal-card .occurrence-action-button {
    width: 46px;
    min-width: 46px;
    height: 46px;
    border-radius: 14px;
    padding: 0;
    box-shadow: 0 14px 26px rgba(2, 6, 23, 0.22);
}

.modal-card .occurrence-action-button svg {
    width: 19px;
    height: 19px;
}

.modal-card .occurrence-action-link {
    text-decoration: none;
}

.map-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 18px;
}

.map-sidebar,
.map-panel {
    min-height: 640px;
}

.map-client-list {
    display: grid;
    gap: 12px;
    max-height: 540px;
    overflow: auto;
}

.map-client-card {
    text-align: left;
    width: 100%;
    cursor: pointer;
}

.map-frame {
    width: 100%;
    min-height: 540px;
    border: 0;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
}

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

.disarmed-card {
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(22, 37, 61, 0.98), rgba(13, 24, 42, 0.98));
    border: 1px solid var(--border);
}

.disarmed-card.warning {
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: inset 3px 0 0 rgba(245, 158, 11, 0.75);
}

.disarmed-card.critical {
    border-color: rgba(239, 68, 68, 0.35);
    box-shadow: inset 3px 0 0 rgba(239, 68, 68, 0.78);
}

.desarmados-page .filters-panel {
    margin-bottom: 10px;
    padding: 14px 16px;
}

.desarmados-page .filters {
    grid-template-columns: minmax(260px, 2fr) minmax(150px, 0.95fr) minmax(210px, 1.05fr) auto;
    gap: 10px;
}

.desarmados-page .field {
    gap: 4px;
}

.desarmados-page .field label {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.desarmados-page .field input,
.desarmados-page .field select {
    min-height: 42px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
}

.desarmados-page .field-button {
    align-self: end;
}

.desarmados-page .field-button button {
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 11px;
    font-size: 13px;
}

.desarmados-page .stats-grid {
    gap: 10px;
    margin-bottom: 10px;
}

.desarmados-page .stat-card {
    padding: 14px 16px;
    border-radius: 16px;
}

.desarmados-page .stat-card span {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.desarmados-page .stat-card strong {
    margin-top: 8px;
    font-size: 24px;
    line-height: 1;
}

.desarmados-card-actions {
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px 14px;
}

.desarmados-card-link-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}

.desarmados-card-note {
    margin-top: 0;
    font-size: 12px;
}

.desarmados-quick-actions {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.desarmados-quick-button {
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(15, 23, 42, 0.82);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.desarmados-quick-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.desarmados-quick-button:disabled {
    opacity: 0.68;
    cursor: progress;
}

.desarmados-quick-button.is-busy {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.desarmados-quick-button-status {
    border-color: rgba(59, 130, 246, 0.34);
    background: rgba(30, 64, 175, 0.20);
    color: #bfdbfe;
}

.desarmados-quick-button-armar {
    border-color: rgba(239, 68, 68, 0.34);
    background: rgba(127, 29, 29, 0.24);
    color: #fecaca;
}

.desarmados-quick-button-desarmar {
    border-color: rgba(34, 197, 94, 0.34);
    background: rgba(20, 83, 45, 0.24);
    color: #bbf7d0;
}

.desarmados-quick-feedback {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.4;
}

.desarmados-quick-feedback.error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.24);
    color: #ffc2c7;
}

.desarmados-quick-feedback.success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.24);
    color: #a8efba;
}

.desarmados-quick-feedback.info {
    background: rgba(96, 165, 250, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.24);
    color: #bfdbfe;
}

.empty-cell {
    text-align: center;
    color: var(--muted);
    padding: 26px;
}

@media (max-width: 1500px) {
    .stats-grid-large {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .filters-clients .field-button {
        justify-content: flex-end;
    }
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

    .system-status-panel {
        min-width: 100%;
    }

    .workflow-board {
        grid-template-columns: 1fr;
    }

    .dashboard-board-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-connection-status {
        justify-content: flex-start;
    }

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

    .client-events-filter-actions-field {
        grid-column: 1 / -1;
    }

    .dashboard-page {
    overflow: hidden;
}

    .desarmados-card-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .desarmados-quick-actions {
        justify-content: flex-start;
    }

.dashboard-page .layout {
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
}

.dashboard-page .sidebar {
    height: auto;
}

.dashboard-page .content {
    height: calc(100vh - 58px);
    overflow: hidden;
}

@media (max-width: 1280px) {
    .dashboard-toolbar-status {
        flex: 0 1 auto;
        max-width: 58vw;
    }

    .dashboard-toolbar-status .dashboard-connection-indicator {
        min-width: max-content;
    }
}

    .dashboard-page .content {
        overflow: hidden;
    }

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

    .modal-card-wide {
        width: min(860px, 100%);
    }

    .whatsapp-compose-modal-card {
        width: min(100%, calc(100% - 10px));
        max-height: 96vh;
        padding: 12px;
    }

    .whatsapp-compose-layout {
        grid-template-rows: auto auto minmax(0, 1fr);
        height: auto;
    }

    .whatsapp-compose-selection-grid {
        grid-template-columns: 1fr;
    }

    .whatsapp-compose-checklist,
    .whatsapp-compose-drafts {
        height: auto;
        max-height: none;
    }

    .settings-whatsapp-template-fields {
        grid-template-columns: 1fr;
    }

    .filters,
    .filters-wide,
    .filters-events {
        grid-template-columns: 1fr 1fr;
    }

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

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

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

    .detail-grid,
    .raw-grid,
    .detail-stats,
    .auth-card,
    .disarmed-grid,
    .operator-card-grid,
    .dashboard-grid,
    .shortcut-grid,
    .health-grid,
    .signal-grid,
    .schedule-days-grid,
    .schedule-status-grid,
    .topic-summary-grid,
    .map-layout {
        grid-template-columns: 1fr;
    }

    .attachment-card {
        flex-direction: column;
        align-items: start;
    }

    .client-detail-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        padding: 10px 12px;
        gap: 10px;
    }

    .page-header {
        flex-direction: column;
        align-items: start;
    }

    .inline-page-stats {
        width: 100%;
        justify-content: flex-start;
    }

    .dashboard-page .content {
        padding: 16px;
    }

    .content {
        padding: 16px 18px 24px;
    }

    .system-status-title {
        text-align: left;
    }

    .history-head {
        flex-direction: column;
    }

    .client-detail-page .client-edit-group {
        padding: 10px;
    }

    .client-detail-page .client-header-partitions {
        min-width: 100%;
    }

    .client-detail-page .client-header-partition-card {
        flex-basis: 168px;
        width: 168px;
        max-width: 168px;
    }

    .client-detail-page .client-header-partition-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .client-detail-page .client-header-partition-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    .client-events-filter-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .client-events-filter-actions .panel-note {
        width: 100%;
        margin-left: 0;
        white-space: normal;
    }
}

@media (max-width: 640px) {
    .content,
    .sidebar {
        padding: 16px;
    }

    .inline-page-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .inline-page-stats .stat-card {
        display: grid;
        gap: 4px;
        align-items: start;
    }

    .inline-page-stats .stat-card span {
        max-width: none;
    }

    .inline-page-stats .stat-card strong {
        display: block;
        font-size: 17px;
    }

    .sidebar {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .sidebar-tools {
        margin-left: auto;
    }

    .stats-grid,
    .minimal-stats-grid,
    .stats-grid-large,
    .filters,
    .filters-wide,
    .filters-events,
    .filters-clients {
        grid-template-columns: 1fr;
    }

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

    .auth-card {
        padding: 20px;
    }

    .auth-copy h1 {
        font-size: 32px;
    }

    .client-detail-stats,
    .client-overview-grid,
    .client-list-stats,
    .client-summary-grid {
        grid-template-columns: 1fr;
    }

    .client-detail-page .client-header-partitions {
        width: 100%;
    }

    .client-detail-page .client-header-partition-card {
        flex: 1 1 100%;
        width: 100%;
        max-width: none;
    }

    .modal-shell {
        padding: 16px;
    }

    .modal-card {
        padding: 16px;
        border-radius: 20px;
    }

    .occurrence-history-columns {
        display: none;
    }

    .occurrence-history-list {
        max-height: 320px;
    }

    .occurrence-history-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 12px;
    }

    .occurrence-history-description {
        grid-column: 1 / -1;
    }

.occurrence-history-cell::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 4px;
        color: var(--muted);
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
    }
}

.environment-banner {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.environment-banner strong {
    color: inherit;
}

.environment-banner-warning {
    background: linear-gradient(90deg, rgba(163, 84, 28, 0.95), rgba(242, 147, 54, 0.95));
    color: #fff8ef;
}

.environment-banner-danger {
    background: linear-gradient(90deg, rgba(122, 23, 23, 0.96), rgba(184, 42, 42, 0.96));
    color: #fff1f1;
}

.runtime-status-banner {
    position: fixed;
    top: 72px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 16px;
    max-width: min(680px, calc(100vw - 28px));
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 16px;
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.28);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    pointer-events: none;
}

.runtime-status-banner strong {
    color: inherit;
}

.runtime-status-banner-warning {
    background: rgba(163, 84, 28, 0.95);
    color: #fff5e6;
}

.runtime-status-banner-error {
    background: rgba(122, 23, 23, 0.96);
    color: #fff1f1;
}

.runtime-status-banner-info {
    background: rgba(19, 72, 128, 0.95);
    color: #eff7ff;
}

.runtime-status-banner-success {
    background: rgba(18, 96, 63, 0.95);
    color: #edfff7;
}
