:root {
    --bg: #f4f6f8;
    --panel: #ffffff;
    --ink: #0d2538;
    --muted: #5b6c78;
    --line: #d8e0e6;
    --brand: #0f766e;
    --brand-2: #134e4a;
    --alert: #b91c1c;
    --warn: #b45309;
    --ok: #0f766e;
    --shadow: 0 10px 30px rgba(13, 37, 56, 0.09);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "SF Pro Display", -apple-system, "Segoe UI", sans-serif;
    color: var(--ink);
    background: #eef1f6;
    min-height: 100%;
}

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

a:hover {
    text-decoration: underline;
}

.ref-link {
    color: #1d4ed8;
    white-space: nowrap;
}

.shell {
    display: grid;
    grid-template-columns: 270px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(165deg, #0f172a 0%, #083344 100%);
    color: #e2e8f0;
    padding: 26px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    width: 280px;
    transition: width 0.25s ease, transform 0.25s ease;
    overflow: hidden;
    z-index: 100;
}

.sidebar.collapsed {
    width: 88px;
}

.sidebar.collapsed .brand,
.sidebar.collapsed .user-box .info,
.sidebar.collapsed .user-box .role,
.sidebar.collapsed .user-box .user-email,
.sidebar.collapsed .logout-btn,
.sidebar.collapsed .badge-text,
.sidebar.collapsed .page-subtitle {
    display: none !important;
}

.sidebar.collapsed .user-box {
    padding: 8px 0;
    border: none;
    background: transparent;
}

.sidebar.collapsed .user-box .avatar {
    margin: 0 auto;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
}

.sidebar.collapsed .sidebar-top {
    justify-content: center;
}

.sidebar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.sidebar-toggle,
.sidebar-toggle-top {
    border: 0;
    background: rgba(255, 255, 255, 0.15);
    width: 38px;
    height: 38px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-icon {
    width: 20px;
    height: 20px;
    color: #fff;
}

.brand {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin: 0 0 22px;
}

.portal-brand-link {
    display: inline-block;
    margin: 0 0 22px;
    text-decoration: none;
    line-height: 0;
}

.portal-brand-link:hover {
    text-decoration: none;
    opacity: 0.88;
}

/* Suppress the CSS-generated "P" badge that the text-brand used.
   Now that the brand is a logo image, the ::before pseudo-element must not render. */
.portal-brand-link::before {
    content: none !important;
    display: none !important;
}

.portal-brand-logo {
    display: block;
    max-width: 140px;
    max-height: 44px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.user-box {
    border: 1px solid rgba(226, 232, 240, 0.24);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 18px;
    font-size: 0.9rem;
    background: rgba(15, 23, 42, 0.25);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-box .avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #0f766e;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 8px;
}

.user-box .info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-box .info > div {
    min-width: 0;
}

.user-box .name {
    display: block;
    font-weight: 600;
}

.user-box .role {
    opacity: 0.8;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.07em;
}

.user-box .user-email {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #dbeafe;
    margin-bottom: 6px;
    font-weight: 600;
    white-space: nowrap;
}

.nav-link.active,
.nav-link:hover {
    background: rgba(148, 163, 184, 0.22);
    text-decoration: none;
}

.nav-link.active .nav-icon,
.nav-link.active .nav-text {
    color: #0f766e;
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    min-width: 22px;
    height: 22px;
    font-size: 0.92rem;
}

.nav-icon i,
.notify-icon i {
    line-height: 1;
}

.nav-icon-svg,
.notify-icon-svg,
.stat-card-icon-svg {
    display: none;
}

.nav-text {
    display: inline;
}

.nav-link.active,
.nav-link:hover {
    background: rgba(148, 163, 184, 0.22);
    text-decoration: none;
}

.logout-btn {
    margin-top: 14px;
    width: 100%;
}

.main {
    padding: 28px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    text-decoration: none;
    padding: 6px 12px;
    margin-bottom: 4px;
    margin-left: -12px;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    line-height: 1.4;
}

.back-link:hover {
    background: #f3f4f6;
    color: #1a2b4a;
    text-decoration: none;
}

.back-link:active {
    background: #e5e7eb;
    color: #111827;
    text-decoration: none;
}

.back-link svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    stroke-width: 2;
}

.main-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.main-head-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.page-head-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #164e7b;
    color: #fff;
}

.page-head-icon svg {
    width: 16px;
    height: 16px;
}

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

.notify-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 8px 12px;
    font-weight: 600;
    color: #0f172a;
}

.notify-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    min-width: 16px;
    height: 16px;
}

.notify-chip:hover {
    text-decoration: none;
    background: #f8fafc;
}

.notify-chip.unread {
    border-color: #0f766e;
}

.notify-chip .count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #0f766e;
    color: #fff;
    font-size: 0.75rem;
    line-height: 1;
    padding: 0 7px;
}

.mention-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.12);
    z-index: 30;
    max-height: 220px;
    overflow-y: auto;
}

.mention-item {
    width: 100%;
    display: block;
    text-align: left;
    border: 0;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 0;
    background: #fff;
    color: #0f172a;
    padding: 10px 12px;
    cursor: pointer;
}

.mention-item:last-child {
    border-bottom: 0;
}

.mention-item:hover,
.mention-item.active {
    background: #ecfeff;
}

.page-title {
    margin: 0;
    font-size: 1.45rem;
}

.page-subtitle {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(13, 37, 56, 0.12);
}

.stat-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.stat-panel-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.stat-panel-link::after {
    content: "Open";
    position: absolute;
    right: 14px;
    bottom: 10px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    opacity: 0;
    transform: translateY(3px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.stat-panel-link:hover::after,
.stat-panel-link:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    opacity: 0.8;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 4px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}

.dashboard-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.dash-sev-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: default;
}

.dash-sev-tip::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 0;
    bottom: calc(100% + 7px);
    background: #1e293b;
    color: #f1f5f9;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.45;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: normal;
    width: max-content;
    max-width: 210px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 200;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.dash-sev-tip::before {
    content: '';
    position: absolute;
    left: 10px;
    bottom: calc(100% + 2px);
    border: 5px solid transparent;
    border-top-color: #1e293b;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 200;
}

.dash-sev-tip:hover::after,
.dash-sev-tip:hover::before {
    opacity: 1;
}

.dashboard-section-head h3 {
    margin: 0;
}

.dashboard-section-head a,
.dashboard-table-link {
    color: #0f766e;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.dashboard-table-link {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
}

.grid {
    display: grid;
    gap: 14px;
}

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

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

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

.stat-value {
    margin: 2px 0 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.stat-label {
    color: var(--muted);
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

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

.pagination {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.pagination li,
.pagination > div,
.pagination > span,
.pagination > a {
    display: inline-flex;
    align-items: center;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    text-decoration: none;
    line-height: 1;
    font-size: 0.86rem;
}

.pagination a:hover {
    background: #f8fafc;
}

.pagination .active span {
    background: #0f766e;
    border-color: #0f766e;
    color: #ffffff;
}

.pagination .disabled span {
    color: #94a3b8;
    background: #f8fafc;
}

.pagination svg,
.pagination svg.w-5.h-5 {
    width: 16px;
    min-width: 16px;
    height: 16px;
    display: block;
}

th,
td {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    font-size: 0.92rem;
}

th {
    font-size: 0.82rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:hover {
    background: #f8fafc;
}

.badge {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: #e2e8f0;
    color: #0f172a;
    white-space: nowrap;
}

.badge.open,
.badge.in_progress,
.badge.waiting_on_customer {
    background: #dbeafe;
    color: #1e3a8a;
}

.badge.resolved,
.badge.closed,
.badge.approved,
.badge.paid,
.badge.matched,
.badge.matched_manual {
    background: #dcfce7;
    color: #166534;
}

.badge.rejected,
.badge.spam,
.badge.blocked,
.badge.overdue {
    background: #fee2e2;
    color: #991b1b;
}

.badge.pending,
.badge.waitlisted,
.badge.unmatched,
.badge.unpaid {
    background: #fef3c7;
    color: #92400e;
}

/* Ticket severity colors: sev1 is highest priority. */
.badge.sev1 {
    background: #fee2e2;
    color: #991b1b;
}

.badge.sev2 {
    background: #ffedd5;
    color: #9a3412;
}

.badge.sev3 {
    background: #fef3c7;
    color: #92400e;
}

.badge.sev4 {
    background: #dbeafe;
    color: #1e3a8a;
}

.badge.internal {
    background: #e0f2fe;
    color: #075985;
}

form.inline {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.internal-help-shell {
    display: grid;
    gap: 16px;
}

.internal-help-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
    gap: 18px;
    align-items: center;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(14, 165, 233, 0.08)),
        #ffffff;
}

.internal-help-hero.compact {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 460px);
    padding: 14px 16px;
}

.internal-help-hero h2 {
    margin: 4px 0 8px;
    font-size: clamp(1.4rem, 2vw, 2rem);
}

.internal-help-note {
    border: 1px solid rgba(15, 118, 110, 0.2);
    border-radius: 14px;
    background: rgba(240, 253, 250, 0.72);
    color: #134e4a;
    padding: 14px;
    line-height: 1.5;
}

.internal-help-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.85fr);
    gap: 16px;
    align-items: start;
}

.internal-help-chat-panel,
.internal-help-topic-panel {
    min-height: 0;
}

.internal-help-chat-head,
.internal-help-topic-head,
.internal-help-actions,
.internal-help-topic-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.internal-help-chat-head h3,
.internal-help-topic-head h3 {
    margin: 0;
}

.internal-help-chat-head p,
.internal-help-topic-head p {
    margin: 4px 0 0;
}

.internal-help-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 340px;
    max-height: 540px;
    overflow-y: auto;
    border: 1px solid #dbe5eb;
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(240, 253, 250, 0.66), rgba(248, 250, 252, 0.82)),
        #f8fafc;
    padding: 14px;
    margin: 14px 0;
}

.internal-help-message {
    max-width: 86%;
}

.internal-help-message.user {
    align-self: flex-end;
}

.internal-help-message.assistant {
    align-self: flex-start;
}

.internal-help-message-label {
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.internal-help-message-body {
    border: 1px solid #dbe5eb;
    border-radius: 16px;
    background: #ffffff;
    padding: 12px 14px;
    line-height: 1.6;
    box-shadow: 0 8px 20px rgba(13, 37, 56, 0.06);
}

.internal-help-message.user .internal-help-message-body {
    background: #0f766e;
    border-color: #0f766e;
    color: #ffffff;
}

.internal-help-message.pending .internal-help-message-body {
    color: var(--muted);
    font-style: italic;
}

.internal-help-message.error .internal-help-message-body {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.internal-help-message-matches {
    display: grid;
    gap: 8px;
    margin-top: 8px;
}

.internal-help-composer {
    display: grid;
    gap: 12px;
}

.internal-help-context-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
    gap: 12px;
}

.internal-help-actions button {
    width: auto;
}

.internal-help-topic-search {
    display: block;
    margin: 14px 0 10px;
}

.internal-help-topic-list,
.internal-help-match-grid {
    display: grid;
    gap: 10px;
}

.internal-help-topic-list {
    max-height: 580px;
    overflow-y: auto;
    padding-right: 4px;
}

.internal-help-topic,
.internal-help-match {
    border: 1px solid #dbe5eb;
    border-radius: 12px;
    background: #f8fafc;
    padding: 12px;
}

.internal-help-match.mini {
    padding: 10px;
}

.internal-help-topic h4,
.internal-help-match h5 {
    margin: 0 0 6px;
}

.internal-help-topic-title-row h4 {
    margin-right: auto;
}

.internal-help-topic-ask {
    width: auto;
    padding: 6px 10px;
    font-size: 0.78rem;
    box-shadow: none;
}

.internal-help-topic p,
.internal-help-match p {
    margin: 0 0 6px;
}

.internal-help-topic details {
    margin: 8px 0;
}

.internal-help-topic summary {
    cursor: pointer;
    color: #0f766e;
    font-weight: 700;
}

.internal-help-topic-body {
    margin-top: 8px;
    color: #334155;
    font-size: 0.88rem;
    line-height: 1.55;
}

.internal-help-topic-keywords {
    display: block;
    font-size: 0.78rem;
}

.internal-help-topic-empty {
    margin-bottom: 0;
}

.internal-help-result h4 {
    margin: 16px 0 10px;
}

.internal-help-answer {
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #ffffff;
    padding: 14px;
    line-height: 1.65;
    white-space: normal;
}

.admin-assistant-context-inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: 8px;
}

.admin-assistant-prompts,
.admin-assistant-suggestions,
.admin-assistant-safety,
.admin-assistant-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-assistant-prompts {
    margin-top: 12px;
}

.admin-assistant-prompt,
.admin-assistant-suggestion,
.mini-btn {
    width: auto;
    box-shadow: none;
}

.admin-assistant-prompt {
    display: grid;
    gap: 3px;
    max-width: 280px;
    text-align: left;
}

.admin-assistant-prompt small {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: normal;
    line-height: 1.35;
    text-transform: none;
}

.admin-assistant-suggestions {
    margin-top: 10px;
}

.admin-assistant-actions {
    align-items: flex-end;
    margin-top: 10px;
}

.admin-assistant-action-form {
    display: grid;
    gap: 8px;
    min-width: min(100%, 260px);
    border: 1px solid #bae6fd;
    border-radius: 12px;
    background: #f0f9ff;
    padding: 10px;
}

.admin-assistant-action-form label {
    display: grid;
    gap: 4px;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 700;
}

.admin-assistant-action-form button {
    width: auto;
}

.admin-assistant-suggestion {
    padding: 6px 10px;
    font-size: 0.78rem;
}

.admin-assistant-safety {
    margin-top: 10px;
}

.admin-assistant-safety span {
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    background: #f0fdf4;
    color: #166534;
    padding: 5px 9px;
    font-size: 0.76rem;
    font-weight: 700;
}

.admin-assistant-scope-note {
    margin-top: 16px;
}

.admin-assistant-scope-note p {
    margin: 6px 0 12px;
}

@media (max-width: 900px) {
    .internal-help-hero,
    .internal-help-layout,
    .internal-help-context-row {
        grid-template-columns: 1fr;
    }

    .internal-help-message {
        max-width: 100%;
    }

    .admin-assistant-context-inline {
        grid-template-columns: 1fr;
    }
}

input,
select,
textarea,
button {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    padding: 8px 10px;
    font: inherit;
    background: #fff;
}

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    background: var(--brand);
    color: #fff;
    border: 1px solid var(--brand);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sidebar.collapsed .brand,
.sidebar.collapsed .user-box .info,
.sidebar.collapsed .user-box .role,
.sidebar.collapsed .user-box .user-email,
.sidebar.collapsed .logout-btn {
    display: none;
}

.sidebar.collapsed .nav-text {
    display: none;
}

.sidebar.collapsed {
    width: 88px;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
}

.sidebar.collapsed .user-box {
    padding: 10px;
    align-items: center;
    justify-content: center;
}

.sidebar:not(.collapsed) .sidebar-toggle {
    display: inline-flex;
}

@media (max-width: 1000px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        width: 280px;
    }

    .sidebar.collapsed {
        transform: translateX(0);
    }

    .sidebar-toggle-top {
        display: inline-flex;
    }
}

button:hover,
.btn:hover {
    background: var(--brand-2);
    border-color: var(--brand-2);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.btn.secondary {
    background: #fff;
    color: var(--brand-2);
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

button.secondary {
    background: #fff;
    color: var(--brand-2);
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn.secondary:hover {
    background: #f8fafc;
    border-color: var(--brand-2);
    color: var(--brand-2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn.danger {
    background: var(--alert);
    border-color: var(--alert);
}

button.danger {
    background: var(--alert);
    border-color: var(--alert);
}

.btn.danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.alert {
    margin-bottom: 14px;
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid;
}

.alert.ok {
    background: #ecfdf5;
    border-color: #86efac;
    color: #166534;
}

.alert.warning {
    background: #fffbeb;
    border-color: #fcd34d;
    color: #92400e;
}

.alert.error {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

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

.list-reset {
    margin: 0;
    padding-left: 18px;
}

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(29, 78, 216, 0.14), transparent 28%),
        radial-gradient(circle at bottom right, rgba(15, 118, 110, 0.12), transparent 24%),
        linear-gradient(180deg, #eef4f8 0%, #f8fbfd 44%, #edf3f7 100%);
}

.login-wrap::before,
.login-wrap::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}

.login-wrap::before {
    width: 360px;
    height: 360px;
    top: -120px;
    right: -80px;
    background: radial-gradient(circle, rgba(15, 23, 42, 0.18) 0%, rgba(15, 23, 42, 0) 72%);
}

.login-wrap::after {
    width: 320px;
    height: 320px;
    bottom: -120px;
    left: -80px;
    background: radial-gradient(circle, rgba(15, 118, 110, 0.18) 0%, rgba(15, 118, 110, 0) 72%);
}

.login-card {
    position: relative;
    z-index: 1;
    max-width: 480px;
    width: 100%;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0) 40%),
        linear-gradient(145deg, #ffffff 0%, #f8fbfd 100%);
    border: 1px solid rgba(203, 213, 225, 0.8);
    border-radius: 24px;
    box-shadow:
        0 24px 60px rgba(13, 37, 56, 0.12),
        0 8px 24px rgba(15, 118, 110, 0.06);
    padding: 30px 28px;
    overflow: hidden;
}

.login-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 6px;
    background: linear-gradient(90deg, #0f766e 0%, #1d4ed8 100%);
}

.login-card > * {
    position: relative;
    z-index: 1;
}

.login-card h1 {
    margin: 0;
    font-size: 2rem;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: #0f172a;
}

.login-card .muted {
    color: #526372;
}

.login-card label {
    color: #173042;
    font-weight: 600;
}

.login-card input,
.login-card select,
.login-card textarea {
    margin-top: 6px;
    border-color: #d6e0e8;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.login-card input:focus,
.login-card select:focus,
.login-card textarea:focus {
    border-color: rgba(15, 118, 110, 0.55);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
    outline: 0;
}

.login-card button,
.login-card .btn {
    min-height: 44px;
}

.login-card form + form,
.login-card form + p,
.login-card .social-auth,
.login-card .muted + .muted {
    margin-top: 14px;
}

.login-logo {
    display: block;
    max-width: 220px;
    height: auto;
    margin: 0 auto 22px;
    filter: drop-shadow(0 6px 18px rgba(15, 23, 42, 0.08));
}

.social-auth {
    margin-top: 14px;
    display: grid;
    gap: 9px;
}

.social-auth-title {
    margin: 0 0 2px;
    font-size: 0.85rem;
    text-align: center;
}

.social-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.social-btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.social-btn.google:hover {
    background: #f8fbff;
    border-color: #bcd2f7;
}

.social-btn.microsoft:hover {
    background: #f0f9ff;
    border-color: #93c5fd;
}

.social-btn:focus-visible {
    outline: 2px solid #0f766e;
    outline-offset: 2px;
}

@media (max-width: 640px) {
    .login-wrap {
        padding: 18px 12px;
    }

    .login-card {
        padding: 24px 18px;
        border-radius: 20px;
    }

    .login-card h1 {
        font-size: 1.7rem;
    }
}

.social-btn-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 20px;
}

.settings-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.settings-shell {
    display: grid;
    gap: 18px;
}

.settings-nav-panel,
.settings-generated-key,
.settings-shell .panel {
    border-radius: 24px;
}

.settings-nav-panel {
    padding: 18px 20px;
    background:
        radial-gradient(circle at top left, rgba(29, 78, 216, 0.1), transparent 28%),
        radial-gradient(circle at bottom right, rgba(15, 118, 110, 0.08), transparent 24%),
        linear-gradient(145deg, #ffffff 0%, #f8fbfd 100%);
}

.settings-generated-key {
    background:
        radial-gradient(circle at top left, rgba(34, 197, 94, 0.12), transparent 26%),
        linear-gradient(145deg, #ffffff 0%, #f7fcf8 100%);
}

.settings-shell .grid.grid-2 {
    gap: 18px;
    align-items: start;
}

.settings-shell .panel {
    padding: 20px 22px;
    overflow: hidden;
}

.settings-shell .panel h3,
.settings-shell .panel h4 {
    margin-top: 0;
}

.settings-shell .table-wrap {
    overflow-x: auto;
    margin-inline: -6px;
    padding-inline: 6px;
}

.settings-shell table thead th {
    background: #f5f8fb;
    color: #687b89;
}

.settings-shell table tbody tr {
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.settings-shell table tbody tr:hover {
    background: linear-gradient(90deg, rgba(240, 249, 255, 0.95), rgba(248, 250, 252, 0.98));
    transform: translateY(-1px);
}

.settings-shell form.grid {
    gap: 12px !important;
}

.settings-shell form.inline {
    align-items: flex-start;
    flex-wrap: wrap;
}

.settings-inline-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.settings-inline-form {
    margin: 0;
}

.settings-inline-form select,
.settings-inline-form button,
.settings-inline-form .btn {
    width: auto;
}

.settings-inline-form select {
    min-width: 0;
    width: 250px;
    max-width: 250px;
}

.settings-inline-actions button,
.settings-inline-actions .btn {
    width: auto;
    min-width: 0;
    min-height: 40px;
    padding: 8px 14px;
    font-size: 0.82rem;
    border-radius: 12px;
}

.settings-inline-note {
    margin: 0;
    white-space: normal;
    flex: 0 1 260px;
}

.settings-inline-actions .danger {
    margin-left: auto;
}

.settings-shell input,
.settings-shell select,
.settings-shell textarea {
    border-radius: 14px;
    border-color: #d6e1e8;
    min-height: 46px;
}

.settings-shell textarea {
    min-height: 96px;
}

.settings-shell label {
    display: grid;
    gap: 6px;
    font-weight: 600;
    color: #173144;
}

.settings-shell label .muted,
.settings-shell .muted {
    font-weight: 400;
}

.settings-shell pre {
    white-space: pre-wrap;
    background: #f8fafc;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #d6e1e8;
}

.settings-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #0f172a;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.settings-tab:hover {
    text-decoration: none;
    background: #f8fafc;
    border-color: #aab8c5;
    transform: translateY(-1px);
}

.settings-tab.active {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
}

.settings-tab-link {
    border-radius: 999px;
    padding: 8px 14px;
    min-height: 42px;
}

.settings-tab-link:not(.secondary) {
    background: #0f766e;
    border-color: #0f766e;
    box-shadow: 0 10px 20px rgba(15, 118, 110, 0.18);
}

.settings-shell .system-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.settings-shell .system-nav {
    position: sticky;
    top: 82px;
    padding: 20px 18px;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.08), transparent 28%),
        linear-gradient(145deg, #ffffff 0%, #f9fcfc 100%);
}

.settings-shell .system-anchor-list {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.settings-shell .system-tab-trigger {
    border: 1px solid #d6dde5;
    border-radius: 14px;
    padding: 10px 12px;
    background: #f8fafc;
    color: #173144;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.settings-shell .system-tab-trigger.active {
    background: #0f766e;
    color: #fff;
    border-color: #0f766e;
}

.settings-shell .system-section {
    border: 1px solid #d6dde5;
    border-radius: 18px;
    padding: 16px 18px;
    margin-bottom: 14px;
    background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
}

.settings-shell .system-advanced {
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    padding: 12px 14px;
    background: #fff;
}

.settings-shell .system-save-row {
    margin-top: 12px;
}

.kv {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 6px 10px;
    font-size: 0.92rem;
}

.chat-detail-shell {
    display: grid;
    gap: 18px;
}

.chat-detail-overview {
    display: grid;
}

.chat-detail-hero {
    padding: 20px;
    background:
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.14), transparent 36%),
        linear-gradient(145deg, #ffffff 0%, #f6fbfb 100%);
}

.chat-detail-hero-main {
    display: grid;
    gap: 14px;
}

.chat-detail-breadcrumbs {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--muted);
}

.chat-detail-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.chat-detail-title {
    margin: 0;
    font-size: 1.8rem;
    line-height: 1.1;
}

.chat-detail-subtitle {
    margin: 8px 0 0;
    color: var(--muted);
}

.chat-detail-separator {
    margin: 0 8px;
}

.chat-detail-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.chat-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #e6f4f1;
    color: #115e59;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

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

.chat-stat-card {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.85);
}

.chat-stat-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

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

.chat-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
    gap: 18px;
    align-items: start;
}

.chat-thread-panel {
    padding: 0;
    overflow: hidden;
}

.chat-thread-header,
.chat-composer,
.chat-side-card {
    padding: 18px;
}

.chat-thread-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    border-bottom: 1px solid var(--line);
}

.chat-thread-header h3,
.chat-composer h3,
.chat-side-card h3 {
    margin: 0;
}

.chat-thread-header p,
.chat-composer p {
    margin: 6px 0 0;
}

.chat-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-size: 0.82rem;
    font-weight: 600;
    color: #0f766e;
}

.chat-live-indicator::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #10b981;
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.12);
}

.chat-thread {
    max-height: 760px;
    overflow-y: auto;
    padding: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(248, 250, 252, 0.95)),
        repeating-linear-gradient(180deg, rgba(148, 163, 184, 0.06), rgba(148, 163, 184, 0.06) 1px, transparent 1px, transparent 28px);
}

