:root {
  /* Sampled directly from the SKD AVIA brand book (logo + business card):
     deep blue -> bright cyan gradient, brand blue for accents/links,
     neutral (not navy-tinted) grays for body text. */
  --brand-deep: #004cbd;     /* gradient start; also primary button fill (7.6:1 with white) */
  --brand-blue: #00abe3;     /* gradient end / logo blue; links, active states, icons */
  --brand-cyan: #6cd4f7;     /* light secondary tone from the logo */
  --navy: #004cbd;           /* headings/labels reuse the deep brand blue */
  --navy-light: #0060d9;
  --accent: #00abe3;
  --accent-dark: #0089b8;
  --accent-light: #e6f6fc;
  --bg: #f6f8fb;
  --card: #ffffff;
  --border: #e1e6ec;
  --text: #23262b;
  --text-muted: #63666b;
  --danger: #b91c1c;
  --danger-bg: #fbeaea;
  --warn: #b45309;
  --warn-bg: #fdf0e0;
  --ok: #15803d;
  --ok-bg: #e7f4ec;
  --violet: #6d28d9;
  --violet-bg: #f1ebfd;
  --radius: 10px;
  --radius-sm: 6px;
  --font-sans: 'Manrope', -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
/* Browsers don't inherit the page font into form controls by default — they
   use the OS UI font instead, which is why buttons/inputs/selects can look
   like a different typeface from the rest of the page unless told otherwise. */
button, input, select, textarea, optgroup { font-family: inherit; font-size: inherit; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { color: var(--brand-deep); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.topbar {
  background: linear-gradient(100deg, var(--brand-deep) 0%, var(--brand-blue) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 32px;
  flex-wrap: wrap;
  gap: 12px;
}

.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand:hover .brand-title { color: #eaf7ff; }
.brand-mark { width: 38px; height: 38px; display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15)); }
.brand-title { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; transition: color 150ms ease; }
.brand-sub {
  font-size: 12px; color: rgba(255,255,255,0.75); margin-top: 1px;
}

.topbar nav { display: flex; gap: 4px; }
.topbar nav a {
  color: rgba(255,255,255,0.85);
  padding: 8px 4px;
  margin: 0 6px;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
}
.topbar nav a:hover { color: #fff; }
.topbar nav a.active { color: #fff; border-bottom-color: #fff; }

.topbar-right { display: flex; align-items: center; gap: 16px; }
.lang-switch { display: flex; gap: 2px; background: rgba(255,255,255,0.16); border-radius: 999px; padding: 2px; }
.lang-form { display: inline-flex; }
.lang-btn {
  background: transparent; border: none; color: rgba(255,255,255,0.85);
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  cursor: pointer; font-family: inherit; transition: background 150ms ease, color 150ms ease;
}
.lang-btn:hover { color: #fff; }
.lang-btn.active { background: var(--brand-deep); color: #fff; cursor: default; }

.user-box { display: flex; align-items: center; }
.avatar-btn {
  display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 50%; border: none; padding: 0; cursor: pointer;
  background: rgba(255,255,255,0.94); color: var(--brand-deep);
  transition: background 150ms ease;
}
.avatar-btn:hover { background: #fff; }
.avatar-btn svg { width: 19px; height: 19px; }
.dropdown-menu-label {
  padding: 8px 10px 6px; font-size: 12px; font-weight: 700; color: var(--text-muted);
  border-bottom: 1px solid var(--border); margin-bottom: 4px;
}

.auth-wrap { display: flex; justify-content: center; padding-top: 40px; }
.auth-card { width: 100%; max-width: 380px; text-align: center; }
.auth-logo { width: 96px; height: auto; margin: 0 auto 18px; display: block; }
.auth-title { margin: 0 0 16px; font-size: 20px; color: var(--navy); font-weight: 700; }
.auth-card .form { text-align: left; }
.auth-links { text-align: center; margin-top: 14px; }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.page-head-actions { margin-top: 10px; }
.inline-form-tight { display: inline; }
.inline-form-tight .btn { padding: 5px 10px; font-size: 12px; }

.checkbox-row { display: flex; gap: 16px; }
.table-scroll { overflow-x: auto; }
.table-scroll .table { min-width: 640px; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.section-head h2 { margin: 0; }
.search-form { display: flex; gap: 8px; align-items: center; }
.search-form input[type="text"] {
  padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 14px; width: 320px; max-width: 50vw;
  font-family: inherit; background: var(--card);
}

.page { max-width: 1600px; margin: 0 auto; padding: 28px 32px 60px; }

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.page-head h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.page-head-center { position: relative; justify-content: center; }
.page-head-center .btn { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.copy-on-click { cursor: pointer; display: inline-flex; align-items: baseline; gap: 10px; }
.copy-on-click:hover { color: var(--accent-dark); }
.copy-feedback { font-size: 12px; font-weight: 700; color: var(--ok); text-transform: none; letter-spacing: normal; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.card h2 {
  font-size: 12px; margin: 0 0 14px; color: var(--text-muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
}
.card h2:not(:first-child) { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.card h2.section-title {
  font-size: 16px; color: var(--text); text-transform: none; letter-spacing: normal;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn-primary { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
.btn-primary:hover { background: #003a94; border-color: #003a94; color: #fff; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  background: var(--accent-light); border-color: transparent; color: var(--accent-dark);
}
.btn-icon:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-icon svg { width: 19px; height: 19px; }
.btn-icon.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-icon.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

.confirm-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.confirm-modal[hidden] { display: none; }
.confirm-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45); }
.confirm-modal-box {
  position: relative; background: var(--card); border-radius: var(--radius); padding: 22px;
  max-width: 420px; width: calc(100% - 40px); box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}
.confirm-modal-title { margin: 0 0 8px; font-size: 17px; font-weight: 800; color: var(--text); letter-spacing: -0.01em; }
.confirm-modal-text { margin: 0 0 20px; font-size: 13px; line-height: 1.5; color: var(--text-muted); }
.confirm-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.confirm-modal-actions .btn-primary.confirm-modal-ok-danger { background: var(--danger); border-color: var(--danger); }
.confirm-modal-actions .btn-primary.confirm-modal-ok-danger:hover { background: #9a1717; border-color: #9a1717; }

.filters { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.filters select {
  padding: 7px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff; font-size: 14px; font-family: inherit;
}
.filters input[type="text"] {
  padding: 7px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff; font-size: 14px;
  font-family: inherit; width: 240px; max-width: 40vw;
}
.checkbox-label { font-size: 14px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 13px; font-weight: 700;
  color: var(--navy); border-bottom: 1px solid var(--border); padding: 8px 10px;
}
.table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr[onclick] { cursor: pointer; transition: background 120ms ease; }
.table tbody tr[onclick]:hover { background: var(--accent-light); }
.table tr.row-overdue td { background: var(--danger-bg); }
.table tr.row-closed { opacity: 0.6; }
.mono { font-variant-numeric: tabular-nums; }
.tabular-nums { font-variant-numeric: tabular-nums; }

.empty { color: var(--text-muted); font-size: 14px; }

.badge {
  display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: #eef0f2; color: var(--text-muted);
}
.badge-lg { font-size: 13px; padding: 5px 13px; }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warn { background: var(--warn-bg); color: var(--warn); margin-left: 6px; }
.badge-dept { background: var(--accent-light); color: var(--accent-dark); }
.badge-fault { background: #eef0f2; color: var(--navy); }
.badge-subagent { background: var(--violet-bg); color: var(--violet); }

.stage-new { background: var(--accent-light); color: var(--accent-dark); }
.stage-support_review { background: var(--accent-light); color: var(--accent-dark); }
.stage-dispute_supplier { background: var(--warn-bg); color: var(--warn); }
.stage-agent_sales_review { background: #efe7f5; color: #7a4c9b; }
.stage-sent_to_subagent { background: #efe7f5; color: #7a4c9b; }
.stage-subagent_dispute { background: var(--danger-bg); color: var(--danger); }
.stage-tech_support { background: #e3f1ec; color: #2f6b57; }
.stage-supplier_payment { background: var(--accent-light); color: var(--accent-dark); }
.stage-client_payment { background: var(--ok-bg); color: var(--ok); }
.stage-closed { background: var(--ok-bg); color: var(--ok); }

.status-row { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.status-row-tight { margin-bottom: 0; flex-direction: column; align-items: flex-end; gap: 6px; }

.def-list { display: flex; flex-direction: column; margin: 0; font-size: 14px; }
.def-row { display: flex; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.def-row:first-child { padding-top: 0; }
.def-row:last-child { border-bottom: none; padding-bottom: 0; }
.def-list dt { flex: 0 0 auto; min-width: 190px; color: var(--text-muted); white-space: nowrap; }
.def-list dd { margin: 0; color: var(--text); flex: 1; min-width: 0; overflow-wrap: break-word; word-break: break-word; }
@media (max-width: 560px) {
  .def-row { flex-direction: column; gap: 2px; }
  .def-list dt { white-space: normal; min-width: 0; }
}

.form .field { margin-bottom: 14px; }
.form label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 5px; color: var(--navy); text-transform: uppercase; letter-spacing: 0.04em; }
.form input, .form select, .form textarea {
  width: 100%; padding: 9px 11px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 14px; font-family: inherit;
  background: var(--card); color: var(--text);
}
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--accent); }
.form input[type="date"]:not(:disabled) { cursor: pointer; }
.form textarea { resize: vertical; }
.form textarea[name="description"] { resize: none; }
.field-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.field-row-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.field-actions { margin-top: 18px; }
.hint { font-size: 13px; color: var(--text-muted); margin-top: 10px; }

.checkbox-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.checkbox-chip {
  display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--card); font-size: 13px; font-weight: 600; color: var(--text);
  cursor: pointer; user-select: none; transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.checkbox-chip:hover { border-color: var(--accent); }
.checkbox-chip input { width: 15px; height: 15px; accent-color: var(--accent); flex-shrink: 0; }
.checkbox-chip:has(input:checked) { border-color: var(--accent); background: var(--accent-light); color: var(--accent-dark); }
.field-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

.take-btn-row { margin-bottom: 10px; }

/* --- Counterparties: list header, filters, sortable table, pagination --- */

.cp-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.cp-head-title { display: flex; flex-direction: column; gap: 2px; }
.cp-head-title-row { display: flex; align-items: center; gap: 10px; }
.cp-head-title-row h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.count-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 7px;
  border-radius: 999px; background: var(--accent-light); color: var(--accent-dark); font-size: 12px; font-weight: 700;
}
.cp-head-sync { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sync-status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-muted); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
.cp-head-sync .btn-primary svg, .cp-head > .btn-primary svg { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; }

.cp-card { padding-top: 16px; }

.search-bar-icon {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fafbfd;
}
.search-bar-icon svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.search-bar-icon input[type="text"] {
  flex: 1; border: none; background: none; font-size: 14px; font-family: inherit; color: var(--text); outline: none;
}
.search-bar-icon .btn { flex-shrink: 0; }

.cp-filters-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.cp-filter { display: flex; flex-direction: column; gap: 5px; }
.cp-filter label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.cp-filter select {
  padding: 7px 30px 7px 11px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff;
  font-size: 13px; font-family: inherit; min-width: 150px;
}
.cp-found { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--text-muted); padding-bottom: 8px; }

.sortable-th { display: inline-flex; align-items: center; gap: 5px; color: inherit; font: inherit; }
.sortable-th:hover { color: var(--accent-dark); }
.sort-icon { width: 13px; height: 13px; color: #b7bec8; flex-shrink: 0; }
.sort-icon-active { color: var(--accent-dark); }

.role-cell { display: flex; flex-wrap: wrap; gap: 5px; }

.cabinet-cell .cabinet-login { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.cabinet-cell .cabinet-login:hover { color: var(--accent-dark); }
.cabinet-cell .cabinet-login svg { width: 13px; height: 13px; color: var(--text-muted); flex-shrink: 0; }
.cabinet-cell .copy-feedback { font-size: 11px; font-weight: 700; color: var(--ok); }
.cabinet-id { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.cp-pagination {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
}
.cp-pagination-range { font-size: 13px; color: var(--text-muted); }
.cp-pagination-controls { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cp-per-page { display: flex; align-items: center; gap: 8px; }
.cp-per-page label { font-size: 13px; color: var(--text-muted); }
.cp-per-page select { padding: 5px 26px 5px 9px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 13px; font-family: inherit; }
.cp-page-nav { display: flex; align-items: center; gap: 4px; }
.cp-page-nav .btn-icon { width: 32px; height: 32px; }
.cp-page-nav .btn-icon svg { width: 16px; height: 16px; }
.cp-page-nav .btn-disabled { opacity: 0.35; cursor: default; pointer-events: none; }
.page-num {
  display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 6px;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; color: var(--text);
}
a.page-num:hover { background: var(--accent-light); color: var(--accent-dark); }
.page-num-active { background: var(--brand-deep); color: #fff; }
.page-num-ellipsis { color: var(--text-muted); font-weight: 400; }

.attachment-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.attachment-list li {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: #fafbfd; flex-wrap: wrap;
}
.attachment-meta { font-size: 12px; color: var(--text-muted); }

.attachment-group-header {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
  padding: 8px 2px 0; margin-top: 2px; border-top: 1px solid var(--border);
}
.attachment-group-header:first-child { padding-top: 0; margin-top: 0; border-top: none; }
.attachment-item { flex-wrap: nowrap !important; gap: 12px !important; padding: 10px 12px !important; }
.attachment-icon {
  display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0;
  border-radius: var(--radius-sm); background: var(--accent-light); color: var(--accent-dark);
}
.attachment-icon svg { width: 17px; height: 17px; }
.attachment-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.attachment-body a { font-size: 13px; font-weight: 700; overflow-wrap: break-word; }
.attachment-actions { display: flex; gap: 6px; flex-shrink: 0; margin-left: auto; }
.attachment-actions .btn-icon { width: 34px; height: 34px; }
.attachment-actions .btn-icon svg { width: 15px; height: 15px; }

/* --- Account detail page: profile header + icon cards ------------------ */

.account-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.account-header-left { display: flex; align-items: center; gap: 16px; }
.avatar-circle {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-light); color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800;
}
.avatar-circle-sm { width: 30px; height: 30px; font-size: 12px; }
.employee-cell { display: inline-flex; align-items: center; gap: 9px; }
.account-header-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.account-header-title-row h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.account-header-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.status-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--ok); }
.status-dot-ok { background: var(--ok); }
.status-dot-danger { background: var(--danger); }
.status-dot-warn { background: var(--warn); }

.account-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .account-grid { grid-template-columns: 1fr; } }
.account-col-main, .account-col-side { display: flex; flex-direction: column; gap: 20px; }
.account-col-main > form { display: flex; flex-direction: column; gap: 20px; }

.icon-card-head { display: flex; align-items: flex-start; gap: 12px; }
.icon-card-icon {
  width: 38px; height: 38px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: var(--accent-light); color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
}
.icon-card-icon svg { width: 19px; height: 19px; }
.icon-card-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.icon-card-head p { margin: 2px 0 0; font-size: 13px; color: var(--text-muted); }
.icon-card-head-meta { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--text-muted); white-space: nowrap; padding-top: 2px; }
.icon-card-body { margin-top: 18px; }
.icon-card-body.form .field:last-child { margin-bottom: 0; }
.icon-card-text { font-size: 13px; color: var(--text-muted); margin: 14px 0 16px; }

.dept-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 18px; }
@media (max-width: 700px) { .dept-grid { grid-template-columns: 1fr; } }
.dept-check {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: #fff; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.dept-check:hover { border-color: var(--accent); }
.dept-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }
.dept-check:has(input:checked) { border-color: var(--accent); background: var(--accent-light); }

.form-actions-row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.form-actions-row .btn-primary svg { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; }

.account-info-list { margin: 18px 0 0; }
.account-info-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.account-info-list > div:last-child { border-bottom: none; padding-bottom: 0; }
.account-info-list dt { margin: 0; color: var(--text-muted); font-weight: 600; }
.account-info-list dd { margin: 0; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; }

.btn-block { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-block svg { width: 16px; height: 16px; }

.edit-details { margin-bottom: 16px; margin-top: 16px; }
.edit-details summary.btn { display: inline-block; cursor: pointer; user-select: none; }
.edit-details[open] summary.btn { margin-bottom: 12px; }
.edit-panel { margin-bottom: 16px; }
.edit-panel:not([hidden]) ~ .def-list { display: none; }
.edit-form {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: #fafbfd;
}

.action-form {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; background: #fafbfd;
}
.action-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.action-form select, .action-form textarea {
  width: 100%; margin-bottom: 8px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-family: inherit; font-size: 14px;
}

.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #f0c6c6; }
.alert-info { background: var(--accent-light); color: var(--accent-dark); border: 1px solid #bfe9f7; }
.sync-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sync-banner form { flex-shrink: 0; }

/* --- Claim detail: workflow-first layout ------------------------------ */

.breadcrumb { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 14px; }
.breadcrumb:hover { color: var(--accent-dark); }
.breadcrumb svg { width: 14px; height: 14px; }

.claim-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.claim-header-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.claim-header-left h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -0.01em; }
.claim-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.claim-header-actions .btn:not(.btn-icon) svg { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; }

.menu-wrap { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 190px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14); padding: 6px; display: flex; flex-direction: column; gap: 2px;
}
.dropdown-menu[hidden] { display: none; }
.dropdown-menu form { display: contents; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: none; background: none;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; font-family: inherit; color: var(--text);
  cursor: pointer; text-align: left;
}
.dropdown-item:hover { background: var(--accent-light); color: var(--accent-dark); }
.dropdown-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.dropdown-item-danger { color: var(--danger); }
.dropdown-item-danger:hover { background: var(--danger-bg); color: var(--danger); }

.summary-bar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 20px; overflow: hidden;
}
.summary-stat { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-right: 1px solid var(--border); min-width: 0; }
.summary-stat:last-child { border-right: none; }
.summary-icon {
  display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%; background: var(--accent-light); color: var(--accent-dark);
}
.summary-icon svg { width: 18px; height: 18px; }
.summary-label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 2px; }
.summary-value { font-size: 14px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-days-sep { color: var(--border); margin: 0 6px; font-weight: 700; }
.summary-days { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--text-muted); white-space: nowrap; }
.summary-days svg { width: 12px; height: 12px; }
.summary-days-warn { color: var(--warn); }
.summary-days-danger { color: var(--danger); }
@media (max-width: 1100px) {
  .summary-bar { grid-template-columns: repeat(2, 1fr); }
  .summary-stat { border-bottom: 1px solid var(--border); }
  .summary-stat:nth-child(2n) { border-right: none; }
}
@media (max-width: 560px) { .summary-bar { grid-template-columns: 1fr; } }

.claim-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 20px; align-items: stretch; }
@media (max-width: 960px) { .claim-grid { grid-template-columns: 1fr; } }
.claim-col-left, .claim-col-right { display: flex; flex-direction: column; }
.claim-col-left > .card:last-child, .claim-col-right > .card:last-child { flex: 1; display: flex; flex-direction: column; }
.claim-col-left > .card:last-child .dropzone-wrap { flex: 1; display: flex; }
.claim-col-left > .card:last-child .dropzone { flex: 1; justify-content: center; }

.stage-panel-card { position: sticky; top: 20px; }
.stage-alert {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--accent-light); color: var(--accent-dark); font-size: 13px; font-weight: 700; margin-bottom: 16px;
}
.stage-alert svg { width: 16px; height: 16px; flex-shrink: 0; }
.stage-alert-warn { background: var(--warn-bg); color: var(--warn); }
.stage-alert-danger { background: var(--danger-bg); color: var(--danger); }

.journey { list-style: none; margin: 0 0 18px; padding: 0; }
.journey-step { position: relative; display: flex; align-items: center; gap: 12px; padding: 6px 10px; margin: 0 -10px 12px; border-radius: var(--radius-sm); }
.journey-step:last-child { margin-bottom: 0; }
.journey-dot {
  position: relative; z-index: 1; flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: #fff; border: 2px solid var(--border); color: var(--text-muted);
}
.journey-dot::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  width: 2px; height: 24px; background: var(--border); z-index: -1;
}
.journey-step:last-child .journey-dot::after { display: none; }
.journey-dot svg { width: 12px; height: 12px; }
.journey-label { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.journey-step-done .journey-dot { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
.journey-step-done .journey-label { color: var(--text); }
.journey-step-current { background: var(--accent-light); }
.journey-step-current .journey-dot { background: var(--brand-deep); border-color: var(--brand-deep); }
.journey-step-current .journey-label { color: var(--brand-deep); font-weight: 800; }

.comment-label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.action-form-v2 { margin-bottom: 18px; }
.action-form-v2:last-child { margin-bottom: 0; }
.action-form-v2 + .action-form-v2 { border-top: 1px solid var(--border); padding-top: 18px; }
.action-form-v2 select, .action-form-v2 textarea {
  width: 100%; margin-bottom: 12px; padding: 9px 11px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-family: inherit; font-size: 14px;
}
.action-form-v2 textarea { min-height: 96px; resize: none; }
.btn-block { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 13px 18px; font-size: 15px; }
.btn-block svg { width: 17px; height: 17px; }

.option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
@media (max-width: 1200px) { .option-grid { grid-template-columns: 1fr; } }
.option-card {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; transition: border-color 150ms ease, background 150ms ease;
}
.option-card:hover { border-color: var(--accent); }
.option-card-selected { border-color: var(--brand-deep); background: var(--accent-light); }
.option-radio-input { width: 18px; height: 18px; flex-shrink: 0; margin: 0; accent-color: var(--brand-deep); }
.option-text { display: flex; flex-direction: column; gap: 2px; }
.option-title { font-size: 13px; font-weight: 700; color: var(--text); }
.option-sub { font-size: 12px; color: var(--text-muted); }
.option-grid-1col { grid-template-columns: 1fr; }
/* Compact radio-card variant with a leading icon (access-level picker):
   radio + small icon + title sit on one row, the description wraps full
   width on the row below, indented to align under the title rather than
   the radio. text-transform:none overrides the .form label { uppercase }
   rule these labels would otherwise inherit (they're real <label> elements
   living inside a .form). */
.option-card-compact { flex-direction: column; align-items: stretch; gap: 3px; }
.option-card-compact-row { display: flex; align-items: center; gap: 8px; }
.option-card-compact .option-radio-input { width: 16px; height: 16px; }
.option-icon-inline { display: flex; flex-shrink: 0; color: var(--accent-dark); }
.option-icon-inline svg { width: 16px; height: 16px; }
.option-card-compact .option-title { text-transform: none; letter-spacing: normal; }
.option-card-compact .option-sub { text-transform: none; letter-spacing: normal; margin-left: 40px; }

/* --- Create-account card: icon header, sections, radio+icon options ---- */

.create-account-card { max-width: 960px; margin: 0 auto; }
.create-account-head { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.create-account-icon { width: 40px; height: 40px; }
.create-account-icon svg { width: 19px; height: 19px; }
.create-account-head h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.create-account-section { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.section-title { margin: 0; font-size: 16px; font-weight: 700; text-transform: none; letter-spacing: normal; color: var(--text); }
.section-subtitle { margin: 3px 0 14px; font-size: 13px; color: var(--text-muted); }

.password-info-box {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; padding: 14px; border-radius: var(--radius-sm);
  background: var(--accent-light);
}
.password-info-icon { width: 20px; height: 20px; color: var(--accent-dark); flex-shrink: 0; margin-top: 1px; }
.password-info-icon svg { width: 20px; height: 20px; }
.password-info-title { font-size: 13px; font-weight: 700; color: var(--accent-dark); margin-bottom: 4px; }
.password-info-text { margin: 0; font-size: 12px; color: var(--text); line-height: 1.5; }

.create-account-footer {
  display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border);
}
.create-account-footer .btn-primary svg { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; }

.decision-comment {
  width: 100%; min-height: 96px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  font-family: inherit; font-size: 14px; color: var(--text); resize: none; margin-bottom: 4px;
}

/* --- Toggle switch (shared: claims-list "only open", account status) --- */

.switch-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; user-select: none; }
.switch-label-compact { font-size: 13px; font-weight: 700; }
.switch { position: relative; display: inline-flex; flex-shrink: 0; }
.switch input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  display: inline-flex; align-items: center; width: 38px; height: 22px; border-radius: 999px;
  background: #cbd2db; transition: background 150ms ease; padding: 2px; box-sizing: border-box;
}
.switch-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.25); transition: transform 150ms ease; }
.switch input:checked ~ .switch-track { background: var(--brand-deep); }
.switch input:checked ~ .switch-track .switch-thumb { transform: translateX(16px); }
.switch input:focus-visible ~ .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Claims list: header, filter bar, rich stage select, row chevron ---- */

.page-head > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.page-subtitle { margin: 0; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.page-head .btn-primary svg { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; }

.claims-filter-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.claims-search { flex: 1; min-width: 220px; margin-bottom: 0; }
.claims-department-select {
  padding: 10px 30px 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff;
  font-size: 14px; font-family: inherit;
}
.reset-link {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--accent-dark);
  white-space: nowrap;
}
.reset-link svg { width: 14px; height: 14px; }
.reset-link:hover { color: var(--brand-deep); }
.claims-found { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }

.stage-select { position: relative; }
.stage-select-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 220px;
  padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff;
  font-size: 14px; font-family: inherit; font-weight: 600; color: var(--text); cursor: pointer;
}
.stage-select-trigger:hover { border-color: var(--accent); }
.stage-select[data-open] .stage-select-trigger { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }
.stage-select-trigger svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; transition: transform 150ms ease; }
.stage-select[data-open] .stage-select-trigger svg { transform: rotate(180deg); }
.stage-select-panel {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; width: 340px; max-width: 90vw;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
}
.stage-select-panel[hidden] { display: none; }
.stage-select-search-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 6px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fafbfd;
}
.stage-select-search-row svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.stage-select-search { flex: 1; border: none; background: none; font-size: 13px; font-family: inherit; outline: none; }
.stage-select-clear {
  flex-shrink: 0; border: none; background: none; padding: 3px 6px; font-size: 12px; font-weight: 700;
  color: var(--accent-dark); cursor: pointer; font-family: inherit; border-radius: var(--radius-sm);
}
.stage-select-clear:hover { background: var(--accent-light); }
.stage-select-options { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.stage-option { border-radius: var(--radius-sm); }
.stage-option[hidden] { display: none; }
.stage-option-active { background: var(--accent-light); }
.stage-option-label {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer;
}
.stage-option-label:hover { background: var(--accent-light); color: var(--accent-dark); }
.stage-option-label input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); flex-shrink: 0; }
.stage-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.stage-option-group-label {
  padding: 10px 10px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
}
.stage-option-group-label[hidden] { display: none; }
.stage-select-hint {
  display: flex; align-items: flex-start; gap: 7px; margin-top: 8px; padding: 9px 10px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted); line-height: 1.4;
}
.stage-select-hint svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; }
.stage-select-actions { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.stage-select-actions .btn { display: flex; align-items: center; justify-content: center; width: 100%; }

.badge .stage-dot { margin-right: 5px; display: inline-block; vertical-align: middle; }

.claim-number-link { color: var(--accent-dark); text-decoration: underline; font-weight: 600; }
.claim-number-link:hover { color: var(--brand-deep); }
.copy-icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-left: 4px;
  padding: 0; border: none; background: none; color: var(--text-muted); cursor: pointer; border-radius: var(--radius-sm);
  vertical-align: -5px;
}
.copy-icon-btn:hover { background: var(--accent-light); color: var(--accent-dark); }
.copy-icon-btn svg { width: 13px; height: 13px; }
.copy-icon-btn .copy-feedback {
  position: absolute; top: -24px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--text); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 4px;
}

.section-head .list-title {
  font-size: 16px; font-weight: 700; text-transform: none; letter-spacing: normal; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.section-head .btn-icon { width: 36px; height: 36px; }
.section-head .btn-icon svg { width: 16px; height: 16px; }
.decision-comment:focus { border-color: var(--accent); }

.decision-extra { margin-bottom: 14px; }
.decision-extra label {
  display: block; font-size: 12px; font-weight: 700; margin-bottom: 5px; color: var(--navy);
  text-transform: uppercase; letter-spacing: 0.04em;
}

.searchable-select { position: relative; }
.searchable-select-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  padding: 9px 11px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--card);
  font-size: 14px; font-family: inherit; color: var(--text); cursor: pointer; text-align: left;
}
.searchable-select-trigger:hover { border-color: var(--accent); }
.searchable-select-trigger.searchable-select-error { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.searchable-select-trigger svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.searchable-select-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.searchable-select-value.is-placeholder { color: var(--text-muted); }
.searchable-select-panel {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14); padding: 6px;
}
.searchable-select-panel[hidden] { display: none; }
.searchable-select-search {
  width: 100%; padding: 8px 10px; margin-bottom: 6px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  font-size: 13px; font-family: inherit;
}
.searchable-select-options { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; }
.searchable-select-options li { padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13px; cursor: pointer; }
.searchable-select-options li:hover { background: var(--accent-light); color: var(--accent-dark); }
.searchable-select-options li[hidden] { display: none; }
.decision-actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.decision-actions .btn-primary { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; }
.decision-actions .btn-primary svg { width: 17px; height: 17px; flex-shrink: 0; }
.decision-target-hint { margin: 8px 0 0; font-size: 12px; color: var(--text-muted); text-align: right; }
.draft-feedback { font-size: 12px; font-weight: 700; color: var(--ok); margin-left: 8px; }

.assignee-status { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--ok); margin-top: 3px; }
.assignee-status svg { width: 13px; height: 13px; flex-shrink: 0; }

