/* ============================================================================
   MonitorDesk — themed to the Customer Data Manager / Monitor CRMS design system
   (Poppins + Tabler icons, dark-blue #262262 / bright-blue #12c3f4, pill controls)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
    --bright-blue: #12c3f4;
    --dark-blue: #262262;
    --bright-blue-600: #0fa9d6;
    --bright-blue-100: #d6f4fd;
    --bright-blue-050: #ecfaff;
    --dark-blue-400: #4b4789;
    --blood-orange: #f05125;
    --orange: #f79024;
    --purple: #63288a;
    --pink: #ee759b;
    --grey: #f3f3f3;
    --white: #ffffff;
    --ink: #262262;
    --ink-700: #3c3a6b;
    --ink-500: #6f6d92;
    --ink-300: #a6a4c0;
    --line: #e4e4ee;
    --line-200: #eeeef4;

    --accent: var(--bright-blue);
    --accent-ink: var(--bright-blue-600);
    --success: #1fa971;
    --success-bg: #e4f7ef;
    --warning: var(--orange);
    --warning-bg: #fdeedd;
    --danger: var(--blood-orange);
    --danger-bg: #fde6df;
    --info-bg: var(--bright-blue-100);

    --font-sans: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-pill: 999px;

    --shadow-sm: 0 1px 2px rgba(38,34,98,.06), 0 1px 3px rgba(38,34,98,.08);
    --shadow-md: 0 4px 12px rgba(38,34,98,.08), 0 2px 4px rgba(38,34,98,.06);
    --shadow-lg: 0 12px 32px rgba(38,34,98,.12), 0 4px 8px rgba(38,34,98,.06);
    --shadow-blue: 0 8px 24px rgba(18,195,244,.28);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--grey);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 14.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--bright-blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--grey); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; font-family: var(--font-mono); font-size: .85em; }
h1, h2, h3 { color: var(--dark-blue); }
h1:focus, h1:focus-visible, .page-title:focus, .page-title:focus-visible { outline: none; }

/* ---- Shell ---------------------------------------------------------------- */
.app-shell { --nav-w: 246px; display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
.app-shell.nav-collapsed { --nav-w: 68px; }

.sidebar {
    background: var(--white);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.main { min-width: 0; display: flex; flex-direction: column; }
.content { padding: 26px 30px 60px; max-width: 1320px; width: 100%; }

/* ---- Brand + nav ---------------------------------------------------------- */
.brand { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 4px 6px 20px; }
.brand-mono { flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--dark-blue); color: #fff;
    font-weight: 800; font-size: 13.5px; letter-spacing: .5px; display: grid; place-items: center; }
.brand-text2 { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-word { font-size: 15px; font-weight: 700; color: var(--dark-blue); letter-spacing: -.2px; }
.brand-sub { font-size: 9.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-300); margin-top: 1px; }

.nav-links { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
    display: flex; align-items: center; gap: 13px;
    padding: 11px 13px; border-radius: var(--r-sm);
    color: var(--ink-500); font-weight: 500; font-size: 14px;
    transition: all .14s;
}
.nav-item:hover { background: var(--grey); color: var(--dark-blue); text-decoration: none; }
.nav-item:hover .nav-ico { color: var(--dark-blue); }
.nav-item.active { background: var(--bright-blue-050); color: var(--dark-blue); font-weight: 600; }
.nav-item.active .nav-ico { color: var(--bright-blue-600); }
.nav-ico { color: var(--ink-300); font-size: 18px; flex: none; display: inline-flex; }

.nav-footer { margin-top: auto; padding: 12px 12px 2px; font-size: 12px; color: var(--ink-300); display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line-200); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 2px var(--success-bg); }

/* ---- Config banner -------------------------------------------------------- */
.config-banner {
    display: flex; align-items: center; gap: 12px;
    background: var(--warning-bg); border-bottom: 1px solid #f2dca0;
    color: #8a5a12; padding: 11px 30px; font-size: 13.5px;
}
.config-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); flex: none; }

