:root {
    --ink: #102033;
    --muted: #5f7288;
    --line: #d6e1ea;
    --surface: #ffffff;
    --soft: #edf3f7;
    --brand: #0f766e;
    --brand-dark: #115e59;
    --accent: #9f1239;
    --warning: #b45309;
    --sidebar-bg: #0e1922;
    --sidebar-hover: rgba(255, 255, 255, .08);
    --shadow-sm: 0 8px 22px rgba(15, 23, 42, .06);
    --shadow-md: 0 18px 42px rgba(15, 23, 42, .10);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: #eef4f7;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: var(--brand-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
    background: var(--sidebar-bg);
    color: #fff;
    padding: 24px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 18px 0 40px rgba(15, 23, 42, .08);
    z-index: 1035;
}

.mobile-appbar,
.sidebar-backdrop {
    display: none;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    color: #fff;
    margin-bottom: 30px;
    min-height: 64px;
}

.brand:hover {
    color: #fff;
    text-decoration: none;
}

.brand small {
    display: block;
    color: #b8c7d4;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, var(--brand), #2563eb);
    color: #fff;
    font-weight: 800;
}

.brand-logo {
    width: 58px;
    height: 58px;
    border-radius: 8px;
    object-fit: contain;
    background: #fff;
    padding: 4px;
}

.login-logo {
    width: 112px;
    height: 112px;
    object-fit: contain;
    display: block;
}

.nav-menu {
    display: grid;
    gap: 8px;
}

.nav-menu a {
    color: #d9e4ec;
    padding: 11px 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 42px;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.nav-menu a:hover,
.nav-menu a.is-active {
    background: var(--sidebar-hover);
    color: #fff;
    text-decoration: none;
}

.nav-menu a.is-active {
    box-shadow: inset 3px 0 0 #34d399;
    font-weight: 800;
}

.counter {
    min-width: 24px;
    min-height: 24px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
}

.main-content {
    width: min(100%, 1320px);
    margin-inline: auto;
    padding: 28px;
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
    padding: 2px 0;
}

.topbar h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
}

.topbar-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.user-chip {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    padding: 7px 12px;
    color: var(--muted);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.user-chip strong {
    color: #166534;
    font-size: 12px;
}

.presence-count-button {
    border: 1px solid #86efac;
    background: #ecfdf5;
    border-radius: 999px;
    color: #14532d;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 7px 12px;
    white-space: nowrap;
}

.presence-count-button strong {
    font-size: 16px;
}

.notification-sound-button {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 999px;
    color: var(--muted);
    min-height: 38px;
    padding: 7px 12px;
    white-space: nowrap;
}

.pwa-install-button {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--brand-dark);
    display: inline-flex;
    font-size: 14px;
    font-weight: 800;
    min-height: 38px;
    padding: 7px 12px;
    white-space: nowrap;
}

.pwa-install-button:hover {
    background: #ecfdf5;
    border-color: #99f6e4;
}

.notification-sound-button.is-enabled {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
    font-weight: 800;
}

.notification-sound-button.has-alert {
    animation: sound-alert-pulse .9s ease;
}

@keyframes sound-alert-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(15, 118, 110, 0);
    }

    35% {
        box-shadow: 0 0 0 5px rgba(15, 118, 110, .2);
    }
}

.presence-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    display: inline-block;
    flex: 0 0 auto;
    background: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, .16);
}

.presence-dot.is-online {
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .18);
}

.presence-dot.is-offline {
    background: #94a3b8;
}

.presence-total-badge {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    padding: 6px 10px;
    white-space: nowrap;
}

.presence-user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
}

.presence-user-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbfc;
    display: flex;
    gap: 10px;
    min-width: 0;
    padding: 11px 12px;
}

.presence-user-card.is-online {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.presence-user-card div {
    min-width: 0;
}

.presence-user-card strong,
.presence-user-card small {
    display: block;
    overflow-wrap: anywhere;
}

.presence-user-card small {
    color: var(--muted);
    font-size: 12px;
}

.presence-inline {
    align-items: center;
    display: inline-flex;
    gap: 7px;
}

.presence-inline.is-online strong {
    color: #166534;
}

.presence-inline.is-offline strong {
    color: #64748b;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 700;
}

.panel,
.metric-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.panel {
    padding: 22px;
}

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

.panel-header h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.form-section-title {
    background: var(--brand);
    color: #fff;
    border-radius: 8px 8px 0 0;
    font-weight: 700;
    padding: 12px 14px;
}

.requester-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #f8fbfc;
}

