:root {
  --blue: #0066df;
  --blue-2: #1588ff;
  --ink: #06152b;
  --muted: #63728a;
  --line: #dbe5f1;
  --page: #f4f7fb;
  --panel: #ffffff;
  --input: #ffffff;
  --soft: #edf5ff;
  --table-head: #f8fbff;
  --row-line: #e8eef6;
  --shadow: rgba(20, 46, 88, 0.12);
  --ok: #11a36a;
  --warn: #e89418;
  --bad: #d13b3b;
}

body[data-theme="dark"] {
  --blue: #2d7dff;
  --blue-2: #68a6ff;
  --ink: #eef5ff;
  --muted: #9aa9bf;
  --line: #22324b;
  --page: #050b16;
  --panel: #0b1220;
  --input: #101a2c;
  --soft: #13243d;
  --table-head: #0e1829;
  --row-line: #1d2a40;
  --shadow: rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  color: var(--ink);
  background: var(--page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background: #06285c;
}

body.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: url("/login-bg-final.png?v=20260521-final-bg") center / cover no-repeat;
  filter: none;
  opacity: 1;
  transform: none;
}

body.login-page::after {
  display: none;
}

.login-corner-logo {
  position: fixed;
  z-index: 1;
  top: 28px;
  left: 32px;
  width: 132px;
  height: auto;
  filter: drop-shadow(0 18px 34px rgba(0, 0, 0, 0.18));
}

.login-card {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  box-shadow: 0 32px 100px rgba(4, 22, 55, 0.36);
  padding: 34px;
  display: grid;
  gap: 18px;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(14px);
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 0;
}

.login-brand strong {
  font-size: 28px;
}

.login-description {
  margin-top: -8px;
  margin-bottom: 8px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.check-row {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.login-button {
  width: 100%;
  margin-top: 0;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  width: 100%;
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 34px;
  height: 34px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #63728a;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: rgba(30, 118, 237, 0.1);
  color: #1f7af0;
  outline: none;
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar {
  min-height: 100vh;
  padding: 26px 16px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
}

.logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

body[data-theme="dark"] .logo {
  content: url("/forumlogo-dark.png");
}

.brand-text strong {
  display: block;
  line-height: 1;
  font-size: 24px;
}

nav {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  padding: 14px 16px;
  border-radius: 8px;
}

nav a.active {
  color: var(--blue);
  background: var(--soft);
}

.topbar p,
.result-head p,
.message {
  color: var(--muted);
}

main {
  min-width: 0;
}

.topbar {
  min-height: 80px;
  padding: 26px 32px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.15;
}

h2 {
  font-size: 21px;
}

.topbar p {
  margin-top: 8px;
}

.account-menu {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-dropdown {
  position: relative;
}

.account-dropdown summary {
  list-style: none;
}

.account-dropdown summary::-webkit-details-marker {
  display: none;
}

.account-button {
  min-width: 230px;
  height: 58px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
}

.account-button em {
  margin-left: auto;
  color: var(--muted);
  font-style: normal;
  font-size: 18px;
}

.account-button span {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
}

.account-button div {
  display: grid;
  gap: 2px;
  text-align: left;
}

.account-button small {
  color: var(--muted);
}

.theme-toggle,
.settings-button {
  width: 42px;
  height: 42px;
  min-width: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--soft);
  color: var(--blue);
  box-shadow: none;
  font-size: 20px;
}

.theme-toggle {
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 102, 223, 0.22);
  background: #dcecff;
}

.theme-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle svg circle {
  fill: currentColor;
  stroke: none;
}

body[data-theme="dark"] .theme-toggle {
  background: rgba(255, 196, 66, 0.14);
  color: #ffc542;
}

body[data-theme="dark"] .theme-toggle:hover {
  background: rgba(255, 196, 66, 0.22);
  border-color: rgba(255, 196, 66, 0.28);
}

.account-panel {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 80px var(--shadow);
  z-index: 10;
}

.account-dropdown[open] .account-panel {
  display: block;
}

.account-panel h2 {
  font-size: 18px;
  margin-bottom: 14px;
}

.logout-button {
  width: 100%;
  height: 44px;
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 8px;
  background: var(--soft);
  color: var(--blue);
  font-weight: 850;
}

.workspace {
  padding: 32px;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.upload-panel,
.result-panel {
  max-width: 1180px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 60px var(--shadow);
}

.upload-panel {
  padding: 32px;
}

.excel-hint {
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
}

.settings-card h2 {
  display: block;
  font-size: 20px;
  margin-bottom: 6px;
}

.sample-table {
  width: min(560px, 100%);
  min-width: 0;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.sample-table th,
.sample-table td {
  padding: 9px 12px;
  white-space: nowrap;
  border: 1px solid #d9e3ef;
}

.sample-table th {
  background: var(--table-head);
  color: var(--ink);
  font-size: 13px;
}

.dropzone {
  min-height: 248px;
  border: 2px dashed #a9c7ec;
  border-radius: 8px;
  background: var(--table-head);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.dropzone.drag {
  border-color: var(--blue);
  background: var(--soft);
}

.manual-divider {
  margin: 22px 0 18px;
  text-align: center;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.manual-swap {
  display: grid;
  grid-template-columns: minmax(260px, 1.45fr) minmax(150px, 0.85fr) minmax(130px, 0.8fr) minmax(170px, 0.95fr) minmax(180px, 1fr);
  gap: 14px;
  width: 100%;
  align-items: end;
}

.manual-swap label {
  min-width: 0;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
  text-align: left;
  position: relative;
}

.manual-swap input[readonly] {
  opacity: 0.9;
}

.manual-swap input,
.manual-swap select {
  width: 100%;
  min-width: 0;
}

.dropzone input {
  display: none;
}

.upload-icon {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 36px;
  line-height: 1;
}

.dropzone strong {
  font-size: 22px;
}

.dropzone small {
  color: var(--muted);
}

.dropzone em {
  min-height: 20px;
  color: var(--blue);
  font-style: normal;
  font-weight: 700;
}

button {
  border: 0;
  border-radius: 8px;
  height: 48px;
  padding: 0 24px;
  font-weight: 850;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 102, 223, 0.22);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.primary {
  margin-top: 20px;
  min-width: 160px;
  background: var(--blue);
}

.primary-inline {
  min-width: 138px;
  background: var(--blue);
}

.danger,
.secondary {
  background: var(--blue);
  min-width: 138px;
}

.secondary {
  background: var(--soft);
  color: var(--blue);
  box-shadow: none;
}

.compact {
  margin-top: 4px;
  min-width: 120px;
}

.message {
  min-height: 24px;
  margin-top: 12px;
}

.result-panel {
  margin-top: 24px;
  overflow: hidden;
}

.result-panel.standalone {
  margin-top: 0;
}

.dashboard-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.dashboard-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 60px var(--shadow);
  overflow: hidden;
}

.dashboard-card > h2,
.dashboard-card > p {
  margin-left: 22px;
  margin-right: 22px;
}

.dashboard-card > h2 {
  margin-top: 22px;
  margin-bottom: 8px;
}

.dashboard-card > p {
  margin-top: 0;
  color: var(--muted);
}

.dashboard-wide {
  grid-column: 1 / -1;
}

.compact-head {
  border-bottom: 1px solid var(--line);
}

.stats-grid {
  padding: 18px 22px 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--table-head);
  display: grid;
  align-content: center;
  gap: 8px;
}

.stat-card span,
.ranking-row small,
.ranking-row em {
  color: var(--muted);
}

.stat-card strong {
  font-size: 34px;
  line-height: 1;
}

.stat-card small {
  color: var(--muted);
  font-weight: 700;
}

.pie-card {
  padding: 8px 22px 24px;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.pie-visual {
  width: 172px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 22px rgba(255, 255, 255, 0.64);
}

body[data-theme="dark"] .pie-visual {
  box-shadow: inset 0 0 0 22px rgba(9, 15, 27, 0.78);
}

.pie-visual.empty {
  background: var(--soft);
}

.pie-visual span {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: var(--panel);
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 900;
}

.pie-legend {
  display: grid;
  gap: 10px;
}

.pie-legend div {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-weight: 800;
}

.pie-legend i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.period-bars,
.ranking-list {
  padding: 8px 22px 24px;
  display: grid;
  gap: 14px;
}

.period-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 54px;
  gap: 14px;
  align-items: center;
  font-weight: 800;
}

.period-track,
.ranking-track {
  height: 10px;
  border-radius: 999px;
  background: var(--soft);
  overflow: hidden;
}

.period-track b,
.ranking-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--blue-2));
}

.ranking-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--table-head);
}

.ranking-row > b {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
}

.ranking-row > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.ranking-row strong,
.ranking-row small,
.ranking-row em {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-row em {
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.empty-state {
  padding: 18px;
  color: var(--muted);
  font-weight: 800;
}

#dashboardView.workspace {
  padding-top: 28px;
  background:
    radial-gradient(circle at 92% 8%, rgba(0, 102, 223, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(244, 248, 253, 0.88), rgba(244, 248, 253, 0));
}

body[data-theme="dark"] #dashboardView.workspace {
  background:
    radial-gradient(circle at 92% 8%, rgba(45, 125, 255, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(16, 26, 44, 0.5), rgba(9, 15, 27, 0));
}

.dashboard-grid {
  max-width: 1360px;
  gap: 20px;
}

.dashboard-card {
  border-color: rgba(157, 178, 208, 0.32);
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(30, 62, 105, 0.09);
}

body[data-theme="dark"] .dashboard-card {
  border-color: rgba(96, 128, 180, 0.28);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.dashboard-card h2 {
  letter-spacing: 0;
}

.stats-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 22px;
}

.stat-card {
  position: relative;
  min-height: 138px;
  padding: 18px 18px 16px;
  align-content: start;
  background: linear-gradient(180deg, var(--panel), var(--table-head));
  box-shadow: 0 10px 28px rgba(30, 62, 105, 0.06);
}

.stat-card i {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 22px;
  color: var(--blue);
  background: rgba(0, 102, 223, 0.1);
}

.stat-card-2 i,
.stat-card-5 i {
  color: #13a86b;
  background: rgba(19, 168, 107, 0.12);
}

.stat-card-3 i {
  color: #7c5cff;
  background: rgba(124, 92, 255, 0.12);
}

.stat-card-4 i {
  color: #ff8a1f;
  background: rgba(255, 138, 31, 0.12);
}

.stat-card span {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 800;
}

.stat-card strong {
  font-size: 29px;
}

.stat-card small {
  line-height: 1.35;
}

.card-title-row {
  padding: 22px 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.card-title-row h2,
.card-title-row p {
  margin: 0;
}

.card-title-row p {
  margin-top: 6px;
  color: var(--muted);
}

.card-title-row > span {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--table-head);
  font-weight: 800;
  white-space: nowrap;
}

.activity-chart {
  padding: 8px 18px 18px;
  min-height: 288px;
}

.activity-chart svg {
  width: 100%;
  height: 288px;
  display: block;
}

.chart-grid-line {
  stroke: var(--row-line);
  stroke-width: 1;
}

.chart-area {
  fill: url(#activityFill);
}

.chart-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-dot {
  fill: var(--blue);
  stroke: var(--panel);
  stroke-width: 3;
}

.chart-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pie-card {
  grid-template-columns: 170px minmax(0, 1fr);
}

.pie-visual {
  width: 158px;
  box-shadow: inset 0 0 0 18px rgba(255, 255, 255, 0.72);
}

.pie-visual span {
  width: 78px;
  height: 78px;
  font-size: 24px;
}

.period-row {
  grid-template-columns: 130px minmax(0, 1fr) 64px;
}

.period-track,
.ranking-track {
  background: rgba(0, 102, 223, 0.08);
}

.ranking-row {
  background: linear-gradient(180deg, var(--panel), var(--table-head));
}

.hidden {
  display: none !important;
}

.result-head {
  padding: 22px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.result-head p {
  margin-top: 6px;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.table-wrap {
  overflow-x: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  table-layout: fixed;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--row-line);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  color: var(--muted);
  font-size: 12px;
  background: var(--table-head);
  position: relative;
  user-select: none;
}

td {
  font-size: 13px;
}

th:last-child,
td:last-child {
  width: 124px;
  min-width: 124px;
  overflow: visible;
}

th:first-child {
  width: 154px;
}

.recordings-table th,
.recordings-table td {
  padding-left: 8px;
  padding-right: 8px;
}

.recordings-table th:nth-child(1) { width: 138px; }
.recordings-table th:nth-child(2) { width: 70px; }
.recordings-table th:nth-child(3) { width: 156px; }
.recordings-table th:nth-child(4) { width: 58px; }
.recordings-table th:nth-child(5) { width: 112px; }
.recordings-table th:nth-child(6) { width: 105px; }
.recordings-table th:nth-child(7) { width: 168px; }
.recordings-table th:nth-child(8) { width: 92px; }
.recordings-table th:nth-child(9) { width: 82px; }
.recordings-table th:nth-child(10) { width: 116px; }

.history-table {
  table-layout: fixed;
  min-width: 0;
}

.history-table th:nth-child(1),
.history-table td:nth-child(1) {
  width: 150px;
}

.history-table th:nth-child(2),
.history-table td:nth-child(2) {
  width: 190px;
}

.history-table th:nth-child(3),
.history-table td:nth-child(3) {
  width: 138px;
}

.history-table th:nth-child(4),
.history-table td:nth-child(4) {
  width: auto;
}

.history-table td {
  vertical-align: top;
}

.history-table td:nth-child(1),
.history-table td:nth-child(2),
.history-table td:nth-child(3) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-table td:nth-child(4) {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.history-table th.history-rollback-col,
.history-table td:nth-child(5) {
  display: none;
  width: 92px;
  min-width: 92px;
}

.history-table.history-can-rollback th.history-rollback-col,
.history-table.history-can-rollback td:nth-child(5) {
  display: table-cell;
}

.rollback-btn {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid #ffd0d0;
  border-radius: 10px;
  color: #d32f3f;
  background: #fff1f2;
  font-weight: 850;
  cursor: pointer;
}

.rollback-btn:disabled {
  cursor: wait;
  opacity: 0.65;
}

.rollback-done {
  color: #6b7890;
  font-size: 12px;
  font-weight: 800;
}

.column-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
}

.column-resizer::after {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 3px;
  width: 2px;
  border-radius: 999px;
  background: transparent;
}

th:hover .column-resizer::after,
.resizing-columns .column-resizer::after {
  background: #b8c9df;
}

.resizing-columns {
  cursor: col-resize;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.chip.ready,
.chip.already {
  color: #066442;
  background: #e9f8f1;
}

.chip.warning {
  color: #805000;
  background: #fff4dd;
}

.chip.not_found,
.chip.conflict,
.chip.error {
  color: #8a2020;
  background: #ffeaea;
}

.progress-wrap {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--muted);
}

.progress {
  height: 12px;
  border-radius: 999px;
  background: var(--soft);
  overflow: hidden;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--blue-2));
  transition: width 220ms ease;
}

.settings-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(320px, 1fr);
  gap: 24px;
}

.settings-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 20px 60px var(--shadow);
}