/* ---- Page header ---------------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; margin: 0; color: var(--dark-blue); letter-spacing: -.2px; }
.page-sub { color: var(--ink-500); font-size: 13px; font-weight: 300; margin: 3px 0 0; }

/* ---- Buttons (pill) ------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    border: 1.5px solid var(--line); background: var(--white); color: var(--dark-blue);
    border-radius: var(--r-pill); padding: 9px 18px; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all .15s; font-family: var(--font-sans); text-decoration: none;
}
.btn:hover { border-color: var(--bright-blue); color: var(--bright-blue-600); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--bright-blue); border-color: var(--bright-blue); color: #fff; box-shadow: var(--shadow-blue); }
.btn-primary:hover { background: var(--bright-blue-600); border-color: var(--bright-blue-600); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--grey); border-color: transparent; color: var(--dark-blue); }
.btn-sm { padding: 6px 13px; font-size: 12.5px; }

/* ---- Cards / tiles -------------------------------------------------------- */
.card { background: var(--white); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--line-200); }
.card-pad { padding: 20px 22px; }
.card-title { font-size: 11px; font-weight: 700; color: var(--ink-300); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 14px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--white); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); border: 1px solid var(--line-200); }
.stat-label { font-size: 12.5px; color: var(--ink-500); font-weight: 500; display: flex; align-items: center; gap: 7px; }
.stat-value { font-size: 32px; font-weight: 700; margin-top: 6px; color: var(--dark-blue); letter-spacing: -.5px; }
.stat-foot { font-size: 12px; color: var(--ink-300); font-weight: 300; margin-top: 2px; }
.stat-accent { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---- Bars ----------------------------------------------------------------- */
.bar-row { display: grid; grid-template-columns: 130px 1fr 40px; align-items: center; gap: 12px; margin-bottom: 11px; }
.bar-label { font-size: 13px; color: var(--ink-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { display: block; background: var(--grey); border-radius: var(--r-pill); height: 10px; overflow: hidden; }
.bar-fill { display: block; height: 100%; min-width: 6px; border-radius: var(--r-pill); background: var(--bright-blue); }
.bar-val { font-size: 12.5px; color: var(--ink-500); text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }

/* ---- Badges (pill) -------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: var(--r-pill); }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; }
.st-todo { background: var(--grey); color: var(--ink-500); }
.st-todo .badge-dot { background: var(--dark-blue-400); }
.st-progress { background: var(--info-bg); color: var(--dark-blue); }
.st-progress .badge-dot { background: var(--bright-blue-600); }
.st-done { background: var(--success-bg); color: var(--success); }
.st-done .badge-dot { background: var(--success); }
.st-unknown { background: var(--grey); color: var(--ink-500); }
.st-unknown .badge-dot { background: var(--ink-300); }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 9px; border-radius: var(--r-pill); background: var(--grey); color: var(--ink-500); }

/* ---- Priority + type pips -------------------------------------------------- */
.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink-500); }
.prio img { width: 15px; height: 15px; display: block; }

/* ---- Avatars -------------------------------------------------------------- */
.avatar { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; background: var(--dark-blue-400); object-fit: cover; overflow: hidden; }
.avatar-lg { width: 34px; height: 34px; font-size: 13px; }
.avatar-unassigned { background: transparent; color: var(--ink-300); border: 1.5px dashed var(--line); }
.user-cell { display: flex; align-items: center; gap: 8px; }
.user-name { font-size: 13px; color: var(--ink-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Table ---------------------------------------------------------------- */
.tickets { width: 100%; border-collapse: collapse; }
.tickets thead th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-300); font-weight: 700; padding: 6px 14px 12px; }
.tickets tbody td { padding: 13px 14px; border-top: 1px solid var(--line-200); font-size: 14px; color: var(--ink-700); vertical-align: middle; }
.tickets tbody tr { cursor: pointer; transition: background .12s; }
.tickets tbody tr:hover { background: var(--bright-blue-050); }
.tickets tbody tr:hover td { border-top-color: transparent; }
.t-key { font-family: var(--font-mono); font-size: 12.5px; color: var(--bright-blue-600); font-weight: 600; white-space: nowrap; }
.t-summary { font-weight: 500; color: var(--dark-blue); max-width: 460px; }
.t-summary .t-comp { color: var(--ink-300); font-size: 12px; font-weight: 300; }

/* ---- Filters -------------------------------------------------------------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--ink-500); font-weight: 500; }
.input, .select, textarea.input {
    border: 1.5px solid var(--line); border-radius: var(--r-sm);
    padding: 9px 13px; font-size: 14px; font-weight: 300; background: var(--white); color: var(--dark-blue);
    font-family: var(--font-sans); min-width: 0; outline: none; transition: all .15s;
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--bright-blue); box-shadow: 0 0 0 3px var(--bright-blue-100); }
.select { appearance: none; cursor: pointer; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a6a4c0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.search { flex: 1 1 240px; display: flex; align-items: center; gap: 10px; background: var(--grey); border: 1px solid transparent; border-radius: var(--r-pill); padding: 3px 8px 3px 16px; transition: all .15s; }
.search:focus-within { background: var(--white); border-color: var(--bright-blue); box-shadow: 0 0 0 3px var(--bright-blue-100); }
.search::before { content: "\ea9b"; font-family: "tabler-icons"; color: var(--ink-300); font-size: 17px; }
.search .input { flex: 1; border: none; background: none; box-shadow: none; padding: 8px 4px; }
.search .input:focus { box-shadow: none; }

/* ---- Board ---------------------------------------------------------------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(272px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.board-col { background: var(--grey); border-radius: var(--r-lg); padding: 12px; min-height: 120px; }
.board-col-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding: 2px 4px; }
.board-col-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-500); display: flex; align-items: center; gap: 8px; }
.board-count { background: var(--white); border-radius: var(--r-pill); font-size: 11px; padding: 1px 9px; color: var(--ink-500); font-weight: 600; }
.board-card { background: var(--white); border-radius: var(--r-md); border: 1.5px solid var(--line); padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color .14s, box-shadow .14s; }
.board-card:hover { border-color: var(--bright-blue); box-shadow: var(--shadow-md); }
.board-card .bc-key { font-family: var(--font-mono); font-size: 11.5px; color: var(--bright-blue-600); font-weight: 600; }
.board-card .bc-summary { font-size: 13.5px; margin: 6px 0 10px; color: var(--dark-blue); font-weight: 500; }
.board-card .bc-foot { display: flex; align-items: center; justify-content: space-between; }

/* ---- Ticket detail -------------------------------------------------------- */
.detail-grid { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }
@media (max-width: 980px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-desc { color: var(--ink-700); font-size: 14px; }
.detail-desc img { max-width: 100%; height: auto; border-radius: 8px; }
.detail-desc p:first-child { margin-top: 0; }

.side-panel { background: var(--white); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--line-200); overflow: hidden; }
.side-row { padding: 14px 16px; border-bottom: 1px solid var(--line-200); }
.side-row:last-child { border-bottom: none; }
.side-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-300); font-weight: 700; margin-bottom: 8px; }

.comment { display: flex; gap: 12px; padding: 15px 0; border-top: 1px solid var(--line-200); }
.comment:first-of-type { border-top: none; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.comment-author { font-weight: 600; font-size: 13.5px; color: var(--dark-blue); }
.comment-time { font-size: 12px; color: var(--ink-300); font-weight: 300; }
.comment-text { font-size: 13.5px; color: var(--ink-700); }
.comment-text p:first-child { margin-top: 0; }
.comment-text img { max-width: 100%; height: auto; border-radius: 8px; }
.internal-tag { background: var(--warning-bg); color: var(--orange); border-radius: var(--r-pill); font-size: 10px; font-weight: 700; padding: 2px 8px; text-transform: uppercase; letter-spacing: .05em; }
.internal .comment-text { background: var(--warning-bg); border: 1px solid #f2dca0; border-radius: var(--r-md); padding: 10px 12px; }

.reply-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.reply-tab { font-size: 12.5px; padding: 7px 13px; border-radius: var(--r-pill); cursor: pointer; border: 1.5px solid transparent; color: var(--ink-500); font-weight: 600; }
.reply-tab.active-public { background: var(--info-bg); color: var(--dark-blue); border-color: transparent; }
.reply-tab.active-internal { background: var(--warning-bg); color: var(--orange); border-color: transparent; }

/* ---- Misc ----------------------------------------------------------------- */
.section-title { font-size: 15px; font-weight: 700; color: var(--dark-blue); margin: 26px 0 12px; }
.muted { color: var(--ink-300); }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 56px 24px; color: var(--ink-300); font-size: 13px; }
.empty-mark { font-size: 34px; opacity: .5; }
.spinner { width: 18px; height: 18px; border: 2.5px solid var(--line); border-top-color: var(--bright-blue); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row { display: flex; align-items: center; gap: 10px; color: var(--ink-300); padding: 40px; justify-content: center; }
.toast { position: fixed; bottom: 22px; right: 22px; background: var(--dark-blue); color: #fff; padding: 12px 18px; border-radius: var(--r-md); box-shadow: var(--shadow-lg); font-size: 13.5px; z-index: 50; display: flex; align-items: center; gap: 10px; }
.toast.err { background: var(--danger); }
.alert-err { display: flex; align-items: flex-start; gap: 8px; background: var(--danger-bg); border: 1px solid rgba(240,81,37,.2); color: var(--danger); padding: 11px 14px; border-radius: var(--r-sm); font-size: 13px; margin-bottom: 14px; }
.crumbs { font-size: 12.5px; color: var(--ink-300); margin-bottom: 6px; }
.crumbs a { color: var(--ink-300); }
.pager { display: flex; justify-content: center; margin-top: 18px; }

#blazor-error-ui { background: var(--warning-bg); bottom: 0; box-shadow: 0 -2px 8px rgba(38,34,98,.1); display: none; left: 0; padding: 12px 18px; position: fixed; width: 100%; z-index: 1000; color: var(--ink-700); font-size: 13px; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 14px; top: 10px; font-weight: bold; }


/* ============================================================================
   Auth: login, sidebar user chip + super-user switch, customer request list
   ========================================================================== */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--grey); padding: 24px; }
.login-card { background: var(--white); border: 1px solid var(--line-200); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 34px 32px; width: 384px; max-width: 100%; text-align: center; }
.login-logo { height: 32px; }
.login-sub { font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-300); margin-top: 8px; }
.login-title { font-size: 22px; font-weight: 700; margin: 18px 0 4px; }
.login-lead { color: var(--ink-500); font-size: 13px; margin: 0 0 20px; }
.login-form { text-align: left; }
.login-form .field { margin-bottom: 14px; }
.login-form .input { width: 100%; }
.login-btn { width: 100%; justify-content: center; margin-top: 6px; }
.login-demo { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-200); font-size: 11.5px; color: var(--ink-500); line-height: 1.8; }
.login-demo strong { color: var(--dark-blue); }