.requester-summary span {
    color: var(--muted);
    display: block;
    font-size: 12px;
}

.requester-summary strong {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

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

.quick-tags-panel {
    background: #062e57;
    border: 1px solid #0b4f8a;
    border-radius: 8px;
    padding: 14px;
}

.quick-tags-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9cc8f5;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 10px;
}

.quick-tags-title strong {
    background: #1e5aa4;
    color: #dbeafe;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
}

.quick-tags-list,
.ticket-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    --tag-color: #374151;
    border: 1px solid color-mix(in srgb, var(--tag-color), #ffffff 35%);
    background: color-mix(in srgb, var(--tag-color), #111827 24%);
    color: #f8fafc;
    border-radius: 999px;
    min-height: 28px;
    padding: 4px 12px;
    display: inline-flex;
    gap: 6px;
    align-items: center;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.tag:hover {
    filter: brightness(1.12);
}

.tag.selected {
    border-color: #60a5fa;
    background: #123f73;
    color: #93c5fd;
}

.tag-add {
    background: #57534e;
    border-color: #78716c;
}

.attachment-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.attachment-title {
    background: #111827;
    color: #e5e7eb;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 12px;
    font-weight: 700;
}

.attachment-dropzone {
    min-height: 148px;
    border: 1px dashed #94a3b8;
    border-radius: 8px;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 18px;
    color: var(--muted);
    cursor: pointer;
    background: #f8fafc;
}

.attachment-dropzone strong,
.attachment-dropzone small {
    display: block;
}

.attachment-dropzone.is-dragover {
    border-color: var(--brand);
    background: #ecfdf5;
    color: var(--brand-dark);
}

.attachment-icon {
    font-size: 30px;
    line-height: 1;
}

.attachment-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 12px;
}

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

.attachment-preview-item,
.attachment-item {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
    background: #fff;
    color: var(--ink);
}

.attachment-preview-item img,
.attachment-item img {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--line);
}

.attachment-preview-item strong,
.attachment-item strong,
.attachment-preview-item small,
.attachment-item small {
    display: block;
    overflow-wrap: anywhere;
}

.attachment-preview-item small,
.attachment-item small {
    color: var(--muted);
}

.attachment-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 800;
}

.attachment-file-icon {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    display: inline-grid;
    place-items: center;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 800;
    border: 1px solid #fecaca;
}

.ticket-attachments h3 {
    font-size: 16px;
    margin: 0 0 10px;
}

.tracking-card,
.tracking-public-header,
.tracking-status-band,
.history-item,
.tracking-resolution {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.tracking-card,
.tracking-public-header,
.tracking-status-band,
.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
}

.tracking-card strong {
    display: block;
    overflow-wrap: anywhere;
}

.ticket-qr {
    width: 160px;
    height: 160px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
    padding: 6px;
}

.ticket-history h3,
.ticket-history h2,
.tracking-resolution h2 {
    font-size: 16px;
    margin: 0 0 10px;
}

.ticket-history {
    display: grid;
    gap: 10px;
}

.history-item {
    align-items: flex-start;
    justify-content: flex-start;
}

.history-item > span {
    flex: 0 0 auto;
}

.history-item p {
    color: var(--muted);
    margin: 4px 0 0;
}

.tracking-public-panel {
    width: min(100%, 960px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .12);
}

.tracking-public-header {
    align-items: center;
    margin-bottom: 14px;
}

.tracking-public-header .login-logo {
    width: 82px;
    height: 82px;
}

.tracking-public-header h1 {
    font-size: 26px;
    margin: 0;
}

.tracking-status-band {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 14px;
}

.tracking-status-band span,
.tracking-detail-grid span {
    color: var(--muted);
    display: block;
    font-size: 13px;
}

.tracking-status-band strong {
    display: block;
    font-size: 18px;
    overflow-wrap: anywhere;
}

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

.tracking-resolution {
    margin-top: 12px;
    padding: 14px;
}

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