form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 750;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="email"],
select,
textarea {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--input);
  color: var(--ink);
  font: inherit;
}

input[type="date"] {
  color-scheme: light;
  cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
}

body[data-theme="dark"] input[type="date"] {
  color-scheme: dark;
}

body[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.8);
  opacity: 0.9;
}

textarea {
  min-height: 68px;
  padding: 10px 12px;
  resize: vertical;
}

.filters {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  align-items: end;
}

.filters .direction-filter {
  width: 100%;
  grid-column: 1;
}

.filters .direction-filter select {
  width: 100%;
}

.filters .direction-filter + .primary {
  grid-column: 2;
  justify-self: stretch;
}

.filters .direction-filter + .primary + .secondary {
  grid-column: 3;
  justify-self: stretch;
}

.team-select,
.profile-input {
  width: 100%;
  min-width: 132px;
  height: 38px;
}

.profile-input {
  padding: 0 8px;
  font-size: 13px;
}

.subtable-section {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.subtable-section h3 {
  margin: 0;
  padding: 0 22px 16px;
  font-size: 18px;
}

.subtable-actions {
  display: flex;
  justify-content: flex-end;
  padding: 16px 22px 22px;
}

.actions {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 108px;
}

.user-row > .actions {
  align-self: center;
}

.round-action {
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  box-shadow: none;
  background: var(--soft);
  color: var(--blue);
  font-size: 16px;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.round-action.primary-action {
  background: var(--blue);
  color: #fff;
}

.round-action.play-action {
  text-indent: 2px;
}

.round-action.save-action {
  font-size: 18px;
  color: var(--blue);
  font-weight: 900;
  line-height: 1;
  padding-bottom: 1px;
}

.round-action.save-action.saved {
  background: #ef4444;
  color: #fff;
  font-size: 0;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.24);
}

.round-action.save-action.saved::before {
  content: "\00d7";
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-0.5px);
}

.round-action.save-action.saving {
  pointer-events: none;
}

.round-action.save-action.saved-pop {
  animation: savedPop 260ms ease;
}

.round-action.save-action.save-error {
  background: #ffeaea;
  color: #d13b3b;
  animation: saveShake 220ms ease;
}

.round-action.download-action {
  color: var(--blue);
  font-size: 16px;
  font-weight: 900;
}

.direction-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  white-space: nowrap;
  max-width: 100%;
}

.direction-chip .direction-icon {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  line-height: 1;
}

.direction-chip .direction-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.direction-chip.outgoing .direction-icon {
  background: #12a15f;
}

.direction-chip.incoming .direction-icon {
  background: #f1b51c;
  color: #101828;
}

.direction-chip.missed .direction-icon,
.direction-chip.missed-agent .direction-icon {
  background: #d83a3a;
}

.direction-chip.missed-agent {
  gap: 5px;
}

.direction-chip.missed-agent .direction-label {
  background: transparent;
  color: #111827;
  border-radius: 0;
  padding: 0;
  font-weight: 900;
}

.disabled-action {
  cursor: not-allowed;
  opacity: 0.55;
}

.recording-note-row td {
  padding-top: 0;
  background: var(--panel);
  border-top: 1px solid var(--row-line);
}

tr.row-removing {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 180ms ease, transform 180ms ease;
}