.switcher { margin-top: 16px; padding: 12px; background: var(--grey); border-radius: var(--r-md); }
.switch-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-300); margin-bottom: 7px; }
.switch-select { width: 100%; }
.switch-note { font-size: 12.5px; color: var(--dark-blue); display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.switch-note i { color: var(--bright-blue-600); }
.switch-back { width: 100%; justify-content: center; }

.nav-footer-user { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-200); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 4px 10px; }
.user-chip .avatar { width: 34px; height: 34px; font-size: 12px; }
.user-chip-info { min-width: 0; }
.user-chip-name { font-size: 13px; font-weight: 600; color: var(--dark-blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-role { font-size: 11px; color: var(--ink-300); }
.signout { display: flex; align-items: center; gap: 8px; width: 100%; border: none; background: none; padding: 8px 6px; border-radius: var(--r-sm); font-family: var(--font-sans); font-size: 12.5px; font-weight: 500; color: var(--ink-500); cursor: pointer; }
.signout:hover { background: var(--danger-bg); color: var(--danger); }

/* ---- Settings page ---- */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line-200); }
.set-row:first-of-type { border-top: none; }
.set-label { display: block; font-size: 14px; font-weight: 600; color: var(--dark-blue); }
.set-hint { display: block; font-size: 12px; color: var(--ink-500); font-weight: 300; margin-top: 2px; max-width: 400px; }
.set-switch { width: 18px; height: 18px; cursor: pointer; accent-color: var(--bright-blue); flex: none; }
.set-field { margin: 14px 0; }
.set-field label { display: block; font-size: 12px; font-weight: 500; color: var(--ink-500); margin-bottom: 6px; }
.set-field .input { width: 100%; }
.set-field .set-hint { margin-top: 6px; }
.set-saved { font-size: 13px; font-weight: 600; color: var(--success); display: inline-flex; align-items: center; gap: 5px; }


/* ---- Settings: database card ---- */
.alert-ok { display: flex; align-items: flex-start; gap: 8px; background: var(--success-bg); border: 1px solid rgba(31,169,113,.25); color: var(--success); padding: 11px 14px; border-radius: var(--r-sm); font-size: 13px; }
.conn-view { font-family: var(--font-mono); font-size: 12px; color: var(--ink-700); background: var(--grey); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; word-break: break-all; }
.conn-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12px; color: var(--ink-700); }
.conn-facts strong { color: var(--dark-blue); font-weight: 600; }

/* ---- Connections panel (structured DB / Jira fields) ---- */
.panel-title { font-size: 16px; font-weight: 700; color: var(--dark-blue); margin: 0; }
.conn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .conn-grid { grid-template-columns: 1fr; } }
.conn-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.conn-cell .input { width: 100%; }
.conn-lbl { font-size: 11px; font-weight: 600; color: var(--ink-500); }
.conn-check { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--dark-blue); cursor: pointer; }
.conn-check .set-switch { flex: none; margin: 0; }



/* ==== Collapsible main menu ==== */
.sidebar { position: sticky; transition: padding .16s ease; }
.nav-collapse { position: absolute; top: 16px; right: -12px; width: 24px; height: 24px; border-radius: 50%;
    border: 1px solid var(--line); background: var(--white); color: var(--ink-500); cursor: pointer;
    display: grid; place-items: center; font-size: 14px; box-shadow: var(--shadow-sm); z-index: 50; transition: color .12s, border-color .12s; }
.nav-collapse:hover { color: var(--dark-blue); border-color: var(--bright-blue); }

