/* ===== Officer back-office — shared page components (owned by officer pages) ===== */
:root {
  --o-ink: #0f1e3c;
  --o-muted: #667085;
  --o-line: #e4e7ec;
  --o-navy: #0f2147;
  --o-chip: #f2f4f7;
  --o-head: #f1f1f1;
}

body.app.officer-page { background: var(--white); }

.o-page { display: flex; flex-direction: column; gap: 18px; padding: 22px 24px 56px; color: var(--o-ink); font-family: var(--font-ui); }
.o-page.narrow { max-width: 1500px; padding-left: 32px; padding-right: 32px; gap: 20px; }
.o-title { margin: 0; font-size: 27px; line-height: 41.85px; font-weight: 700; color: var(--o-ink); }
.o-sub { display: flex; gap: 10px; align-items: center; padding-top: 1.5px; font-size: 13.5px; line-height: 20.93px; color: var(--o-muted); }
.o-sub strong { font-weight: 600; color: var(--o-ink); }

.o-panel { background: var(--white); border: 1px solid var(--o-line); border-radius: 14px; padding: 16px 0 0; display: flex; flex-direction: column; }
.o-panel > .o-alert, .o-panel > .o-info { margin: 0 18px; }
.o-panel > .o-info { margin-top: 16px; }

/* alert banners */
.o-alert { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 10px; border: 1px solid; }
.o-alert .mark { width: 30px; height: 30px; border-radius: 15px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13.5px; flex-shrink: 0; }
.o-alert .txt { flex: 1 1 0; min-width: 0; }
.o-alert .txt b { display: block; font-weight: 600; font-size: 13.5px; line-height: 20.25px; }
.o-alert .txt small { display: block; font-size: 12.5px; line-height: 18.75px; }
.o-alert .close { background: none; border: 0; padding: 2px 6px; font-size: 18px; line-height: 1; }
.o-alert.warn { background: #fffaeb; border-color: #fedf89; }
.o-alert.warn .mark { background: #fef0c7; color: #b54708; }
.o-alert.warn .txt b, .o-alert.warn .txt small { color: #7a2e0e; }
.o-alert.danger { background: #fef3f2; border-color: #fecdca; }
.o-alert.danger .mark { background: #fee4e2; color: #b42318; }
.o-alert.danger .txt b { color: #912018; }
.o-alert.danger .txt small { color: #9a3412; }
.o-alert.danger .close { color: #b42318; }
.o-alert[hidden] { display: none; }

/* big tab buttons with count */
.o-tabs { display: flex; gap: 10px; padding: 16px 18px 0; }
.o-tab { display: inline-flex; align-items: center; gap: 10px; padding: 11px 26px; border-radius: 8px; border: 0; background: var(--o-chip); color: var(--o-ink); font: 400 14.5px var(--font-ui); }
.o-tab .n { min-width: 20px; height: 20px; padding: 0 6.7px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; background: var(--o-navy); color: var(--white); }
.o-tab[aria-selected="true"] { background: var(--o-navy); color: var(--white); }
.o-tab[aria-selected="true"] .n { background: var(--white); color: var(--o-navy); }

.o-info { background: #e8f1fd; border-radius: 10px; padding: 12px 16px; text-align: center; font-size: 13.5px; line-height: 20.93px; color: #14407e; }

/* stats + filters row */
.o-overview { display: flex; align-items: flex-end; justify-content: space-between; gap: 34px; padding: 22px 24px 6px; flex-wrap: wrap; }
.o-stats .total { display: flex; align-items: baseline; gap: 10px; }
.o-stats .total b { font-weight: 300; font-size: 46px; line-height: 1; }
.o-stats .total span { font-size: 17px; color: var(--o-muted); }
.o-stats .parts { display: flex; gap: 22px; margin-top: 6px; }
.o-stats .parts div { border-left: 3px solid var(--o-ink); padding-left: 10px; }
.o-stats .parts b { display: block; font-weight: 300; font-size: 22px; line-height: 1.3; }
.o-stats .parts span { font-size: 13px; color: var(--o-muted); }

.o-filters { width: 760px; max-width: 100%; }
.o-filters h3 { margin: 0 0 8px; font-weight: 400; font-size: 18px; line-height: 27.9px; }
.o-filters .row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.o-select { position: relative; display: block; }
.o-select select {
  -webkit-appearance: none; appearance: none; width: 100%;
  border: 1px solid var(--o-line); border-radius: 8px; background: var(--white);
  padding: 10px 34px 10px 12px; font: 400 13.5px/15px var(--font-ui); color: var(--o-ink); cursor: pointer;
}
.o-select img { position: absolute; right: 13px; top: 50%; width: 12px; height: 12px; transform: translateY(-50%); pointer-events: none; }
.o-field-label { display: block; font-size: 12px; line-height: 18.6px; color: var(--o-muted); margin-bottom: 4px; }

/* sections + tables */
.o-section { padding: 30px 24px 6px; }
.o-section:last-child { padding-bottom: 22px; }
.o-section h2 { margin: 0 0 10px; font-weight: 400; font-size: 18px; line-height: 27.9px; color: var(--o-ink); }
.o-section h2 small { font-size: 14px; color: var(--o-muted); margin-left: 4px; }

.o-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13.8px; line-height: 21.39px; }
.o-table th { background: var(--o-head); padding: 12px; text-align: left; font-weight: 500; font-size: 14px; line-height: 21.7px; color: var(--o-ink); }
.o-table.center-head th { text-align: center; }
.o-table td { padding: 13px 12px; border-bottom: 1px solid var(--o-line); vertical-align: middle; color: var(--o-ink); }
.o-table tr.hl-warn td { background: #fffbeb; }
.o-table tr.hl-danger td { background: #fffbfa; }
.o-table tbody tr { transition: background .12s; }
.o-table tbody tr:hover td { background: #f8fafc; }
.o-table .muted { color: var(--o-muted); }
.o-table small { display: block; font-size: 12px; line-height: 18.6px; color: var(--o-muted); }

.msg { display: flex; align-items: center; gap: 10px; }
.case-id { flex-shrink: 0; background: var(--o-chip); color: var(--o-muted); font-size: 12px; line-height: 18.6px; padding: 1px 7px; border-radius: 4px; }

.person { display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 15px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.client { background: #ead0df; color: #6b2c4f; }
.avatar.staff { background: #cfe0f7; color: #1b4e8f; }
.avatar.ai { background: linear-gradient(135deg, #27c0f5, #1b6fd8); color: var(--white); }
.tag-new { background: #f79009; color: var(--white); font-weight: 700; font-size: 10.5px; padding: 0 6px; border-radius: 4px; margin-left: 4px; }
.tag-you { background: #dcfce7; color: #15803d; font-weight: 600; font-size: 11px; padding: 0 8px; border-radius: 999px; margin-left: 6px; }

.status { display: inline-flex; align-items: center; gap: 6px; padding: 3.5px 12px 3.88px; border-radius: 999px; font-weight: 600; font-size: 12.5px; line-height: 19.38px; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 3.5px; background: currentColor; }
.status.waiting { background: #fef3c7; color: #b45309; }
.status.ai { background: #e8f0fe; color: #1d4ed8; }
.status.active { background: #dcfce7; color: #15803d; }
.status.transfer { background: #ede9fe; color: #6d28d9; }
.status.closed { background: #e5e7eb; color: #4b5563; }
.ai-flag { display: inline-flex; margin-top: 6px; padding: 1px 8px; border-radius: 999px; border: 1px solid #fecdca; background: #fef3f2; color: #b42318; font-weight: 600; font-size: 11.5px; line-height: 17.83px; white-space: nowrap; }

.actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--o-line); background: var(--white); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-btn img { width: 16px; height: 16px; }
.icon-btn:hover { background: #f2f5f9; }
.o-btn { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 8px; border: 1px solid var(--o-navy); font: 500 12.5px/19.38px var(--font-ui); white-space: nowrap; }
.o-btn img { width: 16px; height: 16px; }
.o-btn.eye img { width: 15px; height: 15px; }
.o-btn.primary { background: var(--o-navy); color: var(--white); }
.o-btn.primary:hover { background: #1b3561; }
.o-btn.outline { background: var(--white); color: var(--o-navy); }
.o-btn.outline:hover { background: #f2f5f9; }
.o-btn[disabled] { opacity: .6; cursor: default; }

.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { background: var(--o-chip); color: var(--o-ink); font-size: 11.8px; line-height: 18.29px; padding: 1px 8px; border-radius: 6px; white-space: nowrap; }

/* toast */
.o-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--o-navy); color: var(--white); padding: 10px 18px; border-radius: 8px; font-size: 13.5px; box-shadow: 0 8px 24px rgba(15,33,71,.25); z-index: 70; transition: opacity .2s; }
.o-toast[hidden] { display: block; opacity: 0; pointer-events: none; }
