html, body {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, rgba(20, 184, 166, .14), transparent 34%), #f7f8fb;
}

body { margin: 0; }

/* Suppress focus decoration caused by pointer/programmatic navigation while
   retaining an accessible focus indicator for keyboard navigation. */
a:focus:not(:focus-visible),
.brand-lockup:focus:not(:focus-visible),
.brand-mark:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

a:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 3px;
}
.app-shell { min-height: 100vh; }
.side-rail { border-right: 1px solid rgba(148, 163, 184, .18); backdrop-filter: blur(24px); }
.main-canvas { padding: 24px; }
.brand-lockup { display: flex; gap: 12px; align-items: center; padding: 24px; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: white; font-weight: 800; background: linear-gradient(135deg, #4f46e5, #14b8a6); box-shadow: 0 16px 30px rgba(79, 70, 229, .28); }
.brand-lockup span { display: block; color: #64748b; font-size: .8rem; }
.nav-menu { padding: 0 14px; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.topbar h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: 0; line-height: 1; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.eyebrow { color: #64748b; font-size: .78rem; font-weight: 800; letter-spacing: .12em; margin: 0 0 7px; text-transform: uppercase; }
.dashboard-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, .8fr); gap: 18px; margin-bottom: 18px; }
.glass-card { background: rgba(255, 255, 255, .72); border: 1px solid rgba(255, 255, 255, .82); border-radius: 8px; box-shadow: 0 24px 60px rgba(15, 23, 42, .08); backdrop-filter: blur(22px); }
.metric-card { padding: 20px; border-top: 3px solid var(--accent); }
.metric-card span, .metric-card small { color: #64748b; display: block; }
.metric-card strong { display: block; margin: 12px 0 4px; font-size: 2.1rem; line-height: 1; }
.running-work-card { position: relative; display: block; overflow: hidden; color: inherit; text-decoration: none; background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(236,254,255,.82)); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.running-work-card::after { content: ""; position: absolute; width: 110px; height: 110px; right: -42px; bottom: -54px; border-radius: 50%; background: rgba(14,165,233,.1); }
.running-work-card:hover { transform: translateY(-3px); border-color: rgba(14,165,233,.3); box-shadow: 0 28px 64px rgba(14,165,233,.16); }
.metric-card-heading { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; }
.metric-link-icon { display: grid !important; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #0284c7 !important; background: rgba(14,165,233,.12); }
.metric-filter-card { position: relative; display: block; overflow: hidden; color: inherit; text-decoration: none; background: linear-gradient(145deg, rgba(255,255,255,.95), rgba(248,250,252,.86)); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.metric-filter-card::after { content: ""; position: absolute; width: 96px; height: 96px; right: -44px; bottom: -50px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 10%, transparent); pointer-events: none; }
.metric-filter-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 28%, transparent); box-shadow: 0 24px 54px color-mix(in srgb, var(--accent) 14%, transparent); }
.metric-filter-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 32%, transparent); outline-offset: 3px; }
.metric-filter-icon { color: var(--accent) !important; background: color-mix(in srgb, var(--accent) 12%, white); transition: transform .18s ease, background .18s ease; }
.metric-filter-card:hover .metric-filter-icon { transform: translateY(-1px) rotate(-4deg); background: color-mix(in srgb, var(--accent) 18%, white); }
.metric-filter-link { display: flex !important; align-items: center; justify-content: space-between; gap: 10px; }
.metric-arrow { display: grid !important; place-items: center; width: 26px; height: 26px; border-radius: 999px; color: var(--accent) !important; background: color-mix(in srgb, var(--accent) 10%, white); transition: transform .18s ease; }
.metric-filter-card:hover .metric-arrow { transform: translateX(3px); }
.metric-breakdown { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 14px 0 12px; }
.metric-breakdown > span { display: flex !important; align-items: center; justify-content: space-between; gap: 5px; padding: 7px 8px; border: 1px solid rgba(148,163,184,.2); border-radius: 9px; color: #334155; background: rgba(248,250,252,.82); }
.metric-breakdown small { color: #64748b; font-size: .66rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.metric-breakdown b { font-size: .84rem; color: #0f172a; }
.metric-breakdown-open { border-color: rgba(20,184,166,.2) !important; background: rgba(240,253,250,.82) !important; }
.metric-breakdown-open b { color: #0f766e; }
.metric-breakdown-closed { border-color: rgba(100,116,139,.2) !important; background: rgba(241,245,249,.86) !important; }
.metric-breakdown-closed b { color: #475569; }
.metric-filter-banner { border-color: rgba(79,70,229,.18); background: linear-gradient(135deg, rgba(238,242,255,.96), rgba(255,255,255,.96)); }
.metric-banner-icon { color: #4f46e5; background: rgba(79,70,229,.12); }
.running-work-link { position: relative; z-index: 1; display: flex !important; align-items: center; gap: 7px; color: #0369a1 !important; font-weight: 800; }
.live-indicator { display: inline-block !important; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,.13); animation: live-pulse 1.8s ease-in-out infinite; }
.running-filter-banner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; margin-bottom: 18px; padding: 20px 22px; overflow: hidden; border: 1px solid rgba(14,165,233,.2); border-radius: 10px; background: linear-gradient(125deg, rgba(240,249,255,.98), rgba(236,253,245,.84)); box-shadow: 0 18px 45px rgba(14,165,233,.1); }
.running-filter-banner h1 { margin: 0; color: #0f172a; font-size: 1.35rem; }
.running-filter-banner p:last-child { margin: 5px 0 0; color: #64748b; }
.running-filter-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #0284c7, #10b981); box-shadow: 0 12px 24px rgba(14,165,233,.22); }
.sla-filter-banner { border-color: rgba(79,70,229,.18); background: linear-gradient(125deg, rgba(238,242,255,.96), rgba(248,250,252,.9)); }
.sla-filter-icon { background: linear-gradient(135deg, #4f46e5, #14b8a6); box-shadow: 0 12px 24px rgba(79,70,229,.2); }
.clear-running-filter { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; border: 1px solid rgba(14,165,233,.2); border-radius: 8px; color: #0369a1; background: rgba(255,255,255,.7); font-size: .82rem; font-weight: 850; text-decoration: none; }
.running-ticket-status { display: flex; align-items: center; gap: 8px; color: #047857; font-size: .8rem; font-weight: 850; }
.running-since { display: block; margin: 5px 0 0 16px; color: #64748b; }
.card-running-status { margin-top: 12px; }
.sla-ticket-status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; color: #0f766e; background: rgba(20,184,166,.1); font-size: .76rem; font-weight: 850; white-space: nowrap; }
.sla-ticket-status.risk { color: #b45309; background: rgba(245,158,11,.14); }
.sla-ticket-status.breached { color: #b91c1c; background: rgba(239,68,68,.13); }
@keyframes live-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .62; transform: scale(.82); } }
.panel-large, .ticket-surface { padding: 22px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: 1.25rem; }
.ticket-list-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; min-width: min(680px, 100%); }
.view-toggle { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid rgba(148,163,184,.28); border-radius: 8px; background: rgba(248,250,252,.86); }
.view-toggle button { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px; border: 0; border-radius: 7px; color: #475569; background: transparent; font: inherit; font-size: .84rem; font-weight: 850; cursor: pointer; transition: background-color .16s ease, box-shadow .16s ease, color .16s ease; }
.view-toggle button:hover { color: #1e293b; background: rgba(255,255,255,.74); }
.view-toggle button.active { color: #312e81; background: #fff; box-shadow: 0 8px 22px rgba(15,23,42,.1); }
.ticket-search { position: relative; display: grid; grid-template-columns: 38px 0 0; align-items: center; width: 42px; min-height: 42px; overflow: hidden; border: 1px solid rgba(148,163,184,.28); border-radius: 8px; background: rgba(255,255,255,.84); box-shadow: 0 10px 24px rgba(15,23,42,.06); transition: width .28s ease, grid-template-columns .28s ease, border-color .2s ease, box-shadow .2s ease, background-color .2s ease; }
.ticket-search.open { grid-template-columns: 38px minmax(180px, 1fr) 34px; width: min(380px, 100%); border-color: rgba(79,70,229,.38); background: #fff; box-shadow: 0 16px 34px rgba(79,70,229,.12); }
.ticket-search-icon, .ticket-search-clear { display: grid; place-items: center; width: 38px; height: 38px; border: 0; color: #475569; background: transparent; cursor: pointer; transition: color .16s ease, transform .16s ease; }
.ticket-search-icon:hover, .ticket-search-clear:hover { color: #312e81; transform: scale(1.04); }
.ticket-search input { min-width: 0; width: 100%; height: 38px; border: 0; outline: none; opacity: 0; color: #0f172a; background: transparent; font: inherit; font-size: .88rem; transition: opacity .18s ease .08s; }
.ticket-search.open input { opacity: 1; }
.ticket-search input::placeholder { color: #94a3b8; }
.ticket-search-clear { width: 34px; color: #64748b; }
.priority-bars { display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 90px 1fr 42px; align-items: center; gap: 12px; }
.bar-track { height: 10px; overflow: hidden; border-radius: 999px; background: rgba(148, 163, 184, .18); }
.bar-fill { height: 100%; border-radius: inherit; animation: slide-right .8s ease both; }
.bar-fill.low { background: #3b82f6; }
.bar-fill.medium { background: #22c55e; }
.bar-fill.high { background: #f97316; }
.bar-fill.critical { background: #ef4444; }
.sla-ring { width: 190px; height: 190px; margin: 10px auto 16px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--sla-color, #14b8a6) 0 var(--sla-health, 100%), rgba(148, 163, 184, .18) var(--sla-health, 100%) 100%); color: #0f172a; position: relative; transition: background .35s ease; }
.sla-ring::after { content: ""; position: absolute; inset: 18px; border-radius: inherit; background: rgba(255,255,255,.86); }
.sla-ring span, .sla-ring small { position: relative; z-index: 1; display: block; text-align: center; }
.sla-ring span { font-size: 2.3rem; font-weight: 800; }
.sla-live-summary { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.sla-live-summary > a { display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 999px; color: #0f766e; background: rgba(20,184,166,.1); font-size: .72rem; font-weight: 750; text-decoration: none; transition: transform .16s ease, box-shadow .16s ease; }
.sla-live-summary > a:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15,23,42,.1); }
.sla-live-summary .sla-risk { color: #b45309; background: rgba(245,158,11,.13); }
.sla-live-summary .sla-breached { color: #b91c1c; background: rgba(239,68,68,.12); }
.muted-copy { color: #64748b; line-height: 1.6; }
.priority-pill { padding: 5px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.priority-pill.low { color: #1d4ed8; background: rgba(59,130,246,.12); }
.priority-pill.medium { color: #15803d; background: rgba(34,197,94,.12); }
.priority-pill.high { color: #c2410c; background: rgba(249,115,22,.13); }
.priority-pill.critical { color: #b91c1c; background: rgba(239,68,68,.14); }
.kanban-grid { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 14px; overflow-x: auto; }
.kanban-column { background: rgba(248,250,252,.78); border: 1px solid rgba(148,163,184,.16); border-radius: 8px; padding: 12px; min-height: 420px; }
.column-title, .ticket-card > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ticket-card { background: white; border: 1px solid rgba(148,163,184,.18); border-radius: 8px; padding: 14px; margin-top: 12px; }
.ticket-card p { margin: 12px 0 10px; font-weight: 650; }
.ticket-card small { color: #64748b; }
.search-box { min-width: min(420px, 100%); }
.ticket-table-wrap { overflow-x: auto; border: 1px solid rgba(148,163,184,.18); border-radius: 8px; background: rgba(255,255,255,.86); }
.ticket-table { width: 100%; min-width: 860px; border-collapse: collapse; }
.ticket-table th, .ticket-table td { padding: 13px 14px; border-bottom: 1px solid rgba(148,163,184,.16); text-align: left; vertical-align: middle; }
.ticket-table th { color: #64748b; background: rgba(248,250,252,.92); font-size: .74rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.ticket-table td { color: #334155; font-size: .9rem; }
.ticket-table tbody tr:hover { background: rgba(238,242,255,.46); }
.ticket-table tbody tr:last-child td { border-bottom: 0; }
.ticket-subject-cell { max-width: 360px; color: #0f172a; font-weight: 720; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 9px; border-radius: 999px; font-size: .76rem; font-weight: 800; white-space: nowrap; }
.status-pill.new { color: #1d4ed8; background: rgba(59,130,246,.12); }
.status-pill.assigned, .status-pill.open { color: #047857; background: rgba(16,185,129,.13); }
.status-pill.pending, .status-pill.waitingcustomer { color: #b45309; background: rgba(245,158,11,.16); }
.status-pill.resolved { color: #4338ca; background: rgba(99,102,241,.13); }
.status-pill.closed { color: #475569; background: rgba(100,116,139,.14); }
.ticket-table-skeleton { display: grid; gap: 8px; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%, rgba(79,70,229,.16), transparent 34%), radial-gradient(circle at 80% 0%, rgba(20,184,166,.16), transparent 30%), #f7f8fb; }
.login-panel { width: min(460px, 100%); padding: 28px; }
.login-brand { padding: 0 0 22px; }
.login-copy h1 { margin: 0 0 10px; font-size: 2.2rem; letter-spacing: 0; }
.login-copy p:not(.eyebrow) { color: #64748b; line-height: 1.6; margin-bottom: 22px; }
.login-form { display: grid; gap: 16px; }
.login-field { display: grid; gap: 8px; color: #334155; font-weight: 700; }
.login-field input { width: 100%; border: 1px solid rgba(148,163,184,.36); border-radius: 8px; padding: 14px 15px; font: inherit; outline: none; background: rgba(255,255,255,.82); transition: border-color .2s ease, box-shadow .2s ease; }
.login-field input, .login-field select, .login-field textarea { width: 100%; border: 1px solid rgba(148,163,184,.36); border-radius: 8px; padding: 14px 15px; font: inherit; outline: none; background: rgba(255,255,255,.82); transition: border-color .2s ease, box-shadow .2s ease; }
.login-field input:focus, .login-field select:focus, .login-field textarea:focus { border-color: #4f46e5; box-shadow: 0 0 0 4px rgba(79,70,229,.12); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dns-record { display: grid; gap: 8px; padding: 14px; border: 1px solid rgba(148,163,184,.28); border-radius: 8px; background: rgba(248,250,252,.72); }
.dns-record span { color: #64748b; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.dns-record code { display: block; white-space: pre-wrap; overflow-wrap: anywhere; color: #0f172a; background: rgba(255,255,255,.78); border: 1px solid rgba(148,163,184,.22); border-radius: 6px; padding: 9px 10px; }
.ticket-link { color: #1d4ed8; font-weight: 900; text-decoration: none; }
.ticket-link:hover { text-decoration: underline; }
.activity-limit { width: 120px; }
.activity-limit.native-select { border: 1px solid rgba(148,163,184,.42); border-radius: 8px; padding: 8px 10px; background: rgba(255,255,255,.86); color: #0f172a; font-weight: 800; font-size: .84rem; outline: none; }
.activity-limit.native-select:focus { border-color: #4f46e5; box-shadow: 0 0 0 4px rgba(79,70,229,.12); }
.dashboard-activity-timeline { position: relative; display: grid; gap: 8px; padding: 2px 0 2px 6px; }
.dashboard-activity-timeline::before { content: ""; position: absolute; left: 10px; top: 8px; bottom: 8px; width: 1px; background: rgba(148,163,184,.35); }
.dashboard-activity-item { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: start; }
.activity-dot { z-index: 1; width: 9px; height: 9px; margin: 9px 0 0 0; border-radius: 999px; background: #4f46e5; box-shadow: 0 0 0 4px rgba(79,70,229,.12); }
.activity-card-mini { border: 1px solid rgba(148,163,184,.22); background: rgba(248,250,252,.7); border-radius: 8px; padding: 9px 11px; display: grid; gap: 4px; }
.activity-row-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.activity-row-top .ticket-link { font-size: .78rem; }
.activity-row-top time { color: #64748b; font-size: .72rem; white-space: nowrap; }
.activity-card-mini strong { color: #0f172a; font-size: .82rem; line-height: 1.25; }
.activity-card-mini p { margin: 0; color: #475569; font-size: .76rem; line-height: 1.35; overflow-wrap: anywhere; }
.action-row.compact { align-items: center; gap: 10px; }
.priority-editor { width: min(170px, 100%); padding: 3px; border: 1px solid rgba(245,158,11,.22); border-radius: 9px; background: rgba(255,251,235,.72); }
.priority-editor .mud-input-control { margin: 0; }
.assignment-editor { width: min(230px, 100%); padding: 3px; border: 1px solid rgba(79,70,229,.2); border-radius: 9px; background: rgba(238,242,255,.68); }
.assignment-editor .mud-input-control { margin: 0; }
.ticket-detail-grid { display: grid; gap: 18px; align-items: start; min-width: 0; }
.ticket-detail-grid.with-timeline { grid-template-columns: minmax(0, 1fr) 360px; }
.ticket-detail-grid.full-width { grid-template-columns: minmax(0, 1fr); }
.conversation-panel, .timeline-panel { min-width: 0; border: 1px solid rgba(148,163,184,.26); border-radius: 8px; background: rgba(255,255,255,.58); padding: 18px; }
.conversation-panel { background: linear-gradient(180deg, rgba(248,250,252,.92), rgba(255,255,255,.76)); box-shadow: inset 0 1px 0 rgba(255,255,255,.72); }
.ticket-meta { display: grid; grid-template-columns: repeat(2, max-content minmax(0, 1fr)); gap: 8px 14px; margin-bottom: 18px; color: #475569; }
.ticket-meta span { font-size: .75rem; text-transform: uppercase; font-weight: 800; color: #64748b; }
.ticket-quick-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; min-height: 42px; margin: -4px 0 14px; padding: 8px; border: 1px solid rgba(148,163,184,.2); border-radius: 8px; background: rgba(255,255,255,.64); }
.iconic-command { width: 44px !important; height: 44px !important; padding: 0 !important; border-width: 1.5px !important; border-radius: 8px !important; transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease !important; }
.iconic-command:hover:not(.mud-disabled) { transform: translateY(-1px); }
.neutral-command { color: #172033 !important; border-color: #172033 !important; background: rgba(255,255,255,.8) !important; }
.neutral-command:hover:not(.mud-disabled) { background: #f8fafc !important; box-shadow: 0 9px 20px rgba(15,23,42,.12); }
.close-command { color: #047857 !important; border-color: rgba(5,150,105,.7) !important; background: rgba(236,253,245,.78) !important; }
.close-command:hover:not(.mud-disabled) { background: #d1fae5 !important; box-shadow: 0 9px 20px rgba(5,150,105,.16); }
.delete-command { color: #b91c1c !important; border-color: rgba(220,38,38,.65) !important; background: rgba(254,242,242,.82) !important; }
.delete-command:hover:not(.mud-disabled) { background: #fee2e2 !important; box-shadow: 0 9px 20px rgba(220,38,38,.15); }
.merge-command { color: #0369a1 !important; border-color: rgba(2,132,199,.65) !important; background: rgba(240,249,255,.86) !important; }
.merge-command:hover:not(.mud-disabled) { background: #e0f2fe !important; box-shadow: 0 9px 20px rgba(2,132,199,.16); }
.start-command { color: #1d4ed8 !important; border-color: rgba(37,99,235,.68) !important; background: rgba(239,246,255,.86) !important; }
.start-command:hover:not(.mud-disabled) { background: #dbeafe !important; box-shadow: 0 9px 20px rgba(37,99,235,.16); }
.stop-command { color: #dc2626 !important; border-color: rgba(220,38,38,.68) !important; background: rgba(254,242,242,.9) !important; }
.stop-command:hover:not(.mud-disabled) { background: #fee2e2 !important; box-shadow: 0 9px 20px rgba(220,38,38,.17); }
.toolbar-confirm { margin-top: -4px; margin-bottom: 14px; }
.ticket-action-panel { margin-bottom: 18px; padding: 16px; box-shadow: none; }
.ticket-merge-panel { margin: 0 0 18px; padding: 18px; border-color: rgba(2,132,199,.22); background: linear-gradient(135deg, rgba(240,249,255,.92), rgba(255,255,255,.86)); box-shadow: none; }
.merge-choice-label { margin: 18px 0 9px; color: #334155; font-weight: 850; }
.merge-keep-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.merge-keep-option { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 10px; padding: 14px; border: 1px solid rgba(148,163,184,.3); border-radius: 9px; color: #334155; background: rgba(255,255,255,.78); font: inherit; text-align: left; cursor: pointer; transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.merge-keep-option:hover { transform: translateY(-1px); border-color: rgba(2,132,199,.45); box-shadow: 0 10px 22px rgba(2,132,199,.1); }
.merge-keep-option.selected { color: #075985; border-color: #0ea5e9; background: rgba(224,242,254,.82); box-shadow: 0 0 0 3px rgba(14,165,233,.1); }
.merge-keep-option span, .merge-keep-option small { display: block; min-width: 0; }
.merge-keep-option small { margin-top: 3px; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.merge-confirm-actions { justify-content: flex-end; }
.estimate-editor { display: grid; grid-template-columns: minmax(170px, .35fr) minmax(260px, 1fr); gap: 12px; align-items: center; margin: 0 0 14px; padding: 12px; border: 1px solid rgba(148,163,184,.2); border-radius: 8px; background: rgba(255,255,255,.72); }
.estimate-display { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; align-items: center; min-width: 0; }
.estimate-display > .mud-icon-root { width: 38px; height: 38px; padding: 8px; border-radius: 8px; color: #0f766e; background: rgba(20,184,166,.12); }
.estimate-display span { color: #64748b; font-size: .72rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.estimate-display strong { display: block; margin-top: 2px; color: #0f172a; font-size: 1.05rem; line-height: 1.15; overflow-wrap: anywhere; }
.estimate-controls { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(120px, .65fr) 44px 44px; gap: 9px; align-items: center; min-width: 0; }
.reply-composer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .48fr); gap: 14px; align-items: stretch; }
.reply-editor { min-width: 0; }
.attachment-picker { display: grid; gap: 10px; min-width: 0; }
.attachment-dropzone { position: relative; min-height: 126px; display: grid; place-items: center; align-content: center; gap: 6px; padding: 18px; border: 1px dashed rgba(79,70,229,.42); border-radius: 8px; color: #334155; background: linear-gradient(180deg, rgba(238,242,255,.75), rgba(255,255,255,.72)); cursor: pointer; transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease; text-align: center; }
.attachment-dropzone:hover { border-color: rgba(79,70,229,.78); box-shadow: 0 12px 30px rgba(79,70,229,.12); transform: translateY(-1px); }
.attachment-dropzone.disabled { cursor: default; opacity: .62; transform: none; box-shadow: none; }
.attachment-dropzone .mud-icon-root { color: #4f46e5; font-size: 2rem; }
.attachment-dropzone span { color: #0f172a; font-weight: 850; }
.attachment-dropzone small { max-width: 280px; color: #64748b; line-height: 1.35; }
.attachment-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.attachment-dropzone.disabled .attachment-input { cursor: default; }
.selected-attachments { display: grid; gap: 8px; }
.selected-attachment, .attachment-card { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-width: 0; min-height: 54px; padding: 9px 10px; border: 1px solid rgba(148,163,184,.24); border-radius: 8px; background: rgba(255,255,255,.82); }
.selected-attachment > div, .attachment-card > div { min-width: 0; }
.selected-attachment > .mud-icon-root, .attachment-card > .mud-icon-root { width: 34px; height: 34px; padding: 7px; border-radius: 8px; color: #4f46e5; background: rgba(79,70,229,.1); }
.selected-attachment strong, .attachment-card strong { display: block; color: #0f172a; font-size: .88rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-attachment span, .attachment-card span { display: block; margin-top: 2px; color: #64748b; font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.attachment-card { min-height: 62px; background: rgba(248,250,252,.82); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.attachment-card:hover { border-color: rgba(79,70,229,.34); box-shadow: 0 14px 34px rgba(15,23,42,.08); transform: translateY(-1px); }
.message-thread { display: grid; gap: 14px; min-width: 0; overflow: hidden; padding: 18px; border: 1px solid rgba(148,163,184,.16); border-radius: 8px; background: radial-gradient(circle at 10% 0%, rgba(79,70,229,.08), transparent 32%), linear-gradient(180deg, rgba(241,245,249,.78), rgba(255,255,255,.64)); }
.message-toggle { justify-self: center; display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 11px; border: 1px solid rgba(148,163,184,.28); border-radius: 999px; color: #475569; background: rgba(255,255,255,.78); font: inherit; font-size: .8rem; font-weight: 850; cursor: pointer; transition: color .16s ease, border-color .16s ease, background-color .16s ease, box-shadow .16s ease; }
.message-toggle:hover { color: #312e81; border-color: rgba(79,70,229,.36); background: #fff; box-shadow: 0 8px 18px rgba(15,23,42,.08); }
.message-toggle .mud-icon-root { font-size: 1.05rem; }
.ticket-message { position: relative; width: min(760px, 100%); max-width: 100%; min-width: 0; overflow: hidden; border: 1px solid rgba(148,163,184,.22); border-radius: 8px; padding: 16px; background: rgba(255,255,255,.9); box-shadow: 0 12px 32px rgba(15,23,42,.06); }
.ticket-message.main-ticket { border-color: rgba(79,70,229,.3); background: linear-gradient(180deg, rgba(238,242,255,.96), rgba(255,255,255,.9)); }
.ticket-message.customer-reply { justify-self: start; border-color: rgba(14,165,233,.3); background: rgba(240,249,255,.96); }
.ticket-message.agent-reply { justify-self: end; border-color: rgba(34,197,94,.32); background: rgba(240,253,244,.97); }
.ticket-message.internal-note { justify-self: center; width: min(680px, 100%); border-color: rgba(245,158,11,.36); background: rgba(255,251,235,.96); }
.message-header { display: flex; justify-content: space-between; gap: 12px; min-width: 0; color: #64748b; margin-bottom: 12px; }
.message-header > div { display: grid; gap: 2px; min-width: 0; }
.message-header strong { color: #0f172a; }
.message-header span { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; overflow-wrap: anywhere; }
.message-header small { flex: 0 0 auto; }
.message-body { max-width: 100%; min-width: 0; color: #0f172a; line-height: 1.6; overflow-x: auto; overflow-y: hidden; overflow-wrap: anywhere; word-break: break-word; }
.message-body * { max-width: 100%; box-sizing: border-box; }
.message-body p { margin: 0 0 10px; }
.message-body img { display: block; max-width: min(100%, 720px); max-height: 520px; height: auto; object-fit: contain; border-radius: 8px; }
.message-body pre { max-width: 100%; white-space: pre-wrap; overflow-x: auto; overflow-wrap: anywhere; }
.message-body code { white-space: pre-wrap; overflow-wrap: anywhere; }
.message-body table { display: block; width: max-content; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.message-body td, .message-body th { border: 1px solid rgba(148,163,184,.25); padding: 6px 8px; }
.message-body td, .message-body th, .message-body li, .message-body a { overflow-wrap: anywhere; word-break: break-word; }
.chat-attachments { display: grid; gap: 9px; min-width: 0; margin-top: 12px; }
.chat-attachments .attachment-card { background: rgba(255,255,255,.74); }
.attachment-card.image-card { grid-template-columns: 72px minmax(0, 1fr) auto; }
.chat-attachment-preview { width: 72px; height: 54px; max-width: 72px; object-fit: cover; border-radius: 8px; border: 1px solid rgba(148,163,184,.24); background: #fff; }
.ticket-reply-panel { display: grid; gap: 10px; margin-top: 16px; padding: 14px; border: 1px solid rgba(148,163,184,.24); border-radius: 8px; background: rgba(255,255,255,.82); }
.reply-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reply-panel-header h2 { margin: 0; font-size: 1rem; }
.reply-toolbar { display: inline-flex; align-items: center; gap: 4px; width: fit-content; padding: 3px; border: 1px solid rgba(148,163,184,.24); border-radius: 8px; background: rgba(248,250,252,.84); }
.reply-toolbar button { display: grid; place-items: center; width: 34px; height: 32px; border: 0; border-radius: 6px; color: #475569; background: transparent; cursor: pointer; }
.reply-toolbar button:hover:not(:disabled) { color: #312e81; background: #fff; box-shadow: 0 6px 14px rgba(15,23,42,.08); }
.reply-toolbar button:disabled { cursor: default; opacity: .5; }
.reply-toolbar .mud-icon-root { font-size: 1.15rem; }
.html-reply-editor { min-height: 136px; max-height: 420px; overflow: auto; padding: 12px 13px; border: 1px solid rgba(148,163,184,.34); border-radius: 8px; color: #0f172a; background: #fff; line-height: 1.55; outline: none; overflow-wrap: anywhere; }
.html-reply-editor:focus { border-color: rgba(79,70,229,.58); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.html-reply-editor:empty::before { content: attr(data-placeholder); color: #94a3b8; }
.html-reply-editor.disabled { opacity: .68; background: rgba(248,250,252,.9); }
.html-reply-editor img { display: block; max-width: min(100%, 680px); max-height: 420px; margin: 8px 0; object-fit: contain; border-radius: 8px; }
.html-reply-editor table { max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.html-reply-editor td, .html-reply-editor th { border: 1px solid rgba(148,163,184,.28); padding: 5px 7px; }
.reply-footer { display: grid; grid-template-columns: auto minmax(260px, 1fr); gap: 10px; align-items: center; }
.reply-attach-button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 12px; border: 1px dashed rgba(79,70,229,.45); border-radius: 8px; color: #334155; background: rgba(238,242,255,.54); font-weight: 800; cursor: pointer; overflow: hidden; }
.reply-attach-button:hover { border-color: rgba(79,70,229,.75); background: rgba(238,242,255,.78); }
.reply-attach-button.disabled { cursor: default; opacity: .62; }
.reply-recipient-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.reply-note-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; padding-top: 10px; border-top: 1px solid rgba(148,163,184,.18); }
.compact-list { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.timeline-panel h3 { margin: 0 0 14px; font-size: 1rem; }
.timeline-list { display: grid; gap: 14px; }
.timeline-item { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; }
.timeline-item > span { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: #4f46e5; box-shadow: 0 0 0 4px rgba(79,70,229,.12); }
.timeline-item strong { color: #0f172a; }
.timeline-item p { margin: 3px 0; color: #475569; }
.timeline-item small { color: #64748b; }
@media (max-width: 980px) { .ticket-detail-grid.with-timeline, .ticket-detail-grid.full-width, .reply-composer, .reply-footer, .estimate-editor { grid-template-columns: minmax(0, 1fr); } .ticket-meta { grid-template-columns: max-content minmax(0, 1fr); } .ticket-message.agent-reply { margin-left: 0; } }
@media (max-width: 640px) { .main-canvas { padding: 16px; } .conversation-panel, .timeline-panel, .message-thread { padding: 12px; } .ticket-message { padding: 13px; } .message-header, .reply-panel-header, .reply-recipient-add, .reply-note-panel, .estimate-controls, .merge-keep-grid { display: grid; grid-template-columns: minmax(0, 1fr); } .ticket-quick-toolbar { justify-content: stretch; } .ticket-quick-toolbar .mud-button-root { flex: 1 1 160px; } .attachment-card.image-card { grid-template-columns: 56px minmax(0, 1fr) auto; } .chat-attachment-preview { width: 56px; max-width: 56px; height: 44px; } }
.wide { grid-column: 1 / -1; }
.action-row { display: flex; gap: 12px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.agent-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid rgba(148,163,184,.18); }
.agent-row span { display: block; color: #64748b; margin-top: 3px; }
.fade-in { animation: fade-in .38s ease both; }
.slide-up { animation: slide-up .42s ease both; }
.card-hover { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: 0 24px 60px rgba(15, 23, 42, .14); border-color: rgba(79, 70, 229, .3); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slide-right { from { width: 0; } }
@keyframes pulse { 50% { opacity: .64; } }
@keyframes glow { 50% { box-shadow: 0 0 24px rgba(79, 70, 229, .35); } }
@keyframes shimmer { to { background-position-x: -200%; } }

#blazor-error-ui { display: none; }

@media (max-width: 1100px) {
    .dashboard-grid, .workspace-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .main-canvas { padding: 16px; }
    .topbar, .section-heading { align-items: flex-start; flex-direction: column; }
    .dashboard-grid, .workspace-grid { grid-template-columns: 1fr; }
}
.settings-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.ticket-sidebar-properties {
    display: grid;
    gap: 0.85rem;
}