.metric-card {
    min-height: 128px;
    padding: 18px;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #0f766e;
}

.metric-card:nth-child(2)::before {
    background: #0891b2;
}

.metric-card:nth-child(3)::before {
    background: #4f46e5;
}

.metric-card:nth-child(4)::before {
    background: #d97706;
}

.metric-card:nth-child(5)::before {
    background: #16a34a;
}

.metric-card:nth-child(6)::before {
    background: #64748b;
}

.metric-card span {
    color: var(--muted);
    display: block;
    font-size: 14px;
    line-height: 1.35;
}

.metric-card strong {
    display: block;
    font-size: 36px;
    line-height: 1;
    margin-top: 8px;
}

.alert-metric {
    border-color: #fecaca;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, .9fr);
    gap: 18px;
}

.inventory-integration-panel {
    overflow: hidden;
}

.inventory-integration-header {
    align-items: flex-start;
}

.inventory-integration-title {
    align-items: center;
    display: flex;
    gap: 14px;
    min-width: 0;
}

.inventory-integration-title p {
    color: var(--muted);
    margin: 4px 0 0;
}

.inventory-integration-logo {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    flex: 0 0 auto;
    height: 64px;
    object-fit: contain;
    padding: 5px;
    width: 72px;
}

.inventory-integration-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.inventory-kpi-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.inventory-kpi-grid article {
    background: #f8fbfc;
    border: 1px solid var(--line);
    border-radius: 8px;
    min-width: 0;
    padding: 14px;
}

.inventory-kpi-grid span,
.inventory-latest span {
    color: var(--muted);
    display: block;
    font-size: 13px;
}

.inventory-kpi-grid strong {
    display: block;
    font-size: 28px;
    margin-top: 4px;
}

.inventory-latest {
    border-top: 1px solid var(--line);
    margin-top: 14px;
    padding-top: 14px;
}

.inventory-latest strong,
.inventory-latest small {
    display: block;
    overflow-wrap: anywhere;
}

.clms-integration-panel {
    background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
}

.clms-integration-logo {
    background: #eef4ff;
    border-color: #c7d7fe;
}

.clms-kpi-grid article:nth-child(1) {
    border-left: 4px solid #3730a3;
}

.clms-kpi-grid article:nth-child(2) {
    border-left: 4px solid #059669;
}

.clms-kpi-grid article:nth-child(3) {
    border-left: 4px solid #be123c;
}

.clms-kpi-grid article:nth-child(4) {
    border-left: 4px solid #0f766e;
}

.clms-latest {
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
}

.clms-latest > div {
    min-width: 0;
}

.ticket-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
}

.ticket-side-stack {
    display: grid;
    align-content: start;
    gap: 18px;
}

.ticket-support-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 14px;
    align-items: stretch;
    max-width: 780px;
}

.ticket-support-grid > section {
    min-width: 0;
}

.support-card,
.diagnostic-panel,
.notification-toggle-panel {
    background: #20201e;
    border: 1px solid #2d2d2b;
    border-radius: 8px;
    color: #e7e5e4;
    min-height: 222px;
    padding: 16px 18px;
}

.support-card-title,
.diagnostic-title,
.notification-toggle-title {
    background: #090909;
    border: 1px solid #303030;
    border-radius: 8px;
    color: #d6d3d1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 9px 12px;
    margin-bottom: 12px;
    font-weight: 800;
    max-width: 196px;
}

.diagnostic-progress {
    color: #a8a29e;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 8px;
}

.diagnostic-list {
    display: grid;
    gap: 0;
}

.diagnostic-question {
    border: 0;
    border-bottom: 1px solid #383838;
    border-radius: 0;
    margin: 0;
    padding: 8px 0;
}

.diagnostic-question legend {
    color: #d6d3d1;
    float: none;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 8px;
    width: auto;
}

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

.notification-toggle-list {
    display: grid;
    gap: 0;
}

.diagnostic-options label {
    border: 1px solid #3f3f46;
    border-radius: 999px;
    color: #d6d3d1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
}

.diagnostic-options label:has(input:checked) {
    background: #0f766e;
    border-color: #34d399;
    color: #ecfdf5;
}

.diagnostic-options input {
    accent-color: #10b981;
}