@keyframes savedPop {
  0% {
    transform: scale(0.86);
  }
  60% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes saveShake {
  0%,
  100% {
    transform: translateX(0);
  }
  35% {
    transform: translateX(-2px);
  }
  70% {
    transform: translateX(2px);
  }
}

.recording-note {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  padding: 10px 0 14px;
}

.recording-note label {
  gap: 6px;
}

.note-status {
  min-width: 120px;
  color: var(--muted);
  font-weight: 700;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(6, 21, 43, 0.42);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 20;
}

.modal-card {
  width: min(640px, 100%);
  background: var(--panel);
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 22px;
  box-shadow: 0 24px 80px var(--shadow);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.modal-head p {
  color: var(--muted);
  margin-top: 6px;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  box-shadow: none;
  color: var(--ink);
  background: var(--soft);
  font-size: 28px;
  line-height: 1;
}

audio {
  width: 100%;
}

.download-link {
  margin-top: 16px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  font-weight: 850;
  padding: 0 18px;
}

.pagination {
  min-height: 62px;
  padding: 12px 22px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.pagination .secondary {
  min-width: 104px;
  height: 36px;
  padding: 0 14px;
}

.pagination span {
  color: var(--muted);
  font-weight: 750;
}

.page-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-number {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  box-shadow: none;
}

.page-number.active {
  background: var(--blue);
  color: #fff;
}

.page-gap {
  padding: 0 4px;
}

.page-size-label {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  justify-self: end;
}

.page-size-label select {
  width: 128px;
}


.users-list {
  display: grid;
  gap: 10px;
}

.user-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.user-row small {
  color: var(--muted);
}

.user-edit {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  padding-top: 8px;
}

.user-edit .form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
}

/* Mockup-style visual layer */
:root {
  --blue: #0b73f6;
  --blue-2: #2f8cff;
  --ink: #111c33;
  --muted: #66758f;
  --line: #e4ebf5;
  --page: #f6f9fd;
  --panel: #ffffff;
  --input: #ffffff;
  --soft: #eef5ff;
  --table-head: #f8fbff;
  --row-line: #edf2f8;
  --shadow: rgba(27, 55, 92, 0.08);
}

body {
  grid-template-columns: 216px minmax(0, 1fr);
  background:
    radial-gradient(circle at 88% 0%, rgba(11, 115, 246, 0.05), transparent 34%),
    var(--page);
  font-size: 14px;
}

.sidebar {
  padding: 22px 18px;
  gap: 26px;
  background: rgba(255, 255, 255, 0.96);
  border-right-color: #e7edf6;
}

.brand {
  min-height: 48px;
  gap: 8px;
}

.logo {
  width: 54px;
  height: 54px;
}

.brand-text strong {
  font-size: 20px;
  letter-spacing: 0;
}

nav {
  margin-top: 10px;
  gap: 4px;
}

nav::before {
  content: "GŁÓWNE";
  margin: 4px 10px 10px;
  color: #8290a8;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

nav a {
  min-height: 38px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 6px;
  color: #465675;
  font-size: 13px;
  font-weight: 750;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

nav a::before {
  width: 18px;
  height: 18px;
  border: 1.5px solid currentColor;
  border-radius: 5px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 10px;
  line-height: 1;
  opacity: 0.88;
}

nav a:nth-child(1)::before { content: "D"; }
nav a:nth-child(2)::before { content: "N"; }
nav a:nth-child(3)::before { content: "Z"; }
nav a:nth-child(4)::before { content: "T"; }
nav a:nth-child(5)::before { content: "P"; }
nav a:nth-child(6)::before { content: "H"; }
nav a:nth-child(7)::before { content: "U"; }

nav a:hover {
  color: var(--blue);
  background: rgba(11, 115, 246, 0.06);
}

nav a.active {
  color: var(--blue);
  background: #eaf3ff;
  transform: translateX(1px);
}

.topbar {
  min-height: 76px;
  padding: 20px 30px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: #e7edf6;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
}

.topbar p,
.result-head p,
.dashboard-card > p,
.card-title-row p {
  color: #687895;
  font-size: 13px;
}

.account-button {
  min-width: 210px;
  height: 48px;
  border-color: #dfe8f4;
  border-radius: 8px;
}

.account-button span {
  width: 34px;
  height: 34px;
}

.theme-toggle,
.settings-button {
  width: 38px;
  height: 38px;
  min-width: 38px;
}

.workspace {
  padding: 28px 30px;
}

.upload-panel,
.result-panel,
.settings-card,
.dashboard-card {
  border-color: #dfe8f4;
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(27, 55, 92, 0.07);
}

.result-head {
  min-height: 72px;
  padding: 18px 20px;
}

button,
.logout-button,
.download-link {
  border-radius: 6px;
  box-shadow: none;
}

button {
  height: 42px;
  padding: 0 18px;
}

.secondary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 24px rgba(11, 115, 246, 0.18);
}

input,
select,
textarea {
  border-color: #dce6f3;
  border-radius: 6px;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(11, 115, 246, 0.1);
  outline: none;
}

th {
  background: #f8fbff;
  color: #53647f;
  font-size: 12px;
}

td {
  font-size: 13px;
}

#dashboardView.workspace {
  padding-top: 26px;
  background: transparent;
}

.dashboard-grid {
  max-width: 1500px;
  grid-template-columns: minmax(0, 1.42fr) minmax(360px, 0.7fr);
  gap: 18px;
}

.dashboard-wide:first-child {
  grid-column: 1 / -1;
}

.dashboard-activity {
  grid-column: 1;
}

.stats-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.stat-card {
  min-height: 118px;
  padding: 16px;
  border-color: #e4ebf5;
  background: #fff;
  box-shadow: 0 12px 28px rgba(27, 55, 92, 0.055);
}

.stat-card i {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 19px;
}

.stat-card span {
  margin-top: 4px;
  font-size: 12px;
}

.stat-card strong {
  font-size: 25px;
  letter-spacing: 0;
}

.stat-card small {
  color: #15a86b;
  font-size: 12px;
}

.card-title-row {
  padding: 18px 20px 0;
}

.card-title-row > span {
  min-width: 98px;
  text-align: center;
  border-color: #dfe8f4;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}

.activity-chart {
  min-height: 316px;
  padding: 10px 18px 18px;
}

.chart-stage {
  position: relative;
}

.activity-chart svg {
  height: 306px;
}

.chart-grid-line {
  stroke: #e9eef6;
}

.chart-day-line {
  stroke: #edf3fb;
  stroke-width: 1;
}

.chart-line {
  stroke-width: 3.2;
}

.chart-dot {
  r: 4;
  cursor: pointer;
  transition: r 140ms ease, filter 140ms ease;
}

.chart-dot:hover {
  r: 6;
  filter: drop-shadow(0 4px 8px rgba(11, 115, 246, 0.32));
}

.chart-tooltip {
  position: absolute;
  z-index: 3;
  min-width: 178px;
  padding: 12px;
  display: grid;
  gap: 4px;
  border: 1px solid #dfe8f4;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(27, 55, 92, 0.16);
  color: var(--ink);
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
}

.chart-tooltip strong {
  font-size: 13px;
}

.chart-tooltip span {
  color: var(--blue);
  font-weight: 900;
}

.chart-tooltip small {
  color: var(--muted);
  font-weight: 750;
}

.chart-tooltip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 10px;
  height: 10px;
  background: inherit;
  border-right: 1px solid #dfe8f4;
  border-bottom: 1px solid #dfe8f4;
  transform: translateX(-50%) rotate(45deg);
}

.pie-card {
  grid-template-columns: 168px minmax(0, 1fr);
  min-height: 286px;
  padding: 14px 20px 22px;
}

.pie-visual {
  width: 150px;
}

.pie-legend div {
  font-size: 13px;
}

.period-bars {
  padding-top: 4px;
}

.period-row {
  grid-template-columns: 126px minmax(0, 1fr) 58px;
  font-size: 13px;
}

.ranking-list {
  padding: 10px 20px 22px;
  gap: 10px;
}

.ranking-period-toggle {
  padding: 4px;
  border: 1px solid #dfe8f4;
  border-radius: 8px;
  background: #f5f8fc;
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}

.ranking-period-toggle button {
  height: 34px;
  min-width: 78px;
  padding: 0 12px;
  border-radius: 6px;
  background: transparent;
  color: #5d6c86;
  box-shadow: none;
  font-size: 12px;
}

.ranking-period-toggle button.active {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 8px 18px rgba(11, 115, 246, 0.18);
}

.ranking-columns {
  padding: 8px 20px 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.ranking-columns h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.ranking-columns p {
  margin: 0 0 8px;
  color: #687895;
  font-size: 13px;
}

.ranking-columns .ranking-list {
  padding: 0;
}

.ranking-row {
  padding: 10px;
  border-color: #e4ebf5;
  background: #fff;
}

.ranking-row > b {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

body[data-theme="dark"] {
  --page: #050b16;
  --panel: #0b1220;
  --line: #22324b;
  --table-head: #0e1829;
  --row-line: #1d2a40;
}

body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .dashboard-card,
body[data-theme="dark"] .stat-card,
body[data-theme="dark"] .ranking-row,
body[data-theme="dark"] .card-title-row > span,
body[data-theme="dark"] .activity-period-toggle,
body[data-theme="dark"] .ranking-period-toggle {
  background: var(--panel);
  border-color: var(--line);
}

body[data-theme="dark"] .activity-period-toggle button,
body[data-theme="dark"] .ranking-period-toggle button {
  color: var(--muted);
}

body[data-theme="dark"] .activity-period-toggle button.active,
body[data-theme="dark"] .ranking-period-toggle button.active {
  color: #fff;
}

body[data-theme="dark"] .chart-day-line {
  stroke: rgba(86, 112, 153, 0.22);
}

body[data-theme="dark"] .chart-tooltip {
  background: var(--panel);
  border-color: var(--line);
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea {
  background: var(--input);
  border-color: var(--line);
}

/* ZIP reference theme integration */
:root {
  --blue: #1479f5;
  --blue-2: #61a4ff;
  --ink: #0f1f3a;
  --muted: #6d7c94;
  --muted-2: #98a6bb;
  --line: #e7edf7;
  --line-strong: #dbe5f3;
  --page: #f7faff;
  --panel: #ffffff;
  --input: #ffffff;
  --soft: #eaf3ff;
  --table-head: #f9fbff;
  --row-line: #edf2fa;
  --shadow: rgba(28, 69, 129, 0.08);
  --shadow-soft: 0 18px 55px rgba(28, 69, 129, 0.08);
  --shadow-small: 0 8px 24px rgba(28, 69, 129, 0.07);
  --green: #16bf73;
  --green-soft: #e9fbf3;
  --purple: #8558ff;
  --purple-soft: #f1edff;
  --orange: #ff8a1f;
  --orange-soft: #fff2e7;
  --cyan: #16b6cb;
  --cyan-soft: #e8faff;
  --red: #f04444;
  --red-soft: #fff0f0;
}

body {
  grid-template-columns: 258px minmax(0, 1fr);
  background: radial-gradient(circle at top right, rgba(29, 125, 242, 0.07), transparent 30%), var(--page);
  font-size: 14px;
}

.sidebar {
  position: sticky;
  top: 0;
  min-height: 100vh;
  height: 100vh;
  padding: 24px 22px;
  gap: 22px;
  background: rgba(255, 255, 255, 0.82);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
  z-index: 10;
}

.brand {
  min-height: 42px;
  gap: 12px;
}

.logo {
  width: 48px;
  height: 48px;
}

.brand-text strong {
  font-size: 22px;
  letter-spacing: -0.7px;
}

nav {
  flex: 0 0 auto;
  overflow: auto;
  margin-top: 12px;
  gap: 5px;
  padding-right: 2px;
  align-content: start;
}

nav::before {
  content: "Główne";
  display: block;
  margin: 20px 0 9px 2px;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
}

nav a {
  min-height: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  gap: 12px;
  color: #526179;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 3px;
}

nav a::before {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 7px;
  font-weight: 900;
  font-size: 12px;
}

nav a[data-view="dashboardView"]::before { content: "⌁"; }
nav a[data-view="recordingsView"]::before { content: "▣"; }
nav a[data-view="savedRecordingsView"]::before { content: "▤"; }
nav a[data-view="telemarketersView"]::before { content: "♙"; }
nav a[data-view="swapView"]::before { content: "⇄"; }
nav a[data-view="historyView"]::before { content: "◷"; }
nav a[data-view="settingsView"]::before { content: "⚙"; }

nav a:hover {
  background: #f2f7ff;
  color: var(--blue);
  transform: none;
}

nav a.active {
  color: var(--blue);
  background: var(--soft);
}

nav a.active::before {
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(20, 121, 245, 0.12);
}

.topbar {
  min-height: 76px;
  padding: 18px 32px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

h1 {
  font-size: 25px;
  line-height: 1.15;
  letter-spacing: -0.7px;
}

h2 {
  font-size: 18px;
  letter-spacing: -0.35px;
}

.topbar p,
.result-head p,
.dashboard-card > p,
.card-title-row p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.account-menu {
  gap: 14px;
}

.global-search {
  width: min(360px, 32vw);
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-small);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.global-search input {
  min-width: 0;
  flex: 1;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.global-search kbd {
  padding: 3px 7px;
  border-radius: 6px;
  background: #f1f5fb;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.account-button {
  min-width: 210px;
  height: 50px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-small);
}

.account-button span {
  width: 36px;
  height: 36px;
}

.theme-toggle,
.settings-button {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-small);
}

.workspace {
  padding: 28px 34px 36px;
}

.upload-panel,
.result-panel,
.settings-card,
.dashboard-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.dashboard-grid {
  max-width: 1480px;
  gap: 18px;
}

.result-head,
.card-title-row {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.stats-grid {
  padding: 18px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  min-height: 126px;
  padding: 18px;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  align-items: center;
  gap: 14px;
  border-color: var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-small);
}

.stat-card i {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 22px;
}

.stat-card span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.stat-card strong {
  margin-top: 4px;
  font-size: 25px;
  letter-spacing: -0.6px;
}

.stat-card small {
  margin-top: 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.stat-card-1 i,
.stat-card-2 i { color: var(--blue); background: var(--soft); }
.stat-card-3 i { color: var(--purple); background: var(--purple-soft); }
.stat-card-4 i { color: var(--orange); background: var(--orange-soft); }
.stat-card-5 i { color: var(--cyan); background: var(--cyan-soft); }

.activity-chart {
  min-height: 326px;
  padding: 8px 22px 22px;
}

.activity-chart svg {
  height: 306px;
}

.chart-tooltip {
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(28, 69, 129, 0.18);
}

.pie-card {
  min-height: 290px;
  padding: 18px 22px 24px;
  grid-template-columns: 172px minmax(0, 1fr);
}

.pie-visual {
  width: 158px;
}

.period-bars,
.ranking-list {
  padding: 18px 22px 24px;
}

.ranking-columns {
  padding: 20px 22px 24px;
  gap: 18px;
}

.ranking-row {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.ranking-period-toggle {
  border-radius: 14px;
  border-color: var(--line);
  background: #f4f8fe;
}

.ranking-period-toggle button {
  border-radius: 10px;
}

button {
  height: 44px;
  border-radius: 12px;
  box-shadow: none;
}

.primary,
.primary-inline,
.danger,
.secondary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 24px rgba(20, 121, 245, 0.18);
}

.compact {
  height: 38px;
}

input,
select,
textarea {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
}

.filters {
  padding: 18px 22px;
  gap: 14px;
}

th {
  color: #50627d;
  background: #f9fbff;
  font-size: 12px;
  font-weight: 800;
}

td {
  border-color: var(--row-line);
}

.round-action {
  width: 36px;
  height: 36px;
  min-width: 36px;
}

.modal-card,
.account-panel {
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 55px rgba(28, 69, 129, 0.14);
}

body[data-theme="dark"] {
  --page: #07101f;
  --panel: #0d1728;
  --input: #101c31;
  --soft: #132947;
  --table-head: #101d32;
  --row-line: #20314d;
  --line: #253752;
  --line-strong: #304461;
}

body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .global-search,
body[data-theme="dark"] .account-button,
body[data-theme="dark"] .theme-toggle,
body[data-theme="dark"] .upload-panel,
body[data-theme="dark"] .result-panel,
body[data-theme="dark"] .settings-card,
body[data-theme="dark"] .dashboard-card,
body[data-theme="dark"] .stat-card,
body[data-theme="dark"] .ranking-row,
body[data-theme="dark"] .modal-card,
body[data-theme="dark"] .account-panel {
  background: var(--panel);
  border-color: var(--line);
}

body[data-theme="dark"] .global-search kbd,
body[data-theme="dark"] nav a.active .nav-icon,
body[data-theme="dark"] nav a.active::before {
  background: var(--soft);
}

@media (max-width: 860px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    padding: 18px;
  }

  nav,
  .sidebar-card {
    display: none;
  }

  .topbar,
  .result-head,
  .card-title-row,
  .excel-hint,
  .settings-grid,
  .dashboard-grid,
  .stats-grid,
  .pie-card,
  .ranking-columns,
  .filters,
  .recording-note {
    align-items: flex-start;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .dashboard-wide {
    grid-column: auto;
  }

  .workspace {
    padding: 18px;
  }

}

@media (max-width: 1180px) {
  .manual-swap {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

/* Full 3CX SaaS visual rebuild */
:root {
  --blue: #1479f5;
  --blue-dark: #0a63d9;
  --blue-soft: #eaf3ff;
  --page: #f6f9fd;
  --panel: #ffffff;
  --panel-soft: #f9fbff;
  --line: #e2eaf5;
  --line-strong: #d4e0ef;
  --text: #17233c;
  --muted: #697995;
  --muted-2: #9aa9be;
  --green: #18bf76;
  --green-soft: #e9fbf3;
  --red: #f0444d;
  --red-soft: #fff0f1;
  --orange: #ff9428;
  --orange-soft: #fff3e7;
  --purple: #8a5cff;
  --purple-soft: #f2edff;
  --cyan: #16b6cb;
  --cyan-soft: #e8fbff;
  --shadow-card: 0 14px 36px rgba(33, 71, 124, 0.07);
  --shadow-hover: 0 20px 46px rgba(33, 71, 124, 0.11);
  --sidebar-width: 258px;
}

* {
  box-sizing: border-box;
}

body {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 85% 0%, rgba(20, 121, 245, 0.05), transparent 34%),
    var(--page);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  padding: 24px 22px 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  background: rgba(255, 255, 255, 0.9);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  margin-bottom: 28px;
  flex: 0 0 auto;
}

.brand .logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.brand-text strong {
  color: #12213a;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.sidebar-collapse {
  width: 32px;
  height: 32px;
  margin-left: auto;
  border: 0;
  border-radius: 10px;
  background: transparent;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  box-shadow: none;
}

.sidebar-collapse span {
  display: block;
  width: 14px;
  height: 2px;
  background: #7c8aa2;
  border-radius: 999px;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 0 0 auto;
}

.nav-section {
  margin: 18px 0 8px;
  color: #7f8da5;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 0 12px;
  color: #54657f;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

nav a:hover {
  color: var(--blue);
  background: #f1f7ff;
}

nav a.active {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: #d9e9ff;
}

nav a.active::before {
  display: none;
}

nav::before,
nav a::before {
  content: none !important;
  display: none !important;
}

.nav-icon {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  color: #6e7f98;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.nav-chart,
.nav-headphones,
.nav-clock {
  position: relative;
}

.nav-chart::before {
  content: "";
  width: 16px;
  height: 16px;
  background:
    linear-gradient(var(--blue), var(--blue)) 2px 9px / 3px 5px no-repeat,
    linear-gradient(var(--blue), var(--blue)) 7px 5px / 3px 9px no-repeat,
    linear-gradient(var(--blue), var(--blue)) 12px 2px / 3px 12px no-repeat;
  border-bottom: 2px solid currentColor;
}

.nav-headphones::before {
  content: "";
  width: 15px;
  height: 11px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
}

.nav-headphones::after {
  content: "";
  position: absolute;
  top: 12px;
  width: 16px;
  height: 6px;
  background:
    linear-gradient(currentColor, currentColor) left top / 4px 6px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 4px 6px no-repeat;
  border-radius: 2px;
}

.nav-clock::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 1.7px solid currentColor;
  border-radius: 50%;
  background: transparent;
}

.nav-clock::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background:
    linear-gradient(currentColor, currentColor) 3px 0 / 1.7px 5px no-repeat,
    linear-gradient(currentColor, currentColor) 3px 3.5px / 5px 1.7px no-repeat;
  transform: translate(1px, 0);
}

.nav-star {
  font-size: 15px;
}

.nav-numbers {
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: -0.08em;
}

.nav-icon:not(.nav-chart):not(.nav-headphones):not(.nav-clock) {
  transform: none;
}

body.sidebar-collapsed {
  --sidebar-width: 58px;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

body.sidebar-collapsed .sidebar {
  width: var(--sidebar-width);
  padding: 16px 6px;
  overflow-x: hidden;
  overflow-y: auto;
}

body.sidebar-collapsed .brand {
  position: relative;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-height: 84px;
  margin-bottom: 14px;
}

body.sidebar-collapsed .brand .logo {
  width: 38px;
  height: 38px;
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-section,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .sidebar-footer {
  display: none;
}

body.sidebar-collapsed .sidebar-collapse {
  position: static;
  margin: 0;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

body.sidebar-collapsed nav a {
  justify-content: center;
  width: 42px;
  height: 42px;
  min-height: 42px;
  margin: 0 auto 8px;
  padding: 0;
  overflow: hidden;
  font-size: 0;
  white-space: nowrap;
}

body.sidebar-collapsed nav a.active {
  display: flex;
}

body.sidebar-collapsed .nav-icon {
  flex-basis: 26px;
  width: 26px;
  height: 26px;
  font-size: 14px;
}

nav a.active .nav-icon {
  color: var(--blue);
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(20, 121, 245, 0.1);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 18px;
  flex: 0 0 auto;
}

.storage-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.storage-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.storage-card strong {
  font-size: 13px;
}

.storage-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.mini-progress {
  height: 6px;
  overflow: hidden;
  background: #eef4fb;
  border-radius: 999px;
}

.mini-progress i {
  display: block;
  width: 32%;
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
}

main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}

.page-heading h1 {
  margin: 0;
  color: #101c31;
  font-size: 24px;
  font-weight: 850;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.page-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.account-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.global-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(360px, 34vw);
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.global-search span {
  color: #7f8da5;
  font-size: 18px;
}

.global-search input {
  flex: 1;
  min-height: 0;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.global-search kbd {
  padding: 3px 7px;
  border-radius: 7px;
  color: #8290a6;
  background: #f3f7fc;
  font-size: 11px;
  font-weight: 800;
}

.notify-button,
.theme-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--blue);
  background: #f3f8ff;
  box-shadow: none;
}

.notify-button::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 10px;
  width: 7px;
  height: 7px;
  border: 2px solid #f3f8ff;
  border-radius: 50%;
  background: var(--blue);
}

.theme-toggle {
  font-size: 18px;
}

.account-dropdown {
  position: relative;
}

.account-dropdown summary {
  list-style: none;
}

.account-dropdown summary::-webkit-details-marker {
  display: none;
}

.account-button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.account-button > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  border-radius: 50%;
  background: var(--blue);
  font-weight: 850;
}

.account-button div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.account-button strong {
  overflow: hidden;
  color: #10213a;
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-button small {
  color: var(--muted);
  font-size: 11px;
}

.account-button em {
  margin-left: auto;
  color: #66758c;
  font-style: normal;
}

.account-chevron {
  display: block;
  width: 8px;
  height: 8px;
  border-right: 1.8px solid #66758c;
  border-bottom: 1.8px solid #66758c;
  transform: rotate(45deg) translateY(-2px);
  transform-origin: center;
}

.account-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 50;
  width: 340px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(23, 52, 94, 0.16);
}

.account-panel h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.workspace {
  display: none;
  padding: 28px 34px 42px;
}

.workspace.active-view {
  display: block;
}

.dashboard-shell,
.result-panel.standalone,
.settings-grid,
.upload-panel,
#resultPanel {
  width: min(100%, 1510px);
  margin: 0 auto;
}

.dashboard-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: end;
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-toolbar > div:first-child {
  display: grid;
  gap: 5px;
  min-width: 270px;
}

.dashboard-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.dashboard-toolbar strong {
  height: 40px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #2f3d55;
  font-size: 13px;
  font-weight: 750;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  padding: 0;
  margin-bottom: 18px;
}

.dashboard-filter-panel {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-card);
}

.dashboard-scope-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f5f8fd;
}

.dashboard-scope-toggle button {
  min-width: 96px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  color: #5e6e86;
  background: transparent;
  font-weight: 850;
  box-shadow: none;
}

.dashboard-scope-toggle button.active {
  color: #fff;
  background: var(--blue);
}

.dashboard-filter-select {
  display: grid;
  gap: 6px;
  min-width: min(320px, 100%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.dashboard-filter-select select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--input);
  font-weight: 800;
}

.stat-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon value"
    "icon note";
  align-items: center;
  gap: 2px 14px;
  min-height: 116px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.stat-card i {
  grid-area: icon;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 20px;
  font-style: normal;
}

.stat-card i svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-card i svg path:first-child:not(:only-child),
.stat-card i svg circle + path {
  fill: none;
}

.stat-card i svg path:only-child {
  fill: currentColor;
  stroke: none;
}

.stat-card span {
  grid-area: label;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.stat-card strong {
  grid-area: value;
  color: #101c31;
  font-size: 26px;
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.stat-card small {
  grid-area: note;
  color: var(--green);
  font-size: 12px;
  font-weight: 750;
}

.stat-card-2 i { color: var(--green); background: var(--green-soft); }
.stat-card-3 i { color: var(--purple); background: var(--purple-soft); }
.stat-card-4 i { color: var(--orange); background: var(--orange-soft); }
.stat-card-5 i { color: var(--cyan); background: var(--cyan-soft); }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.9fr) minmax(340px, 0.8fr);
  gap: 18px;
  max-width: none;
}

.dashboard-card,
.result-panel,
.settings-card,
.upload-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.dashboard-card:hover,
.result-panel:hover,
.settings-card:hover,
.upload-panel:hover {
  box-shadow: var(--shadow-hover);
}

.dashboard-activity {
  grid-column: span 2;
}

.dashboard-wide {
  grid-column: span 3;
}

.dashboard-card h2,
.result-head h2,
.settings-card h2 {
  margin: 0;
  color: #101c31;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.dashboard-card > h2 {
  padding: 20px 22px 0;
}

.card-title-row,
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.card-title-row p,
.result-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.card-title-row > span {
  min-width: 108px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #42526c;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.activity-chart {
  min-height: 318px;
  padding: 6px 22px 20px;
}

.chart-stage {
  position: relative;
  min-height: 300px;
}

.activity-chart svg {
  width: 100%;
  height: 300px;
  display: block;
}

.chart-day-line {
  stroke: rgba(215, 226, 241, 0.7);
  stroke-width: 1;
}

.chart-grid-line {
  stroke: #dbe5f2;
  stroke-width: 1;
}

.chart-area {
  fill: url(#activityFill);
}

.chart-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 4;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-dot {
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 4;
  cursor: pointer;
}

.chart-label {
  fill: #63738d;
  font-size: 13px;
  font-weight: 800;
}

.chart-tooltip {
  position: absolute;
  z-index: 20;
  transform: translate(-50%, calc(-100% - 14px));
  display: grid;
  gap: 4px;
  min-width: 210px;
  max-width: 250px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 18px 40px rgba(23, 52, 94, 0.16);
  pointer-events: none;
}

.chart-tooltip.below {
  transform: translate(-50%, 12px);
}

.chart-tooltip.hidden {
  display: none;
}

.chart-tooltip strong {
  font-size: 13px;
}

.chart-tooltip span,
.chart-tooltip small {
  color: var(--muted);
  font-size: 12px;
}

.pie-card {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 250px;
  padding: 18px 22px 24px;
}

.pie-visual {
  position: relative;
  width: 170px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: visible;
}

.pie-visual::after,
.pie-visual span {
  display: none;
}

.pie-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.pie-segment {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
  cursor: pointer;
}

.pie-svg:hover .pie-segment {
  opacity: 0.72;
}

.pie-svg .pie-segment:hover {
  opacity: 1;
  transform: scale(1.08);
  filter: drop-shadow(0 10px 16px rgba(20, 121, 245, 0.18));
}

.pie-empty {
  display: grid;
  place-items: center;
  width: 142px;
  height: 142px;
  border-radius: 50%;
  color: var(--muted);
  background: #eef4fb;
  font-weight: 800;
  text-align: center;
}

.pie-legend {
  display: grid;
  gap: 12px;
}

.pie-legend div {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.pie-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.pie-legend span {
  color: #34435a;
  font-size: 13px;
  font-weight: 750;
}

.pie-legend strong {
  color: #64748d;
  font-size: 13px;
}

.period-bars {
  display: grid;
  gap: 16px;
  padding: 20px 22px 24px;
}

.period-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 70px;
  gap: 14px;
  align-items: center;
}

.period-row span {
  color: #43536c;
  font-weight: 800;
}

.period-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #eaf1f9;
}

.period-track b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #69a9ff, var(--blue));
}

.period-row strong {
  color: #17233c;
  text-align: right;
}

.ranking-period-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f5f8fd;
}

.activity-period-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f5f8fd;
}

.activity-period-toggle button {
  height: 32px;
  min-width: 72px;
  border: 0;
  border-radius: 9px;
  color: #5e6e86;
  background: transparent;
  font-weight: 800;
  box-shadow: none;
}

.activity-period-toggle button.active {
  color: #fff;
  background: var(--blue);
}

.ranking-controls {
  display: flex;
  align-items: end;
  gap: 12px;
}

.ranking-controls label {
  display: grid;
  gap: 6px;
  min-width: 205px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.ranking-controls select {
  min-height: 40px;
}

.ranking-period-toggle button {
  height: 32px;
  min-width: 72px;
  border: 0;
  border-radius: 9px;
  color: #5e6e86;
  background: transparent;
  font-weight: 800;
  box-shadow: none;
}

.ranking-period-toggle button.active {
  color: #fff;
  background: var(--blue);
}

.ranking-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 20px 22px 24px;
}

.ranking-columns h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.ranking-columns p {
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.ranking-list {
  display: grid;
  gap: 10px;
}

.ranking-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.ranking-row b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #fff;
  border-radius: 50%;
  background: var(--blue);
}

.ranking-row strong {
  display: block;
  color: #17233c;
  font-size: 14px;
}

.ranking-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ranking-head span {
  flex: 0 0 auto;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--soft);
  font-size: 12px;
  font-weight: 850;
  line-height: 18px;
}

