:root {
    --navy-950: #061525;
    --navy-900: #081b30;
    --navy-800: #0d2743;
    --navy-700: #173b61;
    --gold-600: #a9843d;
    --gold-500: #c7a35b;
    --gold-300: #e3cc98;
    --cream-100: #fbfaf6;
    --cream-200: #f3efe7;
    --slate-900: #1b2430;
    --slate-700: #445264;
    --slate-500: #748092;
    --slate-300: #cad1da;
    --slate-200: #e4e8ed;
    --slate-100: #f4f6f8;
    --white: #ffffff;
    --green: #1f7a56;
    --red: #b63c43;
    --orange: #c4642d;
    --amber: #a96d11;
    --blue: #2768a7;
    --cyan: #157c8b;
    --purple: #6651a7;
    --shadow-sm: 0 3px 12px rgba(5, 22, 40, .07);
    --shadow-md: 0 14px 38px rgba(5, 22, 40, .12);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100%;
    overflow-x: hidden;
    color: var(--slate-900);
    background: #f5f6f7;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.55;
}
a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--gold-600); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar {
    width: 272px;
    min-height: 100vh;
    max-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    background:
        radial-gradient(circle at top right, rgba(199, 163, 91, .14), transparent 32%),
        linear-gradient(180deg, var(--navy-950), var(--navy-900));
    color: rgba(255, 255, 255, .82);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(199, 163, 91, .18);
}
.sidebar::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .12;
    background-image: linear-gradient(135deg, transparent 0 47%, rgba(255,255,255,.08) 48% 49%, transparent 50% 100%);
    background-size: 24px 24px;
}
.sidebar > * { position: relative; z-index: 1; }
.sidebar-brand { min-height: 98px; padding: 18px 18px 14px; display: flex; align-items: center; }
.brand-link { display: flex; gap: 12px; align-items: center; color: #fff; min-width: 0; }
.brand-link:hover { color: #fff; }
.brand-link img { width: 64px; height: 48px; object-fit: contain; }
.brand-link div { min-width: 0; }
.brand-link strong { display: block; color: var(--gold-300); font-family: Georgia, 'Times New Roman', serif; font-size: 19px; letter-spacing: .04em; }
.brand-link span { display: block; color: var(--gold-300); font-size: 10px; text-transform: uppercase; letter-spacing: .13em; margin-top: 2px; }
.sidebar-close { display: none; border: 0; background: transparent; color: #fff; font-size: 26px; margin-left: auto; }
.sidebar-section-label { padding: 15px 24px 7px; color: rgba(255, 255, 255, .38); font-size: 10px; text-transform: uppercase; letter-spacing: .15em; font-weight: 700; }
.sidebar-nav { display: grid; gap: 3px; padding: 0 12px; }
.nav-item { min-height: 44px; padding: 9px 12px; display: flex; align-items: center; gap: 12px; border-radius: 9px; color: rgba(255,255,255,.75); transition: .18s ease; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(199,163,91,.22), rgba(199,163,91,.08)); color: #fff; box-shadow: inset 3px 0 0 var(--gold-500); }
.nav-icon { width: 22px; text-align: center; font-size: 17px; color: var(--gold-300); }
.nav-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; }
.sidebar-footer { margin-top: auto; padding: 16px; border-top: 1px solid rgba(255,255,255,.08); background: rgba(0,0,0,.11); }
.sidebar-user { display: flex; gap: 10px; align-items: center; }
.avatar, .topbar-avatar { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(145deg, var(--gold-300), var(--gold-600)); color: var(--navy-950); font-weight: 800; box-shadow: 0 0 0 3px rgba(199,163,91,.15); }
.avatar img, .topbar-avatar img { width: 100%; height: 100%; display: block; border-radius: inherit; object-fit: cover; }
.avatar-sm { width: 34px; height: 34px; font-size: 12px; box-shadow: 0 0 0 2px rgba(199,163,91,.13); }
.sidebar-user-text { min-width: 0; }
.sidebar-user-text strong { display: block; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-text span { display: block; color: rgba(255,255,255,.47); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-links { display: flex; gap: 16px; margin: 12px 0 0 48px; }
.sidebar-user-links a { color: var(--gold-300); font-size: 11px; }
.sidebar-overlay { display: none; }
.main-area { min-width: 0; width: calc(100% - 272px); flex: 1; margin-left: 272px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { min-height: 86px; padding: 14px 30px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--slate-200); display: flex; justify-content: space-between; align-items: center; gap: 22px; position: sticky; top: 0; z-index: 30; backdrop-filter: blur(10px); }
.topbar-left { min-width: 0; display: flex; align-items: center; gap: 14px; }
.topbar-left > div { min-width: 0; }
.menu-button { display: none; border: 1px solid var(--slate-200); background: #fff; color: var(--navy-900); border-radius: 8px; width: 42px; height: 42px; }
.eyebrow { color: var(--gold-600); text-transform: uppercase; letter-spacing: .13em; font-size: 10px; font-weight: 700; }
.topbar h1 { margin: 2px 0 0; max-width: 100%; overflow-wrap: anywhere; font-family: Georgia, 'Times New Roman', serif; color: var(--navy-900); font-size: 27px; font-weight: 500; line-height: 1.2; }
.topbar-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 15px; }
.global-search { width: min(310px, 25vw); height: 40px; padding: 0 9px 0 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--slate-200); border-radius: 10px; background: var(--slate-100); transition: .17s ease; }
.global-search:focus-within { border-color: var(--gold-500); background: #fff; box-shadow: 0 0 0 3px rgba(199,163,91,.14); }
.global-search-icon { flex: 0 0 auto; color: var(--slate-500); font-size: 17px; line-height: 1; }
.global-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--slate-900); }
.global-search input::placeholder { color: var(--slate-500); }
.global-search input::-webkit-search-cancel-button { cursor: pointer; }
.global-search kbd { flex: 0 0 auto; min-width: 21px; height: 21px; display: inline-grid; place-items: center; border: 1px solid var(--slate-300); border-radius: 5px; background: #fff; color: var(--slate-500); box-shadow: 0 1px 1px rgba(5,22,40,.08); font: 700 11px/1 Arial, sans-serif; }
.sla-alert { display: inline-flex; gap: 7px; align-items: center; color: var(--red); font-size: 12px; font-weight: 700; }
.sla-alert span { width: 23px; height: 23px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #fff0f1; }
.escalation-notification-menu { position: relative; flex: 0 0 auto; }
.escalation-alert { position: relative; flex: 0 0 auto; width: 38px; height: 38px; padding: 0; display: inline-grid; place-items: center; border: 1px solid var(--slate-200); border-radius: 50%; background: #fff; color: var(--slate-500); font-weight: 800; }
.escalation-alert:hover, .escalation-alert.has-alerts { border-color: #e5b76c; color: #9b481e; background: #fff8e8; }
.escalation-alert strong { position: absolute; right: -5px; top: -6px; min-width: 20px; height: 20px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; border-radius: 99px; background: var(--red); color: #fff; font-size: 10px; box-shadow: 0 0 0 2px #fff; }
.escalation-alert:focus-visible { outline: 3px solid rgba(196,100,45,.22); outline-offset: 3px; }
.update-notification-menu { position: relative; flex: 0 0 auto; }
.update-notification-alert { position: relative; width: 38px; height: 38px; padding: 0; display: inline-grid; place-items: center; border: 1px solid var(--slate-200); border-radius: 50%; background: #fff; color: var(--slate-500); font-size: 16px; }
.update-notification-alert:hover, .update-notification-alert.has-alerts { border-color: #93bddd; color: #1f5d95; background: #eef6fc; }
.update-notification-alert strong { position: absolute; right: -5px; top: -6px; min-width: 20px; height: 20px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; border-radius: 99px; background: #1f5d95; color: #fff; font-size: 10px; box-shadow: 0 0 0 2px #fff; }
.update-notification-alert:focus-visible { outline: 3px solid rgba(39,104,167,.22); outline-offset: 3px; }
.internal-chat-notification-menu { position: relative; flex: 0 0 auto; }
.internal-chat-alert { position: relative; width: 38px; height: 38px; padding: 0; display: inline-grid; place-items: center; border: 1px solid var(--slate-200); border-radius: 50%; background: #fff; color: var(--slate-500); font-size: 16px; }
.internal-chat-alert:hover, .internal-chat-alert.has-alerts { border-color: var(--gold-500); color: var(--navy-800); background: #fff9e9; }
.internal-chat-alert strong { position: absolute; right: -5px; top: -6px; min-width: 20px; height: 20px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; border-radius: 99px; background: var(--navy-700); color: #fff; font-size: 10px; box-shadow: 0 0 0 2px #fff; }
.internal-chat-alert:focus-visible { outline: 3px solid rgba(199,163,91,.28); outline-offset: 3px; }
.notification-dropdown { position: absolute; top: calc(100% + 12px); right: 0; z-index: 80; width: min(430px, calc(100vw - 24px)); max-height: min(680px, calc(100vh - 110px)); display: flex; flex-direction: column; overflow: hidden; border: 1px solid #cfdbe6; border-radius: 14px; background: #fff; box-shadow: 0 20px 52px rgba(5,22,40,.2); color: var(--slate-900); }
.notification-dropdown-header { position: relative; z-index: 1; min-height: 65px; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--slate-200); background: #fff; }
.notification-dropdown-header strong { display: block; color: var(--navy-900); font-family: Georgia, 'Times New Roman', serif; font-size: 17px; }
.notification-dropdown-header span { display: block; margin-top: 1px; color: var(--slate-500); font-size: 11px; }
.notification-dropdown-header a { flex: 0 0 auto; color: var(--blue); font-size: 12px; font-weight: 700; }
.notification-dropdown-list { min-height: 94px; overflow-y: auto; overscroll-behavior: contain; background: #fff; }
.notification-dropdown-item { min-height: 88px; padding: 11px 14px; display: grid; grid-template-columns: 9px minmax(0, 1fr); gap: 10px; border-bottom: 1px solid #e5ebf0; color: inherit; transition: background .15s ease; }
.notification-dropdown-item:last-child { border-bottom: 0; }
.notification-dropdown-item.is-unread { background: #eaf5ff; }
.notification-dropdown-item.is-read { background: #fff; }
.notification-dropdown-item:hover { color: inherit; background: #f2f7fb; }
.notification-dropdown-item.is-unread:hover { background: #dceeff; }
.notification-dropdown-item:focus-visible { position: relative; z-index: 1; outline: 3px solid rgba(39,104,167,.24); outline-offset: -3px; }
.notification-dropdown-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--slate-300); }
.notification-dropdown-item.is-unread .notification-dropdown-dot { background: var(--blue); box-shadow: 0 0 0 3px rgba(39,104,167,.12); }
.notification-dropdown-content { min-width: 0; display: block; }
.notification-dropdown-title { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.notification-dropdown-title strong { min-width: 0; overflow: hidden; color: var(--navy-900); font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.notification-dropdown-title time { color: var(--slate-500); font-size: 9px; line-height: 1.5; white-space: nowrap; }
.notification-dropdown-type { display: block; margin-top: 3px; color: var(--blue); font-size: 10px; font-weight: 700; }
.notification-dropdown-message { margin-top: 2px; display: -webkit-box; overflow: hidden; color: var(--slate-700); font-size: 11px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.notification-dropdown-by { display: block; margin-top: 3px; color: var(--slate-500); font-size: 9px; }
.notification-dropdown-empty { min-height: 150px; padding: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--slate-500); text-align: center; }
.notification-dropdown-empty > span { font-size: 23px; }
.notification-dropdown-empty strong { margin-top: 5px; color: var(--navy-900); }
.notification-dropdown-empty small { margin-top: 2px; }
.notification-dropdown-footer { min-height: 42px; padding: 10px 16px; display: block; border-top: 1px solid var(--slate-200); background: var(--slate-100); color: var(--navy-700); text-align: center; font-size: 11px; font-weight: 700; }
.notification-dropdown-footer:hover { color: var(--blue); background: #edf4f9; }
.content-wrap { min-width: 0; width: 100%; max-width: 1600px; margin: 0 auto; padding: 28px 30px 40px; flex: 1; }
.app-footer { padding: 18px 30px; display: flex; justify-content: space-between; color: var(--slate-500); border-top: 1px solid var(--slate-200); font-size: 11px; }

.page-actions { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.page-actions-left, .page-actions-right { min-width: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.page-actions-right { justify-content: flex-end; }
.section-title { margin: 0 0 16px; color: var(--navy-900); font-family: Georgia, 'Times New Roman', serif; font-size: 22px; font-weight: 500; }
.section-subtitle { margin: -10px 0 20px; color: var(--slate-500); }

.btn { min-height: 40px; padding: 9px 15px; border-radius: 8px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; font-weight: 700; font-size: 13px; line-height: 1.2; transition: .17s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible, .form-control:focus-visible, .clickable-row:focus-visible { outline: 3px solid rgba(199,163,91,.28); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; opacity: .58; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--navy-800), var(--navy-950)); color: #fff; box-shadow: 0 5px 14px rgba(6,21,37,.14); }
.btn-primary:hover { color: #fff; background: var(--navy-700); }
.btn-gold { background: linear-gradient(135deg, var(--gold-500), var(--gold-600)); color: var(--navy-950); }
.btn-gold:hover { color: var(--navy-950); }
.btn-outline { background: #fff; color: var(--navy-800); border-color: var(--slate-300); }
.btn-outline:hover { border-color: var(--gold-500); color: var(--gold-600); }
.btn-danger { background: #fff; color: var(--red); border-color: #ecc9cc; }
.btn-sm { min-height: 33px; padding: 6px 10px; font-size: 11px; }
.btn-block { width: 100%; }

.alert { border-radius: 10px; padding: 13px 15px; margin-bottom: 18px; display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; border: 1px solid; box-shadow: var(--shadow-sm); }
.alert button { border: 0; background: transparent; font-size: 20px; line-height: 1; color: inherit; }
.alert-success { color: #155d40; background: #ebf8f1; border-color: #bfe4d1; }
.alert-danger { color: #8d242b; background: #fff0f1; border-color: #ecc5c8; }
.alert-warning { color: #7f550e; background: #fff8e8; border-color: #edd9a7; }
.alert-info { color: #1f5e8f; background: #edf6fd; border-color: #c5dff3; }

.card { min-width: 0; background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.card-header { min-width: 0; min-height: 60px; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; gap: 14px; border-bottom: 1px solid var(--slate-200); }
.card-header h2, .card-header h3 { margin: 0; color: var(--navy-900); font-family: Georgia, 'Times New Roman', serif; font-weight: 500; }
.card-header h2 { font-size: 20px; }
.card-header h3 { font-size: 17px; }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--slate-200); background: var(--cream-100); border-radius: 0 0 var(--radius-md) var(--radius-md); }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-grid-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-grid > *, .dashboard-grid > *, .detail-grid > *, .form-grid > *, .stack > * { min-width: 0; }
.stat-card {
    position: relative;
    overflow: hidden;
    padding: 20px;
    min-height: 136px;
    background: #fff;
    color: inherit;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transform: translate3d(0, 0, 0);
    transition:
        transform .22s cubic-bezier(.2, .7, .2, 1),
        box-shadow .22s ease,
        border-color .22s ease;
}
.stat-card::after {
    content: '';
    position: absolute;
    right: -22px;
    top: -32px;
    width: 102px;
    height: 102px;
    border-radius: 50%;
    background: rgba(199,163,91,.08);
    transition: transform .25s ease, background .25s ease;
}
.stat-card:hover,
.stat-card:focus-visible {
    z-index: 1;
    transform: translate3d(0, -6px, 0) scale(1.012);
    border-color: rgba(199,163,91,.48);
    box-shadow: 0 16px 30px rgba(6,21,37,.14);
}
.stat-card:hover::after,
.stat-card:focus-visible::after {
    transform: translate3d(-5px, 5px, 0) scale(1.08);
    background: rgba(199,163,91,.13);
}
.stat-card:focus-visible {
    outline: 3px solid rgba(199,163,91,.24);
    outline-offset: 3px;
}
.stat-card:active {
    transform: translate3d(0, -2px, 0) scale(1.004);
}
.stat-label { color: var(--slate-500); text-transform: uppercase; letter-spacing: .09em; font-size: 10px; font-weight: 700; }
.stat-value { margin: 10px 0 3px; color: var(--navy-900); font-family: Georgia, 'Times New Roman', serif; font-size: 34px; line-height: 1; }
.stat-meta { color: var(--slate-500); font-size: 12px; }
.stat-accent {
    position: absolute;
    left: 0;
    top: 19px;
    width: 4px;
    height: 46px;
    border-radius: 0 4px 4px 0;
    background: var(--gold-500);
    transition: height .22s ease, transform .22s ease;
}
.stat-card:hover .stat-accent,
.stat-card:focus-visible .stat-accent {
    height: 56px;
    transform: translateY(-2px);
}
.stat-danger .stat-accent { background: var(--red); }
.stat-warning .stat-accent { background: var(--amber); }
.stat-success .stat-accent { background: var(--green); }
.stat-blue .stat-accent { background: var(--blue); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); gap: 20px; }
.stack { display: grid; gap: 20px; }

.table-responsive { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.data-table th { padding: 12px 13px; text-align: left; color: var(--slate-500); background: #f7f8fa; border-bottom: 1px solid var(--slate-200); font-size: 10px; text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; }
.data-table td { padding: 13px; border-bottom: 1px solid #edf0f3; vertical-align: middle; overflow-wrap: anywhere; }
.data-table tbody tr:hover { background: #fcfbf7; }
.data-table tbody tr.clickable-row { cursor: pointer; transition: background .15s ease, box-shadow .15s ease; }
.data-table tbody tr.clickable-row:hover { background: #fbf8ef; box-shadow: inset 3px 0 0 var(--gold-500); }
.data-table tbody tr.clickable-row:focus { background: #fbf8ef; box-shadow: inset 3px 0 0 var(--gold-500); outline: none; }
.data-table tbody tr.clickable-row:active { background: #f6f0df; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.ticket-link { color: var(--navy-800); font-weight: 700; }
.ticket-title { min-width: 220px; max-width: 360px; }
.ticket-title strong { display: block; color: var(--slate-900); }
.ticket-title span { display: block; color: var(--slate-500); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.ticket-title .ticket-unread-badge { display: inline-flex; width: fit-content; max-width: 100%; margin: 4px 0; padding: 3px 8px; border-radius: 999px; background: #eaf3fb; color: #1f5d95; font-size: 10px; font-weight: 800; line-height: 1.4; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.badge-blue { color: #1f5d95; background: #eaf3fb; }
.badge-cyan { color: #136977; background: #e8f6f7; }
.badge-purple { color: #5c4698; background: #f0ecfb; }
.badge-green { color: #176744; background: #e8f7ef; }
.badge-red { color: #9e2e35; background: #ffebed; }
.badge-amber { color: #895a0d; background: #fff4db; }
.badge-orange { color: #9b481e; background: #fff0e8; }
.badge-gray { color: #5f6a78; background: #edf0f3; }
.badge-escalated { color: #8a2e19; background: #ffe7dc; box-shadow: inset 0 0 0 1px #f3c5b5; }

.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.col-12 { grid-column: span 12; }
.col-11 { grid-column: span 11; }
.col-10 { grid-column: span 10; }
.col-9 { grid-column: span 9; }
.col-8 { grid-column: span 8; }
.col-7 { grid-column: span 7; }
.col-6 { grid-column: span 6; }
.col-5 { grid-column: span 5; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }
.col-2 { grid-column: span 2; }
.col-1 { grid-column: span 1; }
.reference-subform { align-content: start; padding: 15px; border: 1px solid var(--slate-200); border-radius: var(--radius-sm); background: var(--slate-100); }
.form-group { display: grid; gap: 7px; }
.form-group label { color: var(--navy-900); font-size: 12px; font-weight: 700; }
.form-group label .required { color: var(--red); }
.form-control { min-width: 0; width: 100%; min-height: 43px; border: 1px solid var(--slate-300); border-radius: 8px; background: #fff; color: var(--slate-900); padding: 9px 11px; outline: none; transition: .15s ease; }
textarea.form-control { min-height: 118px; resize: vertical; }
.form-control:focus { border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(199,163,91,.14); }
.form-control[readonly], .form-control:disabled { background: #f3f5f7; color: var(--slate-500); }
.form-text { color: var(--slate-500); font-size: 11px; }
.form-actions { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--slate-200); display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.input-group { min-width: 0; display: flex; }
.input-group .form-control { min-width: 0; }
.input-group .form-control { border-radius: 8px 0 0 8px; }
.input-group .btn { border-radius: 0 8px 8px 0; }
.filter-bar { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(145px, 1fr)) auto; gap: 12px; align-items: end; }
.filter-bar-compact { grid-template-columns: repeat(2, minmax(180px, 1fr)) auto; }
.filter-bar-users { grid-template-columns: minmax(240px, 2fr) minmax(170px, 1fr) auto; }
.filter-actions, .table-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.filter-actions { align-self: end; }
.table-actions form { margin: 0; }
.table-actions .btn:hover { transform: none; }
.align-end { align-self: end; }
.filter-bar .form-group { gap: 4px; }
.filter-bar label { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--slate-500); }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(310px, .75fr); gap: 20px; }
.ticket-hero { border-top: 4px solid var(--gold-500); }
.ticket-hero-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 16px; }
.ticket-hero-main { min-width: 0; }
.ticket-badges { flex: 0 0 auto; display: flex; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.ticket-hero-title { margin: 0; overflow-wrap: anywhere; color: var(--navy-900); font-family: Georgia, 'Times New Roman', serif; font-size: 27px; font-weight: 500; line-height: 1.25; }
.ticket-code { color: var(--gold-600); font-weight: 800; letter-spacing: .04em; }
.ticket-description { white-space: pre-wrap; color: var(--slate-700); font-size: 14px; line-height: 1.75; }
.meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.meta-item { padding: 13px 0; border-bottom: 1px solid var(--slate-200); }
.meta-item:nth-child(odd) { padding-right: 15px; }
.meta-item:nth-child(even) { padding-left: 15px; border-left: 1px solid var(--slate-200); }
.meta-label { display: block; color: var(--slate-500); text-transform: uppercase; letter-spacing: .07em; font-size: 9px; font-weight: 700; }
.meta-value { display: block; margin-top: 4px; overflow-wrap: anywhere; color: var(--slate-900); font-weight: 700; }
.meta-item-wide { grid-column: 1 / -1; padding-left: 0 !important; padding-right: 0 !important; border-left: 0 !important; }
.timeline { position: relative; display: grid; gap: 0; }
.timeline::before { content: ''; position: absolute; left: 18px; top: 10px; bottom: 15px; width: 1px; background: var(--slate-200); }
.timeline-item { position: relative; padding: 0 0 22px 52px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: 7px; top: 3px; width: 23px; height: 23px; border-radius: 50%; border: 5px solid #fff; background: var(--gold-500); box-shadow: 0 0 0 1px var(--gold-300); }
.timeline-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.timeline-head strong { color: var(--navy-900); }
.timeline-time { color: var(--slate-500); font-size: 10px; white-space: nowrap; }
.timeline-message { margin: 7px 0; white-space: pre-wrap; color: var(--slate-700); }
.timeline-meta { display: flex; gap: 7px; flex-wrap: wrap; color: var(--slate-500); font-size: 10px; }
.timeline-change { margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--gold-500); background: var(--cream-100); color: var(--slate-700); font-size: 11px; }

.progress-row { margin-bottom: 14px; }
.progress-row:last-child { margin-bottom: 0; }
.progress-link { display: block; padding: 7px 8px; margin-left: -8px; margin-right: -8px; border-radius: 8px; transition: .15s ease; }
.progress-link:hover { background: var(--cream-100); }
.progress-link:focus-visible { outline: 3px solid rgba(199,163,91,.28); outline-offset: 1px; }
.progress-head { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--slate-700); font-size: 11px; }
.progress-track { height: 7px; border-radius: 999px; background: var(--slate-100); overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--navy-700), var(--gold-500)); }
.empty-state { padding: 45px 20px; text-align: center; color: var(--slate-500); }
.empty-state-mark { width: 58px; height: 58px; border-radius: 50%; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; background: var(--cream-200); color: var(--gold-600); font-size: 24px; }
.empty-state h3 { margin: 0 0 5px; color: var(--navy-900); font-family: Georgia, 'Times New Roman', serif; font-weight: 500; }

.pagination { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 18px; }
.pagination a, .pagination span { min-width: 34px; height: 34px; padding: 0 9px; border: 1px solid var(--slate-200); border-radius: 7px; background: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.pagination .current { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }

.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(430px, .9fr) minmax(520px, 1.1fr); background: var(--navy-950); }
.auth-brand-panel { position: relative; overflow: hidden; padding: 65px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; background:
    radial-gradient(circle at 20% 15%, rgba(199,163,91,.22), transparent 27%),
    linear-gradient(145deg, rgba(13,39,67,.7), rgba(6,21,37,.96)); }
.auth-brand-panel::after { content: ''; position: absolute; inset: 0; opacity: .16; background-image: linear-gradient(45deg, transparent 48%, rgba(255,255,255,.12) 49%, transparent 51%); background-size: 54px 54px; }
.auth-brand-panel > * { position: relative; z-index: 1; }
.auth-logo { width: 170px; }
.auth-kicker { color: var(--gold-300); text-transform: uppercase; letter-spacing: .16em; font-size: 11px; font-weight: 700; }
.auth-brand-panel h1 { max-width: 620px; margin: 14px 0 18px; font: 500 48px/1.1 Georgia, 'Times New Roman', serif; }
.auth-brand-panel p { max-width: 560px; color: rgba(255,255,255,.68); font-size: 16px; }
.auth-footnote { color: rgba(255,255,255,.42); font-size: 11px; }
.auth-form-panel { display: flex; align-items: center; justify-content: center; padding: 35px; background: var(--cream-100); }
.auth-card { width: min(460px, 100%); padding: 36px; background: #fff; border-radius: var(--radius-lg); box-shadow: 0 24px 70px rgba(0,0,0,.24); border-top: 4px solid var(--gold-500); }
.auth-card h2 { margin: 0; color: var(--navy-900); font: 500 31px Georgia, 'Times New Roman', serif; }
.auth-card-subtitle { margin: 8px 0 24px; color: var(--slate-500); }
.auth-card .form-group { margin-bottom: 16px; }
.auth-help { margin-top: 18px; padding: 12px; border-radius: 8px; background: var(--cream-100); color: var(--slate-500); font-size: 11px; }

.install-page { min-height: 100vh; padding: 35px 20px; background: linear-gradient(145deg, var(--navy-950), var(--navy-800)); }
.install-wrap { width: min(980px, 100%); margin: auto; }
.install-header { color: #fff; text-align: center; margin-bottom: 25px; }
.install-header img { width: 145px; }
.install-header h1 { margin: 13px 0 6px; font: 500 35px Georgia, 'Times New Roman', serif; }
.install-header p { margin: 0; color: rgba(255,255,255,.62); }
.install-card { background: #fff; border-radius: var(--radius-lg); box-shadow: 0 28px 80px rgba(0,0,0,.26); overflow: hidden; }
.install-card-header { padding: 22px 28px; background: var(--cream-100); border-bottom: 1px solid var(--slate-200); }
.install-card-header h2 { margin: 0; color: var(--navy-900); font: 500 24px Georgia, 'Times New Roman', serif; }
.install-card-body { padding: 28px; }
.install-success { text-align: center; padding: 25px; }
.install-success-mark { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center; background: #e8f7ef; color: var(--green); font-size: 34px; }
.code-box { max-width: 100%; overflow-x: auto; padding: 12px; border-radius: 8px; background: var(--navy-950); color: #f3dfb3; font-family: Consolas, monospace; overflow-wrap: anywhere; word-break: break-word; }

.info-callout { max-width: 100%; overflow-wrap: anywhere; padding: 14px 16px; border-left: 4px solid var(--gold-500); background: var(--cream-100); color: var(--slate-700); border-radius: 0 8px 8px 0; }
.warning-callout { max-width: 100%; overflow-wrap: anywhere; padding: 14px 16px; border-left: 4px solid var(--amber); background: #fff8e8; color: #77520f; border-radius: 0 8px 8px 0; }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; color: var(--slate-700); font-weight: 400 !important; }
.checkbox-row input { flex: 0 0 auto; margin-top: 3px; }
.checkbox-row span { min-width: 0; }
.info-callout.checkbox-row { margin-top: 0; }
.stat-value-compact { font-size: 28px; line-height: 1.15; }
.workload-cell { min-width: 180px; }
.profile-summary { padding: 12px 0 22px; text-align: center; }
.profile-avatar { width: 72px; height: 72px; margin: auto; font-size: 26px; }
.profile-photo-editor { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: start; }
.profile-photo-preview { width: 104px; height: 104px; font-size: 36px; }
.profile-photo-controls { min-width: 0; display: grid; gap: 12px; }
.profile-photo-controls form { margin: 0; }
.profile-cropper { margin-top: 16px; padding: 16px; display: grid; grid-template-columns: minmax(220px, 320px) minmax(220px, 1fr); gap: 18px; align-items: start; border: 1px solid var(--slate-200); border-radius: var(--radius-sm); background: var(--cream-100); }
.profile-crop-canvas-wrap { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 50%; background: var(--navy-950); box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--gold-300); }
.profile-crop-canvas-wrap canvas { width: 100%; height: 100%; display: block; }
.profile-crop-controls { display: grid; gap: 12px; }
.profile-crop-controls input[type="range"] { width: 100%; accent-color: var(--gold-600); }
.profile-crop-status { margin: 9px 0 0; }
.profile-photo-actions { margin-top: 12px; display: flex; gap: 9px; flex-wrap: wrap; }
.user-identity { min-width: 230px; display: flex; align-items: center; gap: 11px; }
.escalation-banner { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid #e8c58b; border-left: 4px solid var(--orange); border-radius: var(--radius-sm); background: #fff8e8; box-shadow: var(--shadow-sm); }
.escalation-banner strong, .escalation-banner span { display: block; }
.escalation-banner strong { color: #7f3a1b; }
.escalation-banner span { margin-top: 2px; color: #806238; font-size: 12px; }
.escalation-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.escalation-list { display: grid; }
.escalation-item { padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; border-bottom: 1px solid var(--slate-200); transition: background .15s ease; }
.escalation-item:last-child { border-bottom: 0; }
.escalation-item.is-pending { background: #fffdf8; box-shadow: inset 4px 0 0 var(--orange); }
.escalation-item.is-unread { background: #eaf5ff; box-shadow: inset 4px 0 0 var(--blue); }
.escalation-item.is-unread:hover { background: #dceeff; }
.escalation-item-main { min-width: 0; display: block; color: inherit; }
.escalation-item-main:hover { color: inherit; }
.escalation-item-main:focus-visible { border-radius: 8px; outline: 3px solid rgba(39,104,167,.24); outline-offset: 4px; }
.escalation-item-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.escalation-item h3 { margin: 10px 0 6px; color: var(--navy-900); font-family: Georgia, 'Times New Roman', serif; font-size: 19px; font-weight: 500; }
.escalation-item p { margin: 0; white-space: pre-wrap; color: var(--slate-700); }
.escalation-meta { margin-top: 12px; display: flex; gap: 8px 16px; flex-wrap: wrap; color: var(--slate-500); font-size: 11px; }
.escalation-item-actions { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.escalation-item-actions form { margin: 0; }

.internal-chat-card { scroll-margin-top: 108px; }
.internal-chat-card .card-header > div { min-width: 0; }
.internal-chat-card .card-header h2 { margin-bottom: 1px; }
.internal-chat-live { flex: 0 0 auto; padding: 4px 9px; border: 1px solid #bdd9c8; border-radius: 99px; background: #edf8f1; color: #24633b; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.internal-chat-live.is-warning { border-color: #e7c480; background: #fff8e8; color: #8c4a20; }
.internal-chat-live.is-offline { border-color: #efb8b8; background: #fff1f1; color: #9b2c2c; }
.internal-chat-privacy { border-left-color: var(--gold-500); }
.internal-chat-message-list { min-height: 230px; max-height: 500px; padding: 18px; display: flex; flex-direction: column; gap: 13px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--slate-200); border-radius: 12px; background: #f7f9fb; scroll-behavior: smooth; }
.internal-chat-message { width: 100%; display: flex; align-items: flex-end; gap: 9px; }
.internal-chat-message.is-mine { flex-direction: row-reverse; }
.internal-chat-avatar { flex: 0 0 auto; width: 34px; height: 34px; display: inline-grid; place-items: center; overflow: hidden; border: 2px solid #fff; border-radius: 50%; background: var(--navy-800); color: var(--gold-300); box-shadow: 0 2px 8px rgba(5,22,40,.12); font-size: 12px; font-weight: 800; }
.internal-chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.internal-chat-bubble { min-width: 0; max-width: 78%; padding: 10px 13px; display: block; border: 1px solid var(--slate-200); border-radius: 12px 12px 12px 3px; background: #fff; box-shadow: 0 2px 8px rgba(5,22,40,.05); }
.internal-chat-message.is-mine .internal-chat-bubble { border-color: #b8d2e7; border-radius: 12px 12px 3px 12px; background: #eaf5ff; }
.internal-chat-message-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.internal-chat-message-head strong { overflow: hidden; color: var(--navy-900); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.internal-chat-message-head span { flex: 0 0 auto; color: var(--slate-500); font-size: 9px; }
.internal-chat-message-text { margin-top: 4px; display: block; color: var(--slate-800); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.internal-chat-empty { min-height: 190px; display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; color: var(--slate-500); text-align: center; }
.internal-chat-empty[hidden] { display: none; }
.internal-chat-empty > span { font-size: 28px; }
.internal-chat-empty strong { margin-top: 5px; color: var(--navy-900); }
.internal-chat-empty small { margin-top: 2px; }
.internal-chat-compose { margin-top: 15px; }
.internal-chat-compose > label { margin-bottom: 6px; display: block; color: var(--navy-900); font-size: 12px; font-weight: 800; }
.internal-chat-compose textarea { resize: vertical; }
.internal-chat-compose-footer { margin-top: 9px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.internal-chat-compose-footer .form-text { margin: 0; }

.internal-conversation-list { display: grid; }
.internal-conversation-item { min-height: 104px; padding: 17px 19px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 14px; border-bottom: 1px solid var(--slate-200); color: inherit; transition: background .15s ease; }
.internal-conversation-item:last-child { border-bottom: 0; }
.internal-conversation-item.is-unread { background: #eaf5ff; box-shadow: inset 4px 0 0 var(--blue); }
.internal-conversation-item:hover { color: inherit; background: #f2f7fb; }
.internal-conversation-item.is-unread:hover { background: #dceeff; }
.internal-conversation-item:focus-visible { position: relative; z-index: 1; outline: 3px solid rgba(39,104,167,.24); outline-offset: -3px; }
.internal-conversation-mark { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--navy-800); color: var(--gold-300); font-size: 18px; }
.internal-conversation-content { min-width: 0; display: block; }
.internal-conversation-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px; }
.internal-conversation-head strong { overflow: hidden; color: var(--navy-900); text-overflow: ellipsis; white-space: nowrap; }
.internal-conversation-head time { color: var(--slate-500); font-size: 10px; white-space: nowrap; }
.internal-conversation-message { margin-top: 5px; display: block; overflow: hidden; color: var(--slate-700); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.internal-conversation-meta { margin-top: 4px; display: block; color: var(--slate-500); font-size: 10px; }
.update-notification-banner { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid #b9d4e8; border-left: 4px solid #1f5d95; border-radius: var(--radius-sm); background: #f2f8fc; box-shadow: var(--shadow-sm); }
.update-notification-banner strong, .update-notification-banner span { display: block; }
.update-notification-banner strong { color: #174f7e; }
.update-notification-banner span { margin-top: 2px; color: #55738b; font-size: 12px; }
.notification-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.update-alert-list { display: grid; }
.update-alert-item { padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; border-bottom: 1px solid var(--slate-200); color: inherit; transition: background .15s ease; }
.update-alert-item:last-child { border-bottom: 0; }
.update-alert-item.is-unread { background: #eaf5ff; box-shadow: inset 4px 0 0 #1f5d95; }
.update-alert-item:hover { color: inherit; background: #f2f7fb; }
.update-alert-item.is-unread:hover { background: #dceeff; }
.update-alert-item:focus-visible { position: relative; z-index: 1; outline: 3px solid rgba(39,104,167,.24); outline-offset: -3px; }
.update-alert-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.update-alert-main h3 { margin: 10px 0 7px; color: var(--navy-900); font-family: Georgia, 'Times New Roman', serif; font-size: 19px; font-weight: 500; }
.update-alert-main h3 a { color: var(--navy-800); }
.update-alert-main p { margin: 0; color: var(--slate-700); line-height: 1.65; }
.update-alert-meta { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--slate-500); font-size: 11px; }
.update-alert-actions .btn { pointer-events: none; }
.timeline-item { scroll-margin-top: 110px; }
.timeline-item:target { margin: -10px -12px 0 0; padding: 10px 12px 22px 52px; border-radius: 10px; background: #eaf5ff; box-shadow: inset 4px 0 0 var(--blue); }
.timeline-item:target .timeline-dot { top: 13px; }
.update-alert-actions { display: flex; align-items: flex-start; min-width: 170px; }
section[id] { scroll-margin-top: 106px; }
.text-muted { color: var(--slate-500); }
.text-danger { color: var(--red); }
.text-success { color: var(--green); }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.w-100 { width: 100%; }

@media (max-width: 1400px) {
    .stat-grid-five { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1180px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid, .detail-grid { grid-template-columns: 1fr; }
    .filter-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .filter-bar-compact, .filter-bar-users { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-bar-compact .filter-actions, .filter-bar-users .filter-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 900px) {
    body.sidebar-open { overflow: hidden; }
    .sidebar { transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-md); }
    .sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-open .sidebar-overlay { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(3,12,23,.55); }
    .sidebar-close, .menu-button { display: inline-flex; align-items: center; justify-content: center; }
    .main-area { width: 100%; margin-left: 0; }
    .auth-page { grid-template-columns: 1fr; }
    .auth-brand-panel { display: none; }
    .auth-form-panel { min-height: 100vh; }
    .global-search { width: min(280px, 34vw); }
}

@media (max-width: 720px) {
    .topbar { min-height: 76px; padding: 12px 16px; gap: 12px; }
    .topbar h1 { font-size: 21px; }
    .eyebrow, .sla-alert, .global-search { display: none; }
    .notification-dropdown { position: fixed; top: 76px; right: 12px; left: 12px; width: auto; max-height: calc(100vh - 92px); }
    .content-wrap { padding: 20px 15px 30px; }
    .app-footer { padding: 15px; display: block; text-align: center; }
    .app-footer span { display: block; }
    .stat-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .col-12, .col-11, .col-10, .col-9, .col-8, .col-7, .col-6, .col-5, .col-4, .col-3, .col-2, .col-1 { grid-column: auto; }
    .filter-bar, .filter-bar-compact, .filter-bar-users { grid-template-columns: 1fr; }
    .filter-bar-compact .filter-actions, .filter-bar-users .filter-actions { grid-column: auto; }
    .filter-actions { width: 100%; }
    .filter-actions .btn { flex: 1; }
    .page-actions { align-items: stretch; flex-direction: column; }
    .page-actions-left, .page-actions-right { width: 100%; }
    .page-actions-right { justify-content: flex-start; }
    .page-actions-right .btn, .page-actions-left .btn { flex: 1; }
    .card-header { min-height: 0; align-items: flex-start; flex-wrap: wrap; }
    .card-body { padding: 17px; }
    .ticket-hero-head { flex-direction: column; }
    .ticket-badges { justify-content: flex-start; }
    .ticket-hero-title { font-size: 23px; }
    .meta-grid { grid-template-columns: 1fr; }
    .meta-item, .meta-item-wide, .meta-item:nth-child(odd), .meta-item:nth-child(even) { grid-column: auto; padding-left: 0 !important; padding-right: 0 !important; border-left: 0 !important; }
    .timeline-head { flex-direction: column; gap: 4px; }
    .timeline-time { white-space: normal; }
    .form-actions { justify-content: stretch; }
    .form-actions .btn { flex: 1; }
    .auth-form-panel { padding: 18px; }
    .auth-card { padding: 25px 20px; }
    .install-card-body { padding: 20px; }
    .profile-photo-editor { grid-template-columns: 1fr; }
    .profile-photo-preview { margin: auto; }
    .profile-photo-controls { text-align: left; }
    .profile-cropper { grid-template-columns: 1fr; }
    .profile-crop-canvas-wrap { width: min(320px, 100%); margin: auto; }
    .escalation-banner, .escalation-item, .update-notification-banner, .update-alert-item { grid-template-columns: 1fr; flex-direction: column; align-items: stretch; }
    .escalation-item-actions { width: 100%; }
    .escalation-item-actions .btn { flex: 1; }
    .update-alert-actions { width: 100%; }
    .update-alert-actions .btn { flex: 1; }
    .internal-chat-bubble { max-width: 88%; }
    .internal-chat-compose-footer { align-items: stretch; flex-direction: column; }
    .internal-chat-compose-footer .btn { width: 100%; }
    .internal-conversation-item { grid-template-columns: 36px minmax(0, 1fr) auto; padding: 15px; gap: 10px; }
    .internal-conversation-mark { width: 36px; height: 36px; }
    .internal-conversation-head { grid-template-columns: 1fr; gap: 2px; }
    .internal-conversation-head time { white-space: normal; }
}

@media (max-width: 480px) {
    .topbar-avatar { display: none; }
    .topbar-actions { gap: 9px; }
    .notification-dropdown-title { grid-template-columns: 1fr; gap: 1px; }
    .notification-dropdown-title time { white-space: normal; }
    .content-wrap { padding-left: 12px; padding-right: 12px; }
    .card-header, .card-body, .card-footer { padding-left: 15px; padding-right: 15px; }
    .btn { padding-left: 12px; padding-right: 12px; }
    .table-actions { min-width: 190px; }
    .input-group { flex-wrap: wrap; gap: 8px; }
    .input-group .form-control, .input-group .btn { width: 100%; border-radius: 8px; }
    .internal-chat-message-list { margin-right: -5px; margin-left: -5px; padding: 12px 9px; }
    .internal-chat-avatar { width: 30px; height: 30px; }
    .internal-chat-bubble { max-width: calc(100% - 39px); }
    .internal-chat-message-head { align-items: flex-start; flex-direction: column; gap: 1px; }
    .internal-chat-message-head span { white-space: normal; }
    .internal-conversation-item { grid-template-columns: 34px minmax(0, 1fr); }
    .internal-conversation-item > .nav-count, .internal-conversation-item > .badge { grid-column: 2; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
    .sidebar, .topbar, .app-footer, .page-actions, .filter-bar, .form-actions { display: none !important; }
    .main-area { width: 100%; margin: 0; }
    .content-wrap { max-width: none; padding: 0; }
    .card, .stat-card { box-shadow: none; break-inside: avoid; }
}

/* v1.15.1: breached and not-applicable/rejected ticket surfaces stay connected across pages. */
.data-table tbody tr.ticket-reddish-highlight > td,
.data-table tbody tr.ticket-sla-breached > td {
    background: #fff2f3;
}
.data-table tbody tr.ticket-reddish-highlight > td:first-child,
.data-table tbody tr.ticket-sla-breached > td:first-child {
    box-shadow: inset 4px 0 0 #c84b56;
}
.data-table tbody tr.ticket-reddish-highlight:hover > td,
.data-table tbody tr.ticket-reddish-highlight:focus > td,
.data-table tbody tr.ticket-sla-breached:hover > td,
.data-table tbody tr.ticket-sla-breached:focus > td {
    background: #ffe7e9;
}
.ticket-hero.ticket-reddish-highlight,
.internal-conversation-item.ticket-reddish-highlight,
.update-alert-item.ticket-reddish-highlight,
.escalation-item.ticket-reddish-highlight,
.notification-dropdown-item.ticket-reddish-highlight,
.ticket-hero.ticket-sla-breached,
.internal-conversation-item.ticket-sla-breached,
.update-alert-item.ticket-sla-breached,
.escalation-item.ticket-sla-breached,
.notification-dropdown-item.ticket-sla-breached {
    background: #fff2f3;
    box-shadow: inset 4px 0 0 #c84b56;
}
.ticket-hero.ticket-reddish-highlight,
.ticket-hero.ticket-sla-breached {
    border-color: #efc4c8;
}
.internal-conversation-item.ticket-reddish-highlight:hover,
.update-alert-item.ticket-reddish-highlight:hover,
.notification-dropdown-item.ticket-reddish-highlight:hover,
.internal-conversation-item.ticket-sla-breached:hover,
.update-alert-item.ticket-sla-breached:hover,
.notification-dropdown-item.ticket-sla-breached:hover {
    background: #ffe7e9;
}
.escalation-item.ticket-reddish-highlight,
.escalation-item.ticket-sla-breached {
    border-color: #efc4c8;
}


/* v1.15.2: At Risk tickets use a connected light-orange warning surface. */
.data-table tbody tr.ticket-at-risk-highlight > td {
    background: #fff7e8;
}
.data-table tbody tr.ticket-at-risk-highlight > td:first-child {
    box-shadow: inset 4px 0 0 #d98624;
}
.data-table tbody tr.ticket-at-risk-highlight:hover > td,
.data-table tbody tr.ticket-at-risk-highlight:focus > td {
    background: #ffedcf;
}
.ticket-hero.ticket-at-risk-highlight,
.internal-conversation-item.ticket-at-risk-highlight,
.update-alert-item.ticket-at-risk-highlight,
.escalation-item.ticket-at-risk-highlight,
.notification-dropdown-item.ticket-at-risk-highlight {
    background: #fff7e8;
    box-shadow: inset 4px 0 0 #d98624;
}
.ticket-hero.ticket-at-risk-highlight {
    border-color: #efd2a5;
}
.internal-conversation-item.ticket-at-risk-highlight:hover,
.update-alert-item.ticket-at-risk-highlight:hover,
.notification-dropdown-item.ticket-at-risk-highlight:hover {
    background: #ffedcf;
}
.escalation-item.ticket-at-risk-highlight {
    border-color: #efd2a5;
}

/* v1.15.0: secure internal-chat attachments. */
.internal-chat-attachments {
    margin-top: 9px;
    display: grid;
    gap: 7px;
}
.internal-chat-attachment {
    min-width: 0;
    padding: 7px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(127, 145, 163, .28);
    border-radius: 9px;
    background: rgba(255, 255, 255, .78);
}
.internal-chat-message.is-mine .internal-chat-attachment {
    background: rgba(255, 255, 255, .68);
}
.internal-chat-attachment-preview,
.internal-chat-attachment-icon {
    width: 44px;
    height: 38px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 7px;
    background: #e8edf2;
    color: var(--navy-800);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .04em;
}
.internal-chat-attachment-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.internal-chat-attachment.is-pdf .internal-chat-attachment-icon {
    background: #ffeaec;
    color: #9e2e35;
}
.internal-chat-attachment-info {
    min-width: 0;
    display: grid;
    gap: 2px;
}
.internal-chat-attachment-info a {
    overflow: hidden;
    color: var(--navy-800);
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.internal-chat-attachment-info small {
    color: var(--slate-500);
    font-size: 9px;
}
.internal-chat-attachment-download {
    color: #245f93;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}
.internal-chat-upload-row {
    margin-top: 9px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}
.internal-chat-upload-button {
    min-height: 36px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--slate-300);
    border-radius: 8px;
    background: #fff;
    color: var(--navy-800);
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
}
.internal-chat-upload-button:hover {
    border-color: var(--gold-500);
    background: #fffaf0;
}
.internal-chat-upload-row .form-text {
    margin: 0;
    flex: 1 1 260px;
}
.internal-chat-selected-files {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 8px;
}
.internal-chat-selected-files[hidden] {
    display: none;
}
.internal-chat-selected-file {
    min-width: 0;
    padding: 8px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    border: 1px solid var(--slate-200);
    border-radius: 9px;
    background: #f7f9fb;
}
.internal-chat-selected-file-preview {
    width: 42px;
    height: 38px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 7px;
    background: #e8edf2;
    color: var(--navy-800);
    font-size: 9px;
    font-weight: 900;
}
.internal-chat-selected-file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.internal-chat-selected-file-info {
    min-width: 0;
    display: grid;
    gap: 2px;
}
.internal-chat-selected-file-info strong {
    overflow: hidden;
    color: var(--navy-900);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.internal-chat-selected-file-info small {
    color: var(--slate-500);
    font-size: 9px;
}
.internal-chat-upload-error {
    grid-column: 1 / -1;
    color: #9e2e35;
    font-size: 10px;
    font-weight: 700;
}

@media (max-width: 560px) {
    .internal-chat-attachment {
        grid-template-columns: 38px minmax(0, 1fr);
    }
    .internal-chat-attachment-preview,
    .internal-chat-attachment-icon {
        width: 38px;
        height: 36px;
    }
    .internal-chat-attachment-download {
        grid-column: 2;
        justify-self: start;
    }
    .internal-chat-upload-row {
        align-items: stretch;
        flex-direction: column;
    }
    .internal-chat-upload-button,
    .internal-chat-upload-row .btn {
        justify-content: center;
        width: 100%;
    }
}
.btn-link {
    min-height: 0;
    padding: 4px 2px;
    border: 0;
    background: transparent;
    color: #245f93;
    box-shadow: none;
}
.btn-link:hover {
    color: var(--navy-900);
    transform: none;
}

/* v1.15.3: presentation-only mobile refinement. No workflow or permission behavior is changed. */
.auth-mobile-brand,
.auth-mobile-footer {
    display: none;
}
.auth-footnote {
    display: grid;
    gap: 3px;
}
.topbar-left {
    flex: 1 1 auto;
    overflow: hidden;
}
.topbar-actions,
.card-header > *,
.page-actions-left > *,
.page-actions-right > * {
    min-width: 0;
}
.card-header h2,
.card-header h3,
.section-title,
.auth-card h2 {
    overflow-wrap: anywhere;
}
.table-responsive {
    min-width: 0;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--slate-300) transparent;
}
.table-responsive::-webkit-scrollbar {
    height: 9px;
}
.table-responsive::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: var(--slate-300);
    background-clip: padding-box;
}
.table-responsive::-webkit-scrollbar-track {
    background: transparent;
}

@media (max-width: 900px) {
    .sidebar {
        width: min(320px, 88vw);
    }
    .auth-page {
        min-height: 100vh;
        min-height: 100dvh;
    }
    .auth-form-panel {
        min-height: 100vh;
        min-height: 100dvh;
        padding: max(22px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
        flex-direction: column;
        justify-content: flex-start;
        gap: 18px;
        overflow-y: auto;
        background:
            radial-gradient(circle at 50% 12%, rgba(199, 163, 91, .14), transparent 24%),
            var(--cream-100);
    }
    .auth-mobile-brand {
        width: 100%;
        margin-top: auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .auth-mobile-brand img {
        width: clamp(128px, 34vw, 168px);
        height: auto;
        object-fit: contain;
    }
    .auth-card {
        flex: 0 0 auto;
    }
    .auth-mobile-footer {
        width: min(460px, 100%);
        margin-bottom: auto;
        display: grid;
        gap: 2px;
        color: var(--slate-500);
        text-align: center;
        font-size: 10px;
        line-height: 1.5;
    }
}

@media (max-width: 720px) {
    .topbar {
        min-height: 72px;
        padding: 10px max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
        gap: 8px;
    }
    .topbar-left {
        gap: 9px;
    }
    .topbar-left > div {
        overflow: hidden;
    }
    .topbar h1 {
        margin-top: 0;
        overflow: hidden;
        font-size: clamp(17px, 5vw, 21px);
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .topbar-actions {
        gap: 7px;
    }
    .menu-button {
        flex: 0 0 auto;
        width: 39px;
        height: 39px;
    }
    .internal-chat-alert,
    .update-notification-alert,
    .escalation-alert {
        width: 36px;
        height: 36px;
    }
    .notification-dropdown {
        top: 72px;
        right: max(8px, env(safe-area-inset-right));
        left: max(8px, env(safe-area-inset-left));
        width: auto;
        max-height: calc(100dvh - 84px - env(safe-area-inset-bottom));
    }
    .content-wrap {
        padding: 18px max(12px, env(safe-area-inset-right)) 28px max(12px, env(safe-area-inset-left));
    }
    .app-footer {
        padding: 14px max(12px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
        line-height: 1.6;
    }
    .card-header h2 {
        font-size: 19px;
    }
    .card-header h3 {
        font-size: 16px;
    }
    .section-title {
        font-size: 20px;
    }
    .data-table {
        min-width: 660px;
    }
    .ticket-title {
        min-width: 190px;
        max-width: 290px;
    }
    .ticket-title span {
        max-width: 260px;
    }
    .pagination {
        max-width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 4px;
    }
    .alert {
        flex-wrap: wrap;
    }
    .alert > div {
        min-width: 0;
        overflow-wrap: anywhere;
    }
    .install-page {
        padding: 22px max(12px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    }
    .install-card-header {
        padding: 18px;
    }
    .install-card-header h2 {
        font-size: 21px;
    }
    .install-header h1 {
        font-size: 29px;
    }
    .user-identity,
    .workload-cell {
        min-width: 0;
    }
}

@media (max-width: 560px) {
    .topbar {
        gap: 6px;
    }
    .topbar-actions {
        gap: 5px;
    }
    .menu-button {
        width: 37px;
        height: 37px;
    }
    .internal-chat-alert,
    .update-notification-alert,
    .escalation-alert {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }
    .internal-chat-alert strong,
    .update-notification-alert strong,
    .escalation-alert strong {
        right: -4px;
        top: -5px;
        min-width: 18px;
        height: 18px;
        font-size: 9px;
    }
    .content-wrap {
        padding-top: 14px;
    }
    .page-actions {
        gap: 10px;
        margin-bottom: 16px;
    }
    .page-actions-left,
    .page-actions-right,
    .filter-actions,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }
    .page-actions-left .btn,
    .page-actions-right .btn,
    .filter-actions .btn,
    .form-actions .btn {
        width: 100%;
        flex: 0 0 auto;
    }
    .card-header {
        padding: 14px;
        gap: 10px;
    }
    .card-header > .btn,
    .card-header > a.btn {
        width: 100%;
    }
    .card-body {
        padding: 14px;
    }
    .card-footer {
        padding: 12px 14px;
    }
    .stat-card {
        min-height: 118px;
        padding: 17px;
    }
    .stat-value {
        font-size: 30px;
    }
    .ticket-hero-title {
        font-size: 22px;
    }
    .ticket-badges {
        width: 100%;
    }
    .timeline::before {
        left: 14px;
    }
    .timeline-item {
        padding-left: 42px;
    }
    .timeline-dot {
        left: 3px;
    }
    .timeline-item:target {
        margin-right: 0;
        padding-left: 42px;
    }
    .timeline-item:target .timeline-dot {
        top: 13px;
    }
    .update-alert-head,
    .escalation-item-head,
    .notification-dropdown-title {
        flex-direction: column;
        grid-template-columns: 1fr;
        gap: 3px;
    }
    .update-alert-head time,
    .escalation-item-head time,
    .notification-dropdown-title time {
        white-space: normal;
    }
    .notification-dropdown-header {
        align-items: flex-start;
        gap: 8px;
    }
    .notification-dropdown-header > div {
        min-width: 0;
    }
    .notification-dropdown-header span {
        overflow-wrap: anywhere;
    }
    .internal-chat-card .card-body {
        padding: 12px;
    }
    .internal-chat-message-list {
        min-height: 210px;
        max-height: 62dvh;
        padding: 11px 8px;
    }
    .internal-chat-bubble {
        max-width: calc(100% - 39px);
        padding: 9px 10px;
    }
    .internal-chat-message-head strong {
        white-space: normal;
    }
    .internal-chat-privacy,
    .info-callout,
    .warning-callout {
        padding: 12px;
    }
    .internal-conversation-message {
        white-space: normal;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }
    .profile-photo-actions {
        align-items: stretch;
        flex-direction: column;
    }
    .profile-photo-actions .btn,
    .profile-photo-actions form,
    .profile-photo-actions form .btn {
        width: 100%;
    }
    .auth-form-panel {
        gap: 14px;
        padding-left: 14px;
        padding-right: 14px;
    }
    .auth-card {
        padding: 24px 18px;
        border-radius: 18px;
    }
    .auth-card h2 {
        font-size: 29px;
    }
    .auth-card-subtitle {
        margin-bottom: 20px;
    }
    .auth-mobile-footer {
        font-size: 9.5px;
    }
}

@media (max-width: 400px) {
    .sidebar {
        width: 92vw;
    }
    .topbar h1 {
        font-size: 16px;
    }
    .topbar-actions {
        gap: 4px;
    }
    .internal-chat-alert,
    .update-notification-alert,
    .escalation-alert {
        width: 32px;
        height: 32px;
    }
    .content-wrap {
        padding-left: 9px;
        padding-right: 9px;
    }
    .card-header,
    .card-body,
    .card-footer {
        padding-left: 12px;
        padding-right: 12px;
    }
    .data-table {
        min-width: 620px;
    }
    .auth-mobile-brand img {
        width: 122px;
    }
    .auth-card {
        padding: 22px 16px;
    }
    .auth-card h2 {
        font-size: 27px;
    }
    .auth-help {
        padding: 11px;
    }
}

@media (max-height: 700px) and (max-width: 900px) {
    .auth-form-panel {
        gap: 12px;
    }
    .auth-mobile-brand {
        margin-top: 0;
    }
    .auth-mobile-brand img {
        width: 112px;
    }
    .auth-mobile-footer {
        margin-bottom: 0;
    }
    .auth-card {
        padding-top: 22px;
        padding-bottom: 22px;
    }
}

/* v1.15.4: mobile Users page cards. Presentation only; account actions are unchanged. */
.users-table {
    min-width: 940px;
}
.users-table th:first-child,
.users-table td:first-child {
    min-width: 270px;
}
.users-table th:last-child,
.users-table td:last-child {
    min-width: 250px;
}
.user-identity-copy {
    min-width: 0;
    flex: 1 1 auto;
    line-height: 1.35;
}
.user-identity-copy strong,
.user-identity-copy .text-muted {
    display: block;
    min-width: 0;
}
.user-identity-copy strong {
    color: var(--slate-900);
    overflow-wrap: break-word;
    word-break: normal;
}
.user-identity-copy .text-muted {
    margin-top: 2px;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.users-table-value {
    min-width: 0;
}
.users-table-status {
    display: grid;
    justify-items: start;
    gap: 5px;
}
.users-table .table-actions {
    min-width: 230px;
}

@media (max-width: 900px) {
    .users-table-responsive {
        overflow: visible;
    }
    .users-table {
        display: block;
        width: 100%;
        min-width: 0;
        padding: 12px;
        background: #f7f8fa;
    }
    .users-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }
    .users-table tbody {
        display: grid;
        gap: 12px;
    }
    .users-table tbody tr {
        display: grid;
        width: 100%;
        min-width: 0;
        overflow: hidden;
        border: 1px solid var(--slate-200);
        border-radius: 12px;
        background: #fff;
        box-shadow: var(--shadow-sm);
    }
    .users-table tbody tr:hover {
        background: #fff;
    }
    .users-table td,
    .users-table th:first-child,
    .users-table td:first-child,
    .users-table th:last-child,
    .users-table td:last-child {
        width: 100%;
        min-width: 0;
    }
    .users-table td {
        display: grid;
        grid-template-columns: minmax(88px, 31%) minmax(0, 1fr);
        align-items: center;
        gap: 11px;
        padding: 10px 12px;
        border-bottom: 1px solid #edf0f3;
        overflow-wrap: normal;
        word-break: normal;
    }
    .users-table td::before {
        content: attr(data-label);
        color: var(--slate-500);
        font-size: 9px;
        font-weight: 800;
        letter-spacing: .07em;
        line-height: 1.35;
        text-transform: uppercase;
    }
    .users-table td.users-table-user {
        display: block;
        padding: 14px 12px;
        background: #fbfaf6;
    }
    .users-table td.users-table-user::before {
        display: none;
    }
    .users-table .user-identity {
        width: 100%;
        min-width: 0;
        gap: 10px;
    }
    .users-table .avatar-sm {
        flex: 0 0 auto;
    }
    .users-table .user-identity-copy strong {
        font-size: 14px;
    }
    .users-table .user-identity-copy .text-muted {
        font-size: 11px;
        line-height: 1.45;
    }
    .users-table-value {
        justify-self: start;
        max-width: 100%;
        overflow-wrap: anywhere;
    }
    .users-table td.users-table-actions-cell {
        display: block;
        padding: 12px;
        border-bottom: 0;
    }
    .users-table td.users-table-actions-cell::before {
        display: block;
        margin-bottom: 8px;
    }
    .users-table .table-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
        width: 100%;
        min-width: 0;
        gap: 8px;
    }
    .users-table .table-actions form,
    .users-table .table-actions .btn {
        width: 100%;
        min-width: 0;
    }
    .users-table .table-actions .btn {
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .users-table {
        padding: 9px;
    }
    .users-table td {
        grid-template-columns: minmax(82px, 34%) minmax(0, 1fr);
        gap: 9px;
        padding-right: 10px;
        padding-left: 10px;
    }
    .users-table .table-actions {
        grid-template-columns: 1fr;
    }
}

/* v1.15.4: keep the ticket update submit action close to the form on phone and tablet layouts. */
.ticket-update-form {
    min-width: 0;
}
.ticket-update-actions {
    min-width: 0;
}

@media (max-width: 1020px) {
    #add-update .ticket-update-form {
        display: block;
        width: 100%;
    }
    #add-update .form-grid {
        align-content: start;
        align-items: start;
    }
    #add-update .ticket-update-actions {
        position: static;
        inset: auto;
        width: 100%;
        min-height: 0;
        margin: 14px 0 0;
        padding: 14px 0 0;
        align-items: stretch;
        justify-content: stretch;
    }
    #add-update .ticket-update-actions .btn {
        width: 100%;
        max-width: none;
        margin: 0;
        flex: 1 1 100%;
    }
}

/* v1.16.0: prevent the chat upload helper from becoming a 260px-tall flex item on phones. */
@media (max-width: 560px) {
    .internal-chat-upload-row .form-text {
        width: 100%;
        flex: 0 0 auto;
    }
}


/* v1.18 secure sign-in verification */
.otp-code-input {
    text-align: center;
    letter-spacing: .32em;
    font-size: 1.55rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.otp-actions {
    display: grid;
    gap: .85rem;
    margin-top: 1rem;
}
.auth-cancel-link {
    display: inline-flex;
    justify-content: center;
    color: var(--muted, #6b7280);
    font-size: .9rem;
    text-decoration: none;
}
.auth-cancel-link:hover,
.auth-cancel-link:focus-visible {
    color: var(--text, #111827);
    text-decoration: underline;
}