.chat-message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: flex-start;
}

.chat-message.customer {
    flex-direction: row-reverse;
}

.chat-message-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #0f766e, #115e59);
    box-shadow: 0 10px 22px rgba(15, 118, 110, 0.18);
}

.chat-message.customer .chat-message-avatar {
    background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
    box-shadow: 0 10px 22px rgba(29, 78, 216, 0.2);
}

.chat-message.system .chat-message-avatar {
    background: linear-gradient(135deg, #64748b, #334155);
    box-shadow: none;
}

.chat-message-body {
    width: min(100%, 720px);
}

.chat-message.customer .chat-message-body {
    display: grid;
    justify-items: end;
}

.chat-message-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 0.84rem;
}

.chat-message-bubble {
    padding: 14px 16px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #d9e2ec;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    line-height: 1.55;
}

.chat-message.agent .chat-message-bubble {
    border-top-left-radius: 6px;
}

.chat-message.customer .chat-message-bubble {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-color: #bfdbfe;
    border-top-right-radius: 6px;
}

.chat-message.system .chat-message-bubble {
    background: #f8fafc;
    border-style: dashed;
    color: #334155;
}

.chat-empty-state {
    padding: 48px 20px;
    text-align: center;
}

.chat-empty-state h4 {
    margin: 0 0 8px;
}

.chat-composer {
    border-top: 1px solid var(--line);
    background: #fcfefe;
}

.chat-composer-form {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.chat-field {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

.chat-field span {
    font-size: 0.88rem;
}

.chat-composer-form textarea {
    min-height: 120px;
    resize: vertical;
}

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

.chat-side-rail {
    display: grid;
    gap: 18px;
    position: sticky;
    top: 28px;
}

.chat-side-card {
    display: grid;
    gap: 14px;
}

.chat-side-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.chat-side-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

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

.chat-info-list > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.chat-info-list > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.chat-info-label {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.chat-inline-form {
    margin-top: -2px;
}

.chat-note {
    margin: 0;
}

.chat-modal-open {
    overflow: hidden;
}

.chat-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 200;
}

.chat-modal-backdrop[hidden],
body:not(.chat-modal-open) .chat-modal-backdrop {
    display: none !important;
    pointer-events: none !important;
}

.chat-modal-open .chat-modal-backdrop:not([hidden]) {
    display: flex;
}

.chat-modal-card {
    width: min(980px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border-radius: 24px;
    padding: 26px 28px;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.08), transparent 24%),
        linear-gradient(145deg, #ffffff 0%, #fbfdff 100%);
}

.chat-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.chat-modal-head h3 {
    margin: 0;
}

.chat-modal-close {
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 999px;
    background: #fff;
    color: #163247;
    border-color: #d5e1e8;
    box-shadow: 0 4px 12px rgba(13, 37, 56, 0.08);
}

.chat-modal-close:hover {
    background: #f8fafc;
    color: #163247;
    border-color: #b9cad5;
}

.ticket-index-shell {
    display: grid;
    gap: 18px;
}

.ticket-index-hero {
    padding: 22px;
    background:
        radial-gradient(circle at top left, rgba(29, 78, 216, 0.12), transparent 32%),
        radial-gradient(circle at bottom right, rgba(15, 118, 110, 0.1), transparent 28%),
        linear-gradient(145deg, #ffffff 0%, #f8fbfd 100%);
}

.ticket-index-hero-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}

.ticket-kicker,
.ticket-section-label {
    margin: 0 0 8px;
    color: #0f766e;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ticket-index-title {
    margin: 0;
    font-size: 1.9rem;
    line-height: 1.1;
}

.ticket-index-subtitle {
    max-width: 780px;
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
}

.ticket-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

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

.ticket-index-stat {
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
}

.ticket-index-stat-label {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.ticket-index-stat-value {
    font-size: 1.25rem;
    line-height: 1.2;
}

.ticket-control-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
}

.ticket-panel {
    display: grid;
    gap: 16px;
}

.ticket-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.ticket-panel-head h3 {
    margin: 0;
}

.ticket-panel-head p {
    margin: 6px 0 0;
}

.ticket-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.ticket-span-full {
    grid-column: 1 / -1;
}

.ticket-form-actions,
.ticket-filter-actions,
.ticket-pagination,
.ticket-pagination-actions,
.ticket-badge-stack,
.ticket-ref-line,
.ticket-list-summary {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.ticket-info-card {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid #dbe7ef;
    background: linear-gradient(145deg, #f9fbfc, #f2f8f9);
}

.ticket-info-card-label {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ticket-info-card p {
    margin: 0;
}

.ticket-list-panel {
    padding: 0;
    overflow: hidden;
}

.ticket-list-head {
    padding: 18px 18px 0;
}

.ticket-list-summary {
    color: var(--muted);
    font-size: 0.88rem;
    justify-content: flex-end;
}

.ticket-inline-filters-wrap {
    padding: 18px 18px 0;
}

.ticket-inline-filters {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 12px;
    align-items: end;
}

.ticket-inline-filter-triplet {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.ticket-inline-filter {
    min-width: 0;
}

.ticket-inline-filter-search {
    min-width: 0;
}

.ticket-inline-filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    grid-column: 1 / -1;
    justify-content: flex-end;
}

.ticket-table-wrap {
    overflow-x: auto;
    padding: 18px;
}

.ticket-table {
    min-width: 860px;
}

.ticket-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.ticket-sort-link:hover {
    color: #2563eb;
    text-decoration: none;
}

.ticket-sort-link.is-active {
    color: #2563eb;
}

.ticket-sort-icon {
    width: 8px;
    height: 10px;
    flex-shrink: 0;
    color: inherit;
}

.ticket-table thead th {
    background: #f8fafc;
}

.ticket-table tbody tr {
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.ticket-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(239, 246, 255, 0.9), rgba(248, 250, 252, 0.95));
    transform: translateY(-1px);
}

.ticket-reference-cell {
    min-width: 170px;
}

.ticket-ref-link {
    color: #0f766e;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ticket-ref-link:hover {
    color: #134e4a;
}

.ticket-subject {
    font-weight: 600;
    line-height: 1.45;
}

.ticket-subject-cell {
    min-width: 340px;
}

.ticket-inline-note {
    color: var(--muted);
    font-size: 0.84rem;
}

.ticket-badge-stack {
    align-items: flex-start;
}

.ticket-customer-name,
.ticket-owner,
.ticket-updated {
    font-weight: 600;
}

.ticket-empty-cell {
    padding: 36px 20px;
    text-align: center;
}

.ticket-empty-cell h4,
.ticket-empty-cell p {
    margin: 0;
}

.ticket-empty-cell p {
    margin-top: 8px;
}

.ticket-pagination {
    justify-content: space-between;
    padding: 0 18px 18px;
}

.ticket-show-shell {
    display: grid;
    gap: 18px;
}

.ticket-show-summary {
    padding: 20px;
    background:
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.1), transparent 32%),
        linear-gradient(145deg, #ffffff 0%, #f8fbfd 100%);
}

.ticket-show-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.ticket-show-summary-item {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.84);
}

.ticket-show-summary-label {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ticket-show-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.92fr);
    gap: 18px;
    align-items: start;
}

.ticket-show-main,
.ticket-show-sidebar,
.ticket-show-action-grid {
    display: grid;
    gap: 18px;
    min-width: 0;
}

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

.ticket-show-sidebar {
    position: sticky;
    top: 28px;
}

.ticket-show-panel h3 {
    margin-top: 0;
}

.ticket-show-panel {
    overflow: hidden;
}

.ticket-show-form {
    gap: 12px;
}

.ticket-show-note,
.ticket-mention-examples {
    margin-bottom: 0;
}

.ticket-show-details-list {
    display: grid;
    gap: 12px;
}

.ticket-show-details-list > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.ticket-show-details-list > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.ticket-show-details-list strong {
    font-size: 0.82rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.ticket-message-stream,
.ticket-event-stream {
    display: grid;
    gap: 14px;
}

.ticket-message-card,
.ticket-event-card {
    border: 1px solid #dde6ee;
    border-radius: 16px;
    padding: 16px;
    background: linear-gradient(145deg, #ffffff 0%, #f9fbfc 100%);
}

.ticket-message-card.internal {
    background: linear-gradient(145deg, #fffaf0 0%, #fff7e6 100%);
    border-color: #f3d7a1;
}

.ticket-message-shell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: flex-start;
}

.ticket-message-content {
    min-width: 0;
}

.ticket-message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.ticket-message-avatar--support {
    background: #dcfce7;
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.ticket-message-avatar--customer {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.24);
}

.ticket-message-head,
.ticket-event-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.ticket-message-meta {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ticket-message-body {
    margin-top: 12px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.ticket-message-attachments {
    margin-top: 12px;
}

.ticket-attachment-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.ticket-attachment-link {
    display: block;
}

.ticket-attachment-image {
    max-width: 180px;
    max-height: 120px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    object-fit: cover;
}

.ticket-attachment-file {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 160px;
    height: 110px;
    padding: 10px;
    border: 1px solid #e4e6ea;
    border-radius: 8px;
    background: #f8f9fb;
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    text-align: center;
    overflow: hidden;
    word-break: break-all;
}

.ticket-event-payload {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    margin: 10px 0 0;
    background: #f8fafc;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.ticket-email-add-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.ticket-email-add-form input {
    min-width: 0;
    width: 100%;
}

.ticket-mention-wrap {
    position: relative;
}

.notification-shell {
    display: grid;
    gap: 18px;
}

.notification-hero {
    padding: 22px;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 30%),
        radial-gradient(circle at bottom right, rgba(29, 78, 216, 0.1), transparent 28%),
        linear-gradient(145deg, #ffffff 0%, #f8fbfd 100%);
}

.notification-hero-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.notification-title {
    margin: 0;
    font-size: 1.9rem;
    line-height: 1.1;
}

.notification-subtitle {
    max-width: 760px;
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

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

.notification-stat-card {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.84);
}

.notification-stat-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.notification-stat-value {
    font-size: 1.25rem;
    line-height: 1.2;
}

.notification-list-panel {
    padding: 0;
    overflow: hidden;
}

.notification-list-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 18px 0;
}

.notification-list-head h3 {
    margin: 0;
}

.notification-list-head p {
    margin: 6px 0 0;
}

.notification-page-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.88rem;
    justify-content: flex-end;
}

.notification-list {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.notification-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid #dbe5ee;
    background: linear-gradient(145deg, #ffffff 0%, #f9fbfc 100%);
}

.notification-card.is-unread {
    border-color: #bcd4e6;
    background: #eaf2f8;
}

/* Unread notifications get a stronger, filled button treatment so the
   "Open" / "Mark Read" actions visually differ from read-row buttons. */
.notification-card.is-unread .notification-card-actions .btn.secondary,
.notification-card.is-unread .notification-card-actions button.secondary {
    background: #0f766e;
    color: #ffffff;
    border-color: #0f766e;
}

.notification-card.is-unread .notification-card-actions .btn.secondary:hover,
.notification-card.is-unread .notification-card-actions button.secondary:hover {
    background: #134e4a;
    border-color: #134e4a;
    color: #ffffff;
}

.notification-card-status {
    display: flex;
    align-items: flex-start;
}

.notification-card-main {
    min-width: 0;
}

.notification-card-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.notification-card-title {
    display: block;
    font-size: 1rem;
    line-height: 1.4;
}

.notification-card-title a {
    color: #0f766e;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.notification-card-title a:hover {
    color: #134e4a;
}

.notification-card-message {
    margin-top: 6px;
    line-height: 1.55;
}

.notification-card-time {
    white-space: nowrap;
    flex-shrink: 0;
}

.notification-card-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.notification-reference-wrap {
    display: grid;
    gap: 4px;
}

.notification-reference-label {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.notification-reference-link {
    color: #0f766e;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.notification-card-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.notification-empty-state {
    padding: 42px 20px;
    text-align: center;
}

.notification-empty-state h4,
.notification-empty-state p {
    margin: 0;
}

.notification-empty-state p {
    margin-top: 8px;
}

.notification-pagination {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 0 18px 18px;
    flex-wrap: wrap;
}

.profile-shell {
    display: grid;
    gap: 18px;
}

.profile-hero {
    padding: 22px;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 28%),
        radial-gradient(circle at bottom right, rgba(29, 78, 216, 0.1), transparent 24%),
        linear-gradient(145deg, #ffffff 0%, #f8fbfd 100%);
}

.profile-hero-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f766e, #1d4ed8);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: 0 16px 30px rgba(15, 118, 110, 0.2);
    flex-shrink: 0;
}

.profile-hero-title {
    margin: 0;
    font-size: 1.8rem;
    line-height: 1.1;
}

.profile-hero-subtitle {
    margin: 8px 0 0;
    color: var(--muted);
}

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

.profile-status-item {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.84);
}

.profile-status-label {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 18px;
    align-items: start;
}

.profile-panel {
    display: grid;
    gap: 16px;
}

.profile-panel h3 {
    margin: 0;
}

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

.profile-info-list > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.profile-info-list > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.profile-info-list strong {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-form-grid {
    display: grid;
    gap: 12px;
}

.profile-action-row,
.profile-back-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.profile-note {
    margin: 0;
}

.profile-ticket-copy-card {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid #dbe7ff;
    border-radius: 14px;
    background: linear-gradient(180deg, #f8fbff 0%, #f3f7ff 100%);
}

.profile-inline-form {
    margin-top: -2px;
}

.customer-shell {
    display: grid;
    gap: 22px;
}

.customer-hero {
    display: grid;
    gap: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.customer-hero-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
}

.customer-hero-title {
    margin: 0;
    font-size: 2.05rem;
    line-height: 1.1;
}

.customer-hero-subtitle {
    margin: 10px 0 0;
    color: var(--muted);
}

.customer-hero-stats {
    display: flex;
    justify-content: flex-end;
}

.customer-hero-stat {
    min-width: 84px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(203, 213, 225, 0.82);
    background: #ffffff;
    text-align: center;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.04);
}

.customer-hero-stat-label {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.customer-panel {
    display: grid;
    gap: 16px;
}

.customer-search-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.customer-search-form input {
    min-width: 0;
    flex: 1 1 280px;
}

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

.customer-span-full {
    grid-column: 1 / -1;
}

.customer-form-note {
    margin: -4px 0 0;
}

.customer-action-row,
.customer-pagination,
.customer-page-meta,
.customer-pagination-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.customer-create-card {
    padding: 0;
    overflow: hidden;
}

body.ops-customers-page .customer-create-card {
    border: 1px solid #dbe3ec;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.96));
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
}

.customer-create-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 18px;
    border: 0;
    background: #ffffff;
    text-align: left;
    cursor: pointer;
}

body.ops-customers-page .customer-create-toggle {
    border: 0;
    background: #ffffff;
    color: #111827;
    box-shadow: none;
    transform: none;
}

.customer-create-toggle:hover {
    background: #f8fafc;
}

body.ops-customers-page .customer-create-toggle:hover,
body.ops-customers-page .customer-create-toggle:focus-visible {
    border: 0;
    background: #f8fafc;
    color: #111827;
    box-shadow: none;
    transform: none;
}

.customer-create-toggle-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.customer-create-toggle-main strong {
    display: block;
    margin-bottom: 2px;
    font-size: 1.02rem;
    color: #111827;
}

.customer-create-subtitle {
    display: block;
    color: #94a3b8;
    font-size: 0.97rem;
}

.customer-create-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #dbeafe;
    color: #2563eb;
    font-size: 1.2rem;
    line-height: 1;
}

.customer-create-toggle-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    color: #2563eb;
    background: #eff6ff;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.customer-create-toggle-action svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.customer-create-card.open .customer-create-toggle-action svg {
    transform: rotate(180deg);
}

.customer-create-body {
    padding: 18px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

.customer-list-panel {
    padding: 0;
    overflow: hidden;
}

body.ops-customers-page .customer-list-panel {
    border: 1px solid #dbe3ec;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.045);
}

.customer-list-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid #e5e7eb;
}

.customer-list-head h3 {
    margin: 0;
    font-size: 1.08rem;
}

.customer-directory-subtitle {
    margin: 4px 0 0;
    color: #94a3b8;
    font-size: 0.92rem;
}

.customer-page-meta {
    color: var(--muted);
    font-size: 0.88rem;
    justify-content: flex-end;
}

.customer-search-wrap {
    padding: 14px 18px;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
}

body.ops-customers-page .customer-search-form button,
body.ops-customers-page .customer-search-form .btn {
    width: auto;
    flex: 0 0 auto;
    min-width: 88px;
}

.customer-table-wrap {
    overflow-x: auto;
    padding: 0 18px 0 20px;
}

.customer-table {
    min-width: 920px;
    margin: 0;
}

.customer-table thead th {
    padding: 10px 18px;
    background: #fafafa;
    color: #94a3b8;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.customer-table td {
    padding: 14px 18px;
    vertical-align: middle;
}

body.ops-customers-page .customer-table thead th:first-child,
body.ops-customers-page .customer-table tbody td:first-child {
    padding-left: 22px;
}

body.ops-customers-page .customer-table thead th:last-child,
body.ops-customers-page .customer-table tbody td:last-child {
    padding-right: 24px;
}

.customer-table tbody tr {
    transition: background-color 0.18s ease;
    border-bottom: 1px solid #f1f5f9;
}

.customer-table tbody tr:hover {
    background: #f8fafc;
}

.customer-name-cell {
    min-width: 220px;
}

.customer-name-link {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

.customer-name-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.customer-domain-cell {
    color: #94a3b8;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.95rem;
}

.customer-number-cell {
    text-align: center;
    font-weight: 600;
    color: #334155;
}

.customer-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
}

.customer-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
}

.customer-status-active {
    background: #dcfce7;
    color: #15803d;
}

.customer-status-pending {
    background: #fef3c7;
    color: #b45309;
}

.customer-status-inactive {
    background: #f1f5f9;
    color: #64748b;
}

.customer-empty-cell {
    text-align: center;
    padding: 36px 20px;
}

.customer-pagination {
    justify-content: space-between;
    padding: 14px 18px;
    border-top: 1px solid #e5e7eb;
    background: #fafafa;
}

.customer-pagination-actions {
    justify-content: flex-end;
}

.customer-show-shell {
    display: grid;
    gap: 18px;
}

.customer-show-jump-nav {
    position: sticky;
    top: 12px;
    z-index: 40;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid rgba(203, 213, 225, 0.72);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 8px 18px rgba(13, 37, 56, 0.05);
    backdrop-filter: blur(10px);
}

.customer-show-jump-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #315365;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    background: transparent;
}

.customer-show-jump-nav a:hover,
.customer-show-jump-nav a:focus-visible {
    border-color: rgba(15, 118, 110, 0.18);
    color: #0f766e;
    background: rgba(236, 253, 245, 0.74);
}

.customer-show-summary {
    padding: 18px;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.08), transparent 24%),
        linear-gradient(145deg, #ffffff 0%, #fafcfd 100%);
}

.customer-show-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.customer-show-summary-item {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}

.customer-show-summary-label {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.customer-show-group {
    display: grid;
    gap: 16px;
    padding: 18px;
    scroll-margin-top: 96px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(15, 118, 110, 0.08), transparent 28%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 252, 0.96));
    box-shadow: 0 12px 28px rgba(13, 37, 56, 0.06);
}

.customer-show-group-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.24);
}

.customer-show-group-head h3 {
    margin: 4px 0 0;
    font-size: 1.18rem;
}

.customer-show-group-head p {
    margin: 0;
    max-width: 42ch;
    text-align: right;
}

.customer-show-kicker {
    display: inline-flex;
    color: #36756f;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.customer-show-top-grid,
.customer-show-management-grid,
.customer-show-dual-forms,
.customer-show-solo-form,
.customer-show-bottom-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.customer-show-top-grid > *,
.customer-show-management-grid > *,
.customer-show-dual-forms > *,
.customer-show-solo-form > *,
.customer-show-bottom-grid > * {
    min-width: 0;
}

.customer-show-bottom-grid {
    grid-template-columns: 1fr;
}

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

.customer-show-panel {
    display: grid;
    gap: 14px;
    overflow: hidden;
    padding: 18px;
    border-color: rgba(203, 213, 225, 0.9);
    background: rgba(255, 255, 255, 0.96);
}

.customer-show-panel h3,
.customer-show-panel h4 {
    margin: 0;
}

.customer-show-details-list {
    display: grid;
    gap: 12px;
}

.customer-show-details-list > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.customer-show-details-list > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.customer-show-details-list strong {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.customer-show-form {
    gap: 10px;
}

.customer-show-form button,
.customer-show-billing-form button {
    justify-self: start;
    width: auto;
    min-width: 180px;
}

.customer-show-form-spaced {
    margin-bottom: 10px;
}

.customer-show-note {
    margin: 0;
    max-width: 72ch;
}

.customer-copy-setting,
.customer-reply-routing {
    display: grid;
    gap: 10px;
}

.customer-delivery-card {
    gap: 8px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #dbe7ef;
    border-radius: 16px;
    background: #fbfdff;
}

.customer-delivery-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.customer-reply-routing--primary {
    background: linear-gradient(180deg, #f4fcf8 0%, #fbfefd 100%);
    border-color: #b7e5d5;
}

.customer-reply-toggle {
    display: inline-flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    color: #0f172a;
    font-weight: 600;
}

.customer-reply-toggle input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    margin-top: 2px;
}

.customer-reply-toggle-copy {
    display: grid;
    gap: 4px;
}

.customer-reply-toggle-copy strong {
    display: block;
    font-size: 0.95rem;
    line-height: 1.35;
    color: #0f172a;
}

.customer-delivery-toggle {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
}

.customer-reply-toggle-copy .muted {
    font-size: 0.84rem;
    line-height: 1.45;
}

.customer-routing-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 0.38rem 0.8rem;
    border-radius: 999px;
    border: 1px solid #aee4d4;
    background: #eefbf5;
    color: #2f8d67;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.customer-routing-copy {
    margin: 0;
    color: #60758a;
    font-size: 0.9rem;
    line-height: 1.45;
}

.customer-show-list {
    display: grid;
    gap: 8px;
}

.customer-show-list li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fcfdff;
}

.customer-site-inventory-list {
    display: grid;
    gap: 14px;
}

.customer-site-inventory-card {
    display: grid;
    gap: 14px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(13, 37, 56, 0.05);
}

.customer-site-inventory-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.customer-site-inventory-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.customer-site-inventory-wide {
    grid-column: 1 / -1;
}

.customer-site-inventory-form button {
    justify-self: start;
    width: auto;
    min-width: 160px;
}

.customer-credentials-panel {
    display: grid;
    gap: 16px;
}

.customer-credentials-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.customer-credentials-head h3,
.customer-credential-main h4 {
    margin: 0;
}

.credential-copy-status {
    min-width: 190px;
    text-align: right;
    font-weight: 700;
}

.credential-copy-status-error {
    color: #b91c1c;
}

.customer-credential-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
    border: 1px solid #d8e0e6;
    border-radius: 14px;
    background: #f8fafc;
}

.customer-credential-wide {
    grid-column: 1 / -1;
}

.customer-credential-form button {
    justify-self: start;
    width: auto;
}

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

.customer-credential-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(13, 37, 56, 0.05);
}

.customer-credential-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.customer-credential-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.customer-credential-actions button {
    width: auto;
}

.customer-credential-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
    margin: 0;
}

.customer-credential-meta dt {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.customer-credential-meta dd {
    margin: 3px 0 0;
    overflow-wrap: anywhere;
}

.customer-credential-notes {
    margin: 0;
    padding: 10px 12px;
    border-left: 3px solid #0f766e;
    background: #ecfdf5;
    border-radius: 8px;
    white-space: pre-wrap;
}

.customer-credential-edit {
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
}

.customer-credential-edit summary {
    cursor: pointer;
    color: #0f766e;
    font-weight: 700;
}

.customer-credential-edit form + form {
    margin-top: 10px;
}

.customer-show-dual-forms,
.customer-show-bottom-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.customer-show-solo-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.customer-show-form-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    align-content: start;
    height: 100%;
    box-shadow: 0 8px 22px rgba(13, 37, 56, 0.06);
}

.customer-show-form-card h3,
.customer-show-form-card h4 {
    margin: 0;
}

.customer-show-form-card:hover {
    box-shadow: 0 10px 24px rgba(13, 37, 56, 0.08);
}

.customer-show-empty-card {
    visibility: hidden;
    pointer-events: none;
    min-height: 100%;
}

.customer-show-billing-form {
    gap: 8px;
    margin-bottom: 12px;
}

.customer-show-compact-panel {
    align-content: start;
    padding: 20px 22px;
}