.ranking-row small {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 750;
}

.ranking-row em {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 750;
}

.ranking-track {
  height: 8px;
  margin: 8px 0 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #eaf1f9;
}

.ranking-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

.ranking-track.segmented {
  display: flex;
  width: 100%;
  background: #eaf1f9;
}

.ranking-track.segmented span {
  flex: 0 0 auto;
  border-radius: 0;
}

.ranking-track.segmented span:first-child {
  border-radius: 999px 0 0 999px;
}

.ranking-track.segmented span:last-child {
  border-radius: 0 999px 999px 0;
}

.ranking-track .successful,
.ranking-row em .successful {
  background: #13a86b;
}

.ranking-track .missed,
.ranking-row em .missed {
  background: #ef4d55;
}

.ranking-track .tm-missed,
.ranking-row em .tm-missed {
  background: #d946ef;
}

.ranking-track .short,
.ranking-row em .short {
  background: #f6c343;
}

.ranking-track .after-hours,
.ranking-row em .after-hours {
  background: #7c3aed;
}

.ranking-row em span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ranking-row em i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.primary,
.primary-inline,
.secondary-inline,
.danger,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--blue);
  font-weight: 850;
  box-shadow: 0 12px 24px rgba(20, 121, 245, 0.18);
}

.primary:hover,
.primary-inline:hover {
  background: var(--blue-dark);
}