.notification-toggle {
    border: 0;
    border-bottom: 1px solid #383838;
    color: #f5f5f4;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 7px 0;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.15;
}

.notification-toggle::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #10b981;
    flex: 0 0 auto;
}

.notification-toggle input[type="hidden"] {
    display: none;
}

.notification-toggle input[type="checkbox"] {
    appearance: none;
    background: #0b0b0b;
    border: 1px solid #3f3f46;
    border-radius: 999px;
    cursor: pointer;
    height: 20px;
    margin-left: auto;
    order: 3;
    position: relative;
    width: 36px;
}

.notification-toggle input[type="checkbox"]::after {
    background: #fff;
    border-radius: 999px;
    content: "";
    height: 14px;
    left: 3px;
    position: absolute;
    top: 2px;
    transition: transform .16s ease;
    width: 14px;
}

.notification-toggle input[type="checkbox"]:checked {
    background: #10b981;
    border-color: #10b981;
}

.notification-toggle input[type="checkbox"]:checked::after {
    transform: translateX(16px);
}

.notification-toggle span {
    order: 2;
}

.notification-toggle-panel p {
    color: #a8a29e;
    font-size: 12px;
    line-height: 1.25;
    margin: 10px 0 0;
}

.diagnostic-error {
    border: 1px solid #7f1d1d;
    background: #3b1111;
    color: #fecaca;
    border-radius: 8px;
    margin-top: 12px;
    padding: 10px 12px;
}

.attachment-panel-dark,
.sla-create-panel {
    background: #20201e;
    border: 1px solid #2f302d;
    border-radius: 8px;
    color: #e7e5e4;
}

.attachment-title-dark,
.sla-create-title {
    background: #090909;
    border: 1px solid #303030;
    border-radius: 8px;
    color: #d6d3d1;
    margin-bottom: 14px;
}

.attachment-dropzone-dark {
    min-height: 138px;
    border-color: #525252;
    background: #20201e;
    color: #a8a29e;
}

.attachment-dropzone-dark strong {
    color: #c9c5c0;
}

.attachment-dropzone-dark.is-dragover {
    border-color: #34d399;
    background: #17251e;
    color: #d1fae5;
}

.attachment-panel-dark .attachment-preview-item {
    background: #151515;
    border-color: #3f3f3f;
    color: #e7e5e4;
}

.sla-create-panel {
    display: grid;
    align-content: start;
    gap: 9px;
}

.sla-create-title {
    width: 100%;
    max-width: 196px;
    margin-bottom: 2px;
}

.sla-create-title span {
    color: #c7d2fe;
    font-weight: 900;
}

.sla-create-limit {
    background: #4a2500;
    border: 1px solid #92400e;
    border-radius: 8px;
    color: #fbbf24;
    font-weight: 800;
    line-height: 1.2;
    padding: 11px 12px;
}

.sla-create-panel .sla-progress-label {
    color: #d6d3d1;
}

.sla-create-panel .sla-progress {
    background: #0f0f0f;
}

.sla-create-panel .sla-message {
    color: #a8a29e;
}

.sla-live-card {
    border: 1px solid #fde68a;
    border-radius: 8px;
    background: #fffbeb;
    color: #92400e;
    display: grid;
    gap: 2px;
    padding: 10px 12px;
}

.sla-live-card span,
.sla-progress-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.sla-panel {
    display: grid;
    gap: 12px;
}

.sla-panel-title {
    background: #111827;
    color: #e5e7eb;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    font-weight: 800;
}

.sla-panel-title strong {
    color: #bfdbfe;
    font-size: 12px;
    text-transform: uppercase;
}

.sla-limit {
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: 800;
}

.sla-limit.sla-ok {
    background: #dcfce7;
    color: #166534;
}

.sla-limit.sla-warning {
    background: #fef3c7;
    color: #92400e;
}

.sla-limit.sla-danger {
    background: #fee2e2;
    color: #991b1b;
}

.sla-limit.sla-closed {
    background: #e5e7eb;
    color: #374151;
}

.sla-progress {
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: #e5e7eb;
}

.sla-progress-bar {
    height: 100%;
    border-radius: 999px;
    transition: width .2s ease;
}

.sla-progress-bar.sla-ok {
    background: #10b981;
}

.sla-progress-bar.sla-warning {
    background: #f59e0b;
}