.nav-collapsed .sidebar { padding-left: 10px; padding-right: 10px; }
.nav-collapsed .brand { justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
.nav-collapsed .brand-text2 { display: none; }
.nav-collapsed .nav-label { display: none; }
.nav-collapsed .nav-item { justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
.nav-collapsed .switcher { display: none; }
.nav-collapsed .nav-footer-user { padding-left: 0; padding-right: 0; }
.nav-collapsed .user-chip { justify-content: center; padding-left: 0; padding-right: 0; }
.nav-collapsed .user-chip-info { display: none; }
.nav-collapsed .nav-footer-user form { display: flex; justify-content: center; }
.nav-collapsed .signout { justify-content: center; gap: 0; }

/* Nav items rendered as buttons */
button.nav-item { border: none; background: none; width: 100%; text-align: left; font-family: inherit; cursor: pointer; }

/* ============================================================================
   MDV2 — Request management (shared by agents and customers)
   ========================================================================== */
.st-new { background: var(--warning-bg); color: #8a5a12; }
.st-new .badge-dot { background: var(--orange); }
.st-waiting { background: #f1e8f7; color: var(--purple); }
.st-waiting .badge-dot { background: var(--purple); }

.rq-new { max-width: 760px; margin-bottom: 18px; }
.rq-textarea { width: 100%; min-height: 90px; resize: vertical; font-family: var(--font-sans); }
.rq-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.rq-new .rq-actions { justify-content: flex-end; }

.rq-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.rq-filters .select { width: auto; min-width: 150px; }
.rq-search { flex: 1 1 240px; max-width: 360px; background: var(--white); border-color: var(--line); }
.rq-count { margin-left: auto; font-size: 12.5px; }

.rq-layout { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.rq-layout.has-detail { grid-template-columns: minmax(300px, 420px) 1fr; }
@media (max-width: 1000px) { .rq-layout.has-detail { grid-template-columns: 1fr; } }

.rq-list { padding: 6px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 220px); overflow-y: auto; }
.rq-row { display: block; width: 100%; text-align: left; border: 1px solid transparent; background: none; border-radius: var(--r-sm);
    padding: 11px 12px; cursor: pointer; font-family: var(--font-sans); color: inherit; transition: background .12s, border-color .12s; }
.rq-row:hover { background: var(--grey); }
.rq-row.is-open { background: var(--bright-blue-050); border-color: var(--bright-blue-100); }
.rq-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.rq-row-title { font-size: 13.5px; font-weight: 600; color: var(--dark-blue); line-height: 1.35; overflow-wrap: anywhere; }
.rq-row-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 11.5px; color: var(--ink-500); }
.rq-row-meta i { color: var(--ink-300); }
.rq-ago { margin-left: auto; color: var(--ink-300); }
.req-key { font-family: var(--font-mono); font-size: 11.5px; color: var(--bright-blue-600); font-weight: 600; }

.rq-detail { display: flex; flex-direction: column; min-height: 420px; max-height: calc(100vh - 220px); overflow: hidden; }
.rq-detail-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line-200); }
.rq-detail-titles { flex: 1; min-width: 0; }
.rq-detail-title { font-size: 17px; font-weight: 700; margin: 2px 0 6px; line-height: 1.3; overflow-wrap: anywhere; }
.rq-detail-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-500); }
.rq-detail-meta i { color: var(--ink-300); }
.rq-src { margin-left: 8px; font-size: 11px; font-weight: 600; color: var(--ink-500); background: var(--grey); border-radius: var(--r-pill); padding: 1px 8px; }
.rq-close { border: none; background: none; cursor: pointer; color: var(--ink-300); font-size: 18px; padding: 4px; border-radius: var(--r-sm); display: grid; place-items: center; }
.rq-close:hover { background: var(--grey); color: var(--dark-blue); }

.rq-controls { display: flex; flex-wrap: wrap; gap: 12px 24px; padding: 12px 20px; border-bottom: 1px solid var(--line-200); background: #fcfcfe; }
.rq-control { display: flex; flex-direction: column; gap: 4px; min-width: 180px; }
.rq-control .select { min-width: 200px; }
.rq-assignee { font-size: 13px; font-weight: 600; color: var(--dark-blue); padding-top: 3px; }

.rq-thread { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.rq-msg { display: flex; gap: 10px; max-width: 86%; }
.rq-msg.is-mine { align-self: flex-end; flex-direction: row-reverse; }
.rq-av { width: 30px; height: 30px; font-size: 11px; }
.rq-av.kind-customer { background: var(--purple); }
.rq-av.kind-agent { background: var(--bright-blue-600); }
.rq-av.kind-ai { background: linear-gradient(135deg, var(--bright-blue), var(--purple)); }
.rq-av.kind-system { background: var(--ink-300); }
.rq-bubble { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.rq-msg.is-mine .rq-bubble { background: var(--bright-blue-050); border-color: var(--bright-blue-100); }
.rq-msg.is-internal .rq-bubble { background: #fffaef; border-color: #f3e6c4; }
.rq-msg-head { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 3px; }
.rq-author { font-size: 12.5px; font-weight: 700; color: var(--dark-blue); }
.rq-time { font-size: 10.5px; color: var(--ink-300); }
.rq-tag { font-size: 9.5px; font-weight: 600; color: var(--ink-500); background: var(--grey); border-radius: var(--r-pill); padding: 1px 7px; }
.rq-tag-internal { color: #8a5a12; background: #fdf1d6; }
.rq-msg-text { font-size: 13px; color: var(--ink-700); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.rq-msg-text a { color: var(--bright-blue-600); text-decoration: underline; }
.rq-event { align-self: center; display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-500); }
.rq-event i { color: var(--ink-300); }

.rq-composer { border-top: 1px solid var(--line-200); padding: 12px 20px 16px; }
.rq-composer .rq-textarea { min-height: 70px; }
.rq-composer .rq-textarea.is-internal { background: #fffaef; border-color: #f3e6c4; }
.rq-composer .rq-actions { margin-top: 10px; }
.rq-composer .rq-actions .btn:only-child { margin-left: auto; }
.rq-preview-note { border-top: 1px solid var(--line-200); padding: 12px 20px; font-size: 12.5px; color: var(--ink-500); display: flex; align-items: center; gap: 8px; }

/* ---- Jira link panel ---- */
.rq-jira-link { margin-left: 10px; font-size: 11.5px; font-weight: 600; }
.rq-link { padding: 12px 20px; border-bottom: 1px solid var(--line-200); display: flex; flex-direction: column; gap: 10px; background: #fbfaff; }
.rq-link-state { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-700); flex-wrap: wrap; }
.rq-link-state i { color: var(--purple); }
.rq-link-state .btn { margin-left: auto; }
.rq-link-suggest { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap;
    background: var(--bright-blue-050); border: 1px solid var(--bright-blue-100); border-radius: var(--r-sm); padding: 8px 12px; font-size: 12.5px; }
.rq-link-suggest i { color: var(--bright-blue-600); }
.rq-link-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rq-link-form .select { flex: 1 1 180px; min-width: 0; }
.rq-archived { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--ink-500); background: var(--grey); border-radius: var(--r-pill); padding: 2px 10px; margin-bottom: 6px; }
.rq-composer-sets { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 10px; }
.rq-set { display: flex; flex-direction: column; gap: 4px; flex: 1 1 180px; min-width: 0; }
.rq-set .select { width: 100%; }

/* ---- Count cards ---- */
.rq-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; max-width: 720px; }
@media (max-width: 560px) { .rq-counts { grid-template-columns: 1fr; } }
.rq-count-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; cursor: pointer;
    background: var(--white); border: 1.5px solid var(--card-accent, var(--bright-blue)); border-radius: var(--r-md);
    padding: 14px 16px; font-family: var(--font-sans); box-shadow: var(--shadow-sm); transition: border-color .12s, box-shadow .12s; }
.rq-count-card.is-waiting { --card-accent: var(--purple); }
.rq-count-card.is-closed { --card-accent: var(--ink-300); }
.rq-count-card:hover { box-shadow: var(--shadow-md); }
.rq-count-card.on { box-shadow: 0 0 0 3px var(--bright-blue-100); }
.rq-count-num { font-size: 26px; font-weight: 700; color: var(--dark-blue); line-height: 1.1; }
.rq-count-lbl { font-size: 12px; font-weight: 500; color: var(--ink-500); }

/* ---- History report (customer view) ---- */
.rq-tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.rq-tab { border: none; background: none; padding: 9px 14px; font-family: var(--font-sans); font-size: 13.5px; font-weight: 500;
    color: var(--ink-500); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 6px; }
.rq-tab:hover { color: var(--dark-blue); }
.rq-tab.on { color: var(--dark-blue); font-weight: 600; border-bottom-color: var(--bright-blue); }

.rh { display: flex; flex-direction: column; gap: 16px; max-width: 1100px; }
.rh-top { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.rh-tiles { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)); gap: 12px; flex: 1; }
@media (max-width: 700px) { .rh-tiles { grid-template-columns: 1fr; } }
.rh-tile { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 16px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.rh-tile-num { font-size: 22px; font-weight: 700; color: var(--dark-blue); }
.rh-tile-lbl { font-size: 12px; color: var(--ink-500); }
.rh-range { width: auto; min-width: 170px; }

.rh-card { padding: 16px 18px; }
.rh-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.rh-card-head .btn { margin-left: auto; }
.rh-title { font-size: 14px; font-weight: 700; margin: 0; }
.rh-title .muted { font-weight: 400; font-size: 12px; }
.rh-legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-500); }
.rh-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; }