.secondary {
  color: var(--blue);
  background: var(--blue-soft);
  box-shadow: none;
}

.secondary-inline {
  color: var(--blue);
  background: var(--blue-soft);
  box-shadow: none;
}

.toolbar-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: end;
}

.report-inline {
  background: #16a34a;
  box-shadow: 0 12px 24px rgba(22, 163, 74, 0.2);
}

.report-inline:hover {
  background: #15803d;
}

.danger {
  background: var(--red);
}

.compact {
  min-height: 40px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: #13223a;
  background: #fff;
  outline: none;
}

textarea {
  min-height: 70px;
  padding-top: 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(20, 121, 245, 0.12);
}

label {
  color: #5a6b84;
  font-size: 13px;
  font-weight: 800;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.filters label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.filters .direction-filter,
.filters .team-filter {
  width: auto;
}

.filters .direction-filter + .primary,
.filters .direction-filter + .primary + .secondary {
  grid-column: auto;
}

.filters button {
  align-self: end;
  width: 100%;
  min-height: 42px;
}

.telemarketer-filters {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.telemarketer-filters label:nth-child(5) {
  grid-column: 1;
}

.table-wrap {
  width: 100%;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  color: #54657f;
  background: #f8fbff;
  font-size: 12px;
  font-weight: 850;
}

td {
  color: #10213a;
  font-size: 13px;
}

.recordings-table th:nth-child(1) { width: 138px; }
.recordings-table th:nth-child(2) { width: 52px; }
.recordings-table th:nth-child(3) { width: 142px; }
.recordings-table th:nth-child(4) { width: 84px; }
.recordings-table th:nth-child(5) { width: 122px; }
.recordings-table th:nth-child(6) { width: 112px; }
.recordings-table th:nth-child(7) { width: 142px; }
.recordings-table th:nth-child(8) { width: 112px; }
.recordings-table th:nth-child(9) { width: 88px; }
.recordings-table th:nth-child(10) { width: 170px; }

.recordings-table th:nth-child(10),
.recordings-table td:nth-child(10) {
  overflow: visible;
}

.telemarketers-table th:nth-child(1) { width: 86px; }
.telemarketers-table th:nth-child(2) { width: 150px; }
.telemarketers-table th:nth-child(3) { width: 170px; }
.telemarketers-table th:nth-child(4) { width: 220px; }
.telemarketers-table th:nth-child(5) { width: 156px; }
.telemarketers-table th:nth-child(6) { width: 150px; }
.telemarketers-table th:nth-child(7),
.telemarketers-table th:nth-child(8),
.telemarketers-table th:nth-child(9) { width: 135px; }

.telemarketers-table .profile-input,
.telemarketers-table .team-select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.history-table th:nth-child(1) { width: 155px; }
.history-table th:nth-child(2) { width: 210px; }
.history-table th:nth-child(3) { width: 210px; }

.numbers-table th:nth-child(1) { width: 210px; }
.numbers-table th:nth-child(2) { width: 150px; }
.numbers-table th:nth-child(3) { width: 120px; }
.numbers-table th:nth-child(4),
.numbers-table th:nth-child(5),
.numbers-table th:nth-child(6) { width: 135px; }
.numbers-table th:nth-child(7) { width: 120px; }
.numbers-table th:nth-child(8) { width: 92px; }

.release-account-action,
.round-action.danger-action {
  position: relative;
  color: #fff;
  background: var(--red);
  font-size: 0;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(240, 68, 77, 0.22);
}

.release-account-action > span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  content: "";
  transform: translate(-50%, -50%) rotate(45deg);
}

.release-account-action > span::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: currentColor;
  content: "";
  transform: rotate(90deg);
}

.release-account-action:disabled {
  opacity: 0.55;
  cursor: wait;
}

.actions {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.round-action {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 850;
  text-decoration: none;
  box-shadow: none;
}

.primary-action {
  color: #fff;
  background: var(--blue);
}

.save-action.saved {
  color: #fff;
  background: #ef4444;
}

.disabled-action {
  opacity: 0.45;
}

.direction-badge,
.direction-chip,
.status-badge,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.direction-chip {
  width: 132px;
  justify-content: flex-start;
  flex-shrink: 0;
}

.status-badge.active,
.chip.ready,
.chip.already {
  color: #0b8a52;
  background: var(--green-soft);
}

.status-badge.free {
  color: #0b73f6;
  background: var(--soft);
}

.chip.free {
  color: #0b73f6;
  background: var(--blue-soft);
}

.chip.warning {
  color: #a15a00;
  background: var(--orange-soft);
}

.chip.error,
.chip.not_found,
.chip.conflict {
  color: var(--red);
  background: var(--red-soft);
}

.direction-outgoing {
  color: #0b8a52;
  background: var(--green-soft);
}

.direction-incoming {
  color: #986100;
  background: var(--orange-soft);
}

.direction-missed,
.direction-tm_missed {
  color: var(--red);
  background: var(--red-soft);
}

.direction-tm_missed {
  color: #111827;
  background: #ffd9dd;
}

.direction-chip.outgoing {
  color: #0b8a52;
  background: var(--green-soft);
}

.direction-chip.incoming {
  color: #986100;
  background: var(--orange-soft);
}

.direction-chip.missed {
  color: var(--red);
  background: var(--red-soft);
}

.direction-chip.missed-agent {
  color: #fff;
  background: var(--red);
  gap: 5px;
  padding: 0 10px 0 7px;
  font-size: 11px;
  letter-spacing: -0.01em;
}

.direction-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #fff;
  background: #8aa0ba;
  font-size: 0;
  line-height: 1;
  text-align: center;
}

.direction-svg {
  display: block;
  width: 11px;
  height: 11px;
  color: currentColor;
}

.direction-chip.outgoing .direction-svg,
.direction-chip.incoming .direction-svg {
  width: 10px;
  height: 10px;
}

.direction-chip.outgoing .direction-icon { background: var(--green); }
.direction-chip.incoming .direction-icon { background: #f5b82e; }
.direction-chip.missed .direction-icon { background: var(--red); }
.direction-chip.missed-agent .direction-icon {
  color: var(--red);
  background: #fff;
}

.direction-chip.missed .direction-icon,
.direction-chip.missed-agent .direction-icon {
  font-size: 0;
}

.direction-chip.missed .direction-icon::before,
.direction-chip.missed-agent .direction-icon::before {
  content: "☎";
  display: block;
  width: 18px;
  height: 18px;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  transform: translate(0.2px, -0.2px);
}

.direction-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.direction-chip.missed-agent .direction-label {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.page-buttons {
  display: flex;
  gap: 6px;
}

.page-buttons button {
  min-width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  color: #54657f;
  background: #f1f6fd;
  font-weight: 850;
}

.page-buttons button.active {
  color: #fff;
  background: var(--blue);
}

.pagination span {
  margin-left: auto;
  color: #53647e;
  font-weight: 800;
}

.page-size-label {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.page-size-label select {
  width: 92px;
}

.upload-panel {
  padding: 30px 34px;
}

.excel-hint {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.sample-table {
  width: auto;
  min-width: 520px;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 32px;
  border: 2px dashed #9ec7ff;
  border-radius: 16px;
  background: #f7fbff;
  color: #61728c;
  text-align: center;
}

.dropzone input {
  display: none;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  border-radius: 14px;
  color: #fff;
  background: var(--blue);
  font-size: 28px;
}

.dropzone strong {
  color: #4f5f78;
  font-size: 18px;
}

.dropzone small {
  margin-top: 8px;
}

.manual-divider {
  margin: 28px 0 22px;
  color: #111827;
  text-align: center;
  font-size: 18px;
  font-weight: 850;
}

.manual-swap {
  display: grid;
  grid-template-columns: minmax(240px, 1.45fr) minmax(150px, 0.95fr) minmax(130px, 0.8fr) minmax(170px, 1fr) minmax(210px, 1.15fr);
  gap: 14px;
  align-items: end;
  margin-bottom: 28px;
}

#checkBtn {
  min-width: 160px;
  margin-top: 18px;
}

.number-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.number-summary article {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f9fbff;
}

.number-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.number-summary strong {
  font-size: 24px;
  line-height: 1;
}

.numbers-tabs {
  border-top: 1px solid var(--line);
}

.numbers-tab-buttons {
  display: flex;
  gap: 8px;
  padding: 18px 22px 0;
}

.numbers-tab-buttons button {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  color: #5a6b84;
  background: #f7fbff;
  font-weight: 850;
  box-shadow: none;
}

.numbers-tab-buttons button.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.numbers-tab-panel {
  display: none;
  padding: 20px 22px 24px;
}

.numbers-tab-panel.active {
  display: block;
}

.number-groups {
  display: grid;
  gap: 14px;
}

.number-group-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.number-group-card h3 {
  margin: 0 0 5px;
  font-size: 15px;
}

.number-group-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.number-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.number-pills span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #1b5fa8;
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 850;
}

.status-badge.spam {
  color: var(--red);
  background: var(--red-soft);
}

.spam-table th:nth-child(1) { width: 170px; }
.spam-table th:nth-child(2) { width: 180px; }
.spam-table th:nth-child(3) { width: 90px; }
.spam-table th:nth-child(4) { width: 210px; }
.spam-table th:nth-child(5) { width: 150px; }
.spam-table th:nth-child(6),
.spam-table th:nth-child(7) { width: 140px; }

.settings-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
}

.settings-card {
  padding: 22px;
}

.settings-card form,
.user-edit {
  display: grid;
  gap: 14px;
}

.users-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.subtable-section {
  padding-top: 24px;
}

.subtable-section h3 {
  margin: 0;
  padding: 0 22px 14px;
  font-size: 18px;
}

.profile-input,
td select {
  min-height: 38px;
  padding: 0 10px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 22, 40, 0.44);
}