.sla-progress-bar.sla-danger {
    background: #ef4444;
}

.sla-progress-bar.sla-closed {
    background: #6b7280;
}

.sla-message {
    color: var(--muted);
    margin: 0;
    font-size: 13px;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 190px 190px auto;
    gap: 10px;
}

.list-item,
.notification-row,
.network-plan,
.row-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.list-item {
    align-items: flex-start;
    flex-direction: column;
}

.notification-row {
    align-items: flex-start;
    flex-direction: column;
    color: var(--ink);
}

.notification-row:hover {
    text-decoration: none;
    border-color: var(--brand);
}

.notification-row.is-unread {
    border-left: 4px solid var(--brand);
}

.notification-row small,
.network-plan p,
.comment span {
    color: var(--muted);
}

.ticket-description {
    white-space: normal;
    line-height: 1.6;
}

.ticket-checklist-summary {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 16px 0;
    padding: 14px;
}

.checklist-summary-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.checklist-summary-metrics span {
    background: #eef2ff;
    border-radius: 999px;
    color: #3730a3;
    font-size: 13px;
    font-weight: 800;
    padding: 6px 10px;
}

.checklist-response-list {
    display: grid;
    gap: 8px;
}

.checklist-response-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
}

.checklist-response-item span {
    overflow-wrap: anywhere;
}

.checklist-admin-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 150px 100px 90px auto;
    gap: 10px;
    align-items: center;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.detail-grid div {
    border: 1px solid var(--line);
    border-radius: 8px;
    min-width: 0;
    padding: 12px;
}

.detail-grid span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.detail-grid strong,
.tracking-detail-grid strong {
    display: block;
    line-height: 1.35;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.comment-list {
    display: grid;
    gap: 12px;
}

.comment {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.comment p {
    margin: 8px 0 0;
}

.ticket-chat {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 14px;
}

.ticket-chat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.ticket-chat-header h2 {
    font-size: 18px;
    margin: 0;
}

.chat-online-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    max-width: 520px;
}

.chat-presence {
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    min-height: 28px;
    padding: 4px 10px;
}

.chat-presence::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #94a3b8;
}

.chat-presence.is-online {
    background: #ecfdf5;
    border-color: #86efac;
    color: #166534;
}

.chat-presence.is-online::before {
    background: #16a34a;
}

.chat-thread {
    background: #f8fbfc;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    max-height: 360px;
    overflow-y: auto;
    padding: 12px;
}

.chat-message {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    max-width: min(86%, 680px);
    padding: 10px 12px;
}

.chat-message.is-own {
    justify-self: end;
    background: #ecfdf5;
    border-color: #99f6e4;
}

.chat-message div {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}

.chat-message span {
    color: var(--muted);
    font-size: 12px;
}

.chat-message p {
    margin: 6px 0 0;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.chat-form {
    margin-top: 12px;
}

.chat-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.login-screen,
.install-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, .14), rgba(159, 18, 57, .08)),
        var(--soft);
}

.login-panel,
.install-panel {
    width: min(100%, 460px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, .12);
}

.install-panel {
    width: min(100%, 640px);
}

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

.login-actions .btn {
    min-height: 34px;
}

.password-hint {
    color: var(--muted);
    display: block;
    font-size: 12px;
    margin-top: 6px;
}

.debug-box {
    background: #111827;
    color: #e5e7eb;
    padding: 16px;
    border-radius: 8px;
    overflow: auto;
}

.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
}

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

.form-control,
.form-select,
.btn {
    border-radius: 8px;
}

.priority-baja {
    border-color: #94a3b8;
}

.priority-media {
    border-color: #38bdf8;
}

.priority-alta {
    border-color: #f59e0b;
}

.priority-critica,
.priority-urgente {
    border-color: #ef4444;
    box-shadow: 0 0 0 .2rem rgba(239, 68, 68, .14);
}

.bandwidth-metric-grid .metric-card strong {
    font-size: 30px;
    overflow-wrap: anywhere;
}

.bandwidth-title-row,
.report-list-item,
.finding-item,
.action-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.bandwidth-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
}

.bandwidth-title-row strong,
.bandwidth-title-row span {
    display: block;
}