.rh-cols { display: flex; align-items: stretch; gap: 3px; height: 180px; border-bottom: 1px solid var(--line); padding-top: 4px; }
.rh-col { flex: 1; min-width: 0; display: flex; flex-direction: column; cursor: default; }
.rh-bar-area { flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.rh-stack { width: 100%; max-width: 28px; display: flex; flex-direction: column; gap: 2px; }
.rh-seg { min-height: 2px; }
.rh-seg:first-child { border-radius: 4px 4px 0 0; }
.rh-col:hover .rh-seg { filter: brightness(1.12); }
.rh-col:hover { background: rgba(38,34,98,.04); border-radius: 4px; }
.rh-done, .rh-single { background: #4b4789; }
.rh-open { background: #12c3f4; }
.rh-x { height: 18px; margin-bottom: -22px; font-size: 10.5px; color: var(--ink-500); text-align: center; white-space: nowrap; overflow: visible; }
.rh-card .rh-cols { margin-bottom: 24px; }

.rh-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 4px; }
.rh-table th, .rh-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line-200); }
.rh-table th { color: var(--ink-500); font-weight: 600; font-size: 11.5px; }

.rh-rows { display: flex; flex-direction: column; gap: 6px; }
.rh-row { display: grid; grid-template-columns: minmax(120px, 220px) 1fr 40px; align-items: center; gap: 10px; font-size: 12.5px; }
.rh-row-name { color: var(--ink-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rh-row-track { height: 10px; }
.rh-row-bar { display: block; height: 10px; background: #4b4789; border-radius: 0 4px 4px 0; }
.rh-row-val { text-align: right; color: var(--dark-blue); font-weight: 600; }
.rh-timeframe { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rh-timeframe .select { width: auto; min-width: 160px; }
.rh-timeframe .input { width: auto; }
.rq-tab-filter { margin-left: auto; width: auto; min-width: 200px; align-self: center; margin-bottom: 4px; }

/* ---- SLA view ---- */
.sla-controls { gap: 12px; align-items: flex-end; }
.sla-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-pill); overflow: hidden; background: var(--white); }
.sla-toggle button { border: none; background: none; padding: 8px 16px; font-family: var(--font-sans); font-size: 13px; color: var(--ink-500); cursor: pointer; }
.sla-toggle button.on { background: var(--dark-blue); color: #fff; font-weight: 600; }
.sla-pick { display: flex; flex-direction: column; gap: 4px; }
.sla-pick .select { min-width: 150px; }
.sla-tiles { flex: none; }
.sla-sub { font-size: 15px; color: var(--ink-500); font-weight: 600; }
.sla-pair { gap: 2px; align-items: flex-end; }
.sla-bar { width: 45%; max-width: 14px; border-radius: 4px 4px 0 0; min-height: 0; }
.sla-actuals { position: relative; }
.sla-target-line { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--ink-500); pointer-events: none; z-index: 1; }
.sla-target-key { display: inline-block; width: 16px; border-top: 2px dashed var(--ink-500); vertical-align: middle; margin-right: 4px; }
.sla-over { background: #c4471f; }
.sla-row { cursor: pointer; }
.sla-row:hover td { background: var(--bright-blue-050); }
.sla-flag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; border-radius: var(--r-pill); padding: 2px 9px; white-space: nowrap; }
.sla-breached { background: var(--danger-bg); color: #a2331b; }
.sla-risk { background: var(--warning-bg); color: #8a5a12; }
.sla-ok { background: var(--success-bg); color: var(--success); }
.sla-timers { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 10px 20px; border-bottom: 1px solid var(--line-200); font-size: 12.5px; color: var(--ink-700); }
.sla-timers .sla-flag { margin-left: 6px; }
.st-dev { background: #e9e8f3; color: var(--dark-blue-400); }
.st-dev .badge-dot { background: var(--dark-blue-400); }
.rq-count-card.is-dev { --card-accent: var(--dark-blue-400); }
.sla-dev { background: #e9e8f3; color: var(--dark-blue-400); }
.rq-counts { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 1100px; }
@media (max-width: 760px) { .rq-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---- Assistant, versions, triage ---- */
.rq-ver { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; color: var(--dark-blue-400); background: #e9e8f3; border-radius: var(--r-pill); padding: 0 7px; }
.rq-ai-chip { font-size: 11px; font-weight: 600; color: var(--bright-blue-600); }
.rq-link-btn { border: none; background: none; color: var(--bright-blue-600); font-family: var(--font-sans); font-size: 11.5px; font-weight: 600; cursor: pointer; padding: 0 0 0 6px; }
.rq-link-btn:hover { text-decoration: underline; }
.rq-triage { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 20px; border-bottom: 1px solid var(--line-200); background: #fcfcfe; }
.rq-triage .select, .rq-triage .input { width: auto; min-width: 140px; }
.rq-ai-summary { padding: 8px 20px; border-bottom: 1px solid var(--line-200); font-size: 12.5px; color: var(--ink-700); background: var(--bright-blue-050); }
.rq-ai-summary i { color: var(--bright-blue-600); }
.rq-ai-banner { display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-top: 1px solid var(--line-200); background: var(--bright-blue-050); font-size: 12.5px; color: var(--ink-700); }
.rq-ai-banner i { color: var(--bright-blue-600); }
.rq-ai-banner .btn { margin-left: auto; }
.rq-flag { display: flex; gap: 6px; margin-top: 8px; }
.rq-flag .input { flex: 1; }

/* ---- Ask a question: chat popup ---- */
.qc-overlay { position: fixed; inset: 0; background: rgba(38,34,98,.28); z-index: 1000; display: flex; align-items: flex-end; justify-content: flex-end; padding: 24px; }
.qc-panel { width: min(460px, 100%); height: min(680px, calc(100vh - 48px)); background: var(--white); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; }
.qc-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-200); }
.qc-head-text { flex: 1; min-width: 0; }
.qc-title { font-weight: 700; font-size: 14px; color: var(--dark-blue); }
.qc-sub { font-size: 12px; color: var(--ink-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-thread { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.qc-intro { font-size: 13px; color: var(--ink-500); text-align: center; margin: auto 12px; }
.qc-answered { margin-top: 8px; }
.qc-typing, .qc-note { font-size: 12.5px; color: var(--ink-500); display: flex; align-items: center; gap: 6px; }
.qc-note { background: var(--grey); border-radius: var(--r-sm); padding: 8px 10px; }
.qc-foot { border-top: 1px solid var(--line-200); padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.qc-version { max-width: 260px; font-size: 12.5px; }
.qc-compose { display: flex; gap: 8px; align-items: flex-end; }
.qc-input { flex: 1; resize: none; min-height: 44px; font-family: var(--font-sans); }
.qc-links { display: flex; gap: 16px; font-size: 12px; }
@media (max-width: 600px) { .qc-overlay { padding: 0; } .qc-panel { height: 100vh; border-radius: 0; } }

/* ---- My tasks ---- */
.tk-card { max-width: 820px; }
.tk-add { display: flex; gap: 8px; margin-bottom: 18px; }
.tk-add .input { flex: 1; }
.tk-group { margin-top: 14px; }
.tk-group-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-500); padding-bottom: 6px; border-bottom: 1px solid var(--line-200); }
.tk-empty { font-size: 13px; padding: 8px 2px; }
.tk-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line-200); font-size: 14px; }
.tk-check { width: 16px; height: 16px; flex: none; cursor: pointer; }
.tk-title { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; font: inherit; color: var(--ink-700); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-row.is-done .tk-title { color: var(--ink-500); text-decoration: line-through; }
.tk-due { font-size: 12px; padding: 1px 8px; border-radius: var(--r-pill); background: var(--grey); color: var(--ink-500); white-space: nowrap; }
.tk-due.is-today { background: #fff4d6; color: #8a6100; }
.tk-due.is-late { background: #fde6df; color: #c2381a; }
.tk-edit { display: flex; flex-direction: column; gap: 8px; padding: 10px 0 14px 26px; border-bottom: 1px solid var(--line-200); }
.tk-edit-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---- CSAT ---- */
.csat { background: var(--grey); border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.csat-q { font-size: 13px; font-weight: 600; color: var(--dark-blue); }
.csat-scale { display: flex; gap: 6px; }
.csat-btn { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--white); font-weight: 700; color: var(--ink-700); cursor: pointer; }
.csat-btn:hover { border-color: var(--bright-blue); }
.csat-btn.on { background: var(--bright-blue); border-color: var(--bright-blue); color: #fff; }
.csat-ends { display: flex; justify-content: space-between; width: 214px; font-size: 11px; color: var(--ink-500); }
.csat-text { resize: vertical; font-family: var(--font-sans); }
.csat-actions { display: flex; justify-content: flex-end; }
.csat-done { font-size: 13px; color: var(--ink-500); display: flex; align-items: center; gap: 6px; }
.rq-csat-agent { font-size: 12.5px; background: var(--grey); border-radius: var(--r-sm); padding: 8px 10px; margin: 0 0 10px; }
.rq-resolved-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; background: #e7f8ef; color: #1f6b45; border-radius: var(--r-sm); padding: 10px 12px; margin: 0 0 12px; }
.rq-resolved-note span { flex: 1; }
.rq-count-card.is-resolved { --card-accent: #2fb36d; }

/* ---- Responsible + action with ---- */
.rq-action-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; background: #efe9ff; color: #4b3a99; border-radius: var(--r-pill); padding: 1px 8px; white-space: nowrap; }
.rq-set-action { flex: 1 1 100%; }
.rq-action-edit { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.rq-action-none { font-size: 12.5px; }
.rq-action-add { max-width: 170px; padding-top: 6px; padding-bottom: 6px; font-size: 12.5px; }
.rq-chip-x { border: 0; background: none; padding: 0; cursor: pointer; color: inherit; display: inline-flex; }
.rq-countdown { font-size: 12px; color: #1f6b45; background: #e7f8ef; border-radius: var(--r-pill); padding: 1px 8px; white-space: nowrap; }
.csat-stars { display: inline-flex; gap: 1px; font-size: 15px; color: var(--line); vertical-align: middle; }
.csat-stars .is-on { color: #f2b01e; }

/* ---- Customer summary: square cards ---- */
a.rq-count-card { text-decoration: none; color: inherit; }
.sm-section { margin-top: 22px; }
.sm-title { font-size: 15px; font-weight: 700; color: var(--dark-blue); display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.sm-empty { font-size: 13px; }
.sm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.sm-card { aspect-ratio: 1 / 1; display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 14px; background: var(--white); border: 1px solid var(--line-200); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); cursor: pointer; font: inherit; color: inherit; transition: box-shadow .15s, transform .15s; overflow: hidden; }
.sm-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.sm-card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.sm-card-title { flex: 1; font-size: 14px; font-weight: 600; color: var(--ink-700); line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; }
.sm-card-foot { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-500); }
@media (max-width: 480px) { .sm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.rh-reg { background: #f5a524; }
.rh-tile-num small { font-size: 12px; font-weight: 600; color: var(--ink-500); margin-left: 4px; }
.rq-subtabs { display: inline-flex; gap: 4px; background: var(--grey); border-radius: var(--r-pill); padding: 3px; margin-bottom: 12px; }
.rq-subtab { border: 0; background: none; border-radius: var(--r-pill); padding: 5px 14px; font: inherit; font-size: 13px; color: var(--ink-500); cursor: pointer; }
.rq-subtab.on { background: var(--white); color: var(--dark-blue); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ---- Customer view: no menu ---- */
.app-shell.no-nav { grid-template-columns: 1fr; }
.app-shell.no-nav .content { margin: 0 auto; }
.page-head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-left: auto; }
.acct { display: flex; align-items: center; gap: 10px; }
.acct-av { background: var(--purple); }
.acct-info { display: flex; flex-direction: column; line-height: 1.2; }
.acct-name { font-size: 13px; font-weight: 600; color: var(--dark-blue); }
.acct-org { font-size: 12px; color: var(--ink-500); }
.acct-preview { font-size: 12.5px; color: var(--ink-500); }
@media (max-width: 640px) {
    .app-shell.no-nav .content { padding: 16px 14px 40px; }
    .page-head { align-items: flex-start; }
    .acct-info, .acct-out-lbl { display: none; }
    .rq-tabs { overflow-x: auto; }
}

/* ---- Announcements (customer banners) ---- */
.ann { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--r-md); padding: 10px 14px; margin-bottom: 10px; font-size: 13px; border: 1px solid transparent; }
.ann > .ti { font-size: 18px; margin-top: 1px; }
.ann-text { flex: 1; min-width: 0; }
.ann-title { font-weight: 700; }
.ann-body { margin-top: 2px; white-space: pre-wrap; }
.ann-body a { color: inherit; text-decoration: underline; }
.ann-info { background: #e8f6fd; border-color: #b9e5f8; color: #0b5a78; }
.ann-warning { background: #fff4d6; border-color: #f5d98a; color: #7a5600; }
.ann-critical { background: #fde6df; border-color: #f5b3a0; color: #9e2a10; }
.ann-x { border: 0; background: none; color: inherit; cursor: pointer; padding: 2px; opacity: .7; }
.ann-x:hover { opacity: 1; }

/* ---- Announcements (agents) ---- */
.an-form { max-width: 820px; margin-bottom: 16px; }
.an-targets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.an-add { max-width: 220px; padding-top: 6px; padding-bottom: 6px; font-size: 12.5px; }
.an-list { max-width: 820px; }
.an-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-200); }
.an-row:last-child { border-bottom: 0; }
.an-main { flex: 1; min-width: 0; }
.an-title { font-weight: 600; color: var(--ink-700); font-size: 14px; }
.an-meta { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-actions { display: flex; gap: 6px; }
.an-level { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: var(--r-pill); }
.an-level-info { background: #e8f6fd; color: #0b5a78; }
.an-level-warning { background: #fff4d6; color: #7a5600; }
.an-level-critical { background: #fde6df; color: #9e2a10; }
.rq-counts:empty { display: none; }
.rq-zero-links { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; margin: -6px 0 16px; }
.rq-zero-links a, .rq-zero-links .rq-link-btn { color: var(--ink-500); text-decoration: none; }
.rq-zero-links a:hover, .rq-zero-links .rq-link-btn:hover, .rq-zero-links .rq-link-btn.on { color: var(--bright-blue-600); text-decoration: underline; }
.ann-ask { flex: none; align-self: center; background: rgba(255,255,255,.6); border-color: currentColor; color: inherit; }
.an-ai { margin-top: 14px; background: var(--grey); border-radius: var(--r-md); padding: 12px; }
.an-ai-head { font-size: 13px; font-weight: 600; color: var(--dark-blue); margin-bottom: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.an-ai-head .muted { font-weight: 400; }
.an-ai-check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.acct-menu-wrap { position: relative; }
.acct-trigger { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 2px; cursor: pointer; border-radius: var(--r-pill); }
.acct-trigger:hover .acct-av { box-shadow: 0 0 0 3px rgba(18,195,244,.25); }
.acct-caret { font-size: 14px; color: var(--ink-500); }
.acct-backdrop { position: fixed; inset: 0; z-index: 900; }
.acct-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 901; min-width: 220px; background: var(--white); border: 1px solid var(--line-200); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 6px; }
.acct-menu-head { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line-200); margin-bottom: 4px; }
.acct-menu-item { width: 100%; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 8px 10px; border-radius: var(--r-sm); font: inherit; font-size: 13px; color: var(--ink-700); cursor: pointer; text-align: left; }
.acct-menu-item:hover { background: var(--grey); }
.page-head-left { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
@media (max-width: 640px) { .page-head { flex-wrap: nowrap; align-items: flex-start; } .page-head-left { flex-direction: column; align-items: flex-start; gap: 10px; } }

/* ---- Customer: Ask a question tile ---- */
.ask-row { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.ask-row-ann { flex: 1; min-width: 0; }
.ask-row-ann .ann:last-child { margin-bottom: 0; }
.ask-tile { flex: none; width: 128px; height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    border: 0; border-radius: var(--r-lg); background: var(--bright-blue); color: #fff; box-shadow: var(--shadow-blue);
    font: inherit; font-size: 14px; font-weight: 700; text-align: center; line-height: 1.2; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.ask-tile .ti { font-size: 34px; }
.ask-tile:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(18,195,244,.35); }
@media (max-width: 640px) { .ask-tile { width: 104px; height: 104px; font-size: 13px; } .ask-tile .ti { font-size: 28px; } }

/* Customer: square count cards (128px) next to the Ask a question tile */
.rq-counts.is-square { display: flex; flex-wrap: wrap; gap: 12px; max-width: none; }
.rq-counts.is-square .rq-count-card { width: 128px; height: 128px; justify-content: space-between; padding: 14px; box-shadow: none; }
.rq-counts.is-square .rq-count-num { font-size: 30px; }
@media (max-width: 640px) { .rq-counts.is-square .rq-count-card, .rq-counts.is-square .ask-tile { width: 104px; height: 104px; } }
/* Summary request/chat cards: same 128px squares as the count cards */
.sm-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.sm-card { width: 128px; height: 128px; aspect-ratio: auto; padding: 10px; gap: 4px; border-radius: var(--r-md); border: 1.5px solid var(--line); box-shadow: none; }
.sm-card-top { flex-direction: column; align-items: flex-start; gap: 3px; }
.sm-card-top .req-key { font-size: 11px; }
.sm-card-top .badge { font-size: 10px; padding: 1px 7px; }
.sm-card-title { font-size: 12px; line-height: 1.25; -webkit-line-clamp: 3; }
.sm-card-foot { font-size: 10.5px; gap: 2px; }
.sm-card-foot > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-card-foot .rq-countdown { font-size: 10px; padding: 0 6px; }
@media (max-width: 640px) { .sm-card { width: 104px; height: 104px; } .sm-card-title { -webkit-line-clamp: 2; } }
/* One look for every 128px tile: same radius, same 1.5px coloured border, no glow */
.ask-tile { border-radius: var(--r-md); box-shadow: none; border: 1.5px solid var(--bright-blue); }
.ask-tile:hover, .sm-card:hover, .rq-counts.is-square .rq-count-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.sm-card { border: 1.5px solid var(--card-accent, var(--bright-blue)); }
.sm-card.acc-new { --card-accent: var(--orange); }
.sm-card.acc-inprogress { --card-accent: var(--bright-blue); }
.sm-card.acc-waitingoncustomer { --card-accent: var(--purple); }
.sm-card.acc-resolved { --card-accent: #2fb36d; }
.sm-card.acc-indevelopment { --card-accent: var(--dark-blue-400); }
.sm-card.acc-closed { --card-accent: var(--ink-300); }
.sm-card-title { font-size: 12.5px; }
.sm-card-top .req-key { font-size: 11.5px; }
/* Request/chat tiles: 128 × 256, one row that scrolls sideways (carousel) when it's wider than the screen */
.sm-carousel { position: relative; }
.sm-grid { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 2px; padding: 4px 2px 10px; scrollbar-width: thin; }
.sm-card { flex: none; height: 256px; scroll-snap-align: start; padding: 12px; gap: 6px; }
.sm-card-title { font-size: 13px; line-height: 1.3; -webkit-line-clamp: 7; flex: 0 1 auto; margin-bottom: auto; }
.sm-card-foot { font-size: 11px; }
.sm-nav { position: absolute; top: 50%; transform: translateY(-60%); z-index: 2; width: 32px; height: 32px; border-radius: 50%;
    border: 1px solid var(--line-200); background: var(--white); box-shadow: var(--shadow-md); color: var(--ink-700); cursor: pointer;
    display: flex; align-items: center; justify-content: center; }
.sm-prev { left: -12px; }
.sm-next { right: -12px; }
@media (pointer: coarse) { .sm-nav { display: none; } }
@media (max-width: 640px) { .sm-card { width: 112px; height: 224px; } .sm-card-title { -webkit-line-clamp: 7; } }
.rq-offer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; background: #efe9ff; color: #4b3a99; border-radius: var(--r-sm); padding: 10px 12px; margin: 0 0 12px; }
.rq-offer span { flex: 1; }
.rq-cmds { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.rq-cmd { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; background: #efe9ff; color: #4b3a99; border-radius: var(--r-pill); padding: 2px 9px; }
.rq-cmd.is-err { background: #fde6df; color: #9e2a10; }

/* ---- Request detail: compact header, details folded away ---- */
.rq-compact { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: 12.5px; }
.rq-details-toggle { margin-left: auto; font-size: 12.5px; }
.rq-info { border: 1px solid var(--line-200); border-radius: var(--r-md); padding: 10px 12px; margin: 0 0 12px; background: var(--grey); }
.rq-info .rq-detail-meta { margin: 0 0 8px; }

/* ---- Customer response mode ---- */
.rq-crm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; margin-bottom: 8px; cursor: pointer; color: var(--ink-700); }
.rq-crm input { position: absolute; opacity: 0; width: 0; height: 0; }
.rq-crm-slider { position: relative; width: 38px; height: 22px; border-radius: 11px; background: var(--ink-300); transition: background .15s; flex: none; }
.rq-crm-slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.rq-crm.on .rq-crm-slider { background: #2fb36d; }
.rq-crm.on .rq-crm-slider::after { transform: translateX(16px); }
.rq-crm.on strong { color: #1f6b45; }
.rq-crm-hint { font-size: 12px; }
.rq-textarea.is-public { border-color: #2fb36d; box-shadow: 0 0 0 3px rgba(47,179,109,.12); }

/* ---- Recalled messages ---- */
.rq-msg.is-recalled .rq-msg-text { text-decoration: line-through; opacity: .55; }
.rq-tag-recalled { background: #fde6df; color: #9e2a10; }
.rq-recall { font-size: 11.5px; margin-left: 6px; }

/* ---- In-app updates: "new since you last looked" ---- */
.unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bright-blue); margin-right: 6px; vertical-align: middle; }
.rq-row.is-unread .rq-row-title { font-weight: 700; color: var(--dark-blue); }
.tab-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: var(--bright-blue); color: #fff; font-size: 11px; font-weight: 700; }
.sm-card { position: relative; }
.sm-new { position: absolute; top: 8px; right: 8px; font-size: 10px; font-weight: 700; color: #fff; background: var(--bright-blue); border-radius: var(--r-pill); padding: 1px 7px; }
.sm-card.is-unread .sm-card-title { color: var(--dark-blue); }

/* ---- New comments: orange update banners ---- */
.upd { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; font: inherit; font-size: 13px; cursor: pointer;
    background: #fff1e0; border: 1px solid #f7c48a; color: #8a4a00; border-radius: var(--r-md); padding: 10px 14px; margin-bottom: 10px; }
.upd:hover { background: #ffe8cc; }
.upd > .ti { font-size: 18px; flex: none; }
.upd-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.upd-head, .upd-body { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upd-key { font-family: var(--font-mono); font-size: 12px; margin-right: 4px; }
.upd-body { color: #6b3a00; }
.upd-open { flex: none; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }

/* ---- AI training ---- */
.tab-count { margin-left: 6px; font-size: 11px; color: var(--ink-500); background: var(--grey); border-radius: 9px; padding: 0 6px; }
.tr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .tr-grid { grid-template-columns: 1fr; } }
.tr-answer { margin-top: 12px; border: 1px solid var(--line-200); border-radius: var(--r-md); padding: 12px; background: var(--grey); }
.tr-answer-head { margin-bottom: 6px; }
.tr-note { font-size: 12.5px; color: var(--ink-500); margin-top: 8px; }
.tr-sources { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.tr-src { font-size: 11.5px; background: var(--white); border: 1px solid var(--line-200); border-radius: var(--r-pill); padding: 1px 8px; color: var(--ink-500); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-src.used { border-color: #2fb36d; color: #1f6b45; }
.tr-edit { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.tr-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.tr-item { border: 1px solid var(--line-200); border-radius: var(--r-md); padding: 10px 12px; }
.tr-item-q { font-weight: 600; color: var(--dark-blue); font-size: 13.5px; }
.tr-item-a { font-size: 13px; color: var(--ink-700); white-space: pre-wrap; margin-top: 4px; max-height: 7.5em; overflow: hidden; }
.tr-item-actions { display: flex; gap: 12px; align-items: center; justify-content: flex-end; font-size: 12px; margin-top: 6px; }
.rq-flag-train { flex-direction: column; align-items: stretch; }
.tr-lib { display: flex; flex-direction: column; border-top: 1px solid var(--line-200); }
.tr-lib-row { border-bottom: 1px solid var(--line-200); }
.tr-lib-main { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 4px; background: none; border: 0; font: inherit; font-size: 13px; text-align: left; cursor: pointer; color: var(--ink-700); }
.tr-lib-main:hover { background: var(--grey); }
.tr-lib-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-lib-len { font-size: 11.5px; white-space: nowrap; }
.tr-lib-body { padding: 4px 8px 12px 28px; }
.tr-lib-actions { display: flex; gap: 14px; font-size: 12.5px; margin-bottom: 6px; }
.tr-lib-text { font-size: 12.5px; white-space: pre-wrap; color: var(--ink-700); max-height: 360px; overflow: auto; background: var(--grey); border-radius: var(--r-sm); padding: 10px; }