.modal.hidden,
.hidden {
  display: none !important;
}

.modal-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(10, 22, 40, 0.24);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.modal-card audio {
  width: 100%;
}

.report-modal-card {
  width: min(620px, 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.report-form {
  display: grid;
  gap: 16px;
  max-height: min(72vh, 680px);
  overflow-y: auto;
  padding-right: 6px;
}

.report-form > .primary {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 8px;
}

.report-fieldset {
  display: grid;
  gap: 8px;
}

.report-fieldset > span {
  color: var(--muted);
  font-weight: 800;
}

.report-choice-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.report-choice-row label,
.report-dependent label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
  font-weight: 800;
}

.report-dependent label {
  display: grid;
  align-items: stretch;
  gap: 8px;
}

.report-dependent select,
.report-dependent input {
  width: 100%;
}

.report-date-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.report-employee-list {
  display: grid;
  gap: 10px;
}

.report-employee-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.report-remove-employee {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border-color: #ffd0d0;
  color: #f04452;
  background: #fff1f2;
  font-size: 20px;
  line-height: 1;
}

.report-add-employee {
  justify-self: start;
  min-height: 38px;
  padding-inline: 16px;
}

.report-team-members {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
}

.report-team-header {
  display: grid;
  gap: 3px;
}

.report-team-header strong {
  color: var(--text);
}

.report-team-header span,
.report-team-empty,
.report-team-member small {
  color: var(--muted);
}

.report-team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.report-team-member {
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center !important;
  min-height: 48px !important;
  padding: 9px 10px !important;
  background: #ffffff !important;
}

.report-team-member input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

.report-team-member span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.report-team-member strong,
.report-team-member small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-team-individual {
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start !important;
  gap: 10px !important;
  padding: 12px !important;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
}

.report-team-individual input {
  width: 16px;
  min-height: 16px;
  margin-top: 3px;
  padding: 0;
}

.report-team-individual span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.report-team-individual small {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.report-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.report-options label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
}

.report-options input,
.report-choice-row input {
  width: 16px;
  min-height: 16px;
  padding: 0;
}

body[data-theme="dark"] {
  --page: #07101f;
  --panel: #0d1728;
  --panel-soft: #101d32;
  --line: #233654;
  --line-strong: #2d4262;
  --text: #eef5ff;
  --muted: #9fb0ca;
  --blue-soft: #102947;
  background: #07101f;
  color: var(--text);
}

body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .dashboard-card,
body[data-theme="dark"] .result-panel,
body[data-theme="dark"] .settings-card,
body[data-theme="dark"] .upload-panel,
body[data-theme="dark"] .stat-card,
body[data-theme="dark"] .account-panel,
body[data-theme="dark"] .modal-card,
body[data-theme="dark"] .account-button,
body[data-theme="dark"] .global-search,
body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea {
  color: var(--text);
  background: var(--panel);
  border-color: var(--line);
}

body[data-theme="dark"] .page-heading h1,
body[data-theme="dark"] .dashboard-card h2,
body[data-theme="dark"] .result-head h2,
body[data-theme="dark"] .settings-card h2,
body[data-theme="dark"] .brand-text strong,
body[data-theme="dark"] .account-button strong,
body[data-theme="dark"] td,
body[data-theme="dark"] .stat-card strong {
  color: #f5f9ff;
}

body[data-theme="dark"] th,
body[data-theme="dark"] .pagination,
body[data-theme="dark"] .number-summary article,
body[data-theme="dark"] .dropzone,
body[data-theme="dark"] .number-group-card,
body[data-theme="dark"] .numbers-tab-buttons button {
  background: #101d32;
}

.dashboard-donut {
  overflow: visible;
}

.dashboard-donut > h2 {
  padding-right: 18px;
  white-space: normal;
}

.dashboard-donut .pie-card {
  grid-template-columns: 128px minmax(150px, 1fr);
  gap: 18px;
}

.dashboard-donut .pie-visual {
  width: 128px;
  background: transparent;
  box-shadow: none;
}

body[data-theme="dark"] .dashboard-donut .pie-visual {
  background: transparent;
  box-shadow: none;
}

.dashboard-donut .pie-legend {
  min-width: 0;
}

.dashboard-donut .pie-legend span {
  min-width: 0;
  white-space: normal;
}

@media (max-width: 1320px) {
  body {
    --sidebar-width: 224px;
  }

  .sidebar {
    padding-inline: 14px;
  }

  .topbar {
    padding-inline: 22px;
  }

  .workspace {
    padding: 22px 18px 34px;
  }

  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-activity,
  .dashboard-wide {
    grid-column: auto;
  }

  .filters,
  .telemarketer-filters {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 12px;
    padding: 18px;
  }

  th,
  td {
    padding-left: 8px;
    padding-right: 8px;
    font-size: 12px;
  }

  th {
    font-size: 11px;
  }

  .recordings-table th:nth-child(1) { width: 126px; }
  .recordings-table th:nth-child(2) { width: 44px; }
  .recordings-table th:nth-child(3) { width: 124px; }
  .recordings-table th:nth-child(4) { width: 74px; }
  .recordings-table th:nth-child(5) { width: 106px; }
  .recordings-table th:nth-child(6) { width: 104px; }
  .recordings-table th:nth-child(7) { width: 150px; }
  .recordings-table th:nth-child(8) { width: 94px; }
  .recordings-table th:nth-child(9) { width: 78px; }
  .recordings-table th:nth-child(10) { width: 126px; }

  .actions {
    gap: 6px;
  }

  .round-action,
  .play-button {
    width: 32px;
    height: 32px;
    min-width: 32px;
  }

  .telemarketers-table th:nth-child(1) { width: 74px; }
  .telemarketers-table th:nth-child(2) { width: 124px; }
  .telemarketers-table th:nth-child(3) { width: 140px; }
  .telemarketers-table th:nth-child(4) { width: 176px; }
  .telemarketers-table th:nth-child(5) { width: 132px; }
  .telemarketers-table th:nth-child(6) { width: 130px; }
  .telemarketers-table th:nth-child(7),
  .telemarketers-table th:nth-child(8),
  .telemarketers-table th:nth-child(9) { width: 118px; }
}

@media (max-width: 1180px) {
  body {
    --sidebar-width: 72px;
  }

  .sidebar {
    width: var(--sidebar-width);
    padding: 16px 7px;
    overflow: hidden;
  }

  .brand {
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    min-height: 84px;
    margin-bottom: 14px;
  }

  .brand .logo {
    width: 38px;
    height: 38px;
  }

  .brand-text,
  .nav-section,
  .nav-label,
  .sidebar-footer {
    display: none;
  }

  .sidebar-collapse {
    margin: 0;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
  }

  nav a {
    justify-content: center;
    width: 42px;
    height: 42px;
    min-height: 42px;
    margin: 0 auto 8px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
    white-space: nowrap;
  }

  .nav-icon {
    flex-basis: 26px;
    width: 26px;
    height: 26px;
    font-size: 14px;
  }

  .filters,
  .telemarketer-filters {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }

  input,
  select,
  textarea,
  .primary,
  .primary-inline,
  .secondary {
    min-height: 38px;
  }

  .result-head {
    padding: 18px;
  }
}

@media (max-width: 1040px) {
  .topbar {
    gap: 12px;
  }

  .page-heading h1 {
    font-size: 22px;
  }

  .account-button {
    min-width: 190px;
  }

  .filters,
  .telemarketer-filters {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .filters button {
    min-height: 40px;
  }
}

@media (max-width: 980px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    min-height: 0;
  }

  .sidebar-footer,
  .global-search {
    display: none;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-grid,
  .filters,
  .telemarketer-filters,
  .number-summary,
  .settings-grid,
  .manual-swap,
  .ranking-columns {
    grid-template-columns: 1fr;
  }

  .pie-card {
    grid-template-columns: 1fr;
  }
}


.direction-chip.busy {
  background: #e8f1ff;
  color: #0b5fd7;
}

.direction-chip.busy .direction-icon {
  background: #1d7af3;
  color: #fff;
}

.direction-chip.after-hours {
  color: #6d28d9;
  background: #f1eaff;
}

.direction-chip.after-hours .direction-icon {
  background: #7c3aed;
  color: #fff;
}

.direction-chip.missed .direction-icon,
.direction-chip.missed-agent .direction-icon,
.direction-chip.busy .direction-icon {
  font-size: 0;
  position: relative;
}

.direction-chip.missed .direction-icon::before,
.direction-chip.missed-agent .direction-icon::before,
.direction-chip.busy .direction-icon::before {
  content: "";
  display: block;
  width: 11px;
  height: 11px;
  background: currentColor;
  transform: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.5 6.5h9A2.5 2.5 0 0 1 19 9v1.1c0 .8-.7 1.4-1.5 1.3l-2.6-.4a1.2 1.2 0 0 1-1-1.2V8.6h-3.8v1.2c0 .6-.4 1.1-1 1.2l-2.6.4A1.3 1.3 0 0 1 5 10.1V9a2.5 2.5 0 0 1 2.5-2.5Zm-1.8 8.4 1.8-2.4c.4-.5.9-.8 1.5-.8h6c.6 0 1.2.3 1.5.8l1.8 2.4c.6.8 0 1.9-1 1.9H6.7c-1 0-1.6-1.1-1-1.9Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.5 6.5h9A2.5 2.5 0 0 1 19 9v1.1c0 .8-.7 1.4-1.5 1.3l-2.6-.4a1.2 1.2 0 0 1-1-1.2V8.6h-3.8v1.2c0 .6-.4 1.1-1 1.2l-2.6.4A1.3 1.3 0 0 1 5 10.1V9a2.5 2.5 0 0 1 2.5-2.5Zm-1.8 8.4 1.8-2.4c.4-.5.9-.8 1.5-.8h6c.6 0 1.2.3 1.5.8l1.8 2.4c.6.8 0 1.9-1 1.9H6.7c-1 0-1.6-1.1-1-1.9Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ranking-track .tm-busy,
.ranking-row em .tm-busy {
  background: #1d7af3;
}

.direction-chip .direction-icon::before {
  content: none !important;
  display: none !important;
}

.ranking-row {
  min-height: 118px;
}

.ranking-row > div {
  min-width: 0;
}

.ranking-row em {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 14px;
  width: 100%;
  min-height: 36px;
  line-height: 1.25;
}

.ranking-row em span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ranking-track.segmented {
  width: 100%;
  min-width: 100%;
}

.direction-chip .direction-icon {
  flex-basis: 20px;
  width: 20px;
  height: 20px;
}

.direction-chip .direction-svg {
  width: 14px;
  height: 14px;
}

.direction-chip.outgoing .direction-svg,
.direction-chip.incoming .direction-svg {
  width: 13px;
  height: 13px;
}

.round-action.save-action.saved {
  position: relative;
  color: #fff;
  background: var(--red);
  font-size: 0;
  line-height: 1;
  padding: 0;
  box-shadow: 0 8px 18px rgba(240, 68, 77, 0.22);
}

.round-action.save-action.saved::before {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 14px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  content: "";
  transform: translate(-50%, -50%) rotate(45deg);
}

.round-action.save-action.saved::after {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 14px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  content: "";
  transform: translate(-50%, -50%) rotate(-45deg);
}

.round-action.save-action.saved:focus-visible,
.release-account-action:focus-visible {
  outline: 3px solid rgba(239, 68, 68, 0.22);
  outline-offset: 2px;
}

.manual-free-message {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  display: block;
  min-height: 16px;
  color: #0b8a52;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  max-width: 100%;
}

@media (max-height: 820px) {
  .sidebar {
    padding-top: 18px;
    padding-bottom: 14px;
  }

  .brand {
    margin-bottom: 16px;
  }

  .nav-section {
    margin: 10px 0 5px;
  }

  nav a {
    min-height: 34px;
  }

  .sidebar-footer {
    padding-top: 12px;
  }

  .storage-card {
    padding: 10px;
    gap: 6px;
  }
}

.manual-free-message.error {
  color: var(--red);
}

body[data-theme="dark"] {
  --ink: #f3f8ff;
  --muted: #b8c7dd;
  --muted-2: #8fa3bf;
  --page: #07101f;
  --panel: #0d1728;
  --input: #0b1627;
  --soft: #102947;
  --table-head: #132039;
  --row-line: #243957;
  --line: #28405f;
  --line-strong: #34506f;
  --shadow: rgba(0, 0, 0, 0.34);
  color: var(--ink);
}

body[data-theme="dark"],
body[data-theme="dark"] main {
  background:
    radial-gradient(circle at 88% 0%, rgba(20, 121, 245, 0.11), transparent 34%),
    var(--page);
}

body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .topbar {
  background: rgba(13, 23, 40, 0.96);
  border-color: var(--line);
}

body[data-theme="dark"] .result-panel,
body[data-theme="dark"] .dashboard-card,
body[data-theme="dark"] .stat-card,
body[data-theme="dark"] .settings-card,
body[data-theme="dark"] .upload-panel,
body[data-theme="dark"] .modal-card,
body[data-theme="dark"] .account-panel,
body[data-theme="dark"] .account-button,
body[data-theme="dark"] .number-summary article,
body[data-theme="dark"] .number-group-card,
body[data-theme="dark"] .free-number-pill,
body[data-theme="dark"] .sample-table,
body[data-theme="dark"] .report-target-option,
body[data-theme="dark"] .report-period-option,
body[data-theme="dark"] .report-check,
body[data-theme="dark"] .player-card {
  color: var(--ink);
  background: #0d1728;
  border-color: var(--line);
}

body[data-theme="dark"] .storage-card,
body[data-theme="dark"] .user-row,
body[data-theme="dark"] .ranking-row,
body[data-theme="dark"] .free-number-list,
body[data-theme="dark"] .numbers-tab-buttons button,
body[data-theme="dark"] .manual-swap-grid,
body[data-theme="dark"] .excel-hint {
  color: var(--ink);
  background: #101d32;
  border-color: var(--line);
}

body[data-theme="dark"] .numbers-tab-buttons button.active {
  color: #fff;
  background: var(--blue);
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] .global-search,
body[data-theme="dark"] .profile-input,
body[data-theme="dark"] .team-select {
  color: #f3f8ff;
  background: #0b1627;
  border-color: var(--line-strong);
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
  color: #8498b5;
}

body[data-theme="dark"] th,
body[data-theme="dark"] .filters,
body[data-theme="dark"] .telemarketer-filters,
body[data-theme="dark"] .table-head,
body[data-theme="dark"] .pagination,
body[data-theme="dark"] .result-head,
body[data-theme="dark"] .subtable-section,
body[data-theme="dark"] .metric-card,
body[data-theme="dark"] .dashboard-period-toggle,
body[data-theme="dark"] .ranking-period-toggle,
body[data-theme="dark"] .report-form-inner {
  background: #101d32;
  border-color: var(--line);
}

body[data-theme="dark"] td {
  color: #f4f8ff;
  border-color: var(--row-line);
}

body[data-theme="dark"] th,
body[data-theme="dark"] label,
body[data-theme="dark"] nav::before,
body[data-theme="dark"] .storage-card span,
body[data-theme="dark"] .storage-card small,
body[data-theme="dark"] .topbar p,
body[data-theme="dark"] .result-head p,
body[data-theme="dark"] .dashboard-card > p,
body[data-theme="dark"] .card-title-row p,
body[data-theme="dark"] .ranking-columns p,
body[data-theme="dark"] .ranking-row small,
body[data-theme="dark"] .ranking-row em,
body[data-theme="dark"] .account-button small,
body[data-theme="dark"] .account-button em,
body[data-theme="dark"] .modal-head p,
body[data-theme="dark"] .message,
body[data-theme="dark"] .pie-legend,
body[data-theme="dark"] .period-bars span,
body[data-theme="dark"] .page-size-label {
  color: var(--muted);
}

body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] .brand-text strong,
body[data-theme="dark"] .account-button strong,
body[data-theme="dark"] .ranking-row strong,
body[data-theme="dark"] .stat-card strong,
body[data-theme="dark"] .storage-card strong,
body[data-theme="dark"] .pie-legend b,
body[data-theme="dark"] .period-bars strong {
  color: #ffffff;
}

body[data-theme="dark"] nav a {
  color: #90a4c0;
}

body[data-theme="dark"] nav a:hover {
  color: #d8e8ff;
  background: rgba(45, 125, 255, 0.12);
}

body[data-theme="dark"] nav a.active {
  color: #5aa2ff;
  background: #122c4c;
  border-color: #8fc0ff;
}

body[data-theme="dark"] .secondary,
body[data-theme="dark"] .secondary-inline {
  color: #76b2ff;
  background: #122c4c;
}

body[data-theme="dark"] .danger,
body[data-theme="dark"] .rollback-btn {
  color: #fff;
}

body[data-theme="dark"] .status-pill.active {
  color: #54dfa0;
  background: #103628;
}

body[data-theme="dark"] .status-pill.free {
  color: #6eb5ff;
  background: #102947;
}

body[data-theme="dark"] .chart-tooltip {
  color: #f5f9ff;
  background: #0f1b2e;
  border-color: var(--line);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38);
}

body[data-theme="dark"] .ranking-track,
body[data-theme="dark"] .period-bars i,
body[data-theme="dark"] .storage-bar {
  background: #22324a;
}

body[data-theme="dark"] .account-panel label,
body[data-theme="dark"] .report-modal-card label {
  color: var(--muted);
}

body[data-theme="dark"] .report-target-option,
body[data-theme="dark"] .report-period-option,
body[data-theme="dark"] .report-check {
  background: #101d32;
}

body[data-theme="dark"] .report-choice-row label,
body[data-theme="dark"] .report-options label {
  color: #edf5ff !important;
  background: #101d32 !important;
  border-color: #2d4565 !important;
}

body[data-theme="dark"] .report-choice-row label:has(input:checked),
body[data-theme="dark"] .report-options label:has(input:checked) {
  color: #ffffff !important;
  background: #122c4c !important;
  border-color: #5aa2ff !important;
}

body[data-theme="dark"] .report-target-option:has(input:checked),
body[data-theme="dark"] .report-period-option:has(input:checked),
body[data-theme="dark"] .report-check:has(input:checked) {
  background: #122c4c;
  border-color: #5aa2ff;
}

body[data-theme="dark"] .user-row {
  box-shadow: none;
}

.manual-free-message.hidden {
  display: none;
}

.nav-icon {
  font-size: 13px;
}

.nav-star {
  font-size: 13px;
}

.nav-numbers {
  font-size: 9px;
  letter-spacing: -0.07em;
}

.nav-chart::before {
  width: 15px;
  height: 15px;
}

.nav-headphones::before {
  width: 14px;
  height: 10px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  transform: translateY(-1px);
}

.nav-headphones::after {
  top: 11px;
  width: 16px;
  height: 6px;
  background:
    linear-gradient(currentColor, currentColor) left top / 4px 6px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 4px 6px no-repeat;
  border-radius: 2px;
  transform: translateY(-1px);
}

.nav-clock::before {
  width: 14px;
  height: 14px;
  border-width: 1.7px;
}

.nav-clock::after {
  width: 7px;
  height: 7px;
  background:
    linear-gradient(currentColor, currentColor) 3px 0 / 1.5px 4.5px no-repeat,
    linear-gradient(currentColor, currentColor) 3px 3px / 4.5px 1.5px no-repeat;
  transform: translate(0.5px, 0);
}

body.sidebar-collapsed .nav-icon {
  font-size: 13px;
}

/* Final dark-mode cleanup for legacy bright pills/cards. */
body[data-theme="dark"] .dashboard-toolbar strong {
  color: #eef6ff !important;
  background: #0d1a2d !important;
  border-color: #2d4565 !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

body[data-theme="dark"] .pie-legend,
body[data-theme="dark"] .pie-legend div,
body[data-theme="dark"] .pie-legend span {
  color: #c4d4ec !important;
}

body[data-theme="dark"] .pie-legend b,
body[data-theme="dark"] .pie-legend strong {
  color: #f5f9ff !important;
}

body[data-theme="dark"] .direction-chip.outgoing {
  color: #79f2b9 !important;
  background: #103d2e !important;
}

body[data-theme="dark"] .direction-chip.incoming {
  color: #ffd36a !important;
  background: #3b2b10 !important;
}

body[data-theme="dark"] .direction-chip.missed {
  color: #ffb7c0 !important;
  background: #3a1720 !important;
}

body[data-theme="dark"] .direction-chip.missed-agent {
  color: #ffffff !important;
  background: #f0444d !important;
}

body[data-theme="dark"] .direction-chip.busy {
  color: #b8d8ff !important;
  background: #153661 !important;
}

body[data-theme="dark"] .direction-chip.after-hours {
  color: #ded7ff !important;
  background: #33205f !important;
}

body[data-theme="dark"] .direction-chip .direction-label {
  color: inherit !important;
  background: transparent !important;
}

body[data-theme="dark"] .status-badge.active,
body[data-theme="dark"] .status-pill.active {
  color: #7af0b6 !important;
  background: #103d2e !important;
  border-color: #1c6a4b !important;
}

body[data-theme="dark"] .status-badge.free,
body[data-theme="dark"] .status-pill.free {
  color: #80c2ff !important;
  background: #102947 !important;
  border-color: #235787 !important;
}

body[data-theme="dark"] .rollback-btn {
  color: #ffdce1 !important;
  background: #3a1720 !important;
  border-color: #f06f7d !important;
  box-shadow: none !important;
}

body[data-theme="dark"] .rollback-btn:hover {
  color: #ffffff !important;
  background: #f0444d !important;
}

body[data-theme="dark"] .rollback-done {
  color: #b7c6dc !important;
}

body[data-theme="dark"] .storage-card {
  color: #edf5ff !important;
  background: #101d32 !important;
  border-color: #2d4565 !important;
}

body[data-theme="dark"] .storage-card span,
body[data-theme="dark"] .storage-card small {
  color: #a9bad3 !important;
}

#telemarketersView .table-wrap {
  overflow-x: auto;
}

#telemarketersView .telemarketers-table {
  min-width: 0;
  width: 100%;
}