.dropzone-wrap { margin-bottom: 14px; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 26px 16px;
  border: 1.5px dashed var(--border); border-radius: var(--radius); background: #fafbfd; color: var(--text-muted);
  transition: border-color 150ms ease, background 150ms ease;
}
.dropzone.dropzone-active { border-color: var(--accent); background: var(--accent-light); }
.dropzone-icon {
  display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-bottom: 6px;
  border-radius: 50%; background: var(--accent-light); color: var(--accent-dark);
}
.dropzone-icon svg { width: 19px; height: 19px; }
.dropzone-title { font-size: 14px; font-weight: 700; color: var(--text); }
.dropzone-hint { font-size: 12px; color: var(--text-muted); }
.dropzone .btn { margin-top: 8px; }

.table-dense { table-layout: fixed; }
.table-dense td, .table-dense th { padding: 8px 10px; font-size: 13px; overflow-wrap: break-word; word-break: break-word; }
.table-dense td { vertical-align: middle; }
.table-dense th:nth-child(1), .table-dense td:nth-child(1) { width: 9%; }
.table-dense th:nth-child(2), .table-dense td:nth-child(2) { width: 15%; }
.table-dense th:nth-child(3), .table-dense td:nth-child(3) { width: 12%; }
.table-dense th:nth-child(4), .table-dense td:nth-child(4) { width: 24%; }
.table-dense th:nth-child(5), .table-dense td:nth-child(5) { width: 14%; }
.table-dense th:nth-child(6), .table-dense td:nth-child(6) { width: 26%; }