.bandwidth-title-row > div > span,
.network-summary,
.finding-item p,
.action-item p,
.action-item small,
.report-list-item span,
.report-list-item small {
    color: var(--muted);
}

.network-summary {
    margin: 14px 0 0;
    line-height: 1.6;
}

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

.network-detail-grid strong {
    display: block;
    font-size: 14px;
    margin-top: 3px;
    overflow-wrap: anywhere;
}

.report-list,
.finding-stack,
.action-stack,
.action-grid {
    display: grid;
    gap: 10px;
}

.report-list-item {
    display: grid;
    gap: 3px;
    padding: 12px;
    color: var(--ink);
}

.report-list-item:hover {
    border-color: var(--brand);
    text-decoration: none;
}

.report-list-item.is-active {
    border-left: 4px solid var(--brand);
    background: #f0fdfa;
}

.finding-item,
.action-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 12px;
}

.finding-item strong,
.action-item strong {
    display: block;
    overflow-wrap: anywhere;
}

.finding-item p,
.action-item p {
    margin: 6px 0 0;
}

.finding-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    min-width: 120px;
}

.compact-form .form-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.mobile-appbar {
    align-items: center;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    gap: 12px;
    left: 0;
    min-height: 66px;
    padding: 10px 16px;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1045;
}

.mobile-brand {
    align-items: center;
    color: var(--ink);
    display: inline-flex;
    gap: 10px;
    min-width: 0;
}

.mobile-brand:hover {
    color: var(--ink);
    text-decoration: none;
}

.mobile-brand .brand-logo {
    height: 46px;
    width: 50px;
}

.mobile-brand small,
.mobile-brand strong {
    display: block;
}

.mobile-brand small {
    color: var(--muted);
}

.hamburger-button {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: inline-grid;
    gap: 4px;
    height: 42px;
    justify-content: center;
    padding: 0;
    width: 42px;
}

.hamburger-button span {
    background: var(--ink);
    border-radius: 999px;
    display: block;
    height: 2px;
    width: 18px;
}

.sidebar-backdrop {
    background: rgba(15, 23, 42, .45);
    inset: 0;
    opacity: 0;
    position: fixed;
    transition: opacity .18s ease;
    z-index: 1030;
}

@media (max-width: 1100px) {
    .content-grid,
    .ticket-layout,
    .ticket-support-grid,
    .diagnostic-notification-grid {
        grid-template-columns: 1fr;
    }

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

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

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

    .app-shell {
        display: block;
        min-height: 100vh;
        padding-top: 66px;
    }

    .mobile-appbar {
        display: flex;
    }

    .sidebar {
        border-right: 1px solid rgba(255, 255, 255, .08);
        box-shadow: var(--shadow-md);
        height: 100dvh;
        left: 0;
        max-width: calc(100vw - 48px);
        position: fixed;
        top: 0;
        transform: translateX(-102%);
        transition: transform .2s ease;
        width: 286px;
    }

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

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

    .main-content {
        padding: 22px;
        width: 100%;
    }

    .topbar {
        align-items: flex-start;
    }
}

@media (max-width: 720px) {
    .main-content {
        padding: 16px;
    }

    .topbar,
    .topbar-actions,
    .ticket-chat-header,
    .chat-actions,
    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .filter-bar,
    .stats-grid,
    .detail-grid,
    .inventory-kpi-grid,
    .clms-latest,
    .network-detail-grid,
    .requester-entry-grid,
    .tracking-status-band,
    .tracking-detail-grid,
    .checklist-admin-row,
    .requester-summary {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        gap: 10px;
    }

    .metric-card {
        min-height: 104px;
        padding: 15px 16px;
    }

    .panel {
        padding: 16px;
    }

    .bandwidth-title-row,
    .finding-item,
    .action-item,
    .tracking-card,
    .tracking-public-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .finding-badges {
        justify-content: flex-start;
        min-width: 0;
    }

    .chat-online-list {
        justify-content: flex-start;
    }

    .chat-message {
        max-width: 100%;
    }

    .topbar h1 {
        font-size: 24px;
    }

    .presence-count-button,
    .notification-sound-button,
    .pwa-install-button,
    .user-chip,
    .topbar-actions form,
    .topbar-actions .btn {
        width: 100%;
    }

    .topbar-actions {
        width: 100%;
    }
}