.customer-show-danger-panel {
    border-color: #f0c7c7;
    background: linear-gradient(145deg, #ffffff 0%, #fff8f8 100%);
}

.customer-show-danger-group {
    border-color: rgba(185, 28, 28, 0.22);
    background:
        radial-gradient(circle at top right, rgba(185, 28, 28, 0.08), transparent 24%),
        linear-gradient(145deg, #fffafa 0%, #ffffff 100%);
}

.customer-show-shell > .panel,
.customer-show-group > .panel,
.customer-show-management-grid > .panel,
.customer-show-top-grid > .panel,
.customer-show-dual-forms > .panel,
.customer-show-bottom-grid > .panel {
    box-shadow: 0 8px 22px rgba(13, 37, 56, 0.06);
}

.customer-show-shell > .panel:hover,
.customer-show-group > .panel:hover,
.customer-show-management-grid > .panel:hover,
.customer-show-top-grid > .panel:hover,
.customer-show-dual-forms > .panel:hover,
.customer-show-bottom-grid > .panel:hover {
    transform: none;
    box-shadow: 0 10px 24px rgba(13, 37, 56, 0.08);
}

.service-order-page {
    display: grid;
    gap: 18px;
}

.service-order-filters-panel,
.service-order-table-panel {
    border-radius: 24px;
    padding: 22px 24px;
}

.service-order-filters-panel {
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.08), transparent 28%),
        linear-gradient(145deg, #ffffff 0%, #f9fcfc 100%);
}

.service-order-filters-form {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.service-order-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 14px;
    flex: 1 1 640px;
}

.service-order-filter-field {
    min-width: 0;
}

.service-order-filter-field select {
    min-height: 52px;
    padding-inline: 16px;
    border-radius: 16px;
    border-color: #d7e2e8;
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.service-order-filter-actions,
.service-order-pagination,
.service-order-pagination-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.service-order-filter-actions {
    justify-content: flex-end;
    flex: 0 0 auto;
    white-space: nowrap;
}

.service-order-filter-actions button,
.service-order-filter-actions .btn {
    width: auto;
    min-width: 104px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 14px;
}

.service-order-table-panel {
    overflow: hidden;
    padding-bottom: 20px;
}

.service-order-table-wrap {
    overflow-x: auto;
    margin-inline: -6px;
    padding-inline: 6px;
}

.service-order-table {
    min-width: 1140px;
}

.service-order-table thead th {
    background: #f5f8fb;
    color: #687b89;
    font-size: 0.79rem;
    letter-spacing: 0.08em;
    padding: 16px 14px;
    border-bottom: 1px solid #dce5eb;
}

.service-order-table thead th:first-child {
    border-top-left-radius: 16px;
}

.service-order-table thead th:last-child {
    border-top-right-radius: 16px;
}

.service-order-table tbody td {
    padding: 18px 14px;
    border-bottom: 1px solid #e4ecf1;
}

.service-order-row {
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.service-order-row:hover {
    background: linear-gradient(90deg, rgba(240, 249, 255, 0.95), rgba(248, 250, 252, 0.98));
    transform: translateY(-1px);
}

.service-order-id,
.service-order-customer,
.service-order-type,
.service-order-approval,
.service-order-total {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    font-weight: 700;
    color: #10283c;
}

.service-order-id {
    color: #0f766e;
}

.service-order-total,
.service-order-date-cell {
    white-space: nowrap;
}

.service-order-items-cell {
    min-width: 300px;
}

.service-order-item-line {
    font-weight: 600;
    color: #173348;
}

.service-order-item-line + .service-order-item-line {
    margin-top: 10px;
}

.service-order-item-meta,
.service-order-item-note,
.service-order-action-note {
    margin-top: 6px;
    line-height: 1.5;
}

.service-order-date-cell {
    color: #4b6173;
    font-weight: 500;
}

.service-order-actions-cell {
    min-width: 230px;
}

.service-order-inline-action {
    display: inline-flex;
    width: 100%;
    margin-bottom: 8px;
}

.service-order-reject-form {
    display: grid;
    gap: 8px;
}

.service-order-pagination {
    justify-content: space-between;
    margin-top: 18px;
}

.email-inbox-page {
    display: grid;
    gap: 18px;
}

.email-inbox-filter-panel,
.email-inbox-list-panel {
    border-radius: 24px;
    padding: 22px 24px;
}

.email-inbox-filter-panel {
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.08), transparent 28%),
        linear-gradient(145deg, #ffffff 0%, #f9fcfc 100%);
}

.email-inbox-filter-form {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: nowrap;
}

.email-inbox-filter-field {
    min-width: 0;
    flex: 1 1 auto;
}

.email-inbox-filter-field select {
    min-height: 52px;
    padding-inline: 16px;
    border-radius: 16px;
    border-color: #d7e2e8;
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.email-inbox-filter-actions,
.email-inbox-pagination,
.email-inbox-pagination-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.email-inbox-filter-actions {
    margin-left: auto;
    flex: 0 0 auto;
    white-space: nowrap;
}

.email-inbox-filter-actions button,
.email-inbox-filter-actions .btn {
    width: auto;
    min-width: 104px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 14px;
}

.email-inbox-list-panel {
    overflow: hidden;
    padding-bottom: 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(250, 252, 253, 0.98) 100%);
}

.email-inbox-table-wrap {
    overflow-x: auto;
    margin-inline: -6px;
    padding-inline: 6px;
}

.email-inbox-table {
    min-width: 1060px;
    border-collapse: separate;
    border-spacing: 0;
}

.email-inbox-table thead th {
    background: #f5f8fb;
    color: #687b89;
    font-size: 0.79rem;
    letter-spacing: 0.08em;
    padding: 16px 14px;
    border-bottom: 1px solid #dce5eb;
}

.email-inbox-table thead th:first-child {
    border-top-left-radius: 16px;
}

.email-inbox-table thead th:last-child {
    border-top-right-radius: 16px;
}

.email-inbox-table tbody td {
    padding: 18px 14px;
    border-bottom: 1px solid #e4ecf1;
    background: rgba(255, 255, 255, 0.94);
}

.email-inbox-row {
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.email-inbox-row:hover {
    background: linear-gradient(90deg, rgba(240, 249, 255, 0.95), rgba(248, 250, 252, 0.98));
    transform: translateY(-1px);
}

.email-inbox-row:hover td {
    background: transparent;
}

.email-inbox-cell-stack {
    gap: 4px;
    min-height: 40px;
    align-content: center;
}

.email-inbox-from,
.email-inbox-subject {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    font-weight: 600;
    color: #10283c;
}

.email-inbox-subject {
    color: #0f766e;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.email-inbox-from-cell {
    min-width: 240px;
}

.email-inbox-subject-cell {
    min-width: 260px;
}

.email-inbox-customer-cell {
    min-width: 210px;
}

.email-inbox-status-cell {
    width: 1%;
    white-space: nowrap;
}

.email-inbox-status-cell .badge {
    margin-top: 6px;
}

.email-inbox-ticket-cell {
    width: 1%;
    white-space: nowrap;
}

.email-inbox-ticket-link {
    color: #0f766e;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.email-inbox-ticket-link:hover {
    color: #134e4a;
}

.email-inbox-date-cell {
    width: 1%;
    white-space: nowrap;
    color: #4b6173;
    font-weight: 500;
}

.email-inbox-actions-cell {
    min-width: 320px;
}

.email-inbox-inline-action {
    display: inline-flex;
    flex: 1 1 0;
}

.email-inbox-actions-stack {
    display: grid;
    gap: 10px;
}

.email-inbox-action-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.email-inbox-action-row form,
.email-inbox-action-row .email-inbox-inline-action {
    flex: 1 1 0;
}

.email-inbox-action-row button {
    width: 100%;
}

.email-inbox-inline-form,
.email-inbox-attach-form,
.email-inbox-manual-ticket-form {
    display: grid;
    gap: 8px;
}

.email-inbox-inline-form input,
.email-inbox-inline-form select,
.email-inbox-manual-ticket-form input,
.email-inbox-manual-ticket-form select {
    width: 100%;
}

.email-inbox-inline-form button,
.email-inbox-manual-ticket-form button {
    width: 100%;
}

.email-inbox-empty-cell {
    text-align: center;
    padding: 40px 20px;
}

.email-inbox-pagination {
    justify-content: space-between;
    margin-top: 18px;
}

.email-inbox-detail-page {
    gap: 18px;
}

.email-inbox-detail-summary,
.email-inbox-detail-panel {
    border-radius: 24px;
    padding: 22px 24px;
    min-width: 0;
}

.email-inbox-email-panel {
    overflow: hidden;
}

.email-inbox-detail-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.email-inbox-form-divider {
    position: relative;
    margin: 16px 0;
    text-align: center;
}

.email-inbox-form-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid #dbe5ec;
    transform: translateY(-50%);
}

.email-inbox-form-divider span {
    position: relative;
    display: inline-block;
    padding: 0 12px;
    background: #f7fbfd;
    color: #6b7d8c;
    font-size: 0.82rem;
    font-weight: 600;
}

.email-inbox-candidate-note {
    padding: 10px 12px;
    border: 1px solid #d7e4ed;
    border-radius: 12px;
    background: #f8fbfd;
    color: #47606f;
    font-size: 0.9rem;
    line-height: 1.5;
}

.email-inbox-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.email-inbox-detail-item {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    min-width: 0;
}

.email-inbox-detail-item span:first-child {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.email-inbox-detail-item strong,
.email-inbox-detail-item a {
    overflow-wrap: anywhere;
}

.email-inbox-message-body {
    width: min(100%, 940px);
    min-width: 0;
    padding: 16px;
    margin: 0 auto;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fbfdff;
    max-width: 100%;
    overflow-x: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
    contain: inline-size;
}

.email-inbox-message-body * {
    box-sizing: border-box;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.email-inbox-message-body [width] {
    width: auto !important;
}

.email-inbox-message-body table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed;
    border-collapse: collapse;
}

.email-inbox-message-body td,
.email-inbox-message-body th {
    white-space: normal !important;
}

.email-inbox-message-body a,
.email-inbox-message-body span,
.email-inbox-message-body p,
.email-inbox-message-body div {
    white-space: normal !important;
}

.email-inbox-message-body pre {
    white-space: pre-wrap !important;
}

.email-inbox-message-body img {
    max-width: 100% !important;
    height: auto !important;
}

.email-inbox-attachment-list {
    display: grid;
    gap: 10px;
}

.email-inbox-attachment-list li {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}

.email-inbox-meta-json {
    max-height: 420px;
    overflow: auto;
    padding: 14px;
    border: 1px solid #dbe5ec;
    border-radius: 14px;
    background: #0f172a;
    color: #dbeafe;
    font-size: 0.82rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.portal-home {
    display: grid;
    gap: 18px;
}

.portal-home-banner {
    border-color: rgba(15, 118, 110, 0.22);
    background: linear-gradient(145deg, rgba(236, 253, 245, 0.95), rgba(255, 255, 255, 0.98));
}

.portal-home-banner h3,
.portal-home-hero h2,
.portal-section-heading h3,
.portal-section-heading h4 {
    margin: 0;
}

.portal-home-banner p,
.portal-home-hero p,
.portal-section-heading p {
    margin: 8px 0 0;
}

.portal-home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.9fr);
    gap: 18px;
    padding: 20px 22px;
    background: linear-gradient(145deg, rgba(227, 247, 245, 0.96), rgba(255, 255, 255, 0.96));
}

.portal-home-eyebrow {
    display: inline-flex;
    margin-bottom: 10px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand);
}

.portal-home-hero h2 {
    font-size: 1.95rem;
    line-height: 1.05;
}

.portal-home-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-self: stretch;
}

.portal-home-stat {
    display: grid;
    gap: 6px;
    padding: 15px 16px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.88);
}

.portal-home-stat-label {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-home-stat-value {
    font-size: 1.35rem;
    line-height: 1.2;
}

.portal-home-cta {
    padding: 18px 20px;
}

.portal-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.portal-subsection-heading {
    margin-top: 2px;
}

.portal-home-grid {
    display: grid;
    gap: 18px;
}

.portal-home-grid-primary,
.portal-home-grid-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-work-card {
    display: grid;
    gap: 0;
    padding: 20px;
    align-content: start;
}

.portal-work-card > .portal-section-heading {
    margin-bottom: 6px;
}

.portal-work-card > .portal-section-heading + .portal-form-grid {
    margin-top: 0;
    align-content: start;
}

.portal-work-card-nested {
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.portal-section-card {
    padding: 20px;
}

.portal-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 8px;
}

.portal-form-grid label {
    display: grid;
    gap: 4px;
    margin: 0;
}

.portal-form-grid input,
.portal-form-grid select,
.portal-form-grid textarea {
    padding: 7px 9px;
}

.portal-form-grid button,
.portal-form-grid .btn {
    padding: 7px 12px;
    min-height: 34px;
    font-size: 0.82rem;
}

.portal-form-span-full {
    grid-column: 1 / -1;
}

.portal-form-grid label.portal-checkbox-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.portal-form-grid label.portal-checkbox-row input {
    width: auto;
    margin-top: 0;
    flex: 0 0 auto;
}

.portal-card-note {
    margin: 12px 0 0;
}

.portal-inline-divider {
    margin: 18px 0;
    border-top: 1px solid #e2e8f0;
}

.portal-data-table th {
    background: #f8fafc;
}

.portal-table-link {
    color: #0f766e;
    font-weight: 600;
    text-decoration: underline;
}

.portal-order-note {
    margin-top: 6px;
}

.portal-order-actions {
    display: grid;
    gap: 8px;
}

.portal-order-reject-form {
    display: grid;
    gap: 6px;
}

.portal-ticket-show {
    display: grid;
    gap: 18px;
    min-width: 0;
    width: 100%;
}

.portal-ticket-show > * {
    min-width: 0;
}

.portal-ticket-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.9fr);
    gap: 18px;
    padding: 20px 22px;
    background: linear-gradient(145deg, rgba(227, 247, 245, 0.96), rgba(255, 255, 255, 0.96));
}

.portal-ticket-hero h2 {
    margin: 0;
    font-size: 1.95rem;
    line-height: 1.05;
}

.portal-ticket-hero-copy p {
    margin: 10px 0 0;
}

.portal-ticket-hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.portal-ticket-stat {
    display: grid;
    gap: 6px;
    padding: 15px 16px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.88);
}

