/* assets/css/teams.css
   The Menyoo look for the Teams portal: the same tokens as the Menyoo ERP (app.menyoo.ai): warm canvas, orange brand,
   Space Grotesk headings, Inter text, soft bordered panels, metric cards with an orange underline. */

:root {
  --ink: #24201d;
  --ink-2: #39332f;
  --muted: #746d67;
  --line: #e8e2dc;
  --surface: #fffdfa;
  --canvas: #f7f3ee;
  --brand: #f26b38;
  --brand-2: #cc3e09;
  --accent-soft: #fff0e9;
  --accent-pale: #fff6f1;
  --dark: #25211e;
  --red: #c85f4b;
  --amber: #b9791f;
  --green: #2f8a57;
  --shadow: 0 2px 12px rgba(49, 39, 32, 0.045);
  --radius: 14px;
  --control-h: 38px;
  --display: "Space Grotesk", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
}
h1, h2, h3, h4 { font-family: var(--display); margin: 0; color: var(--ink); letter-spacing: -0.01em; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
small { font-size: 12px; }
.muted { color: var(--muted); }

.kicker { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.14em; color: #8f857d; text-transform: uppercase; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--control-h); padding: 0 16px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink-2);
  font: 600 13px "Inter", sans-serif; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
.btn:hover { background: #fff; border-color: #d9d0c8; text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.danger { color: var(--red); border-color: #efd5cf; background: #fff8f6; }
.btn.danger:hover { background: #fdeeea; }
.btn.ghost { background: transparent; }
.btn.small { height: 32px; padding: 0 12px; font-size: 12px; }
.btn.tiny { height: 28px; padding: 0 10px; font-size: 11.5px; border-radius: 5px; }
.btn.block { width: 100%; }
.icon-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: 8px; font-size: 20px; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: rgba(0,0,0,.05); }

/* ---------------- badges ---------------- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: #f0ebe6; color: var(--muted); white-space: nowrap; }
.badge.orange { background: var(--accent-soft); color: var(--brand-2); }
.badge.amber  { background: #fdf1dc; color: var(--amber); }
.badge.green  { background: #e3f3ea; color: var(--green); }
.badge.red    { background: #fbe7e2; color: var(--red); }

/* ---------------- form fields ---------------- */
.field { display: grid; gap: 6px; font-size: 12px; font-weight: 600; color: #5d554f; }
.field em { font-weight: 400; color: #9a918a; font-style: normal; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], select {
  width: 100%; height: var(--control-h); padding: 0 12px;
  border: 1px solid var(--line); border-radius: 4px; background: #fff;
  font: 500 13px "Inter", sans-serif; color: var(--ink); outline: none;
}
input:focus, select:focus { border-color: #d3a898; box-shadow: 0 0 0 3px rgba(242, 107, 56, 0.12); }
input[readonly] { background: #faf7f3; color: var(--ink-2); }
input::placeholder { color: #b3aaa3; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }

/* ---------------- sign in / sign up ---------------- */
.auth-body { background: var(--surface); }
.auth-page { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.auth-brand { background: var(--dark); color: #f4eee8; display: flex; align-items: center; padding: 56px; position: relative; overflow: hidden; }
.auth-brand::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, rgba(242,107,56,.28), transparent 70%); }
.auth-brand-inner { position: relative; max-width: 460px; z-index: 1; }
.auth-logo { height: 40px; width: auto; display: block; margin-bottom: 44px; }
.auth-headline { font-size: 40px; line-height: 1.12; color: #fff; margin-bottom: 18px; }
.auth-headline .accent { color: var(--brand); }
.auth-lead { color: #cfc6bd; font-size: 15px; margin: 0 0 26px; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; color: #e6ded6; font-size: 14px; }
.auth-points i { color: var(--brand); margin-right: 6px; }
.auth-form-section { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card-head { margin-bottom: 22px; }
.auth-card-head h2 { font-size: 26px; margin: 6px 0 4px; }
.auth-card-head p { margin: 0; color: var(--muted); }
.auth-form { display: grid; gap: 16px; }
.auth-form .btn { height: 42px; font-size: 14px; }
.auth-notice { background: #fdeeea; border: 1px solid #f3cfc6; color: #9c3d2a; border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 16px; }
.auth-switch { text-align: center; color: var(--muted); margin-top: 22px; }
.auth-switch a { font-weight: 600; }

/* ---------------- app shell ---------------- */
.shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid #e7e0da; padding: 22px 16px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: block; margin: 2px 6px 22px; }
.brand img { height: 28px; display: block; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--accent-pale); margin-bottom: 22px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--brand-2); display: inline-flex; align-items: center; justify-content: center; font: 700 14px var(--display); flex: none; }
.side-user strong { display: block; font-size: 13px; line-height: 1.2; }
.side-user small { color: var(--muted); }
.nav { display: grid; gap: 4px; }
.nav-label { font: 800 11px "Inter", sans-serif; letter-spacing: 0.14em; color: #9a9088; margin: 16px 10px 8px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 10px 11px; border-radius: 9px; color: #665f5a; font: 600 13px var(--display); position: relative; }
.nav-link i { font-size: 18px; color: #8a8078; }
.nav-link:hover { background: #fff4ee; color: #2e2824; text-decoration: none; }
.nav-link.active { background: #fff0e8; color: #c65028; font-weight: 700; }
.nav-link.active i { color: var(--brand); }
.nav-link.active::before { content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav-count { margin-left: auto; background: var(--brand); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }
.scrim { display: none; }

.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 28px; background: rgba(255, 253, 250, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; }
.crumbs { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 4px; }
.crumbs strong { color: var(--ink); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.content { padding: 28px; max-width: 1180px; margin: 0 auto; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 30px; margin: 6px 0 4px; }
.page-head p { margin: 0; color: var(--muted); }

.attention { display: flex; align-items: center; gap: 10px; background: #fff7e8; border: 1px solid #f3dfb8; color: #7a5410; border-radius: 10px; padding: 10px 14px; margin-bottom: 18px; font-size: 13px; }
.attention a { font-weight: 700; color: #7a5410; text-decoration: underline; }

/* ---------------- metric cards ---------------- */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metrics.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 14px; box-shadow: var(--shadow); border-bottom: 2px solid #f6b9a1; }
.metric > span { font-size: 13px; color: var(--ink-2); }
.metric strong { display: block; font: 600 26px var(--display); margin: 6px 0 2px; }
.metric strong.amber { color: var(--amber); }
.metric strong.brand { color: var(--brand-2); }
.metric strong.green { color: var(--green); }
.metric small { color: var(--muted); }
.metric.action .inline-form { margin: 8px 0 8px; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1 1 auto; min-width: 0; }

/* ---------------- panels ---------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-size: 16px; margin-top: 2px; }
.panel-body { padding: 18px 20px; }
.count-pill { background: var(--accent-soft); color: var(--brand-2); font-weight: 700; font-size: 12px; border-radius: 999px; padding: 2px 10px; }
.hint { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }
.copy-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #faf7f3; border: 1px dashed #dccfc4; border-radius: 10px; padding: 10px 12px; }
.copy-box a { font-weight: 600; word-break: break-all; }
.line-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f1ebe5; }
.line-row:last-child { border-bottom: 0; }
.empty-inline { color: var(--muted); margin: 0; }

.type-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.type-legend div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; }
.type-legend b { font-family: var(--display); }
.type-legend span { color: var(--muted); font-size: 12.5px; }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #8f857d; font-weight: 700; padding: 11px 16px; background: #fbf8f4; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid #f1ebe5; vertical-align: middle; }
.data-table tbody tr:hover { background: #fdfaf6; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; white-space: nowrap; }
.data-table .check { width: 40px; }
.data-table .actions { text-align: right; white-space: nowrap; }
.data-table .actions .btn { margin-left: 4px; }
.data-table td.empty { text-align: center; color: var(--muted); padding: 34px 16px; }

/* ---------------- bank ---------------- */
.bank-current { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--accent-pale); margin-bottom: 16px; }
.bank-current > i { font-size: 22px; color: var(--brand-2); }
.bank-current strong { display: block; }
.bank-current small { color: var(--muted); }
.bank-current .badge { margin-left: auto; }
.bank-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; margin-top: 14px; }
.bank-status { min-height: 18px; margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.bank-status.ok { color: var(--green); }
.bank-status.bad { color: var(--red); }

/* ---------------- toasts and dialog ---------------- */
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 3000; display: grid; gap: 8px; }
.toast { background: var(--dark); color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.2); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; max-width: 340px; }
.toast.show { opacity: 1; transform: none; }
.toast.ok { background: #25573b; }
.toast.bad { background: #9c3d2a; }

.dialog { position: fixed; inset: 0; z-index: 3500; display: flex; align-items: center; justify-content: center; padding: 20px; }
.dialog-backdrop { position: absolute; inset: 0; background: rgba(36, 32, 29, .45); }
.dialog-card { position: relative; background: var(--surface); border-radius: 16px; padding: 24px; width: 100%; max-width: 400px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.dialog-card h3 { font-size: 18px; margin-bottom: 8px; }
.dialog-card p { margin: 0 0 20px; color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------------- responsive ---------------- */
@media (max-width: 1000px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics.three { grid-template-columns: 1fr; }
  .bank-form { grid-template-columns: 1fr 1fr; }
  .bank-form .btn { grid-column: 1 / -1; }
}
@media (max-width: 880px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-brand { padding: 32px 24px; }
  .auth-logo { margin-bottom: 24px; }
  .auth-headline { font-size: 30px; }
  .auth-points { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; box-shadow: none; }
  .nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(36,32,29,.4); z-index: 50; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 14px; }
  .content { padding: 18px 14px; }
  .nav-link.active::before { left: -16px; }
  .type-legend { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .metrics { grid-template-columns: 1fr; }
  .bank-form { grid-template-columns: 1fr; }
  .copy-box { flex-direction: column; align-items: stretch; }
  .topbar-right .btn { display: none; }
}

/* ---------------- typography: Space Grotesk for everything bold ----------------
   Same rule as the Menyoo ERP (app.menyoo.ai): headings, bold text, table headings, buttons, badges and every amount
   are Space Grotesk; running text stays Inter. Shared with the admin portal (admin.menyoo.ai), which starts from
   this file, so both look the same. */
strong, b, th,
.btn, .badge, .count-pill, .nav-count,
.num, .metric strong, .crumbs strong, .tabs button, .tab-btn,
.type-legend b {
  font-family: var(--display);
}

/* =====================================================================
   Admin portal additions (everything above is shared with teams.menyoo.ai)
   ===================================================================== */

textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff;
  font: 500 13px "Inter", sans-serif; color: var(--ink); outline: none; resize: vertical; line-height: 1.5;
}
textarea:focus { border-color: #d3a898; box-shadow: 0 0 0 3px rgba(242, 107, 56, 0.12); }
input[type="time"] { height: var(--control-h); padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font: 500 13px "Inter", sans-serif; color: var(--ink); }
input:disabled, select:disabled, textarea:disabled { background: #faf7f3; color: #9a918a; cursor: not-allowed; }

.metric strong.red { color: var(--red); }
.metrics.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.two-col .panel { margin-bottom: 0; }
.line-row .num { font-variant-numeric: tabular-nums; }
.no-scroll { overflow: hidden; }

/* ---------------- toolbars, filters, pager ---------------- */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid #f1ebe5; flex-wrap: wrap; }
.toolbar input[type="text"] { flex: 1 1 240px; max-width: 360px; }
.toolbar select { width: auto; min-width: 140px; }
.toolbar-right { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px; }
.pager:empty { display: none; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; padding: 0 14px; height: var(--control-h); font: 600 13px var(--display); color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--accent-soft); color: var(--brand-2); }

.tabs { display: flex; gap: 6px; margin: 0 0 14px; padding: 4px; background: #fbf8f4; border: 1px solid var(--line); border-radius: 12px; width: max-content; max-width: 100%; }
.tab-btn { border: 0; background: transparent; padding: 8px 16px; border-radius: 9px; font: 600 13px var(--display); color: var(--muted); cursor: pointer; }
.tab-btn.active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(49, 39, 32, .08); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.data-table.clickable tbody tr[data-id] { cursor: pointer; }
.data-table tr.unread td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.data-table input.qr-price { width: 130px; text-align: right; }
.data-table .check input { vertical-align: middle; }
.hint a { font-weight: 600; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { min-width: 220px; flex: 0 1 260px; }
label.inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }

/* ---------------- on/off switch ---------------- */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch-ui { position: absolute; inset: 0; border-radius: 22px; background: #d9d4cf; transition: background .15s; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .switch-ui { background: var(--brand); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { box-shadow: 0 0 0 3px rgba(242, 107, 56, .25); }
.switch.locked, .switch input:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------- side panel ---------------- */
.drawer { position: fixed; inset: 0; z-index: 3200; }
.drawer[hidden] { display: none; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(36, 32, 29, .45); }
.drawer-card { position: absolute; right: 0; top: 0; bottom: 0; width: min(480px, 100%); background: var(--surface); box-shadow: -12px 0 40px rgba(0,0,0,.18); display: flex; flex-direction: column; }
.drawer.wide .drawer-card { width: min(720px, 100%); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-size: 18px; margin-top: 2px; }
.drawer-body { padding: 18px 22px 28px; overflow-y: auto; flex: 1; }
.drawer-h { font-size: 13px; margin: 22px 0 10px; color: var(--ink-2); }

.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
.kv { background: #faf7f3; border: 1px solid #f0e9e2; border-radius: 10px; padding: 9px 12px; display: grid; gap: 2px; min-width: 0; }
.kv span { font-size: 11px; color: var(--muted); }
.kv strong { font-size: 13px; overflow-wrap: anywhere; }

.branch-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; display: grid; gap: 8px; background: #fff; }
.branch-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.branch-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.branch-stats strong { color: var(--ink); margin-left: 4px; }
.branch-card .btn { justify-self: start; }

/* ---------------- support desk ---------------- */
.ticket-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.sla-box { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 6px; }
.sla-row { background: #faf7f3; border: 1px solid #f0e9e2; border-radius: 10px; padding: 9px 12px; display: grid; gap: 2px; }
.sla-row small { color: var(--muted); font-size: 11px; }
.sla-row.sla-breached { background: #fdeeea; border-color: #f3cfc6; }
.sla-row.sla-breached strong { color: var(--red); }
.sla-row.sla-due_soon { background: #fdf6e8; border-color: #f1e2bd; }
.sla-row.sla-met strong { color: var(--green); }

.thread { display: grid; gap: 10px; max-height: 340px; overflow-y: auto; padding: 2px; margin-bottom: 14px; }
.msg { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #fff; }
.msg.support { background: #fff8f4; border-color: #f6d9cb; }
.msg.internal { background: #fdf6e8; border-color: #f1e2bd; border-style: dashed; }
.msg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.attachments { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: #f0ebe6; color: var(--ink-2); font-size: 12px; font-weight: 600; font-family: var(--display); }
.chip:hover { text-decoration: none; background: #e8e0d8; }

.reply { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.reply-tools, .reply-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.reply-tools select { width: auto; min-width: 200px; }
.reply-foot .btn.primary { margin-left: auto; }
.reply-foot select { width: auto; }
.reply-files { display: inline-flex; align-items: center; gap: 8px; }
.reply-files label.btn { cursor: pointer; }

.dialog-card.wide { max-width: 560px; max-height: calc(100vh - 40px); overflow-y: auto; }
.dialog-card .field { margin-bottom: 12px; }
.canned-list { max-height: 220px; overflow-y: auto; margin-bottom: 4px; }
.hours-grid { display: grid; gap: 6px; margin: 4px 0 12px; }
.hours-row { display: grid; grid-template-columns: 96px auto auto 1fr; gap: 8px; align-items: center; font-size: 13px; }
.dialog[hidden] { display: none; }

@media (max-width: 1000px) {
  .metrics.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 880px) {
  .ticket-controls { grid-template-columns: 1fr; }
  .sla-box { grid-template-columns: 1fr; }
  .toolbar-right { margin-left: 0; }
  .data-table input.qr-price { width: 100px; }
}
@media (max-width: 520px) {
  .metrics.five { grid-template-columns: 1fr; }
  .kv-grid, .branch-stats { grid-template-columns: 1fr; }
}