#telemarketersView .telemarketers-table th:nth-child(1) { width: 5.5%; }
#telemarketersView .telemarketers-table th:nth-child(2) { width: 11%; }
#telemarketersView .telemarketers-table th:nth-child(3) { width: 12%; }
#telemarketersView .telemarketers-table th:nth-child(4) { width: 17%; }
#telemarketersView .telemarketers-table th:nth-child(5) { width: 11%; }
#telemarketersView .telemarketers-table th:nth-child(6) { width: 11%; }
#telemarketersView .telemarketers-table th:nth-child(7),
#telemarketersView .telemarketers-table th:nth-child(8),
#telemarketersView .telemarketers-table th:nth-child(9) { width: 10.5%; }

#recordingsView .table-wrap,
#savedRecordingsView .table-wrap,
#numbersView .table-wrap {
  overflow-x: auto;
  overflow-y: visible;
}

#recordingsView .recordings-table,
#savedRecordingsView .recordings-table {
  min-width: 0;
  width: 100%;
}

#recordingsView .recordings-table th,
#recordingsView .recordings-table td,
#savedRecordingsView .recordings-table th,
#savedRecordingsView .recordings-table td,
#numbersView .numbers-table th,
#numbersView .numbers-table td {
  padding-left: 9px;
  padding-right: 9px;
}