.portal-ticket-stat-label {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.portal-ticket-stat-value {
    font-size: 1rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.portal-ticket-details-list {
    display: grid;
    gap: 12px;
}

.portal-ticket-details-list > div {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.portal-ticket-details-list > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.portal-ticket-details-list > div > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.portal-ticket-details-list strong {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.portal-ticket-cc-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.portal-ticket-cc-form input {
    flex: 1 1 380px;
    min-width: 260px;
}

.portal-ticket-stream {
    display: grid;
    gap: 14px;
}

.portal-ticket-message {
    padding: 18px;
    border-radius: 16px;
    border: 1px solid #d8e0e6;
    background: #fff;
}

.portal-ticket-message.is-support {
    border-color: rgba(15, 118, 110, 0.22);
    background: linear-gradient(145deg, rgba(241, 250, 249, 0.95), rgba(255, 255, 255, 0.98));
}

.portal-ticket-message.is-customer {
    border-color: rgba(148, 163, 184, 0.24);
}

.portal-ticket-message-shell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: flex-start;
}

.portal-ticket-message-content {
    min-width: 0;
}

.portal-ticket-message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.portal-ticket-message-avatar--support {
    background: #dcfce7;
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.portal-ticket-message-avatar--customer {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.24);
}

.portal-ticket-message-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.portal-ticket-message-author {
    display: block;
    font-size: 1rem;
}

.portal-ticket-message-channel {
    margin-top: 4px;
    font-size: 0.84rem;
}

.portal-ticket-message-body {
    line-height: 1.65;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Keep external email HTML inside the card on small screens. */
.portal-ticket-message-body img,
.portal-ticket-message-body video,
.portal-ticket-message-body iframe {
    max-width: 100%;
    height: auto;
}

.portal-ticket-message-body table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.portal-ticket-message-body pre,
.portal-ticket-message-body code {
    white-space: pre-wrap;
    word-break: break-word;
}

.portal-ticket-attachments {
    margin-top: 14px;
    display: grid;
    gap: 8px;
}

.portal-ticket-attachment-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.portal-ticket-attachment-grid > * {
    max-width: 100%;
}

.portal-ticket-attachment-link {
    display: block;
    text-decoration: none;
}

.portal-ticket-attachment-link:hover {
    text-decoration: none;
}

.portal-ticket-attachment-image,
.portal-ticket-attachment-file {
    display: block;
    width: min(180px, 100%);
    height: 120px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
}

.portal-ticket-attachment-image {
    object-fit: cover;
}

.portal-ticket-attachment-file {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    color: #0f172a;
    font-weight: 600;
    text-align: center;
}

.portal-chat-page {
    display: grid;
    gap: 18px;
}

.portal-chat-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.9fr);
    gap: 18px;
    padding: 20px 22px;
    background: linear-gradient(145deg, rgba(227, 247, 245, 0.96), rgba(255, 255, 255, 0.96));
}

.portal-chat-hero h2 {
    margin: 0;
    font-size: 1.95rem;
    line-height: 1.05;
}

.portal-chat-hero-copy p {
    margin: 10px 0 0;
}

.portal-chat-hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.portal-chat-transcript {
    display: grid;
    gap: 12px;
    max-height: 460px;
    overflow-y: auto;
    padding: 4px;
}

.portal-chat-transcript-assistant {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    background: linear-gradient(145deg, #f9fbfc, #f2f8f9);
}

.portal-chat-composer {
    margin-top: 6px;
}

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

.portal-chat-message {
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid #d8e0e6;
    background: #fff;
}

.portal-chat-message.is-agent,
.portal-chat-message.is-bot {
    border-color: rgba(15, 118, 110, 0.22);
    background: linear-gradient(145deg, rgba(241, 250, 249, 0.95), rgba(255, 255, 255, 0.98));
}

.portal-chat-message.is-customer {
    border-color: rgba(59, 130, 246, 0.18);
    background: linear-gradient(145deg, rgba(239, 246, 255, 0.94), rgba(255, 255, 255, 0.98));
}

.portal-chat-message.is-system {
    border-color: rgba(148, 163, 184, 0.24);
    background: #f8fafc;
}

.portal-chat-message-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 8px;
}

.portal-chat-message-body {
    white-space: pre-wrap;
    line-height: 1.65;
}

.portal-chat-article-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.portal-chat-article-card {
    padding: 10px 12px;
    border: 1px solid #d8e0e6;
    border-radius: 12px;
    background: #fff;
}

.portal-chat-article-card .muted {
    margin-top: 4px;
    display: block;
}

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

    .sidebar {
        height: auto;
        position: static;
    }

    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .settings-tab {
        width: 100%;
        justify-content: flex-start;
        border-radius: 10px;
    }

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

    .chat-side-rail {
        position: static;
    }

    .ticket-index-stats {
        grid-template-columns: 1fr;
    }

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

    .ticket-inline-filter-triplet {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ticket-show-summary-grid,
    .ticket-show-layout,
    .ticket-show-action-grid {
        grid-template-columns: 1fr;
    }

    .ticket-show-sidebar {
        position: static;
    }

    .notification-stats {
        grid-template-columns: 1fr;
    }

    .profile-status-grid,
    .profile-layout {
        grid-template-columns: 1fr;
    }

    .customer-control-grid,
    .customer-hero-stats {
        grid-template-columns: 1fr;
    }

    .customer-show-summary-grid,
    .customer-show-single-grid,
    .customer-show-management-grid,
    .customer-show-top-grid,
    .customer-show-dual-forms,
    .customer-show-solo-form,
	    .customer-show-bottom-grid,
	    .customer-site-inventory-form,
        .customer-credential-form,
        .customer-credential-meta,
	    .email-inbox-detail-grid,
	    .portal-home-hero,
    .portal-chat-hero,
    .portal-ticket-hero,
    .portal-home-grid-primary,
    .portal-home-grid-secondary,
    .service-order-filter-grid {
        grid-template-columns: 1fr;
    }

    .service-order-filters-form {
        align-items: stretch;
    }

    .service-order-filter-actions,
    .service-order-pagination,
    .email-inbox-filter-actions,
    .email-inbox-pagination {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .main {
        padding: 18px;
    }

    .chat-detail-title-row,
    .chat-thread-header,
    .chat-composer-actions,
    .chat-info-list > div {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .chat-thread {
        max-height: none;
    }

    .chat-message,
    .chat-message.customer {
        flex-direction: column;
    }

    .chat-message.customer .chat-message-body {
        justify-items: stretch;
    }

    .ticket-index-hero-main,
    .ticket-panel-head,
    .ticket-pagination {
        flex-direction: column;
        align-items: flex-start;
    }

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

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

    .ticket-inline-filter-triplet {
        grid-template-columns: 1fr;
    }

    .ticket-list-head {
        padding: 18px 18px 0;
    }

    .ticket-show-details-list > div,
    .ticket-message-head,
    .ticket-event-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .ticket-email-add-form {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .notification-hero-main,
    .notification-list-head,
    .notification-card-head,
    .notification-card-footer,
    .notification-pagination {
        flex-direction: column;
        align-items: flex-start;
    }

    .notification-card {
        grid-template-columns: 1fr;
    }

    .profile-hero-card,
    .profile-info-list > div,
    .profile-action-row,
    .profile-back-row {
        flex-direction: column;
        align-items: flex-start;
    }

	    .customer-hero-main,
	    .customer-list-head,
	    .customer-site-inventory-head,
        .customer-show-group-head,
        .customer-credentials-head,
        .customer-credential-main,
	    .dashboard-section-head,
	    .customer-pagination,
        .customer-create-toggle,
    .portal-section-heading,
    .service-order-pagination,
    .service-order-pagination-actions,
    .service-order-filters-form,
    .email-inbox-filter-form,
    .email-inbox-pagination,
    .email-inbox-pagination-actions {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .customer-create-toggle-main {
        align-items: flex-start;
    }

    .customer-create-toggle-action {
        align-self: stretch;
        justify-content: center;
    }

    .customer-show-group-head p {
        text-align: left;
    }

    .portal-home-stats,
    .portal-chat-hero-stats,
    .portal-ticket-hero-stats,
    .portal-form-grid {
        grid-template-columns: 1fr;
    }

    .customer-search-form input {
        min-width: 0;
    }

    .customer-pagination-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .customer-show-details-list > div,
    .portal-chat-message-head,
    .portal-ticket-message-head,
    .portal-ticket-details-list > div,
    .customer-show-list li {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================================
   Dashboard Stat Cards (matches Operations Dashboard design)
   ============================================================ */

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

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

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

.stat-card {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 16px;
    text-decoration: none;
    color: inherit;
}

.stat-card-link {
    cursor: pointer;
    color: inherit;
    text-decoration: none;
}

.stat-card-link:hover {
    text-decoration: none;
}

.stat-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    min-width: 42px;
    height: 42px;
    border-radius: 10px;
    font-size: 1.15rem;
}

.stat-card-icon--ticket {
    background: #eff6ff;
    color: #2563eb;
}

.stat-card-icon--open {
    background: #fff7ed;
    color: #d97706;
}

.stat-card-icon--resolved {
    background: #f0fdf4;
    color: #16a34a;
}

.stat-card-icon--customers {
    background: #f0fdfa;
    color: #0f766e;
}

.stat-card-icon--time {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.stat-card-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.stat-card-label {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
}

.stat-card-value {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.1;
}

.stat-card-unit {
    font-size: 1rem;
    font-weight: 600;
    color: var(--muted);
}

.stat-card-sub {
    margin: 0;
    font-size: 0.78rem;
    color: var(--muted);
}

/* Dashboard table refinements */
.dash-table {
    width: 100%;
    border-collapse: collapse;
}

.dash-table th {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.dash-table td {
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
    vertical-align: middle;
}

.dash-table tbody tr:last-child td {
    border-bottom: none;
}

.dash-th-right,
.dash-td-right {
    text-align: right;
}

.dash-view-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
    white-space: nowrap;
}

.dash-view-link:hover {
    text-decoration: underline;
}

.dash-section-title {
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
}

/* Month dot in monthly volume table */
.dash-month-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0f766e;
    margin-right: 8px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Dashboard inline status badge (text style, not pill) */
.dash-status-badge {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dash-status-closed,
.dash-status-resolved {
    color: #0f766e;
}

.dash-status-open,
.dash-status-in_progress,
.dash-status-waiting_on_customer {
    color: #1d4ed8;
}

.dash-status-pending {
    color: #d97706;
}

.dash-status-rejected,
.dash-status-spam {
    color: #b91c1c;
}

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

@media (max-width: 580px) {
    .dash-stat-grid,
    .dash-stat-grid--2,
    .dash-stat-grid--3 {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Operations Dashboard (pioneer_dashboard_light inspired)
   ============================================================ */

.ops-dashboard-page {
    font-family: "SF Pro Display", -apple-system, "Segoe UI", sans-serif;
    background: #eef1f6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.ops-dashboard-page .shell {
    display: flex;
    height: 100vh;
    min-height: 720px;
    overflow: hidden;
}

.ops-dashboard-page .sidebar {
    width: 220px;
    min-width: 220px;
    height: auto;
    position: static;
    padding: 0;
    border-right: 1px solid #e8ebf0;
    background: #ffffff;
    color: #1a1d23;
}

.ops-dashboard-page .sidebar.collapsed {
    width: 220px;
    min-width: 220px;
}

.ops-dashboard-page .sidebar.collapsed .brand,
.ops-dashboard-page .sidebar.collapsed .user-box .info,
.ops-dashboard-page .sidebar.collapsed .user-box .role,
.ops-dashboard-page .sidebar.collapsed .user-box .user-email,
.ops-dashboard-page .sidebar.collapsed .logout-btn,
.ops-dashboard-page .sidebar.collapsed .badge-text,
.ops-dashboard-page .sidebar.collapsed .page-subtitle {
    display: initial !important;
}

.ops-dashboard-page .sidebar.collapsed .user-box {
    padding: 8px 10px;
    border: 0.5px solid #bdd4ea;
    background: #f4f8ff;
}

.ops-dashboard-page .sidebar.collapsed .user-box .avatar {
    margin: 0;
}

.ops-dashboard-page .sidebar-top {
    margin: 0;
    padding: 16px 18px 14px;
    border-bottom: 0.5px solid #eef1f6;
}

.ops-dashboard-page .sidebar-toggle,
.ops-dashboard-page .sidebar-toggle-top {
    display: none !important;
}

.ops-dashboard-page .brand {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: #164e7b;
    letter-spacing: 0.01em;
}

.ops-dashboard-page .brand::before {
    content: "P";
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #164e7b;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.5px;
    flex: 0 0 30px;
}

.ops-dashboard-page .user-box {
    margin: 0;
    border: 0;
    border-bottom: 0.5px solid #eef1f6;
    border-radius: 0;
    background: transparent;
    padding: 12px 14px 10px;
}

.ops-dashboard-page .user-box .info {
    gap: 10px;
    padding: 8px 10px;
    border-radius: 9px;
    background: #f4f8ff;
    border: 0.5px solid #bdd4ea;
    align-items: flex-start;
}

.ops-dashboard-page .user-box .avatar {
    width: 32px;
    min-width: 32px;
    height: 32px;
    margin-right: 0;
    background: #164e7b;
    font-size: 11px;
}

.ops-dashboard-page .user-box .name {
    margin: 0;
    font-size: 12px;
    line-height: 1.2;
    color: #164e7b;
    font-weight: 700;
}

.ops-dashboard-page .user-box .role {
    margin: 0;
    font-size: 9px;
    color: #888;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ops-dashboard-page .user-box .user-email {
    margin: 0;
    font-size: 10px;
    color: #aaa;
    line-height: 1.3;
}

.ops-dashboard-page .sidebar nav {
    padding: 10px 10px;
    overflow-y: auto;
}

.ops-dashboard-page .sidebar nav::before {
    content: "Menu";
    display: block;
    margin: 0 0 5px 8px;
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #bbb;
    font-weight: 700;
}

.ops-dashboard-page .nav-link {
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 1px;
    gap: 9px;
    color: #888;
    font-size: 12px;
    font-weight: 400;
}

.ops-dashboard-page .nav-link .nav-text {
    color: inherit;
    font-size: 12px;
    font-weight: 400;
}

.ops-dashboard-page .nav-icon {
    width: 14px;
    min-width: 14px;
    height: 14px;
    color: #999;
    font-size: 12px;
}

.ops-dashboard-page .nav-icon i {
    display: none;
}

.ops-dashboard-page .nav-icon-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
}

.ops-dashboard-page .nav-icon-svg svg {
    width: 14px;
    height: 14px;
    display: block;
}

.ops-dashboard-page .notify-icon i {
    display: none;
}

.ops-dashboard-page .notify-icon-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.ops-dashboard-page .notify-icon-svg svg {
    width: 24px;
    height: 24px;
    display: block;
}

.ops-dash-shell .stat-card-icon-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ops-dash-shell .stat-card-icon-svg svg {
    width: 100%;
    height: 100%;
    display: block;
}

.ops-dash-shell .stat-card-icon i {
    display: none;
}

.ops-dashboard-page .nav-link.active {
    background: #164e7b;
    color: #fff;
}

.ops-dashboard-page .nav-link.active .nav-icon,
.ops-dashboard-page .nav-link.active .nav-text {
    color: #fff;
}

.ops-dashboard-page .nav-link.active .nav-text {
    font-weight: 600;
}

.ops-dashboard-page .nav-link:hover {
    background: #f4f8ff;
    color: #164e7b;
}

.ops-dashboard-page .nav-link.active:hover {
    background: #164e7b;
    color: #fff;
}

.ops-dashboard-page .nav-link:hover .nav-icon,
.ops-dashboard-page .nav-link:hover .nav-text {
    color: #164e7b;
}

.ops-dashboard-page .nav-link.active:hover .nav-icon,
.ops-dashboard-page .nav-link.active:hover .nav-text {
    color: #fff;
}

.ops-dashboard-page .badge-text {
    margin-left: auto;
    background: #41b493;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    border-radius: 10px;
    padding: 2px 6px;
}

.ops-dashboard-page .sidebar form {
    margin-top: auto;
    padding: 12px;
    border-top: 0.5px solid #eef1f6;
}

.ops-dashboard-page .logout-btn {
    margin: 0;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e6ec;
    border-radius: 8px;
    background: #fff;
    color: #888;
    font-size: 12px;
    font-weight: 500;
    box-shadow: none;
}

.ops-dashboard-page .logout-btn:hover {
    background: #f8fafc;
    border-color: #cfd7e1;
    color: #667085;
}

.ops-dashboard-page .main {
    flex: 1;
    min-width: 0;
    padding: 0;
    overflow-y: auto;
    background: #eef1f6;
    display: flex;
    flex-direction: column;
}

.ops-dashboard-page .main-head {
    margin: 0;
    padding: 18px 24px 16px;
    border-bottom: 1px solid #e8ebf0;
    background: #fff;
    align-items: center;
}

/* Align back-link with the title inside .main-head (which has 24px left padding).
   margin-left: 12px = 24px (main-head padding) - 12px (back-link left padding) */
.ops-dashboard-page .back-link {
    margin-left: 12px;
    margin-bottom: 0;
    padding-top: 14px;
    padding-bottom: 8px;
}

.ops-dashboard-page .page-title {
    margin: 0 0 3px;
    font-size: 18px;
    font-weight: 700;
    color: #164e7b;
    letter-spacing: -0.01em;
}

.ops-dashboard-page .page-subtitle {
    margin: 0;
    font-size: 11px;
    color: #888;
}

.ops-dashboard-page .notify-chip {
    position: relative;
    width: 50px;
    min-width: 50px;
    height: 50px;
    padding: 0;
    margin-right: 20px;
    border-radius: 12px;
    border: 0.5px solid #e2e4e9;
    background: #f4f6f9;
    justify-content: center;
}

.ops-dashboard-page .notify-chip .notify-icon {
    color: #444;
    font-size: 24px;
}

.ops-dashboard-page .notify-chip.unread {
    background: #eaf4ef;
    border-color: #b7dcca;
}

.ops-dashboard-page .notify-chip .count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #41b493;
    color: #fff;
    padding: 0;
    font-size: 10px;
    font-weight: 700;
    box-shadow: 0 0 0 2px #fff;
}

.ops-dash-shell {
    display: grid;
    gap: 12px;
    padding: 18px 20px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.ops-dash-shell .dash-row {
    display: grid;
    gap: 10px;
}

.ops-dash-shell .dash-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.ops-dash-shell .dash-stat-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ops-dash-shell .dash-stat-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ops-dash-shell .dash-panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ops-dash-shell .panel {
    border: 0.5px solid #dde1e8;
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
}

.ops-dash-shell .panel:hover {
    transform: none;
    box-shadow: none;
}

.ops-dash-shell .dash-card {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 14px 16px;
    border-top: 2px solid #164e7b;
    color: inherit;
}

.ops-dash-shell .dash-card--ticket,
.ops-dash-shell .dash-card--customers {
    border-top-color: #164e7b;
}

.ops-dash-shell .dash-card--open {
    border-top-color: #666666;
}

.ops-dash-shell .dash-card--resolved {
    border-top-color: #41b493;
}

.ops-dash-shell .stat-card-icon {
    width: 12px;
    min-width: 12px;
    height: 12px;
    border-radius: 0;
    background: transparent;
    border: 0;
    color: #164e7b;
    font-size: 12px;
    margin-top: 1px;
}

.ops-dash-shell .stat-card-icon--open {
    color: #666666;
}

.ops-dash-shell .stat-card-icon--resolved {
    color: #41b493;
}

.ops-dash-shell .stat-card-body {
    gap: 3px;
}

.ops-dash-shell .stat-card-label {
    margin: 0;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #888;
}

.ops-dash-shell .stat-card-value {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.03em;
    color: #164e7b;
}

.ops-dash-shell .dash-card--open .stat-card-value {
    color: #666666;
}

.ops-dash-shell .dash-card--resolved .stat-card-value {
    color: #41b493;
}

.ops-dash-shell .stat-card-unit {
    font-size: 12px;
    font-weight: 500;
    color: #aaa;
}

.ops-dash-shell .stat-card-sub {
    margin: 0;
    font-size: 10px;
    color: #aaa;
}

.ops-dash-shell .dash-metric-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-top: 0.5px solid #dde1e8;
}

.ops-dash-shell .dash-metric-card .stat-card-icon {
    width: 42px;
    min-width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 0.5px solid #bdd4ea;
    background: #f0f7ff;
    color: #164e7b;
}

.ops-dash-shell .dash-metric-card .stat-card-icon--open {
    border-color: #fdba74;
    background: #fff7ed;
    color: #f97316;
}

.ops-dash-shell .dash-metric-card .stat-card-value {
    font-size: 24px;
    letter-spacing: -0.02em;
    color: #164e7b;
}

.ops-dash-shell .dash-section-card {
    padding: 0;
    overflow: hidden;
}

.ops-dash-shell .dash-section-head {
    padding: 13px 16px;
    border-bottom: 0.5px solid #eef1f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ops-dash-shell .dash-section-head h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #164e7b;
}

.ops-dash-shell .dash-section-note {
    margin: 4px 0 0;
    font-size: 11px;
    color: #8a94a6;
}

.ops-dash-shell .dash-section-title {
    margin: 0;
    padding: 13px 16px;
    border-bottom: 0.5px solid #eef1f6;
    font-size: 13px;
    font-weight: 700;
    color: #164e7b;
}

.ops-dash-shell .dash-view-link {
    font-size: 11px;
    color: #41b493;
    font-weight: 600;
    text-decoration: none;
}

.ops-dash-shell .dash-view-link:hover {
    text-decoration: underline;
}

.ops-dash-shell .dash-workload-list {
    display: grid;
    gap: 0;
    padding: 0 16px 8px;
}

.ops-dash-shell .dash-workload-row {
    display: grid;
    grid-template-columns: minmax(220px, 0.9fr) minmax(160px, 1fr) minmax(48px, auto);
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 0.5px solid #f4f6f9;
    color: #1a1d23;
    text-decoration: none;
}

.ops-dash-shell .dash-workload-row:last-child {
    border-bottom: 0;
}

.ops-dash-shell .dash-workload-row:hover {
    color: #164e7b;
}

.ops-dash-shell .dash-workload-agent {
    display: flex;
    min-width: 0;
    align-items: center;
}

.ops-dash-shell .dash-workload-agent strong,
.ops-dash-shell .dash-workload-agent span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ops-dash-shell .dash-workload-agent strong {
    font-size: 13px;
}

.ops-dash-shell .dash-workload-agent span {
    margin-top: 2px;
    font-size: 11px;
    color: #8a94a6;
}

.ops-dash-shell .dash-workload-meter {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #eef1f6;
}

.ops-dash-shell .dash-workload-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #41b493;
}

.ops-dash-shell .dash-workload-count {
    min-width: 36px;
    text-align: right;
    font-size: 18px;
    color: #164e7b;
}

.ops-dash-shell .dash-workload-row--unassigned .dash-workload-meter span {
    background: #f97316;
}

.ops-dash-shell .dash-table-wrap {
    padding: 0 16px;
}

.ops-dash-shell .dash-table {
    width: 100%;
    border-collapse: collapse;
}

.ops-dash-shell .dash-table th {
    padding: 8px 0;
    border-bottom: 0.5px solid #eef1f6;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #aaa;
}

.ops-dash-shell .dash-table td {
    padding: 12px 0;
    border-bottom: 0.5px solid #f4f6f9;
    font-size: 13px;
    color: #1a1d23;
    vertical-align: middle;
}

.ops-dash-shell .dash-table tbody tr:last-child td {
    border-bottom: 0;
}

.ops-dash-shell .dash-table tbody tr:hover {
    background: transparent;
}

.ops-dash-shell .dash-th-right,
.ops-dash-shell .dash-td-right {
    text-align: right;
}

.ops-dash-shell .dash-month-dot {
    width: 6px;
    height: 6px;
    margin-right: 8px;
    background: #41b493;
}

.ops-dash-shell .ref-link,
.ops-dash-shell .dashboard-table-link,
.ops-dash-shell .dash-table td a {
    color: #164e7b;
}

.ops-dash-shell .dash-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    border: 0.5px solid #dbe3ea;
    background: #f4f6f9;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ops-dash-shell .dash-status-closed,
.ops-dash-shell .dash-status-resolved {
    background: #f0fbf7;
    border-color: #a7e3cf;
    color: #2d8a6e;
}

.ops-dash-shell .dash-status-open,
.ops-dash-shell .dash-status-in_progress,
.ops-dash-shell .dash-status-waiting_on_customer {
    background: #eef5ff;
    border-color: #bdd4ea;
    color: #164e7b;
}

.ops-dash-shell .dash-status-pending {
    background: #fff7ed;
    border-color: #fdba74;
    color: #b45309;
}

.ops-dash-shell .dash-status-rejected,
.ops-dash-shell .dash-status-spam {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

@media (max-width: 1180px) {
    .ops-dash-shell .dash-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .ops-dashboard-page .shell {
        margin: 0;
        border-radius: 0;
        border: 0;
        min-height: 100vh;
        height: auto;
    }

    .ops-dashboard-page .sidebar {
        width: 100%;
        min-width: 0;
        border-right: 0;
        border-bottom: 1px solid #e8ebf0;
    }

    .ops-dashboard-page .main-head {
        padding: 16px;
    }

    .ops-dash-shell .dash-panel-grid {
        grid-template-columns: 1fr;
    }

    .ops-dash-shell .dash-workload-row {
        grid-template-columns: minmax(180px, 1fr) minmax(120px, 0.7fr) minmax(44px, auto);
    }
}

@media (max-width: 640px) {
    .ops-dash-shell {
        padding: 14px;
    }

    .ops-dash-shell .dash-stat-grid,
    .ops-dash-shell .dash-stat-grid--2,
    .ops-dash-shell .dash-stat-grid--3 {
        grid-template-columns: 1fr;
    }

    .ops-dash-shell .dash-section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .ops-dash-shell .dash-workload-row {
        grid-template-columns: minmax(0, 1fr) minmax(44px, auto);
        gap: 8px 12px;
    }

    .ops-dash-shell .dash-workload-meter {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .ops-dash-shell .dash-table th,
    .ops-dash-shell .dash-table td {
        font-size: 12px;
    }
}

/* ============================================================
   Tickets Index (pioneer_tickets_light inspired)
   ============================================================ */

.ops-tickets-page {
    font-family: "SF Pro Display", -apple-system, "Segoe UI", sans-serif;
    background: #eef1f6;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.ops-tickets-page .shell {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

.ops-tickets-page .sidebar {
    width: 220px;
    min-width: 220px;
    height: auto;
    position: static;
    padding: 0;
    border-right: 1px solid #e8ebf0;
    background: #ffffff;
    color: #1a1d23;
}

.ops-tickets-page .sidebar.collapsed {
    width: 220px;
    min-width: 220px;
}

.ops-tickets-page .sidebar.collapsed .brand,
.ops-tickets-page .sidebar.collapsed .user-box .info,
.ops-tickets-page .sidebar.collapsed .user-box .role,
.ops-tickets-page .sidebar.collapsed .user-box .user-email,
.ops-tickets-page .sidebar.collapsed .logout-btn,
.ops-tickets-page .sidebar.collapsed .badge-text,
.ops-tickets-page .sidebar.collapsed .page-subtitle,
.ops-tickets-page .sidebar.collapsed .nav-text {
    display: initial !important;
}

.ops-tickets-page .sidebar.collapsed .user-box {
    padding: 8px 10px;
    border: 0.5px solid #bdd4ea;
    background: #f4f8ff;
}

.ops-tickets-page .sidebar.collapsed .user-box .avatar {
    margin: 0;
}

.ops-tickets-page .sidebar-top {
    margin: 0;
    padding: 16px 18px 14px;
    border-bottom: 0.5px solid #eef1f6;
}

.ops-tickets-page .sidebar-toggle,
.ops-tickets-page .sidebar-toggle-top {
    display: none !important;
}

.ops-tickets-page .brand {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: #164e7b;
    letter-spacing: 0.01em;
}

.ops-tickets-page .brand::before {
    content: "P";
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #164e7b;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.5px;
    flex: 0 0 30px;
}

.ops-tickets-page .user-box {
    margin: 0;
    border: 0;
    border-bottom: 0.5px solid #eef1f6;
    border-radius: 0;
    background: transparent;
    padding: 12px 14px 10px;
}

.ops-tickets-page .user-box .info {
    gap: 10px;
    padding: 8px 10px;
    border-radius: 9px;
    background: #f4f8ff;
    border: 0.5px solid #bdd4ea;
    align-items: flex-start;
}

.ops-tickets-page .user-box .avatar {
    width: 32px;
    min-width: 32px;
    height: 32px;
    margin-right: 0;
    background: #164e7b;
    font-size: 11px;
}

.ops-tickets-page .user-box .name {
    margin: 0;
    font-size: 12px;
    line-height: 1.2;
    color: #164e7b;
    font-weight: 700;
}

.ops-tickets-page .user-box .role {
    margin: 0;
    font-size: 9px;
    color: #888;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ops-tickets-page .user-box .user-email {
    margin: 0;
    font-size: 10px;
    color: #aaa;
    line-height: 1.3;
}

.ops-tickets-page .sidebar nav {
    padding: 10px 10px;
    overflow-y: auto;
}

.ops-tickets-page .sidebar nav::before {
    content: "Menu";
    display: block;
    margin: 0 0 5px 8px;
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #bbb;
    font-weight: 700;
}

.ops-tickets-page .nav-link {
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 1px;
    gap: 9px;
    color: #888;
    font-size: 12px;
    font-weight: 400;
}

.ops-tickets-page .nav-link .nav-text {
    color: inherit;
    font-size: 12px;
    font-weight: 400;
}

.ops-tickets-page .nav-icon {
    width: 14px;
    min-width: 14px;
    height: 14px;
    color: #999;
    font-size: 12px;
}

.ops-tickets-page .nav-icon i {
    display: none;
}

.ops-tickets-page .nav-icon-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
}

.ops-tickets-page .nav-icon-svg svg {
    width: 14px;
    height: 14px;
    display: block;
}

.ops-tickets-page .notify-icon i {
    display: none;
}

.ops-tickets-page .notify-icon-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.ops-tickets-page .notify-icon-svg svg {
    width: 24px;
    height: 24px;
    display: block;
}

.ops-tickets-page .nav-link.active {
    background: #164e7b;
    color: #fff;
}

.ops-tickets-page .nav-link.active .nav-icon,
.ops-tickets-page .nav-link.active .nav-text {
    color: #fff;
}

.ops-tickets-page .nav-link.active .nav-text {
    font-weight: 600;
}

.ops-tickets-page .nav-link:hover {
    background: #f4f8ff;
    color: #164e7b;
    text-decoration: none;
}

.ops-tickets-page .nav-link:hover .nav-icon,
.ops-tickets-page .nav-link:hover .nav-text {
    color: #164e7b;
}

.ops-tickets-page .nav-link.active:hover {
    background: #164e7b;
    color: #fff;
}

.ops-tickets-page .nav-link.active:hover .nav-icon,
.ops-tickets-page .nav-link.active:hover .nav-text {
    color: #fff;
}

.ops-tickets-page .badge-text {
    margin-left: auto;
    background: #41b493;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    border-radius: 10px;
    padding: 2px 6px;
}

.ops-tickets-page .sidebar form {
    margin-top: auto;
    padding: 12px;
    border-top: 0.5px solid #eef1f6;
}

.ops-tickets-page .logout-btn {
    margin: 0;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e6ec;
    border-radius: 8px;
    background: #fff;
    color: #888;
    font-size: 12px;
    font-weight: 500;
    box-shadow: none;
}

.ops-tickets-page .logout-btn:hover {
    background: #f8fafc;
    border-color: #cfd7e1;
    color: #667085;
}

.ops-tickets-page .main {
    flex: 1;
    min-width: 0;
    padding: 0;
    overflow-y: auto;
    background: #eef1f6;
    display: flex;
    flex-direction: column;
}

.ops-tickets-page .main-head {
    margin: 0;
    padding: 18px 28px;
    border-bottom: 1px solid #e8ebf0;
    background: #fff;
    align-items: flex-start;
}

.ops-tickets-page .main-head-title {
    gap: 12px;
}

.ops-tickets-page .main-head .back-link {
    margin-bottom: 6px;
}

.ops-tickets-page .page-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #164e7b;
    letter-spacing: -0.01em;
}

.ops-tickets-page .page-subtitle {
    margin: 0;
    font-size: 11px;
    color: #888;
}

.ops-tickets-page .tickets-head-total {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 13px;
    background: #f0f7ff;
    border: 0.5px solid #bdd4ea;
    border-radius: 20px;
    font-size: 11px;
    color: #164e7b;
    font-weight: 600;
}

.ops-tickets-page .notify-chip {
    position: relative;
    width: 50px;
    min-width: 50px;
    height: 50px;
    padding: 0;
    margin-right: 20px;
    border-radius: 12px;
    border: 0.5px solid #e2e4e9;
    background: #f4f6f9;
    justify-content: center;
}

.ops-tickets-page .notify-chip .notify-icon {
    color: #444;
    width: 24px;
    min-width: 24px;
    height: 24px;
}

.ops-tickets-page .notify-chip.unread {
    background: #eaf4ef;
    border-color: #b7dcca;
}

.ops-tickets-page .notify-chip .count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #41b493;
    color: #fff;
    padding: 0;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px #fff;
}

.ops-tickets-page .ticket-index-shell {
    display: grid;
    gap: 0;
    padding: 0;
}

.ops-tickets-page .panel {
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
}

.ops-tickets-page .panel:hover {
    transform: none;
    box-shadow: none;
}

.ops-tickets-page .ticket-index-hero {
    position: relative;
    overflow: hidden;
    padding: 20px 24px;
    border: 0;
    background: linear-gradient(135deg, #1E3A5F 0%, #1D4ED8 100%);
}

.ops-tickets-page .ticket-index-hero::before {
    content: "";
    position: absolute;
    right: -20px;
    top: -30px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
}

.ops-tickets-page .ticket-index-hero::after {
    content: "";
    position: absolute;
    right: 40px;
    bottom: -40px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
}

.ops-tickets-page .ticket-index-hero-main {
    position: relative;
    z-index: 1;
    margin-bottom: 18px;
}

.ops-tickets-page .ticket-kicker,
.ops-tickets-page .ticket-section-label {
    margin: 0 0 4px;
    font-size: 9.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #2563EB;
    font-weight: 700;
}

.ops-tickets-page .ticket-index-title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.ops-tickets-page .ticket-index-subtitle {
    margin: 0;
    max-width: none;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.6;
    white-space: nowrap;
}

.ops-tickets-page .ticket-hero-badges {
    display: none;
}

.ops-tickets-page .chat-pill {
    padding: 5px 12px;
    background: #f4f6f9;
    border: 0.5px solid #e2e4e9;
    border-radius: 20px;
    font-size: 11px;
    color: #666666;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.ops-tickets-page .ticket-index-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 0;
    position: relative;
    z-index: 1;
}

.ops-tickets-page .ticket-index-stat {
    background: rgba(255, 255, 255, 0.09);
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    padding: 12px 14px;
}

.ops-tickets-page .ticket-index-stat:nth-child(2) {
    background: rgba(252, 211, 77, 0.15);
    border-color: rgba(252, 211, 77, 0.3);
}

.ops-tickets-page .ticket-index-stat:nth-child(3) {
    background: rgba(110, 231, 183, 0.18);
    border-color: rgba(110, 231, 183, 0.35);
}

.ops-tickets-page .ticket-index-stat-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.ops-tickets-page .ticket-index-stat-icon {
    width: 12px;
    min-width: 12px;
    height: 12px;
    color: rgba(255, 255, 255, 0.5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ops-tickets-page .ticket-index-stat-icon svg {
    width: 12px;
    height: 12px;
}

.ops-tickets-page .ticket-index-stat-label {
    margin: 0;
    color: rgba(255, 255, 255, 0.45);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.ops-tickets-page .ticket-index-stat:nth-child(2) .ticket-index-stat-label {
    color: #FCD34D;
}

.ops-tickets-page .ticket-index-stat:nth-child(3) .ticket-index-stat-label {
    color: #6EE7B7;
}

.ops-tickets-page .ticket-index-stat-value {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
    letter-spacing: -0.02em;
}

.ops-tickets-page .ticket-index-stat:nth-child(2) .ticket-index-stat-value {
    color: #FCD34D;
}

.ops-tickets-page .ticket-index-stat:nth-child(3) .ticket-index-stat-value {
    color: #6EE7B7;
}

.ops-tickets-page .ticket-control-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 0;
    align-items: start;
}

.ops-tickets-page .ticket-panel {
    padding: 0;
    overflow: hidden;
}

.ops-tickets-page .ticket-intake-panel {
    position: sticky;
    top: 0;
    border-left: 1px solid #E4E6EA;
    background: #fff;
}

.ops-tickets-page .ticket-panel-head {
    margin: 0;
    padding: 16px 20px 14px;
    border-bottom: 0.5px solid #eef1f6;
}

.ops-tickets-page .ticket-intake-panel .ticket-panel-head {
    padding: 16px 16px 10px;
    border-bottom: 0;
}

.ops-tickets-page .ticket-intake-panel .ticket-panel-head h3 {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.ops-tickets-page .req-star {
    display: inline;
    color: #EF4444;
    font-weight: 600;
    font-style: normal;
    margin-left: 1px;
}

.ops-tickets-page .ticket-intake-panel .ticket-panel-head .muted {
    font-size: 11px;
    color: #9CA3AF;
    line-height: 1.4;
    margin: 2px 0 0;
}

.ops-tickets-page .ticket-panel-head h3 {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.ops-tickets-page .ticket-panel-head .muted {
    margin: 0;
    font-size: 11px;
    color: #888;
}

.ops-tickets-page .ticket-form-grid {
    gap: 9px;
    padding: 8px 16px 16px;
}

.ops-tickets-page .chat-field {
    display: block;
    font-weight: 600;
}

.ops-tickets-page .chat-field span {
    display: block;
    margin-bottom: 3px;
    font-size: 10.5px;
    font-weight: 500;
    color: #6B7280;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ops-tickets-page .chat-field input,
.ops-tickets-page .chat-field select,
.ops-tickets-page .chat-field textarea {
    width: 100%;
    padding: 6px 9px;
    border: 1px solid #E4E6EA;
    border-radius: 7px;
    background: #F8F9FB;
    color: #111827;
    font-size: 12px;
    font-weight: 400;
    box-shadow: none;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.ops-tickets-page .chat-field input:focus,
.ops-tickets-page .chat-field select:focus,
.ops-tickets-page .chat-field textarea:focus {
    border-color: #93C5FD;
    background: #fff;
    outline: none;
}

.ops-tickets-page .chat-field input::placeholder,
.ops-tickets-page .chat-field textarea::placeholder {
    color: #9CA3AF;
}

.ops-tickets-page .chat-field select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
}

.ops-tickets-page .chat-field textarea {
    height: 70px;
    min-height: unset;
    line-height: 1.5;
    resize: none;
}

.ops-tickets-page .ticket-info-card {
    padding: 10px 13px;
    border-left: 3px solid #2563EB;
    border-radius: 0 8px 8px 0;
    border: 0.5px solid #BFDBFE;
    background: #EFF6FF;
}

.ops-tickets-page .ticket-info-card-icon {
    display: none;
}

.ops-tickets-page .ticket-info-card-icon svg {
    width: 13px;
    height: 13px;
}

.ops-tickets-page .ticket-info-card-copy {
    display: grid;
    gap: 1px;
}

.ops-tickets-page .ticket-info-card-label {
    display: none;
}

.ops-tickets-page .ticket-info-card strong {
    margin: 0;
    font-size: 10px;
    font-weight: 700;
    color: #2563EB;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ops-tickets-page .ticket-info-card .muted {
    margin: 0;
    font-size: 11px;
    color: #666;
}

.ops-tickets-page .ticket-form-actions button {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px;
    border-radius: 8px;
    border: 0;
    background: #16A34A;
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: none;
}

.ops-tickets-page .ticket-submit-icon {
    width: 13px;
    min-width: 13px;
    height: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ops-tickets-page .ticket-submit-icon svg {
    width: 13px;
    height: 13px;
}

.ops-tickets-page .ticket-form-actions button:hover {
    background: #15803D;
    border: 0;
    transform: none;
    box-shadow: none;
}

.ops-tickets-page .ticket-list-panel {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-right: 1px solid #E4E6EA;
}

.ops-tickets-page .ticket-list-head {
    display: block;
    padding: 16px 20px 14px;
    border-bottom: 0.5px solid #eef1f6;
    margin: 0;
}

.ops-tickets-page .ticket-list-head-content {
    display: block;
}

.ops-tickets-page .ticket-list-head-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 2px;
}

.ops-tickets-page .ticket-list-head h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.ops-tickets-page .ticket-list-head .muted {
    margin: 0;
    font-size: 11px;
    color: #888;
}

.ops-tickets-page .ticket-list-summary {
    display: block;
    font-size: 10px;
    color: #aaa;
    line-height: 1;
    white-space: nowrap;
    margin: 0;
}

.ops-tickets-page .ticket-inline-filters-wrap {
    padding: 12px 16px;
    border-bottom: 0.5px solid #eef1f6;
}

/* The filter form itself is ONE continuous CSS grid that holds all 5
   filter fields plus the action-button row. The two row wrappers
   (--primary / --with-actions) collapse out of the visual tree via
   `display: contents`, so their children become direct grid items and
   sit on a single row at wide widths. This matches the "utility bar"
   intent — compact, horizontal, minimum vertical footprint. */
.ops-tickets-page .ticket-inline-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px 12px;
    align-items: end;
    margin-bottom: 0;
}

.ops-tickets-page .ticket-inline-filter-row--primary,
.ops-tickets-page .ticket-inline-filter-row--with-actions {
    display: contents;
}

/* Apply / Reset live alongside the search/customer row. */
.ops-tickets-page .ticket-inline-filter-row--with-actions .ticket-inline-filter-actions {
    grid-column: auto;
    justify-content: flex-start;
    align-self: end;
    margin: 0;
}

/* Individual filter fills its grid cell — grid handles the width now, so
   we explicitly neutralise the old flex sizing to prevent inheritance. */
.ops-tickets-page .ticket-inline-filter {
    flex: none;
    min-width: 0;
    max-width: none;
    width: 100%;
}

.ops-tickets-page .ticket-inline-filter-search {
    flex: none;
    max-width: none;
    min-width: 0;
    width: 100%;
    grid-column: span 2;
}

.ops-tickets-page .ticket-inline-filter span {
    margin-bottom: 4px;
}

.ops-tickets-page .ticket-inline-filter select {
    padding: 7px 10px;
}

.ops-tickets-page .ticket-search-input {
    position: relative;
}

.ops-tickets-page .ticket-search-input input {
    padding-left: 30px;
    padding-right: 32px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.ops-tickets-page .ticket-search-input input:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.ops-tickets-page .ticket-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    width: 12px;
    height: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.ops-tickets-page .ticket-search-icon svg {
    width: 12px;
    height: 12px;
    display: block;
}

.ops-tickets-page .ticket-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: #9ca3af;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.ops-tickets-page .ticket-search-clear svg {
    width: 9px;
    height: 9px;
    display: block;
}

.ops-tickets-page .ticket-search-clear:hover {
    color: #4b5563;
    background: #f0f2f5;
}

.ops-tickets-page .ticket-search-clear[hidden] {
    display: none;
}

.ops-tickets-page .ticket-inline-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 0;
}

.ops-tickets-page .ticket-inline-filter-actions button,
.ops-tickets-page .ticket-inline-filter-actions .btn {
    width: auto;
    margin: 0;
    transform: none;
    box-shadow: none;
}

.ops-tickets-page .ticket-inline-filter-actions button {
    padding: 8px 20px;
    border: 0;
    border-radius: 7px;
    background: #2563EB;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.ops-tickets-page .ticket-inline-filter-actions button:hover {
    background: #1e40af;
    border: 0;
    transform: none;
    box-shadow: none;
}

.ops-tickets-page .ticket-inline-filter-actions .btn.secondary {
    padding: 8px 16px;
    border-radius: 7px;
    border: 1px solid #e2e6ec;
    background: #fff;
    color: #666666;
    font-size: 12px;
    font-weight: 500;
}

.ops-tickets-page .ticket-inline-filter-actions .btn.secondary:hover {
    background: #f8fafc;
    border-color: #c4cbd3;
    color: #4b5563;
}

/* Customer searchable combobox */
.cs-wrap {
    position: relative;
}

.cs-control {
    display: flex;
    align-items: center;
    position: relative;
}

.cs-input {
    width: 100%;
    padding: 7px 56px 7px 10px;
    border: 0.5px solid #d1d5db;
    border-radius: 7px;
    font: inherit;
    font-size: 13px;
    background: #fff;
    color: #1a2b4a;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    cursor: pointer;
}

.cs-input:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
    cursor: text;
}

.cs-open .cs-input {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-color: #2563EB;
    box-shadow: none;
}

.cs-clear,
.cs-chevron {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: #9ca3af;
    border-radius: 50%;
    transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.cs-clear {
    right: 28px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    pointer-events: auto;
    color: #6b7280;
}

.cs-clear[hidden] {
    display: none;
}

.cs-clear:hover {
    color: #374151;
    background: #f0f2f5;
}

.cs-chevron {
    right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    pointer-events: auto;
}

.cs-chevron:hover {
    color: #4b5563;
}

.cs-open .cs-chevron {
    transform: translateY(-50%) rotate(180deg);
}

.cs-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 0.5px solid #2563EB;
    border-top: none;
    border-bottom-left-radius: 7px;
    border-bottom-right-radius: 7px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.cs-option {
    padding: 7px 10px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cs-option-any {
    color: #9ca3af;
}

.cs-option:hover,
.cs-option.cs-active {
    background: #EFF6FF;
    color: #2563EB;
}

.cs-loading,
.cs-empty {
    padding: 10px;
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
}

.ops-tickets-page .ticket-bulk-form {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

.ops-tickets-page .ticket-bulk-toolbar {
    display: grid;
    grid-template-columns: minmax(145px, 1fr) minmax(170px, 220px) auto minmax(170px, 220px) auto;
    align-items: end;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid #E4E6EA;
    border-bottom: 1px solid #E4E6EA;
    background: #fbfcfe;
}

.ops-tickets-page .ticket-bulk-toolbar[hidden] {
    display: none;
}

.ops-tickets-page .ticket-bulk-summary {
    align-self: center;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
}

.ops-tickets-page .ticket-bulk-field {
    min-width: 0;
}

.ops-tickets-page .ticket-bulk-submit {
    min-height: 32px;
    padding: 0 12px;
    border: 0;
    border-radius: 7px;
    background: #2563EB;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}

.ops-tickets-page .ticket-bulk-submit:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.ops-tickets-page .ticket-bulk-submit--secondary {
    background: #1f2937;
}

.ops-tickets-page .ticket-table-wrap {
    padding: 0;
    border: 0;
    border-radius: 0;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ops-tickets-page .ticket-table {
    width: 100%;
    min-width: 840px;
    border-collapse: collapse;
}

.ops-tickets-page .ticket-table thead th {
    padding: 7px 12px;
    background: transparent;
    border-bottom: 1px solid #E4E6EA;
    font-size: 10px;
    color: #9CA3AF;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ops-tickets-page .ticket-select-cell {
    width: 44px;
    min-width: 44px;
    text-align: center;
}

.ops-tickets-page .ticket-select-cell input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2563EB;
    cursor: pointer;
}

.ops-tickets-page .ticket-select-cell input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.35;
}

.ops-tickets-page .ticket-table thead th:nth-child(2),
.ops-tickets-page .ticket-table tbody td:nth-child(2) {
    width: 95px;
}

.ops-tickets-page .ticket-table thead th:nth-child(4),
.ops-tickets-page .ticket-table tbody td:nth-child(4) {
    width: 150px;
}

.ops-tickets-page .ticket-table thead th:nth-child(5),
.ops-tickets-page .ticket-table tbody td:nth-child(5) {
    width: 110px;
}

.ops-tickets-page .ticket-table thead th:nth-child(6),
.ops-tickets-page .ticket-table tbody td:nth-child(6) {
    width: 180px;
}

.ops-tickets-page .ticket-table tbody td {
    padding: 9px 12px;
    border-bottom: 0.5px solid #eef1f6;
    font-size: 12px;
    color: #1a1d23;
    vertical-align: middle;
}

.ops-tickets-page .ticket-table tbody tr:last-child td {
    border-bottom: 0;
}

.ops-tickets-page .ticket-table tbody tr:hover {
    background: #fbfcfe;
    transform: none;
}

.ops-tickets-page .ticket-reference-cell {
    width: 90px;
    min-width: 90px;
}

.ops-tickets-page .ticket-subject-cell {
    min-width: 240px;
}

.ops-tickets-page .ticket-ref-link {
    font-size: 12px;
    font-weight: 700;
    color: #2563EB;
    text-decoration: none;
}

.ops-tickets-page .ticket-ref-link:hover {
    color: #1d4ed8;
    text-decoration: none;
}

.ops-tickets-page .ticket-subject {
    margin: 0 0 2px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    color: #374151;
}

.ops-tickets-page .ticket-inline-note {
    margin: 0;
    font-size: 11px;
    color: #888;
    line-height: 1.35;
}

.ops-tickets-page .ticket-customer-name,
.ops-tickets-page .ticket-owner {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
}

.ops-tickets-page .ticket-owner {
    font-weight: 600;
    color: #374151;
}

.ops-tickets-page .ticket-updated {
    font-size: 11px;
    font-weight: 400;
    color: #9CA3AF;
    font-family: monospace;
    white-space: nowrap;
}

.ops-tickets-page .ticket-ownership-cell {
    min-width: 170px;
}

.ops-tickets-page .ticket-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: capitalize;
    white-space: nowrap;
}

.ops-tickets-page .ticket-status-pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ops-tickets-page .ticket-status-pill--open,
.ops-tickets-page .ticket-status-pill--in_progress,
.ops-tickets-page .ticket-status-pill--waiting_on_customer {
    background: #dbeafe;
    color: #1d4ed8;
}

.ops-tickets-page .ticket-status-pill--open::before,
.ops-tickets-page .ticket-status-pill--in_progress::before,
.ops-tickets-page .ticket-status-pill--waiting_on_customer::before {
    background: #2563eb;
}

.ops-tickets-page .ticket-status-pill--resolved {
    background: #dcfce7;
    color: #15803d;
}

.ops-tickets-page .ticket-status-pill--resolved::before {
    background: #16a34a;
}

.ops-tickets-page .ticket-status-pill--closed {
    background: #f1f5f9;
    color: #64748b;
}

.ops-tickets-page .ticket-status-pill--closed::before {
    background: #94a3b8;
}

.ops-tickets-page .ticket-badge-stack {
    gap: 4px;
}

.ops-tickets-page .ticket-badge-stack .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ops-tickets-page .ticket-badge-stack .badge.open,
.ops-tickets-page .ticket-badge-stack .badge.in_progress,
.ops-tickets-page .ticket-badge-stack .badge.waiting_on_customer {
    background: #eef5ff;
    border-color: #bdd4ea;
    color: #164e7b;
}

.ops-tickets-page .ticket-badge-stack .badge.resolved,
.ops-tickets-page .ticket-badge-stack .badge.closed {
    background: #f0fbf7;
    border-color: #a7e3cf;
    color: #2d8a6e;
}

.ops-tickets-page .ticket-badge-stack .badge.pending {
    background: #fff7ed;
    border-color: #fdba74;
    color: #b45309;
}

.ops-tickets-page .ticket-badge-stack .badge.rejected,
.ops-tickets-page .ticket-badge-stack .badge.spam {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.ops-tickets-page .ticket-badge-stack .badge.sev1,
.ops-tickets-page .ticket-badge-stack .badge.sev2,
.ops-tickets-page .ticket-badge-stack .badge.sev3,
.ops-tickets-page .ticket-badge-stack .badge.sev4 {
    padding: 2px 8px;
    border-radius: 5px;
}

.ops-tickets-page .ticket-badge-stack .badge.sev1 {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

.ops-tickets-page .ticket-badge-stack .badge.sev2 {
    background: #ffedd5;
    border-color: #fdba74;
    color: #9a3412;
}

.ops-tickets-page .ticket-badge-stack .badge.sev3 {
    background: #fef9c3;
    border-color: #fde047;
    color: #854d0e;
}

.ops-tickets-page .ticket-badge-stack .badge.sev4 {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e3a8a;
}

.ops-tickets-page .ticket-empty-cell {
    padding: 36px 20px;
    text-align: center;
    background: #fff;
}

.ops-tickets-page .ticket-empty-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #EFF6FF;
    border: 0.5px solid #BFDBFE;
    color: #2563EB;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.ops-tickets-page .ticket-empty-icon svg {
    width: 18px;
    height: 18px;
}

.ops-tickets-page .ticket-empty-cell h4 {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}

.ops-tickets-page .ticket-empty-cell p {
    margin: 0;
    font-size: 11px;
    color: #aaa;
    line-height: 1.6;
}

.ops-tickets-page .ticket-pagination {
    padding: 10px 16px;
    border-top: 0.5px solid #eef1f6;
    justify-content: space-between;
}

.ops-tickets-page .ticket-pagination .muted {
    font-size: 10px;
    color: #bbb;
}

.ops-tickets-page .ticket-pagination-actions .btn.secondary {
    width: auto;
    padding: 7px 12px;
    border-radius: 7px;
    border: 1px solid #e2e6ec;
    background: #fff;
    color: #666666;
    font-size: 12px;
    font-weight: 500;
}

.ops-tickets-page .ticket-pagination-actions .btn.secondary:hover {
    background: #f8fafc;
    border-color: #c4cbd3;
    color: #4b5563;
}

@media (max-width: 1100px) {
    .ops-tickets-page .ticket-control-grid {
        grid-template-columns: 1fr;
    }

    .ops-tickets-page .ticket-intake-panel {
        position: static;
        border-left: 0;
        border-top: 1px solid #E4E6EA;
    }

    .ops-tickets-page .ticket-list-panel {
        border-right: 0;
    }
}

@media (max-width: 980px) {
    .ops-tickets-page .shell {
        margin: 0;
        border-radius: 0;
        border: 0;
        min-height: 100vh;
    }

    .ops-tickets-page .sidebar {
        width: 100%;
        min-width: 0;
        border-right: 0;
        border-bottom: 1px solid #e8ebf0;
    }

    .ops-tickets-page .main-head {
        padding: 16px;
    }

    .ops-tickets-page .ticket-index-shell {
        padding: 16px;
    }

    .ops-tickets-page .ticket-index-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ops-tickets-page .ticket-bulk-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1201px) {
    .ops-tickets-page .ticket-inline-filters {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .ops-tickets-page .ticket-inline-filter-search {
        grid-column: span 2;
    }
}

@media (max-width: 760px) {
    .ops-tickets-page .ticket-form-grid {
        grid-template-columns: 1fr;
    }

    /* Tablet: 2 per row → 2+2+1 layout (last field alone is acceptable here). */
    .ops-tickets-page .ticket-inline-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Phone: stack everything. */
@media (max-width: 480px) {
    .ops-tickets-page .ticket-inline-filters {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .ops-tickets-page .main-head {
        align-items: flex-start;
        gap: 10px;
        flex-direction: column;
    }

    .ops-tickets-page .ticket-list-head-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .ops-tickets-page .ticket-list-summary {
        white-space: normal;
    }

    .ops-tickets-page .ticket-index-shell {
        padding: 14px;
    }

    .ops-tickets-page .ticket-index-stats {
        grid-template-columns: 1fr;
    }

    .ops-tickets-page .ticket-bulk-toolbar {
        grid-template-columns: 1fr;
    }

    .ops-tickets-page .ticket-bulk-submit {
        width: 100%;
    }
}

/* ============================================================
   Unified Light Theme (Admin + Portal)
   ============================================================ */

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page),
body.ops-portal-page {
    font-family: "SF Pro Display", -apple-system, "Segoe UI", sans-serif;
    background: #eef1f6;
    color: #1a1d23;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.ops-portal-page {
    background: #fff;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .shell,
body.ops-portal-page .shell {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

body.ops-portal-page .shell {
    min-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar,
body.ops-portal-page .sidebar {
    width: 220px;
    min-width: 220px;
    height: auto;
    position: static;
    padding: 0;
    border-right: 1px solid #e8ebf0;
    background: #fff;
    color: #1a1d23;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed {
    width: 220px;
    min-width: 220px;
}

body.ops-portal-page .sidebar.collapsed {
    width: 62px;
    min-width: 62px;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed .brand,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed .user-box .info,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed .user-box .role,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed .user-box .user-email,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed .logout-btn,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed .badge-text,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed .nav-text {
    display: initial !important;
}

body.ops-portal-page .sidebar.collapsed .brand,
body.ops-portal-page .sidebar.collapsed .user-box .role,
body.ops-portal-page .sidebar.collapsed .user-box .user-email,
body.ops-portal-page .sidebar.collapsed .user-box .info > div,
body.ops-portal-page .sidebar.collapsed .logout-btn,
body.ops-portal-page .sidebar.collapsed .badge-text,
body.ops-portal-page .sidebar.collapsed .nav-text,
body.ops-portal-page .sidebar.collapsed nav::before {
    display: none !important;
}

body.ops-portal-page .sidebar.collapsed .user-box .info {
    justify-content: center;
    gap: 0;
    background: transparent !important;
    border: 0 !important;
    padding: 4px 0 !important;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed .user-box {
    padding: 8px 10px;
    border: 0.5px solid #bdd4ea;
    background: #f4f8ff;
}

body.ops-portal-page .sidebar.collapsed .user-box {
    padding: 8px 0;
    border: 0;
    background: transparent;
}

body.ops-portal-page .sidebar.collapsed .user-box .avatar {
    margin: 0 auto;
    display: inline-flex !important;
    flex-shrink: 0;
}

body.ops-portal-page .sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 8px;
}

body.ops-portal-page .sidebar.collapsed .sidebar-top {
    justify-content: center;
    padding: 12px 8px;
}

body.ops-portal-page .sidebar.collapsed form {
    padding: 8px 6px;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar-toggle,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar-toggle-top {
    display: none !important;
}

body.ops-portal-page .sidebar-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: #f0f4fa;
    border: 0.5px solid #d0d8e4;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    flex-shrink: 0;
}

body.ops-portal-page .sidebar-toggle .sidebar-icon,
body.ops-portal-page .sidebar-toggle svg {
    color: #164e7b !important;
    fill: #164e7b;
    width: 16px !important;
    height: 16px !important;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar-top,
body.ops-portal-page .sidebar-top {
    margin: 0;
    padding: 16px 18px 14px;
    border-bottom: 0.5px solid #eef1f6;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .brand,
body.ops-portal-page .brand {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: #164e7b;
    letter-spacing: 0.01em;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .brand::before,
body.ops-portal-page .brand::before {
    content: "P";
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #164e7b;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.5px;
    flex: 0 0 30px;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .user-box,
body.ops-portal-page .user-box {
    margin: 0;
    border: 0;
    border-bottom: 0.5px solid #eef1f6;
    border-radius: 0;
    background: transparent;
    padding: 12px 14px 10px;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .user-box .info,
body.ops-portal-page .user-box .info {
    gap: 10px;
    padding: 8px 10px;
    border-radius: 9px;
    background: #f4f8ff;
    border: 0.5px solid #bdd4ea;
    align-items: flex-start;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .user-box .avatar,
body.ops-portal-page .user-box .avatar {
    width: 32px;
    min-width: 32px;
    height: 32px;
    margin-right: 0;
    background: #164e7b;
    font-size: 11px;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .user-box .name,
body.ops-portal-page .user-box .name {
    margin: 0;
    font-size: 12px;
    line-height: 1.2;
    color: #164e7b;
    font-weight: 700;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .user-box .role,
body.ops-portal-page .user-box .role {
    margin: 0;
    font-size: 9px;
    color: #888;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .user-box .user-email,
body.ops-portal-page .user-box .user-email {
    margin: 0;
    font-size: 10px;
    color: #aaa;
    line-height: 1.3;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar nav,
body.ops-portal-page .sidebar nav {
    padding: 10px 10px;
    overflow-y: auto;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar nav::before,
body.ops-portal-page .sidebar nav::before {
    content: "Menu";
    display: block;
    margin: 0 0 5px 8px;
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #bbb;
    font-weight: 700;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .nav-link,
body.ops-portal-page .nav-link {
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 1px;
    gap: 9px;
    color: #888;
    font-size: 12px;
    font-weight: 400;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .nav-link .nav-text,
body.ops-portal-page .nav-link .nav-text {
    color: inherit;
    font-size: 12px;
    font-weight: 400;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .nav-icon {
    width: 14px;
    min-width: 14px;
    height: 14px;
    color: #999;
    font-size: 12px;
}

body.ops-portal-page .nav-icon {
    width: 18px;
    min-width: 18px;
    height: 18px;
    color: #374151;
    font-size: 13px;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .nav-icon i,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .notify-icon i,
body.ops-portal-page .nav-icon i,
body.ops-portal-page .notify-icon i {
    display: none;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .nav-icon-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
}

body.ops-portal-page .nav-icon-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .notify-icon-svg,
body.ops-portal-page .notify-icon-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .nav-icon-svg svg {
    width: 14px;
    height: 14px;
    display: block;
}

body.ops-portal-page .nav-icon-svg svg {
    width: 18px;
    height: 18px;
    display: block;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .notify-icon-svg svg,
body.ops-portal-page .notify-icon-svg svg {
    width: 24px;
    height: 24px;
    display: block;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .nav-link.active,
body.ops-portal-page .nav-link.active {
    background: #164e7b;
    color: #fff;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .nav-link.active .nav-icon,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .nav-link.active .nav-text,
body.ops-portal-page .nav-link.active .nav-icon,
body.ops-portal-page .nav-link.active .nav-text {
    color: #fff;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .nav-link.active .nav-text,
body.ops-portal-page .nav-link.active .nav-text {
    font-weight: 600;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .nav-link:hover,
body.ops-portal-page .nav-link:hover {
    background: #f4f8ff;
    color: #164e7b;
    text-decoration: none;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .nav-link:hover .nav-icon,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .nav-link:hover .nav-text,
body.ops-portal-page .nav-link:hover .nav-icon,
body.ops-portal-page .nav-link:hover .nav-text {
    color: #164e7b;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .nav-link.active:hover,
body.ops-portal-page .nav-link.active:hover {
    background: #164e7b;
    color: #fff;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .nav-link.active:hover .nav-icon,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .nav-link.active:hover .nav-text,
body.ops-portal-page .nav-link.active:hover .nav-icon,
body.ops-portal-page .nav-link.active:hover .nav-text {
    color: #fff;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .badge-text,
body.ops-portal-page .badge-text {
    margin-left: auto;
    background: #41b493;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    border-radius: 10px;
    padding: 2px 6px;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar form,
body.ops-portal-page .sidebar form {
    margin-top: auto;
    padding: 12px;
    border-top: 0.5px solid #eef1f6;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .logout-btn,
body.ops-portal-page .logout-btn {
    margin: 0;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e6ec;
    border-radius: 8px;
    background: #fff;
    color: #888;
    font-size: 12px;
    font-weight: 500;
    box-shadow: none;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .logout-btn:hover,
body.ops-portal-page .logout-btn:hover {
    background: #f8fafc;
    border-color: #cfd7e1;
    color: #667085;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main,
body.ops-portal-page .main {
    flex: 1;
    min-width: 0;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background: #eef1f6;
    display: flex;
    flex-direction: column;
}

body.ops-portal-page .main {
    min-height: 100vh;
    background: #fff;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main-head,
body.ops-portal-page .main-head {
    margin: 0;
    padding: 18px 24px 16px;
    border-bottom: 1px solid #e8ebf0;
    background: #fff;
    align-items: flex-start;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .page-title,
body.ops-portal-page .page-title {
    margin: 0 0 3px;
    font-size: 18px;
    font-weight: 700;
    color: #164e7b;
    letter-spacing: -0.01em;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .page-subtitle,
body.ops-portal-page .page-subtitle {
    margin: 0;
    font-size: 11px;
    color: #888;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .notify-chip,
body.ops-portal-page .notify-chip {
    position: relative;
    width: 50px;
    min-width: 50px;
    height: 50px;
    padding: 0;
    margin-right: 20px;
    border-radius: 12px;
    border: 0.5px solid #e2e4e9;
    background: #f4f6f9;
    justify-content: center;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .notify-chip .notify-icon,
body.ops-portal-page .notify-chip .notify-icon {
    color: #444;
    width: 24px;
    min-width: 24px;
    height: 24px;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .notify-chip.unread,
body.ops-portal-page .notify-chip.unread {
    background: #eaf4ef;
    border-color: #b7dcca;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .notify-chip .count,
body.ops-portal-page .notify-chip .count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #41b493;
    color: #fff;
    padding: 0;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px #fff;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main > :not(.main-head),
body.ops-portal-page .main > :not(.main-head) {
    margin-left: 0;
    margin-right: 0;
}

body.ops-admin-page:not(.ops-dashboard-page) .main-head .back-link,
body.ops-portal-page .main-head .back-link {
    margin-bottom: 6px;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main > .main-head + *,
body.ops-portal-page .main > .main-head + * {
    margin-top: 18px;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main > :last-child,
body.ops-portal-page .main > :last-child {
    margin-bottom: 20px;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .panel,
body.ops-portal-page .panel {
    border: 0.5px solid #dde1e8;
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .panel:hover,
body.ops-portal-page .panel:hover {
    transform: none;
    box-shadow: none;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main input,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main select,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main textarea,
body.ops-portal-page .main input,
body.ops-portal-page .main select,
body.ops-portal-page .main textarea {
    background: #f4f6f9;
    border: 0.5px solid #d1d5db;
    border-radius: 7px;
    color: #1a1d23;
    font-size: 13px;
    padding: 9px 12px;
    box-shadow: none;
    outline: none;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main textarea,
body.ops-portal-page .main textarea {
    line-height: 1.55;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main button,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .btn,
body.ops-portal-page .main button,
body.ops-portal-page .main .btn {
    border-radius: 8px;
    border: 0.5px solid #164e7b;
    background: #164e7b;
    color: #fff;
    box-shadow: none;
    transform: none;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main button:hover,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .btn:hover,
body.ops-portal-page .main button:hover,
body.ops-portal-page .main .btn:hover {
    background: #123f64;
    border-color: #123f64;
    box-shadow: none;
    transform: none;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main button.secondary,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .btn.secondary,
body.ops-portal-page .main button.secondary,
body.ops-portal-page .main .btn.secondary {
    border: 0.5px solid #d1d5db;
    background: transparent;
    color: #666;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main button.secondary:hover,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .btn.secondary:hover,
body.ops-portal-page .main button.secondary:hover,
body.ops-portal-page .main .btn.secondary:hover {
    border-color: #c4cbd3;
    background: #f8fafc;
    color: #4b5563;
}

body.ops-customers-page .main-head {
    margin-bottom: 4px;
}

body.ops-customers-page .main-head .page-title,
body.ops-customers-page .main-head .page-subtitle {
    display: none;
}

body.ops-customers-page .main-head-title > div {
    display: flex;
    align-items: center;
}

body.ops-customers-page .customer-create-toggle,
body.ops-customers-page .customer-create-toggle:hover,
body.ops-customers-page .customer-create-toggle:focus-visible {
    border: 0 !important;
    background: #ffffff !important;
    color: #111827 !important;
    box-shadow: none !important;
    transform: none !important;
}

body.ops-customers-page .customer-create-toggle-main strong {
    color: #0f172a;
}

body.ops-customers-page .customer-create-subtitle {
    color: #7c8ca1;
}

body.ops-customers-page .customer-create-toggle-action {
    border-color: #dbeafe;
    background: #f8fbff;
    color: #2563eb;
}

body.ops-customers-page .customer-search-form {
    align-items: stretch;
}

body.ops-customers-page .customer-search-form input {
    min-height: 44px;
}

body.ops-customers-page .customer-search-form button,
body.ops-customers-page .customer-search-form .btn {
    min-height: 44px;
    align-self: stretch;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main button.danger,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .btn.danger,
body.ops-portal-page .main button.danger,
body.ops-portal-page .main .btn.danger {
    border-color: #dc2626;
    background: #dc2626;
    color: #fff;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main button.danger:hover,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .btn.danger:hover,
body.ops-portal-page .main button.danger:hover,
body.ops-portal-page .main .btn.danger:hover {
    border-color: #b91c1c;
    background: #b91c1c;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main table th,
body.ops-portal-page .main table th {
    padding: 8px 0;
    border-bottom: 0.5px solid #eef1f6;
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #aaa;
    font-weight: 700;
    background: transparent;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main table td,
body.ops-portal-page .main table td {
    padding: 12px 0;
    border-bottom: 0.5px solid #f4f6f9;
    font-size: 13px;
    color: #1a1d23;
    vertical-align: middle;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main table tr:hover,
body.ops-portal-page .main table tr:hover {
    background: transparent;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .badge,
body.ops-portal-page .main .badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    border: 0.5px solid #dbe3ea;
    background: #f4f6f9;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .badge.open,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .badge.in_progress,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .badge.waiting_on_customer,
body.ops-portal-page .main .badge.open,
body.ops-portal-page .main .badge.in_progress,
body.ops-portal-page .main .badge.waiting_on_customer {
    background: #eef5ff;
    border-color: #bdd4ea;
    color: #164e7b;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .badge.resolved,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .badge.closed,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .badge.approved,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .badge.paid,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .badge.matched,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .badge.matched_manual,
body.ops-portal-page .main .badge.resolved,
body.ops-portal-page .main .badge.closed,
body.ops-portal-page .main .badge.approved,
body.ops-portal-page .main .badge.paid,
body.ops-portal-page .main .badge.matched,
body.ops-portal-page .main .badge.matched_manual {
    background: #f0fbf7;
    border-color: #a7e3cf;
    color: #2d8a6e;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .badge.pending,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .badge.waitlisted,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .badge.unmatched,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .badge.unpaid,
body.ops-portal-page .main .badge.pending,
body.ops-portal-page .main .badge.waitlisted,
body.ops-portal-page .main .badge.unmatched,
body.ops-portal-page .main .badge.unpaid {
    background: #fff7ed;
    border-color: #fdba74;
    color: #b45309;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .badge.rejected,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .badge.spam,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .badge.blocked,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .badge.overdue,
body.ops-portal-page .main .badge.rejected,
body.ops-portal-page .main .badge.spam,
body.ops-portal-page .main .badge.blocked,
body.ops-portal-page .main .badge.overdue {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .badge.sev1,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .badge.sev2,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .badge.sev3,
body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main .badge.sev4,
body.ops-portal-page .main .badge.sev1,
body.ops-portal-page .main .badge.sev2,
body.ops-portal-page .main .badge.sev3,
body.ops-portal-page .main .badge.sev4 {
    padding: 3px 9px;
    border-radius: 5px;
}

body.ops-portal-page .portal-home,
body.ops-portal-page .portal-chat-page {
    display: grid;
    gap: 12px;
}

body.ops-portal-page .portal-home-hero,
body.ops-portal-page .portal-chat-hero {
    padding: 16px 18px;
    background: #fff;
}

body.ops-portal-page .portal-ticket-hero {
    padding: 24px 28px;
    background: linear-gradient(135deg, #1E3A5F 0%, #1D4ED8 100%);
    border: 0;
    border-radius: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

body.ops-portal-page .portal-home-hero h2,
body.ops-portal-page .portal-chat-hero h2,
body.ops-portal-page .portal-ticket-hero h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    color: #164e7b;
}

body.ops-portal-page .portal-ticket-hero h2 {
    color: #fff;
    font-size: 22px;
    letter-spacing: -0.02em;
}

body.ops-portal-page .portal-ticket-hero .muted {
    color: rgba(255, 255, 255, 0.65);
}

body.ops-portal-page .portal-ticket-hero .portal-home-eyebrow {
    color: #93C5FD;
}

body.ops-portal-page .portal-ticket-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

body.ops-portal-page .portal-home-eyebrow {
    margin: 0 0 5px;
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #41b493;
    font-weight: 700;
}

body.ops-portal-page .portal-home-stats,
body.ops-portal-page .portal-chat-hero-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

body.ops-portal-page .portal-ticket-hero-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-self: flex-start;
}

body.ops-portal-page .portal-home-stat {
    border: 0.5px solid #e2e4e9;
    border-top: 2px solid #164e7b;
    border-radius: 8px;
    background: #f4f6f9;
    padding: 14px 16px;
}

body.ops-portal-page .portal-ticket-stat {
    border: 0.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    padding: 12px 16px;
    min-width: 110px;
}

body.ops-portal-page .portal-home-stat-label {
    margin: 0 0 8px;
    color: #666;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.ops-portal-page .portal-ticket-stat-label {
    display: block;
    margin: 0 0 6px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

body.ops-portal-page .portal-home-stat-value {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
    color: #164e7b;
    letter-spacing: -0.02em;
}

body.ops-portal-page .portal-ticket-stat-value {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}

body.ops-portal-page .portal-ticket-hero .portal-ticket-stat .badge {
    background: rgba(255, 255, 255, 0.18) !important;
    border-color: rgba(255, 255, 255, 0.28) !important;
    color: #fff !important;
    font-size: 9px;
    padding: 3px 8px;
}

body.ops-portal-page .portal-home-stat-value-link {
    display: inline-block;
    color: inherit;
    text-decoration: none;
}

body.ops-portal-page .portal-home-stat-value-link:hover,
body.ops-portal-page .portal-home-stat-value-link:focus-visible {
    text-decoration: underline;
    text-underline-offset: 3px;
}

body.ops-portal-page .portal-home-grid {
    gap: 10px;
}

body.ops-portal-page .portal-home-grid-primary,
body.ops-portal-page .portal-home-grid-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.ops-portal-page .portal-work-card,
body.ops-portal-page .portal-section-card {
    padding: 14px 16px;
}

body.ops-portal-page .portal-section-heading {
    margin-bottom: 12px;
}

body.ops-portal-page .portal-section-heading h3,
body.ops-portal-page .portal-section-heading h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #164e7b;
}

body.ops-portal-page .portal-form-grid {
    gap: 10px 12px;
}

body.ops-portal-page .portal-form-grid label {
    gap: 6px;
    color: #666;
    font-size: 11px;
    font-weight: 500;
}

body.ops-portal-page .portal-form-grid label.portal-checkbox-row input {
    width: auto;
    margin-top: 0;
}

body.ops-portal-page .portal-data-table th {
    background: transparent;
}

body.ops-portal-page .portal-table-link {
    color: #164e7b;
    font-weight: 700;
}

body.ops-portal-page .portal-ticket-stream,
body.ops-portal-page .portal-chat-transcript {
    gap: 10px;
}

body.ops-portal-page .portal-ticket-message,
body.ops-portal-page .portal-chat-message,
body.ops-portal-page .portal-chat-article-card {
    border-radius: 10px;
    border: 0.5px solid #dde1e8;
    background: #fff;
}

body.ops-portal-page .portal-ticket-message.is-support,
body.ops-portal-page .portal-chat-message.is-agent,
body.ops-portal-page .portal-chat-message.is-bot {
    background: #f0fbf7;
    border-color: #a7e3cf;
}

body.ops-portal-page .portal-chat-message.is-customer {
    background: #eef5ff;
    border-color: #bdd4ea;
}

body.ops-portal-page .portal-chat-message.is-system {
    background: #f4f6f9;
    border-color: #e2e4e9;
}

body.ops-portal-page .portal-ticket-attachment-image,
body.ops-portal-page .portal-ticket-attachment-file {
    border: 0.5px solid #dbe3ea;
    border-radius: 8px;
}

@media (max-width: 980px) {
    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .shell,
    body.ops-portal-page .shell {
        margin: 0;
        border-radius: 0;
        border: 0;
        min-height: 100vh;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar,
    body.ops-portal-page .sidebar {
        width: 100%;
        min-width: 0;
        border-right: 0;
        border-bottom: 1px solid #e8ebf0;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main-head,
    body.ops-portal-page .main-head {
        padding: 16px;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .main > :not(.main-head),
    body.ops-portal-page .main > :not(.main-head) {
        margin-left: 16px;
        margin-right: 16px;
    }
}

@media (max-width: 760px) {
    body.ops-portal-page .portal-home-stats,
    body.ops-portal-page .portal-chat-hero-stats,
    body.ops-portal-page .portal-ticket-hero-stats,
    body.ops-portal-page .portal-home-grid-primary,
    body.ops-portal-page .portal-home-grid-secondary {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   PORTAL CHAT PAGE — Semantic CSS classes (replaces inline styles)
   ============================================================ */

/* Connected 4-stat grid */
.portal-stat-connected {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.portal-stat-box {
    padding: 16px 20px;
    border-right: 1px solid #e2e8f0;
}

.portal-stat-box:last-child {
    border-right: none;
}

.portal-stat-label {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.portal-stat-value {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
}

.portal-stat-value--available { color: #16a34a; }
.portal-stat-value--offline   { color: #dc2626; }

/* Chat conversation message entries */
.portal-chat-entry {
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
}

.portal-chat-entry.is-agent {
    background: #edf6f0;
    border: 1px solid #d4edda;
}

.portal-chat-entry.is-customer {
    background: #e8f0fe;
    border: 1px solid #d0dff5;
}

.portal-chat-entry.is-system {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.portal-chat-entry-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 6px;
}

.portal-chat-entry-sender {
    font-size: 0.85rem;
    font-weight: 600;
    color: #111827;
}

.portal-chat-entry-time {
    font-size: 0.75rem;
    color: #9ca3af;
    white-space: nowrap;
    flex-shrink: 0;
}

.portal-chat-entry-body {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.5;
}

/* Active chat unified panel header */
.portal-active-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.portal-active-chat-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.portal-active-chat-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.portal-active-chat-agent {
    font-size: 0.85rem;
    color: #6b7280;
}

.portal-active-chat-badge {
    display: inline-block;
    padding: 2px 10px;
    background: #dcfce7;
    color: #15803d;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.portal-chat-section-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

/* Send message footer */
.portal-chat-send-wrap {
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

.portal-chat-send-title {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.portal-chat-send-note {
    display: block;
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 0 0 10px;
}

.portal-chat-send-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

/* ============================================================
   PORTAL MOBILE BAR + OVERLAY
   ============================================================ */

.portal-mobile-bar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #fff;
    border-bottom: 1px solid #e8ebf0;
    position: sticky;
    top: 0;
    z-index: 300;
    flex-shrink: 0;
}

.portal-mobile-bar-brand {
    flex: 1;
    min-width: 0;
    line-height: 0;
    display: block;
    text-decoration: none;
}

.portal-mobile-bar-brand img {
    height: 28px;
    width: auto;
    display: block;
}

.portal-mobile-hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    min-width: 38px;
    height: 38px;
    background: #f4f6f9;
    border: 0.5px solid #e2e4e9;
    border-radius: 9px;
    cursor: pointer;
    color: #666;
    padding: 0;
    flex-shrink: 0;
    box-shadow: none;
}

.portal-mobile-hamburger:hover {
    background: #e8ecf1;
    transform: none;
    box-shadow: none;
}

.portal-mobile-hamburger svg {
    width: 20px;
    height: 20px;
    display: block;
}

.portal-mobile-hamburger:focus-visible {
    outline: 2px solid #41b493;
    outline-offset: 2px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 199;
}

.sidebar-overlay.active {
    display: block;
}

/* ============================================================
   PORTAL CONTENT WRAP
   ============================================================ */

.portal-content-wrap {
    flex: 1;
    min-width: 0;
    min-height: 0;
}

/* ============================================================
   PORTAL RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Mid-size: keep 2-column sidebar layout longer than generic 1080px collapse */
@media (max-width: 1080px) {
    body.ops-portal-page .shell {
        grid-template-columns: 220px 1fr !important;
        margin: 0 !important;
        border-radius: 0 !important;
        min-height: 100vh;
    }

    body.ops-portal-page .sidebar {
        width: 220px !important;
        position: sticky !important;
        height: 100vh !important;
        transform: none !important;
    }

    body.ops-portal-page .main > :not(.main-head) {
        margin-left: 14px;
        margin-right: 14px;
    }

    body.ops-portal-page .main > .main-head + * {
        margin-top: 14px;
    }

    body.ops-portal-page .main > :last-child {
        margin-bottom: 14px;
    }
}

/* Tablet → switch to mobile drawer */
@media (max-width: 900px) {
    body.ops-portal-page .shell {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
        min-height: 100vh;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    body.ops-portal-page .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        width: min(280px, 88vw) !important;
        transform: translateX(-100%) !important;
        z-index: 400 !important;
        overflow-y: auto;
        border-bottom: none !important;
        border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
        transition: transform 0.25s ease;
        padding: 20px 14px;
    }

    body.ops-portal-page .sidebar.open {
        transform: translateX(0) !important;
    }

    body.ops-portal-page .sidebar-overlay {
        z-index: 399;
    }

    body.ops-portal-page .main {
        padding: 0 !important;
        flex: 1;
        min-width: 0;
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    body.ops-portal-page .main > :not(.main-head) {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    body.ops-portal-page .portal-mobile-bar {
        display: flex;
        margin: 0 !important;
    }

    body.ops-portal-page .portal-content-wrap {
        margin: 0 !important;
        padding: 0 16px 20px;
    }

    body.ops-portal-page .main-head {
        padding: 14px 0 14px;
        margin-bottom: 16px;
    }

    body.ops-portal-page .main > .alert {
        margin: 0 0 8px;
    }

    /* Stat grid: 2×2 on tablet */
    .portal-stat-connected {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .portal-stat-box:nth-child(2) {
        border-right: none !important;
    }

    .portal-stat-box:nth-child(3),
    .portal-stat-box:nth-child(4) {
        border-top: 1px solid #e2e8f0;
    }

    /* Forms: single column */
    body.ops-portal-page .portal-form-grid {
        grid-template-columns: 1fr;
    }

    /* Hero grids: single column */
    body.ops-portal-page .portal-home-hero,
    body.ops-portal-page .portal-chat-hero,
    body.ops-portal-page .portal-ticket-hero,
    body.ops-portal-page .portal-home-grid-primary,
    body.ops-portal-page .portal-home-grid-secondary {
        grid-template-columns: 1fr;
    }

    /* Hero stats: keep 2-col on tablet */
    body.ops-portal-page .portal-home-stats,
    body.ops-portal-page .portal-chat-hero-stats,
    body.ops-portal-page .portal-ticket-hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: 640px */
@media (max-width: 640px) {
    body.ops-portal-page .portal-content-wrap {
        padding: 0 12px 16px;
    }

    body.ops-portal-page .panel {
        padding: 14px;
        border-radius: 10px;
    }

    body.ops-portal-page .main-head {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px 0 12px;
    }

    body.ops-portal-page .page-title {
        font-size: 1.35rem;
    }

    /* Active chat header stacks */
    .portal-active-chat-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .portal-active-chat-meta {
        gap: 6px;
    }

    /* Chat entry head: time wraps below sender */
    .portal-chat-entry-head {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 2px;
    }

    .portal-chat-entry-time {
        order: 2;
        white-space: normal;
    }

    /* Send actions: full-width button */
    .portal-chat-send-actions {
        justify-content: stretch;
    }

    .portal-chat-send-actions button {
        width: 100%;
    }

    /* Stat grid: still 2-col on phone */
    .portal-stat-connected {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Hero stats: single column */
    body.ops-portal-page .portal-home-stats,
    body.ops-portal-page .portal-chat-hero-stats,
    body.ops-portal-page .portal-ticket-hero-stats {
        grid-template-columns: 1fr;
    }

    /* Chat transcript: no fixed max-height on phone so content isn't clipped */
    body.ops-portal-page .portal-chat-transcript {
        max-height: none;
    }
}

/* Small mobile: 420px */
@media (max-width: 420px) {
    body.ops-portal-page .portal-content-wrap {
        padding: 0 10px 14px;
    }

    body.ops-portal-page .panel {
        padding: 12px;
    }

    /* Stat grid: full stack on very small screens */
    .portal-stat-connected {
        grid-template-columns: 1fr !important;
    }

    .portal-stat-box {
        border-right: none !important;
        border-top: none !important;
        border-bottom: 1px solid #e2e8f0 !important;
    }

    .portal-stat-box:last-child {
        border-bottom: none !important;
    }

    body.ops-portal-page .page-title {
        font-size: 1.15rem;
    }
}

/* ============================================================
   PORTAL — UTILITY CLASSES & TOUCH FIXES
   ============================================================ */

/* iOS momentum scroll on all scrollable table wrappers */
.table-wrap {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

/* Buttons inside table cells must not stretch to cell width */
td button,
td .btn,
td form button {
    width: auto;
    min-width: unset;
}

/* Disable panel lift on touch devices (hover fires on tap = jerky) */
@media (hover: none) {
    .panel:hover {
        transform: none;
        box-shadow: var(--shadow);
    }
}

/* ============================================================
   PORTAL NOTIFICATIONS PAGE
   ============================================================ */

.portal-notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.portal-notifications-unread {
    margin: 0;
    font-size: 0.9rem;
}

/* Tint unread rows so they stand out from already-read ones. */
.portal-notification-row.is-unread > td {
    background: #eaf2f8;
}

/* Unread rows get a filled button treatment so the "Open" / "Mark Read"
   actions visually differ from the ones on already-read rows. */
.portal-notification-row.is-unread .btn.secondary,
.portal-notification-row.is-unread button.secondary {
    background: #0f766e;
    color: #ffffff;
    border-color: #0f766e;
}

.portal-notification-row.is-unread .btn.secondary:hover,
.portal-notification-row.is-unread button.secondary:hover {
    background: #134e4a;
    border-color: #134e4a;
    color: #ffffff;
}

.portal-notifications-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.portal-notifications-actions form {
    display: inline;
}

/* Pagination row (plain flex, used on notifications + elsewhere) */
.portal-pagination {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

/* ============================================================
   PORTAL TICKET CC FORM FIX
   ============================================================ */

/* Ensure the email input shrinks properly on narrow viewports */
.portal-ticket-cc-form input {
    flex: 1 1 200px;
    min-width: min(200px, 100%);
}

/* ============================================================
   PORTAL ATTACHMENT GRID — RESPONSIVE
   ============================================================ */

.portal-ticket-attachment-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ============================================================
   PORTAL ADDITIONAL RESPONSIVE — 640px
   ============================================================ */

@media (max-width: 640px) {
    /* Minimum 44 px touch targets for primary action buttons */
    body.ops-portal-page button[type="submit"],
    body.ops-portal-page .portal-chat-send-actions button,
    body.ops-portal-page .portal-chat-actions button {
        min-height: 44px;
    }

    /* Keep table-cell action buttons compact */
    td button,
    td .btn,
    td form button {
        min-height: 36px;
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    /* CC form: stacks to a single column */
    .portal-ticket-cc-form {
        flex-direction: column;
        align-items: stretch;
    }

    .portal-ticket-cc-form input {
        min-width: 0;
        flex: 1 1 auto;
    }

    .portal-ticket-cc-form .btn,
    .portal-ticket-cc-form button {
        width: 100%;
    }

    /* Notification header: unread label above buttons */
    .portal-notifications-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Hero sections: tighter padding */
    body.ops-portal-page .portal-home-hero,
    body.ops-portal-page .portal-ticket-hero,
    body.ops-portal-page .portal-chat-hero {
        padding: 14px;
    }

    /* Stat values: scale down */
    body.ops-portal-page .portal-home-stat-value {
        font-size: 1.1rem;
    }

    /* Attachment thumbnails: smaller */
    .portal-ticket-attachment-image,
    .portal-ticket-attachment-file {
        width: 130px;
        height: 90px;
    }

    /* Ticket message head: stacks on small screens */
    body.ops-portal-page .portal-ticket-message-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* ============================================================
   PORTAL ADDITIONAL RESPONSIVE — 360px
   ============================================================ */

@media (max-width: 360px) {
    /* Notification action buttons: full width */
    .portal-notifications-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .portal-notifications-actions button,
    .portal-notifications-actions .btn {
        width: 100%;
    }

    /* Pagination: center on tiny screens */
    .portal-pagination {
        justify-content: center;
    }

    /* Service order table text: smaller */
    body.ops-portal-page .portal-data-table td {
        font-size: 0.8rem;
        padding: 8px 6px;
    }
}

/* =====================================================================
   KB HIDDEN: hide Knowledge Base widget rows and article cards
   ===================================================================== */
.plc-row.kb,
.plc-kb-list,
.plc-kb-title {
    display: none !important;
}

/* =====================================================================
   Portal: Terms Version block (read-only, informational)
   ===================================================================== */
.portal-terms-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
    grid-column: 1 / -1;
}
.portal-terms-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    letter-spacing: 0.02em;
}
.portal-terms-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.portal-terms-version-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #1e40af;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 5px;
    padding: 2px 10px;
    letter-spacing: 0.04em;
    width: fit-content;
}
.portal-terms-desc {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #6b7280;
}
.portal-terms-link {
    font-size: 0.82rem;
    font-weight: 500;
    color: #1d4ed8;
    text-decoration: none;
}
.portal-terms-link:hover {
    text-decoration: underline;
}

/* =====================================================================
   Portal: Ticket show page — polish pass
   ===================================================================== */

/* Fix mid-word break in hero stat values + tighten font */
body.ops-portal-page .portal-ticket-stat-value {
    font-size: 0.84rem;
    font-weight: 600;
    color: #111827;
    overflow-wrap: break-word;
    word-break: normal;
    line-height: 1.35;
}

/* Stat box: tighter padding, vertical flex so label stays top */
body.ops-portal-page .portal-ticket-stat {
    padding: 10px 12px;
    gap: 5px;
    display: flex;
    flex-direction: column;
}

/* Stat label: consistent sizing */
body.ops-portal-page .portal-ticket-stat-label {
    font-size: 9px;
    font-weight: 600;
    color: #7b8da4;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin: 0;
}

/* Hero copy: tighten vertical spacing */
body.ops-portal-page .portal-ticket-hero {
    gap: 14px;
    align-items: center;
}
body.ops-portal-page .portal-ticket-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
body.ops-portal-page .portal-ticket-hero-copy p {
    margin: 0;
}
body.ops-portal-page .portal-ticket-hero-copy .portal-home-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #7b8da4;
}

/* Ticket details list: fixed label width for clean alignment */
body.ops-portal-page .portal-ticket-details-list {
    gap: 0;
}
body.ops-portal-page .portal-ticket-details-list > div {
    padding: 9px 0;
    align-items: center;
    gap: 12px;
}
body.ops-portal-page .portal-ticket-details-list > div:first-child {
    padding-top: 2px;
}
body.ops-portal-page .portal-ticket-details-list strong {
    flex-shrink: 0;
    min-width: 115px;
    font-size: 0.76rem;
    color: #7b8da4;
}
body.ops-portal-page .portal-ticket-details-list > div > span {
    text-align: right;
    font-size: 0.85rem;
    color: #111827;
}

/* Section headings on the ticket page: add subtle separator */
body.ops-portal-page .portal-ticket-show .portal-section-heading {
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 1px solid #f0f2f5;
}

/* Message stream: tighter gap, consistent padding */
body.ops-portal-page .portal-ticket-stream {
    gap: 10px;
}
body.ops-portal-page .portal-ticket-message {
    padding: 14px 16px;
    border-radius: 10px;
}
body.ops-portal-page .portal-ticket-message-head {
    margin-bottom: 10px;
    align-items: center;
}
body.ops-portal-page .portal-ticket-message-author {
    font-size: 0.88rem;
    font-weight: 700;
}
body.ops-portal-page .portal-ticket-message-channel {
    font-size: 0.74rem;
    margin-top: 2px;
}
body.ops-portal-page .portal-ticket-message-body {
    font-size: 0.9rem;
    line-height: 1.6;
}

/* CC form: align input and button neatly */
body.ops-portal-page .portal-ticket-cc-form {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
}
body.ops-portal-page .portal-ticket-cc-form input {
    flex: 1;
    min-width: 0;
}

/* Pioneer contact panel */
body.ops-portal-page .portal-pioneer-contact-details {
    display: grid;
    gap: 0;
}
body.ops-portal-page .portal-pioneer-contact-details > div {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid #f0f2f5;
    font-size: 0.88rem;
}
body.ops-portal-page .portal-pioneer-contact-details > div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
body.ops-portal-page .portal-pioneer-contact-details > div:first-child {
    padding-top: 0;
}
body.ops-portal-page .portal-pioneer-contact-label {
    min-width: 50px;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #7b8da4;
    flex-shrink: 0;
}
@media (max-width: 480px) {
    body.ops-portal-page .portal-pioneer-contact-details > div {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
}

/* =====================================================================
   ADMIN PANEL — RESPONSIVE POLISH
   Scope: body.ops-admin-page (customer portal is untouched).
   Fixes layout, alignment, spacing, and responsive behavior across
   desktop / tablet / mobile. Preserves existing colors, fonts, and text.
   ===================================================================== */

/* 1. Global overflow guard + fluid media inside admin */
body.ops-admin-page {
    overflow-x: hidden;
}
body.ops-admin-page .shell {
    width: 100%;
    max-width: 100%;
}
body.ops-admin-page img,
body.ops-admin-page video {
    max-width: 100%;
    height: auto;
}
body.ops-admin-page .portal-brand-logo {
    /* keep aspect — max sizing already set; ensure no stretch */
    height: auto;
}

/* 2. Tables: always horizontal scroll when needed (no body overflow) */
body.ops-admin-page .table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

/* Form controls never push the layout wider than their container */
body.ops-admin-page input,
body.ops-admin-page select,
body.ops-admin-page textarea {
    max-width: 100%;
}

/* 3. Mobile top bar (brand + hamburger) — hidden by default */
.admin-mobile-bar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #fff;
    border-bottom: 1px solid #e8ebf0;
    position: sticky;
    top: 0;
    z-index: 300;
    flex-shrink: 0;
}
.admin-mobile-bar-brand {
    flex: 1;
    min-width: 0;
    line-height: 0;
    display: block;
    text-decoration: none;
}
.admin-mobile-bar-brand img {
    height: 28px;
    width: auto;
    display: block;
}
.admin-mobile-hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    min-width: 38px;
    height: 38px;
    padding: 0;
    background: #f4f6f9;
    border: 0.5px solid #e2e4e9;
    border-radius: 9px;
    color: #666;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: none;
}
.admin-mobile-hamburger:hover {
    background: #e8ecf1;
    transform: none;
    box-shadow: none;
}
.admin-mobile-hamburger svg {
    width: 20px;
    height: 20px;
    display: block;
}
.admin-mobile-hamburger:focus-visible {
    outline: 2px solid #41b493;
    outline-offset: 2px;
}

/* Body scroll-lock when drawer open */
body.ops-admin-page.admin-drawer-open {
    overflow: hidden;
}

/* Sidebar overlay tuned for admin (reuses .sidebar-overlay selector) */
body.ops-admin-page .sidebar-overlay {
    z-index: 399;
}

/* 4. Tablet landscape polish (≤1200px) — tighter head row */
@media (max-width: 1200px) {
    body.ops-admin-page .main-head {
        gap: 12px;
        flex-wrap: wrap;
    }
    body.ops-admin-page .main-head-actions {
        flex-wrap: wrap;
    }
}

/* 5. Tablet portrait → phone (≤980px): sidebar becomes slide-in drawer */
@media (max-width: 980px) {
    /* Top mobile bar shown everywhere in admin */
    body.ops-admin-page .admin-mobile-bar {
        display: flex;
    }

    /* Shell stacks; disable rounded border frame */
    body.ops-admin-page .shell,
    body.ops-admin-page.ops-dashboard-page .shell,
    body.ops-admin-page.ops-tickets-page .shell {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border: 0 !important;
        overflow: visible !important;
        min-height: 100vh;
        height: auto !important;
    }

    /* Sidebar: fixed drawer off-canvas; colors untouched */
    body.ops-admin-page .sidebar,
    body.ops-admin-page.ops-dashboard-page .sidebar,
    body.ops-admin-page.ops-tickets-page .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        width: min(288px, 86vw) !important;
        min-width: 0 !important;
        transform: translateX(-100%);
        z-index: 400;
        overflow-y: auto;
        transition: transform 0.25s ease;
        border-right: 1px solid #e8ebf0 !important;
        border-bottom: 0 !important;
        box-shadow: 0 18px 40px rgba(13, 37, 56, 0.18);
    }

    /* Open state */
    body.ops-admin-page .sidebar.open {
        transform: translateX(0) !important;
    }

    /* Hide in-sidebar collapse toggle on mobile (drawer handles visibility) */
    body.ops-admin-page .sidebar .sidebar-toggle {
        display: none !important;
    }

    /* Main takes full width under the mobile bar */
    body.ops-admin-page .main,
    body.ops-admin-page.ops-dashboard-page .main,
    body.ops-admin-page.ops-tickets-page .main {
        width: 100%;
        flex: 1;
        min-width: 0;
        padding: 16px;
    }

    body.ops-admin-page .main > :not(.main-head) {
        margin-left: 0;
        margin-right: 0;
    }

    body.ops-admin-page .main-head {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 12px;
    }

    body.ops-admin-page .main-head-actions {
        margin-left: auto;
    }

    body.ops-admin-page .sidebar-toggle-top {
        display: none !important;
    }

    /* Generic dashboard grids adapt to 2-col on tablet */
    body.ops-admin-page .grid-4,
    body.ops-admin-page .grid-3,
    body.ops-admin-page .grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Stat cards: compact */
    body.ops-admin-page .stat-card {
        padding: 14px;
    }
    body.ops-admin-page .stat-card-value {
        font-size: 1.6rem;
    }
}

/* 6. Mobile (≤640px): stack heads, collapse grids, comfy spacing */
@media (max-width: 640px) {
    body.ops-admin-page .main {
        padding: 14px;
    }

    body.ops-admin-page .main-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    body.ops-admin-page .main-head-actions {
        margin-left: 0;
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    body.ops-admin-page .grid-4,
    body.ops-admin-page .grid-3,
    body.ops-admin-page .grid-2 {
        grid-template-columns: 1fr;
    }

    body.ops-admin-page .panel {
        padding: 14px;
        border-radius: 10px;
    }

    /* Compact table cell padding; keep them readable */
    body.ops-admin-page th,
    body.ops-admin-page td {
        padding: 8px 6px;
    }

    /* Primary form buttons: 44px touch target */
    body.ops-admin-page button[type="submit"] {
        min-height: 44px;
    }

    /* Preserve compact buttons inside table cells and pagination */
    body.ops-admin-page td button,
    body.ops-admin-page td .btn,
    body.ops-admin-page td form button {
        min-height: 34px;
        width: auto;
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    body.ops-admin-page .pagination a,
    body.ops-admin-page .pagination span,
    body.ops-admin-page .pagination button {
        min-height: 34px;
    }

    /* Pagination variants wrap cleanly */
    body.ops-admin-page .pagination,
    body.ops-admin-page .ticket-pagination,
    body.ops-admin-page .notification-pagination,
    body.ops-admin-page .customer-pagination,
    body.ops-admin-page .service-order-pagination,
    body.ops-admin-page .email-inbox-pagination {
        flex-wrap: wrap;
        row-gap: 8px;
    }

    .admin-mobile-bar-brand img {
        height: 26px;
    }
}

/* 7. Small mobile (≤420px): extra-tight padding */
@media (max-width: 420px) {
    body.ops-admin-page .main {
        padding: 12px;
    }
    body.ops-admin-page .panel {
        padding: 12px;
    }
    /* Keep the bell a perfect square on very narrow screens — slightly smaller
       so it still fits the header row, but large enough to remain tappable. */
    body.ops-admin-page .notify-chip {
        width: 44px;
        min-width: 44px;
        height: 44px;
        padding: 0;
        margin-right: 12px;
    }
}

/* 8. Kill hover-lift transforms on touch devices (prevents stuck hover) */
@media (hover: none) {
    body.ops-admin-page .panel:hover,
    body.ops-admin-page .stat-card:hover,
    body.ops-admin-page .dash-card:hover {
        transform: none;
    }
}

/* 9. Keyboard focus visibility (a11y polish, no color-scheme change) */
body.ops-admin-page .nav-link:focus-visible,
body.ops-admin-page .notify-chip:focus-visible,
body.ops-admin-page .sidebar-toggle:focus-visible {
    outline: 2px solid #41b493;
    outline-offset: 2px;
}

/* ==========================================================================
   ADMIN PANEL — ROW ALIGNMENT POLISH
   Scope: Customers > Representatives table  +  Settings > Support Users row.
   Goal : inputs, selects and all action buttons share a single horizontal
          baseline with equal spacing; no color / font / content change.
   ========================================================================== */

/* 1. Vertically centre every cell in these two tables so badges, inputs,
      selects and buttons line up on the same axis. */
body.ops-admin-page .customer-users-table th,
body.ops-admin-page .customer-users-table td,
body.ops-admin-page .settings-shell .tickets-table th,
body.ops-admin-page .settings-shell .tickets-table td {
    vertical-align: middle;
}

/* 2. Normalise control heights inside the Representatives row.
      Inputs, selects and buttons all share the same 40px rhythm. */
body.ops-admin-page .customer-users-table input[type="text"],
body.ops-admin-page .customer-users-table input[type="email"],
body.ops-admin-page .customer-users-table select,
body.ops-admin-page .customer-users-table button,
body.ops-admin-page .customer-users-table .btn {
    height: 40px;
    min-height: 40px;
    box-sizing: border-box;
    vertical-align: middle;
}

body.ops-admin-page .customer-users-table input[type="text"],
body.ops-admin-page .customer-users-table input[type="email"],
body.ops-admin-page .customer-users-table select {
    padding: 0 12px;
    line-height: 1.2;
}

body.ops-admin-page .customer-users-table th,
body.ops-admin-page .customer-users-table td {
    padding-top: 18px;
    padding-bottom: 18px;
}

body.ops-admin-page .customer-users-table th:nth-child(4),
body.ops-admin-page .customer-users-table td:nth-child(4) {
    min-width: 250px;
    width: 250px;
}

body.ops-admin-page .customer-users-table .customer-reply-cell {
    padding-right: 18px;
}

body.ops-admin-page .customer-users-table .customer-reply-routing,
body.ops-admin-page .customer-users-table .customer-copy-setting {
    gap: 8px;
}

body.ops-admin-page .customer-users-table .customer-reply-routing .muted,
body.ops-admin-page .customer-users-table .customer-copy-setting .muted {
    font-size: 0.83rem;
    line-height: 1.35;
}

body.ops-admin-page .customer-users-table .customer-reply-toggle {
    font-size: 0.9rem;
    white-space: normal;
}

body.ops-admin-page .customer-users-table .customer-routing-copy {
    margin: 0;
    max-width: 26ch;
    color: #5b7084;
}

body.ops-admin-page .customer-users-table .customer-reply-toggle-copy {
    max-width: 24ch;
}

body.ops-admin-page .customer-users-table .customer-delivery-card {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.ops-admin-page .customer-users-table .customer-routing-pill {
    padding: 0.34rem 0.78rem;
    font-size: 0.76rem;
}

/* 3. Action buttons grouped into a single flex container (Representatives).
      Replaces the old vertical stack caused by an inline margin-top:6px. */
body.ops-admin-page .customer-user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

body.ops-admin-page .customer-user-actions form {
    margin: 0;
    display: inline-flex;
    align-items: center;
}

body.ops-admin-page .customer-user-actions button,
body.ops-admin-page .customer-user-actions .btn {
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 0 14px;
    height: 40px;
    min-height: 40px;
    font-size: 0.82rem;
    border-radius: 12px;
    white-space: nowrap;
}

/* 4. Support Users row (Settings): harmonise control heights so the Update,
      Send Password Reset and Remove Support User buttons share one baseline
      with the role-profile select above them. Existing .settings-inline-actions
      flex layout is preserved; we only fix the danger-button drift. */
body.ops-admin-page .settings-inline-actions {
    row-gap: 8px;
}

body.ops-admin-page .settings-inline-actions > form,
body.ops-admin-page .settings-inline-actions > button {
    margin: 0;
    display: inline-flex;
    align-items: center;
}

body.ops-admin-page .settings-inline-actions button,
body.ops-admin-page .settings-inline-actions .btn {
    height: 40px;
    min-height: 40px;
    padding: 0 14px;
    white-space: nowrap;
}

/* Override the old "margin-left: auto" that pushed Remove Support User to
   the far right and broke equal spacing across the action buttons. */
body.ops-admin-page .settings-inline-actions .danger {
    margin-left: 0;
}

/* Match the Support Users role-profile <select> to the 40px rhythm so it
   sits on the same baseline as the buttons in the adjacent cell. */
body.ops-admin-page .settings-shell .settings-inline-form select {
    height: 40px;
    min-height: 40px;
    padding: 0 12px;
    line-height: 1.2;
}

/* 5. Mobile stacking — keep buttons grouped, stack the group below inputs
      only when horizontal room runs out. No layout change on desktop. */
@media (max-width: 640px) {
    body.ops-admin-page .customer-user-actions,
    body.ops-admin-page .settings-inline-actions {
        width: 100%;
    }

    body.ops-admin-page .customer-user-actions > button,
    body.ops-admin-page .customer-user-actions > form,
    body.ops-admin-page .settings-inline-actions > button,
    body.ops-admin-page .settings-inline-actions > form {
        flex: 1 1 auto;
    }

    body.ops-admin-page .customer-user-actions button,
    body.ops-admin-page .customer-user-actions .btn,
    body.ops-admin-page .settings-inline-actions button,
    body.ops-admin-page .settings-inline-actions .btn {
        width: 100%;
    }

    body.ops-admin-page .settings-inline-note {
        flex-basis: 100%;
    }
}

.user-multiselect {
    position: relative;
}

.user-multiselect-control {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    min-height: 56px;
    padding: 12px;
    border: 1px solid #d8e3ec;
    border-radius: 18px;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(13, 37, 56, 0.04), 0 8px 24px rgba(15, 23, 42, 0.04);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.user-multiselect.is-open .user-multiselect-control,
.user-multiselect-control:focus-within {
    border-color: rgba(15, 118, 110, 0.45);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.user-multiselect-input {
    order: 1;
    flex: 1 1 220px;
    min-width: 0;
    width: auto;
    border: 0;
    outline: none;
    background: #f7fafc;
    color: #0d2538;
    font-size: 0.95rem;
    padding: 12px 14px;
    border-radius: 14px;
    box-shadow: inset 0 0 0 1px #d6dde6;
}

.user-multiselect-input::placeholder {
    color: #7b8b98;
}

.user-multiselect-clear {
    order: 2;
    flex: 0 0 auto;
    width: 38px;
    min-width: 38px;
    max-width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    border: 1px solid #d4dde6;
    border-radius: 999px;
    background: #f8fafc;
    color: #47606f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    box-shadow: none;
}

.user-multiselect-clear[hidden] {
    display: none !important;
}

.user-multiselect-clear:hover,
.user-multiselect-clear:focus {
    background: #eef5f6;
    border-color: #b9cad3;
    color: #134e4a;
}

.user-multiselect-chips {
    order: 3;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1 0 100%;
    min-width: 100%;
}

.user-multiselect-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    padding: 9px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(19, 78, 74, 0.05));
    border: 1px solid rgba(15, 118, 110, 0.16);
    color: #0f172a;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-multiselect-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-multiselect-chip button,
.user-multiselect-option,
.user-multiselect-empty {
    width: auto;
}

.user-multiselect-chip button {
    border: 0;
    background: transparent;
    color: #47606f;
    cursor: pointer;
    padding: 0;
    width: auto;
    min-width: 18px;
    max-width: 18px;
    min-height: 18px;
    font-size: 1rem;
    line-height: 1;
}

.user-multiselect-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 30;
    display: none;
    gap: 6px;
    padding: 10px;
    border: 1px solid #d9e1ea;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(13, 37, 56, 0.16);
    max-height: 260px;
    overflow-y: auto;
}

.user-multiselect.is-open .user-multiselect-dropdown {
    display: grid;
}

.user-multiselect-dropdown[hidden] {
    display: none !important;
}

body.ops-admin-page .user-multiselect-option {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 12px;
    background: #f8fafc;
    color: #0d2538;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 12px;
    text-align: left;
    transition: background 0.16s ease, transform 0.16s ease;
    box-shadow: none;
}

body.ops-admin-page .user-multiselect-option:hover,
body.ops-admin-page .user-multiselect-option:focus {
    background: #e7f3f1;
    border-color: rgba(15, 118, 110, 0.18);
    transform: translateY(-1px);
}

.user-multiselect-option-name {
    font-weight: 700;
}

body.ops-admin-page .user-multiselect-option-meta,
body.ops-admin-page .user-multiselect-empty {
    color: #5b6c78;
    font-size: 0.84rem;
}

.ticket-developer-guidance {
    border: 1px solid rgba(15, 118, 110, 0.14);
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(19, 78, 74, 0.03));
}

body.ops-customers-page .customer-shell {
    gap: 18px;
}

body.ops-customers-page .customer-hero {
    gap: 0;
}

body.ops-customers-page .customer-list-head {
    align-items: center;
}

body.ops-customers-page .customer-list-head-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

body.ops-customers-page .customer-list-head .customer-hero-stat {
    min-width: 90px;
}

@media (min-width: 981px) {
    body.ops-admin-page .sidebar-toggle-top {
        display: none !important;
    }

    body.ops-admin-page .sidebar .sidebar-toggle,
    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar .sidebar-toggle {
        display: inline-flex !important;
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
        border-radius: 12px;
        background: #184f7a;
        box-shadow: 0 10px 20px rgba(24, 79, 122, 0.18);
    }

    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar {
        transition:
            width 0.22s ease,
            min-width 0.22s ease,
            box-shadow 0.22s ease;
    }

    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page).admin-sidebar-collapsed .sidebar,
    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.collapsed {
        width: 88px !important;
        min-width: 88px !important;
        overflow: clip;
    }

    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.collapsed:not(.hover-open) .brand,
    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.collapsed:not(.hover-open) .logout-btn,
    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.collapsed:not(.hover-open) .badge-text,
    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.collapsed:not(.hover-open) .nav-text {
        display: none !important;
    }

    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.collapsed:not(.hover-open) .user-box .info > div,
    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.collapsed:not(.hover-open) .user-box .user-email {
        display: none !important;
    }

    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.collapsed:not(.hover-open) .sidebar-top {
        justify-content: center;
        min-height: 61px;
        padding: 16px 18px 14px;
    }

    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.collapsed:not(.hover-open) .user-box {
        padding: 12px 14px 10px;
        background: transparent;
    }

    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.collapsed:not(.hover-open) .user-box .info {
        display: flex !important;
        justify-content: center;
        padding: 8px 10px;
        border: 0.5px solid transparent;
        background: transparent;
    }

    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.collapsed:not(.hover-open) .user-box .avatar {
        margin: 0 auto;
    }

    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.collapsed:not(.hover-open) nav {
        padding-inline: 8px;
    }

    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.collapsed:not(.hover-open) .nav-link {
        justify-content: center;
        padding-inline: 10px;
    }

    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.collapsed:not(.hover-open) .nav-icon,
    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.collapsed:not(.hover-open) .nav-icon-svg,
    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.collapsed:not(.hover-open) .nav-icon-svg svg {
        width: 14px;
        min-width: 14px;
        height: 14px;
    }

    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.hover-open {
        width: 220px !important;
        min-width: 220px !important;
        box-shadow: 22px 0 44px rgba(15, 23, 42, 0.12);
    }

    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.hover-open .brand {
        display: flex !important;
    }

    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.hover-open .user-box .info > div {
        display: block !important;
    }

    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.hover-open .user-box .role,
    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.hover-open .user-box .user-email,
    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.hover-open .logout-btn,
    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.hover-open .badge-text,
    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.hover-open .nav-text {
        display: initial !important;
    }

    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.hover-open .nav-link {
        justify-content: flex-start !important;
        padding-inline: 10px !important;
    }

    body.ops-admin-page:is(.ops-dashboard-page, .ops-tickets-page) .sidebar.hover-open nav::before {
        display: block !important;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .shell {
        display: grid;
        grid-template-columns: 220px minmax(0, 1fr);
        position: relative;
        align-items: stretch;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page).admin-sidebar-collapsed .shell {
        grid-template-columns: 88px minmax(0, 1fr);
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar {
        width: auto;
        min-width: 0;
        max-width: none;
        position: relative;
        z-index: 30;
        transition:
            width 0.22s ease,
            min-width 0.22s ease,
            transform 0.22s ease,
            box-shadow 0.22s ease;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page).admin-sidebar-collapsed .sidebar {
        width: 88px !important;
        min-width: 88px !important;
        overflow: clip;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed:not(.hover-open) {
        box-shadow: none;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed:not(.hover-open) .brand,
    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed:not(.hover-open) .logout-btn,
    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed:not(.hover-open) .badge-text,
    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed:not(.hover-open) .nav-text {
        display: none !important;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed:not(.hover-open) .user-box .info > div,
    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed:not(.hover-open) .user-box .user-email {
        display: none !important;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed:not(.hover-open) .sidebar-top {
        justify-content: center;
        min-height: 61px;
        padding: 16px 18px 14px;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed:not(.hover-open) .user-box {
        padding: 12px 14px 10px;
        background: transparent;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed:not(.hover-open) .user-box .info {
        display: flex !important;
        justify-content: center;
        padding: 8px 10px;
        border: 0.5px solid transparent;
        background: transparent;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed:not(.hover-open) .user-box .avatar {
        margin: 0 auto;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed:not(.hover-open) nav {
        padding-inline: 8px;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed:not(.hover-open) .nav-link {
        justify-content: center;
        padding-inline: 12px;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed:not(.hover-open) .nav-icon,
    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed:not(.hover-open) .nav-icon-svg,
    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.collapsed:not(.hover-open) .nav-icon-svg svg {
        width: 14px;
        min-width: 14px;
        height: 14px;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.hover-open {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px !important;
        min-width: 280px !important;
        box-shadow: 22px 0 44px rgba(15, 23, 42, 0.16);
        border-right: 1px solid #e8ebf0;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.hover-open .brand {
        display: flex !important;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.hover-open .user-box .info > div {
        display: block !important;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.hover-open .user-box {
        padding: 12px 14px 10px;
        border-bottom: 0.5px solid #eef1f6;
        background: transparent;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.hover-open .user-box .info {
        display: flex !important;
        justify-content: flex-start;
        padding: 8px 10px;
        border: 0.5px solid #bdd4ea;
        background: #f4f8ff;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.hover-open .user-box .role,
    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.hover-open .user-box .user-email {
        display: block !important;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.hover-open .logout-btn,
    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.hover-open .badge-text,
    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.hover-open .nav-text {
        display: initial !important;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.hover-open .nav-link {
        justify-content: flex-start !important;
        padding-inline: 12px !important;
    }

    body.ops-admin-page:not(.ops-dashboard-page):not(.ops-tickets-page) .sidebar.hover-open nav::before {
        display: block !important;
    }
}

body.ops-ticket-detail-page .main-head {
    display: none;
}

body.ops-ticket-detail-page .main {
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

body.ops-ticket-detail-page .main > .alert {
    margin: 16px 24px 0;
    flex-shrink: 0;
}

body.ops-ticket-detail-page .ticket-show-shell {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: row;
    gap: 0;
    background: #ffffff;
    overflow: hidden;
    border-top: 1px solid #e4e6ea;
}

body.ops-ticket-detail-page .ticket-detail-hero {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 18px 22px 14px;
    background: #ffffff;
    border-bottom: 1px solid #e4e6ea;
}

body.ops-ticket-detail-page .ticket-detail-hero:hover,
body.ops-ticket-detail-page .ticket-show-sidebar .ticket-show-panel:hover,
body.ops-ticket-detail-page .ticket-conversation-panel:hover,
body.ops-ticket-detail-page .ticket-composer-panel:hover {
    transform: none;
    box-shadow: none;
}

body.ops-ticket-detail-page .ticket-detail-hero-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

body.ops-ticket-detail-page .ticket-detail-hero-copy {
    min-width: 0;
}

body.ops-ticket-detail-page .ticket-detail-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 12px;
    color: #9ca3af;
    font-size: 11.5px;
    flex-wrap: wrap;
}

body.ops-ticket-detail-page .ticket-detail-breadcrumbs a {
    color: #2563eb;
    font-weight: 500;
}

body.ops-ticket-detail-page .ticket-detail-title {
    margin: 0;
    font-size: 15px;
    line-height: 1.35;
    letter-spacing: -0.01em;
    font-weight: 600;
    color: #111827;
}

body.ops-ticket-detail-page .ticket-detail-subline {
    margin: 3px 0 0;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

body.ops-ticket-detail-page .ticket-detail-hero-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

body.ops-ticket-detail-page .ticket-detail-facts {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, max-content));
    gap: 28px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e4e6ea;
}

body.ops-ticket-detail-page .ticket-detail-fact {
    min-width: 0;
    display: grid;
    gap: 3px;
}

body.ops-ticket-detail-page .ticket-detail-fact-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9ca3af;
}

body.ops-ticket-detail-page .ticket-detail-fact strong {
    color: #374151;
    font-size: 12.5px;
    font-weight: 500;
    overflow-wrap: anywhere;
}

body.ops-ticket-detail-page .ticket-detail-channel-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 3px 10px;
    border-radius: 6px;
    background: #dbeafe;
    color: #2563eb;
    font-size: 11px;
    font-weight: 600;
    text-transform: none;
}

body.ops-ticket-detail-page .ticket-show-left {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}

body.ops-ticket-detail-page .ticket-show-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: #ffffff;
    gap: 0;
}

body.ops-ticket-detail-page .ticket-show-sidebar {
    width: 292px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #f8f9fb;
    border-left: 1px solid #e4e6ea;
    overflow-y: auto;
    overflow-x: hidden;
}

body.ops-ticket-detail-page .ticket-conversation-panel {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

body.ops-ticket-detail-page .ticket-composer-panel {
    flex-shrink: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fafafa;
    border-top: 1px solid #e4e6ea;
}

body.ops-ticket-detail-page .ticket-message-stream {
    gap: 0;
}

body.ops-ticket-detail-page .ticket-message-card {
    border: 0;
    border-bottom: 1px solid #f3f4f6;
    border-radius: 0;
    padding: 14px 22px;
    background: #ffffff;
}

body.ops-ticket-detail-page .ticket-message-card:last-child {
    border-bottom: 0;
}

body.ops-ticket-detail-page .ticket-message-card.internal {
    background: #ffffff;
}

body.ops-ticket-detail-page .ticket-message-card.internal .ticket-message-content {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 11px 13px;
}

body.ops-ticket-detail-page .ticket-message-shell {
    gap: 12px;
}

body.ops-ticket-detail-page .ticket-message-avatar {
    width: 28px;
    height: 28px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0;
    border: 0;
    margin-top: 1px;
}

body.ops-ticket-detail-page .ticket-message-avatar--internal {
    background: #fef3c7;
    color: #b45309;
}

body.ops-ticket-detail-page .ticket-message-head {
    align-items: center;
}

body.ops-ticket-detail-page .ticket-message-head-left {
    min-width: 0;
}

body.ops-ticket-detail-page .ticket-message-author-line {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

body.ops-ticket-detail-page .ticket-message-author {
    font-size: 12.5px;
    font-weight: 600;
    color: #111827;
}

body.ops-ticket-detail-page .ticket-message-channel-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 3px;
    background: #e5edff;
    color: #2563eb;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

body.ops-ticket-detail-page .ticket-message-channel-pill--email {
    background: #dbeafe;
    color: #1d4ed8;
}

body.ops-ticket-detail-page .ticket-message-channel-pill--portal {
    background: #dcfce7;
    color: #15803d;
}

body.ops-ticket-detail-page .ticket-message-channel-pill--chat {
    background: #ede9fe;
    color: #7c3aed;
}

body.ops-ticket-detail-page .ticket-message-channel-pill--internal {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

body.ops-ticket-detail-page .ticket-message-meta {
    margin-top: 4px;
    font-size: 11px;
    color: #94a3b8;
}

body.ops-ticket-detail-page .ticket-message-timestamp {
    white-space: nowrap;
    font-size: 11px;
    color: #9ca3af;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    margin-left: auto;
}

body.ops-ticket-detail-page .ticket-message-body {
    margin-top: 8px;
    color: #4b5563;
    font-size: 12.5px;
    line-height: 1.65;
}

body.ops-ticket-detail-page .ticket-attachment-link {
    max-width: 180px;
    flex-shrink: 0;
    text-decoration: none;
}

body.ops-ticket-detail-page .ticket-composer-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    width: fit-content;
    padding: 14px 22px 0;
    border-bottom: 0;
}

body.ops-ticket-detail-page .ticket-composer-tab {
    border: 1px solid #e4e6ea;
    border-right: 0;
    background: #ffffff;
    color: #6b7280;
    padding: 5px 14px;
    border-radius: 0;
    font-weight: 500;
    cursor: pointer;
    width: auto;
    min-width: 0;
    font-size: 12px;
}

body.ops-ticket-detail-page .ticket-composer-tab:first-child {
    border-radius: 7px 0 0 7px;
}

body.ops-ticket-detail-page .ticket-composer-tab:last-child {
    border-right: 1px solid #e4e6ea;
    border-radius: 0 7px 7px 0;
}

body.ops-ticket-detail-page .ticket-composer-tab.is-active {
    background: #f3f4f6;
    color: #111827;
}

body.ops-ticket-detail-page .ticket-composer-tab[data-ticket-pane-button="public"].is-active {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #93c5fd;
}

body.ops-ticket-detail-page .ticket-composer-tab[data-ticket-pane-button="internal"].is-active {
    background: #fef3c7;
    color: #b45309;
    border-color: #fde68a;
}

body.ops-ticket-detail-page .ticket-composer-pane {
    padding: 10px 22px 18px;
}

body.ops-ticket-detail-page .ticket-composer-form {
    gap: 10px;
}

body.ops-ticket-detail-page .ticket-composer-form textarea {
    min-height: 76px;
    border-radius: 8px;
}

body.ops-ticket-detail-page .ticket-composer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

body.ops-ticket-detail-page .ticket-composer-attachment {
    width: auto;
    margin-bottom: 0;
}

body.ops-ticket-detail-page .ticket-composer-attachment input[type="file"] {
    width: auto;
}

body.ops-ticket-detail-page .ticket-composer-file-note {
    margin-top: 6px;
}

body.ops-ticket-detail-page .ticket-composer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

body.ops-ticket-detail-page .ticket-composer-submit {
    background: #2563eb;
    color: #ffffff;
    border: 1px solid #2563eb;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}

body.ops-ticket-detail-page .ticket-composer-submit:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

body.ops-ticket-detail-page .ticket-show-sidebar .ticket-show-panel {
    padding: 16px 15px;
    border: 0;
    border-bottom: 1px solid #e4e6ea;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    width: 100%;
    overflow: visible;
    position: relative;
}

body.ops-ticket-detail-page .ticket-show-sidebar .ticket-section-label {
    display: block;
    margin-bottom: 11px;
    color: #9ca3af;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

body.ops-ticket-detail-page .ticket-show-sidebar .ticket-show-form {
    gap: 8px;
}

body.ops-ticket-detail-page .ticket-show-sidebar .ticket-show-form > button,
body.ops-ticket-detail-page .ticket-show-sidebar .ticket-email-add-form > button {
    width: 100%;
    margin-top: 0;
}

body.ops-ticket-detail-page .ticket-show-sidebar .ticket-show-note {
    margin-top: 7px;
    font-size: 11px;
    line-height: 1.55;
}

body.ops-ticket-detail-page .ticket-show-sidebar .chat-field > span {
    display: none;
}

body.ops-ticket-detail-page .ticket-show-sidebar .chat-field {
    overflow: visible;
}

body.ops-ticket-detail-page .ticket-show-sidebar .user-multiselect {
    z-index: 2;
}

body.ops-ticket-detail-page .ticket-show-sidebar .user-multiselect.is-open {
    z-index: 20;
}

body.ops-ticket-detail-page .ticket-show-sidebar .user-multiselect-dropdown {
    z-index: 40;
}

body.ops-ticket-detail-page .ticket-show-sidebar select,
body.ops-ticket-detail-page .ticket-show-sidebar input,
body.ops-ticket-detail-page .ticket-show-sidebar textarea {
    border-radius: 7px;
    padding: 6px 9px;
    font-size: 12px;
    background: #ffffff;
}

body.ops-ticket-detail-page .ticket-show-sidebar button {
    border-radius: 7px;
    font-size: 12px;
    padding: 7px 10px;
    font-weight: 500;
}

body.ops-ticket-detail-page .ticket-show-sidebar .ticket-show-form > button:not(.secondary),
body.ops-ticket-detail-page .ticket-show-sidebar .ticket-email-add-form > button:not(.secondary) {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

body.ops-ticket-detail-page .ticket-show-sidebar .ticket-show-form > button:not(.secondary):hover,
body.ops-ticket-detail-page .ticket-show-sidebar .ticket-email-add-form > button:not(.secondary):hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

body.ops-ticket-detail-page .ticket-show-sidebar button.secondary {
    background: #ffffff;
    color: #374151;
    border: 1px solid #e4e6ea;
}

body.ops-ticket-detail-page .ticket-show-sidebar button.secondary:hover {
    background: #f3f4f6;
}

body.ops-ticket-detail-page .ticket-show-sidebar .table-wrap {
    margin-top: 10px;
}

body.ops-ticket-detail-page .ticket-show-sidebar table {
    font-size: 11px;
}

body.ops-ticket-detail-page .ticket-show-sidebar th,
body.ops-ticket-detail-page .ticket-show-sidebar td {
    padding-left: 0;
    padding-right: 0;
}

body.ops-ticket-detail-page .ticket-email-add-form {
    grid-template-columns: 1fr;
}

body.ops-ticket-detail-page .ticket-email-add-form button {
    width: 100%;
}

@media (max-width: 1280px) {
    body.ops-ticket-detail-page .ticket-detail-facts {
        grid-template-columns: repeat(3, minmax(0, max-content));
        gap: 20px;
    }
}

@media (max-width: 980px) {
    body.ops-ticket-detail-page .ticket-detail-hero {
        padding: 18px;
    }

    body.ops-ticket-detail-page .ticket-detail-hero-top,
    body.ops-ticket-detail-page .ticket-composer-footer {
        flex-direction: column;
        align-items: stretch;
    }

    body.ops-ticket-detail-page .ticket-detail-facts {
        grid-template-columns: 1fr 1fr;
    }

    body.ops-ticket-detail-page .main {
        height: auto;
        overflow: visible;
    }

    body.ops-ticket-detail-page .ticket-show-shell {
        flex-direction: column;
        overflow: visible;
        height: auto;
    }

    body.ops-ticket-detail-page .ticket-show-left,
    body.ops-ticket-detail-page .ticket-show-main {
        overflow: visible;
        min-height: 0;
    }

    body.ops-ticket-detail-page .ticket-conversation-panel {
        overflow: visible;
        height: auto;
    }

    body.ops-ticket-detail-page .ticket-show-sidebar {
        position: static;
        width: 100%;
        border-left: 0;
        border-top: 1px solid #e4e6ea;
        overflow-y: visible;
    }
}

@media (max-width: 640px) {
    body.ops-ticket-detail-page .ticket-detail-facts {
        grid-template-columns: 1fr;
    }

    body.ops-ticket-detail-page .ticket-message-card {
        padding: 18px 16px;
    }

    body.ops-ticket-detail-page .ticket-message-card.internal {
        margin: 12px 16px 14px;
    }

    body.ops-ticket-detail-page .ticket-message-head {
        flex-direction: column;
        gap: 8px;
    }

    body.ops-ticket-detail-page .ticket-message-timestamp {
        white-space: normal;
    }
}

/* ============================================================
   PORTAL TICKET SHOW PAGE  (body.portal-ticket-page)
   Matches pioneer_customer_ticket_matched.html mockup
   ============================================================ */

/* Override layout defaults so the ticket view fills full height
   with no side margins and no standard main-head */
body.portal-ticket-page .main-head {
    display: none;
}

body.portal-ticket-page .main {
    overflow-y: hidden;
}

body.portal-ticket-page .main > :not(.main-head),
body.portal-ticket-page .main > :last-child {
    margin: 0 !important;
}

body.portal-ticket-page .portal-content-wrap {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Root wrapper */
.pt-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    font-family: "SF Pro Display", -apple-system, "Segoe UI", sans-serif;
    font-size: 13px;
    color: #111827;
}

/* ── Header ──────────────────────────────── */
.pt-hdr {
    flex-shrink: 0;
    padding: 16px 22px 0;
    border-bottom: 1px solid #E4E6EA;
    background: #fff;
}

.pt-bc {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    color: #9CA3AF;
    margin-bottom: 12px;
}

.pt-bc-link {
    color: #2563EB;
    text-decoration: none;
}

.pt-bc-link:hover {
    text-decoration: underline;
}

.pt-bc-sep {
    color: #D1D5DB;
}

.pt-hdr-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.pt-hdr-copy {
    min-width: 0;
}

.pt-subject {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    line-height: 1.35;
}

.pt-ref {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: #9CA3AF;
    font-family: monospace;
}

.pt-badges {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    margin-top: 2px;
    align-items: center;
}

.pt-meta {
    display: flex;
    gap: 28px;
    padding-bottom: 14px;
    flex-wrap: wrap;
}

.pt-mi {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pt-mi-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9CA3AF;
}

.pt-mi-val {
    font-size: 12.5px;
    color: #374151;
    font-weight: 500;
}

/* ── Channel badge (in header meta + messages) ── */
.pt-ch {
    display: inline-flex;
    align-items: center;
    border-radius: 3px;
    font-size: 9.5px;
    font-weight: 600;
    padding: 2px 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pt-ch-email   { background: #DBEAFE; color: #1D4ED8; }
.pt-ch-portal  { background: #DCFCE7; color: #15803D; }
.pt-ch-phone   { background: #EDE9FE; color: #6D28D9; }

/* ── Body (thread col + right sidebar) ──── */
.pt-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* ── Thread column ───────────────────────── */
.pt-col-main {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #E4E6EA;
}

.pt-thread {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

/* ── Individual message ──────────────────── */
.pt-msg {
    display: flex;
    gap: 12px;
    padding: 14px 22px;
    border-bottom: 1px solid #F3F4F6;
}

.pt-msg:last-child {
    border-bottom: none;
}

.pt-av {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 1px;
}

.pt-av-g { background: #DCFCE7; color: #15803D; }
.pt-av-b { background: #DBEAFE; color: #1D4ED8; }
.pt-av-a { background: #FEF3C7; color: #B45309; }

.pt-msg-body {
    flex: 1;
    min-width: 0;
}

.pt-msg-head {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.pt-sender {
    font-size: 12.5px;
    font-weight: 600;
    color: #111827;
}

.pt-sender-sub {
    font-weight: 400;
    color: #9CA3AF;
    font-size: 11.5px;
}

.pt-ts {
    margin-left: auto;
    font-size: 11px;
    color: #9CA3AF;
    font-family: monospace;
    white-space: nowrap;
}

.pt-msg-text {
    font-size: 12.5px;
    color: #4B5563;
    line-height: 1.65;
}

.pt-msg-text p {
    margin-bottom: 5px;
}

.pt-msg-text p:last-child {
    margin: 0;
}

.pt-empty {
    padding: 24px 22px;
    font-size: 12.5px;
    color: #9CA3AF;
}

/* ── Compose area ────────────────────────── */
.pt-compose {
    flex-shrink: 0;
    border-top: 1px solid #E4E6EA;
    padding: 14px 22px;
    background: #FAFAFA;
}

.pt-compose-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #9CA3AF;
    margin-bottom: 8px;
}

.pt-compose-ta {
    display: block;
    width: 100%;
    border: 1px solid #E4E6EA;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12.5px;
    font-family: inherit;
    color: #374151;
    background: #fff;
    resize: none;
    height: 76px;
    margin-bottom: 10px;
    outline: none;
    box-shadow: none;
}

.pt-compose-ta:focus {
    border-color: #93C5FD;
}

.pt-compose-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pt-compose-attach {
    font-size: 11.5px;
    color: #9CA3AF;
    cursor: pointer;
}

.pt-compose-attach-link {
    color: #2563EB;
    font-weight: 500;
    cursor: pointer;
}

.pt-compose-attach:hover .pt-compose-attach-link {
    text-decoration: underline;
}

.pt-btn {
    border-radius: 7px;
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    border: 1px solid #E4E6EA;
    background: #fff;
    color: #374151;
    box-shadow: none;
    transform: none;
}

.pt-btn:hover {
    background: #F3F4F6;
    transform: none;
    box-shadow: none;
}

.pt-btn-p {
    background: #2563EB;
    color: #fff;
    border-color: #2563EB;
}

.pt-btn-p:hover {
    background: #1D4ED8;
    border-color: #1D4ED8;
}

/* ── Right sidebar ───────────────────────── */
.pt-side {
    width: 244px;
    min-width: 244px;
    flex-shrink: 0;
    background: #F8F9FB;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.pt-side-sec {
    padding: 16px 15px;
    border-bottom: 1px solid #E4E6EA;
}

.pt-side-title {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #9CA3AF;
    margin-bottom: 11px;
}

.pt-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #F3F4F6;
}

.pt-info-row:last-child {
    border-bottom: none;
}

.pt-info-label {
    font-size: 11px;
    color: #9CA3AF;
}

.pt-info-val {
    font-size: 12px;
    font-weight: 500;
    color: #111827;
    text-align: right;
}

.pt-mono {
    font-family: monospace;
}

.pt-side-note {
    font-size: 11px;
    color: #9CA3AF;
    line-height: 1.55;
    margin-bottom: 10px;
    margin-top: 0;
}

.pt-side-inp {
    display: block;
    width: 100%;
    border: 1px solid #E4E6EA;
    border-radius: 7px;
    padding: 6px 9px;
    font-size: 12px;
    font-family: inherit;
    color: #111827;
    background: #fff;
    outline: none;
    box-shadow: none;
}

.pt-side-inp:focus {
    border-color: #93C5FD;
}

.pt-side-btn-p {
    display: block;
    width: 100%;
    border: none;
    border-radius: 7px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    background: #2563EB;
    color: #fff;
    margin-top: 8px;
    box-shadow: none;
    transform: none;
}

.pt-side-btn-p:hover {
    background: #1D4ED8;
    transform: none;
    box-shadow: none;
}

.pt-cc-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
    margin-top: 10px;
}

.pt-cc-tbl th {
    text-align: left;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9CA3AF;
    padding: 5px 0;
    border-bottom: 1px solid #E4E6EA;
    background: transparent;
}

.pt-cc-tbl td {
    padding: 6px 0;
    border-bottom: 1px solid #F3F4F6;
    font-size: 11.5px;
    color: #374151;
    vertical-align: middle;
}

.pt-cc-tbl tr:last-child td {
    border-bottom: none;
}

.pt-cc-remove {
    background: transparent;
    border: none;
    color: #9CA3AF;
    font-size: 14px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    border-radius: 4px;
    box-shadow: none;
    transform: none;
}

.pt-cc-remove:hover {
    color: #EF4444;
    background: #FEF2F2;
    transform: none;
    box-shadow: none;
}

.pt-cc-empty {
    font-size: 11.5px;
    color: #9CA3AF;
    margin-top: 9px;
}