#recordingsView .recordings-table th:nth-child(1),
#savedRecordingsView .recordings-table th:nth-child(1) { width: 126px; }
#recordingsView .recordings-table th:nth-child(2),
#savedRecordingsView .recordings-table th:nth-child(2) { width: 46px; }
#recordingsView .recordings-table th:nth-child(3),
#savedRecordingsView .recordings-table th:nth-child(3) { width: 130px; }
#recordingsView .recordings-table th:nth-child(4),
#savedRecordingsView .recordings-table th:nth-child(4) { width: 76px; }
#recordingsView .recordings-table th:nth-child(5),
#savedRecordingsView .recordings-table th:nth-child(5) { width: 112px; }
#recordingsView .recordings-table th:nth-child(6),
#savedRecordingsView .recordings-table th:nth-child(6) { width: 108px; }
#recordingsView .recordings-table th:nth-child(7),
#savedRecordingsView .recordings-table th:nth-child(7) { width: 142px; }
#recordingsView .recordings-table th:nth-child(8),
#savedRecordingsView .recordings-table th:nth-child(8) { width: 94px; }
#recordingsView .recordings-table th:nth-child(9),
#savedRecordingsView .recordings-table th:nth-child(9) { width: 76px; }
#recordingsView .recordings-table th:nth-child(10),
#recordingsView .recordings-table td:nth-child(10),
#savedRecordingsView .recordings-table th:nth-child(10),
#savedRecordingsView .recordings-table td:nth-child(10) {
  width: 130px;
  min-width: 130px;
  overflow: visible;
}

#numbersView .numbers-table {
  min-width: 0;
  width: 100%;
}

#numbersView .numbers-table th:nth-child(1) { width: 17%; }
#numbersView .numbers-table th:nth-child(2) { width: 12%; }
#numbersView .numbers-table th:nth-child(3) { width: 9%; }
#numbersView .numbers-table th:nth-child(4),
#numbersView .numbers-table th:nth-child(5),
#numbersView .numbers-table th:nth-child(6) { width: 12%; }
#numbersView .numbers-table th:nth-child(7) { width: 9%; }
#numbersView .numbers-table th:nth-child(8),
#numbersView .numbers-table td:nth-child(8) {
  width: 7%;
  min-width: 62px;
  text-align: center;
  overflow: visible;
}

/* Global Forum Menadzer 3CX logo replacement. */
.brand-text,
.login-brand strong {
  display: none !important;
}

.brand .logo {
  content: url("/forumlogo.png") !important;
  width: 214px !important;
  max-width: calc(100% - 44px) !important;
  height: 54px !important;
  object-fit: contain !important;
  object-position: left center !important;
  filter: none !important;
}

body[data-theme="dark"] .brand .logo {
  content: url("/forumlogo-dark.png") !important;
  width: 214px !important;
  max-width: calc(100% - 44px) !important;
  height: 54px !important;
  object-fit: contain !important;
  object-position: left center !important;
  filter: none !important;
}

.login-brand .logo,
body[data-theme="dark"] .login-brand .logo {
  content: url("/forumlogo.png") !important;
  width: min(300px, 100%) !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  filter: none !important;
}

.login-corner-logo,
body[data-theme="dark"] .login-corner-logo {
  content: url("/forumlogo.png") !important;
  width: min(390px, 26vw) !important;
  height: auto !important;
  object-fit: contain !important;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.42)) drop-shadow(0 0 1px rgba(0, 0, 0, 0.55)) !important;
}

body.sidebar-collapsed .brand .logo {
  content: url("/forum-mark.png") !important;
  width: 42px !important;
  height: 42px !important;
  object-fit: contain !important;
  object-position: center !important;
  filter: none !important;
}

body[data-theme="dark"].sidebar-collapsed .brand .logo {
  content: url("/forum-mark-dark.png") !important;
  width: 42px !important;
  height: 42px !important;
  object-fit: contain !important;
  object-position: center !important;
  filter: none !important;
}

@media (max-width: 700px) {
  .login-corner-logo {
    width: 230px !important;
  }
}

/* 2026-05-25 dark dashboard polish. */
body[data-theme="dark"] .brand .logo {
  content: url("/forumlogo-dark.png?v=20260525-white-logo-assets") !important;
}

body[data-theme="dark"].sidebar-collapsed .brand .logo {
  content: url("/forum-mark-dark.png?v=20260525-white-logo-assets") !important;
}

body[data-theme="dark"] .sidebar-collapse {
  color: #7fb3ff !important;
  background: #13243d !important;
  border: 1px solid #2d4565 !important;
}

body[data-theme="dark"] .sidebar-collapse span {
  background: currentColor !important;
}

body[data-theme="dark"].sidebar-collapsed .sidebar-collapse {
  color: #7fb3ff !important;
  background: #13243d !important;
  border-color: #2d4565 !important;
}

body[data-theme="dark"] .stat-card i {
  color: var(--blue) !important;
  background: rgba(45, 125, 255, 0.18) !important;
}

body[data-theme="dark"] .stat-card-2 i {
  color: #34d399 !important;
  background: rgba(52, 211, 153, 0.16) !important;
}

body[data-theme="dark"] .stat-card-3 i {
  color: #a78bfa !important;
  background: rgba(167, 139, 250, 0.16) !important;
}

body[data-theme="dark"] .stat-card-4 i {
  color: #fb923c !important;
  background: rgba(251, 146, 60, 0.16) !important;
}

body[data-theme="dark"] .stat-card-5 i {
  color: #22d3ee !important;
  background: rgba(34, 211, 238, 0.16) !important;
}

body[data-theme="dark"] .stat-card i svg {
  color: inherit !important;
  stroke: currentColor !important;
}

body[data-theme="dark"] .stat-card i svg path:only-child {
  fill: currentColor !important;
  stroke: none !important;
}

.ranking-track .tm-missed,
.ranking-row em .tm-missed,
.direction-tm_missed {
  background: #d946ef !important;
}

.direction-chip.missed-agent .direction-icon {
  color: #fff !important;
  background: #d946ef !important;
}

.direction-chip.missed-agent {
  color: #9d23aa !important;
  background: #fbe7ff !important;
}

body[data-theme="dark"] .ranking-track .tm-missed,
body[data-theme="dark"] .ranking-row em .tm-missed,
body[data-theme="dark"] .direction-tm_missed {
  background: #e879f9 !important;
}

body[data-theme="dark"] .direction-chip.missed-agent {
  color: #f9d0ff !important;
  background: rgba(217, 70, 239, 0.22) !important;
}

body[data-theme="dark"] .direction-chip.missed-agent .direction-icon {
  color: #fff !important;
  background: #d946ef !important;
}

body[data-theme="dark"] .dashboard-filter-panel,
body[data-theme="dark"] .dashboard-scope-toggle {
  background: #101d32 !important;
  border-color: #2d4565 !important;
}

body[data-theme="dark"] .dashboard-scope-toggle button {
  color: #b7c7dd !important;
}

body[data-theme="dark"] .dashboard-scope-toggle button.active {
  color: #fff !important;
  background: var(--blue) !important;
}

body[data-theme="dark"] .dashboard-filter-select {
  color: #9fb2cc !important;
}

body[data-theme="dark"] .dashboard-filter-select select {
  color: #f3f8ff !important;
  background: #0b1627 !important;
  border-color: #2d4565 !important;
}

body[data-theme="dark"] .ranking-head span {
  color: #d8eaff !important;
  background: #122c4c !important;
}

/* 2026-05-25 report modal dark-mode repair. */
.report-employee-select {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--input);
  font-weight: 800;
}

body[data-theme="dark"] .report-modal-card {
  color: var(--ink) !important;
  background: #0d1728 !important;
  border-color: var(--line) !important;
}

body[data-theme="dark"] .report-dependent label,
body[data-theme="dark"] .report-team-members {
  color: #dbe8fb !important;
  background: #101d32 !important;
  border-color: #2d4565 !important;
}

body[data-theme="dark"] .report-dependent label > select,
body[data-theme="dark"] .report-dependent label > input,
body[data-theme="dark"] .report-employee-select {
  color: #f3f8ff !important;
  background: #0b1627 !important;
  border-color: #2d4565 !important;
}

body[data-theme="dark"] .report-team-member {
  color: #e8f1ff !important;
  background: #0d1728 !important;
  border-color: #355174 !important;
}

body[data-theme="dark"] .report-team-member strong {
  color: #f6fbff !important;
}

body[data-theme="dark"] .report-team-member small,
body[data-theme="dark"] .report-team-header span {
  color: #9fb2cc !important;
}

body[data-theme="dark"] .report-team-individual {
  color: #e8f1ff !important;
  background: #101d32 !important;
  border-color: #2d4565 !important;
}

body[data-theme="dark"] .report-team-individual small {
  color: #9fb2cc !important;
}

body[data-theme="dark"] .report-team-member input,
body[data-theme="dark"] .report-choice-row input,
body[data-theme="dark"] .report-options input,
body[data-theme="dark"] .report-team-individual input {
  accent-color: var(--blue);
}

body[data-theme="dark"] .report-add-employee {
  color: #cfe4ff !important;
  background: #122c4c !important;
  border-color: #2d4565 !important;
}

@media (max-width: 1320px) {
  #recordingsView .recordings-table th,
  #recordingsView .recordings-table td,
  #savedRecordingsView .recordings-table th,
  #savedRecordingsView .recordings-table td,
  #numbersView .numbers-table th,
  #numbersView .numbers-table td {
    padding-left: 8px;
    padding-right: 8px;
    font-size: 12px;
  }

  #recordingsView .recordings-table th:nth-child(1),
  #savedRecordingsView .recordings-table th:nth-child(1) { width: 11.8%; }
  #recordingsView .recordings-table th:nth-child(2),
  #savedRecordingsView .recordings-table th:nth-child(2) { width: 4.2%; }
  #recordingsView .recordings-table th:nth-child(3),
  #savedRecordingsView .recordings-table th:nth-child(3) { width: 12%; }
  #recordingsView .recordings-table th:nth-child(4),
  #savedRecordingsView .recordings-table th:nth-child(4) { width: 7%; }
  #recordingsView .recordings-table th:nth-child(5),
  #savedRecordingsView .recordings-table th:nth-child(5) { width: 10.3%; }
  #recordingsView .recordings-table th:nth-child(6),
  #savedRecordingsView .recordings-table th:nth-child(6) { width: 10%; }
  #recordingsView .recordings-table th:nth-child(7),
  #savedRecordingsView .recordings-table th:nth-child(7) { width: 13%; }
  #recordingsView .recordings-table th:nth-child(8),
  #savedRecordingsView .recordings-table th:nth-child(8) { width: 8%; }
  #recordingsView .recordings-table th:nth-child(9),
  #savedRecordingsView .recordings-table th:nth-child(9) { width: 7%; }
  #recordingsView .recordings-table th:nth-child(10),
  #recordingsView .recordings-table td:nth-child(10),
  #savedRecordingsView .recordings-table th:nth-child(10),
  #savedRecordingsView .recordings-table td:nth-child(10) {
    width: 16.7%;
    min-width: 108px;
  }
}
