:root {
  color-scheme: light;
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-soft: #f8f9f7;
  --text: #1c1f1d;
  --muted: #68716b;
  --line: #dde2dd;
  --line-strong: #c9d0ca;
  --action: #202320;
  --action-hover: #080908;
  --link: #245d87;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --warning: #8a6100;
  --warning-bg: #fff8dc;
  --success: #18794e;
  --success-bg: #edf8f2;
  --info: #315f7d;
  --info-bg: #edf5fa;
  --focus: #5b8fb2;
  --sidebar: 252px;
  --header-height: 72px;
  --radius: 8px;
  --control-radius: 8px;
  --button-soft: #f1f3f1;
  --button-soft-hover: #e8ece8;
  --shadow: 0 8px 26px rgb(26 34 28 / 8%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgb(91 143 178 / 35%);
  outline-offset: 2px;
}

a,
.text-link {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover,
.text-link:hover {
  color: #173f5d;
  text-decoration-thickness: 2px;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden] {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #fafbf9;
}

.brand-mark {
  display: flex;
  height: var(--header-height);
  min-height: var(--header-height);
  flex: 0 0 var(--header-height);
  align-items: center;
  gap: 11px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.brand-symbol {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 7px;
  background: var(--action);
  color: #fff;
  font-size: 17px;
  font-weight: 750;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 15px;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.main-nav {
  flex: 1;
  padding: 14px 10px 24px;
}

.nav-section + .nav-section {
  margin-top: 18px;
}

.nav-label {
  margin: 0 10px 7px;
  color: #7a837d;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #343a36;
  text-align: left;
}

.nav-link svg {
  width: 19px;
  height: 19px;
  color: #626b65;
}

.nav-link:hover {
  background: #f0f2ef;
  color: var(--text);
}

.nav-link.is-active {
  background: #e9ece8;
  color: #111311;
  font-weight: 650;
}

.nav-link.is-active svg {
  color: #111311;
}

.nav-badge {
  min-width: 22px;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.profile-compact {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 9px;
  padding: 5px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.profile-compact:hover {
  background: #f0f2ef;
}

.profile-compact > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.profile-compact strong,
.profile-compact small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-compact small {
  color: var(--muted);
  font-size: 11px;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #dfe5df;
  color: #26312a;
  font-size: 11px;
  font-weight: 750;
}

.avatar-button {
  border: 0;
}

.workspace {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  height: var(--header-height);
  min-height: var(--header-height);
  align-items: center;
  gap: 16px;
  padding: 10px clamp(18px, 3vw, 38px);
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(10px);
}

.context-bar {
  display: flex;
  min-width: 0;
  gap: 10px;
}

.context-bar label {
  display: grid;
  min-width: 170px;
  gap: 2px;
}

.context-bar label span {
  padding-left: 1px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
}

.context-bar select {
  height: 34px;
  padding: 0 30px 0 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 620;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.icon-button {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #434a45;
}

.icon-button:hover {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--text);
}

.notification-dot {
  position: absolute;
  top: 4px;
  right: 3px;
  display: grid;
  min-width: 17px;
  height: 17px;
  place-items: center;
  padding: 0 4px;
  border: 2px solid white;
  border-radius: 9px;
  background: var(--danger);
  color: white;
  font-size: 9px;
  font-weight: 750;
}

.mobile-menu {
  display: none;
}

.main-content {
  width: 100%;
  max-width: 1540px;
  margin: 0 auto;
  padding: 30px clamp(18px, 3vw, 38px) 60px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}

.breadcrumbs {
  min-height: 19px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.breadcrumbs span + span::before {
  content: "/";
  margin: 0 7px;
  color: #a0a8a2;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 5px;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 16px;
  font-size: 18px;
  line-height: 1.3;
}

h3 {
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.35;
}

.page-subtitle {
  max-width: 780px;
  margin-bottom: 0;
  color: var(--muted);
}

.page-actions,
.toolbar-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  background: var(--button-soft);
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
}

.button svg {
  width: 18px;
  height: 18px;
}

.button:hover {
  border-color: #aeb7b0;
  background: var(--button-soft-hover);
}

.button-primary {
  border-color: var(--action);
  background: var(--action);
  color: white;
}

.button-primary:hover {
  border-color: var(--action-hover);
  background: var(--action-hover);
}

.button-danger {
  border-color: #efc3bf;
  background: var(--danger-bg);
  color: var(--danger);
}

.button-success {
  border-color: #b9ddca;
  background: var(--success-bg);
  color: var(--success);
}

button.text-link {
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  appearance: none;
  background: transparent;
}

.popover-header button.text-link {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  background: var(--button-soft);
}

.popover-header button.text-link:hover {
  border-color: #aeb7b0;
  background: var(--button-soft-hover);
}

.button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel + .panel,
.section-gap {
  margin-top: 18px;
}

.panel-header {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2,
.panel-header h3,
.panel-header p {
  margin-bottom: 0;
}

.panel-body {
  padding: 18px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.kpi-card {
  min-width: 0;
  min-height: 126px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.kpi-card .kpi-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.kpi-card .kpi-value {
  margin: 15px 0 5px;
  font-size: clamp(25px, 2.6vw, 32px);
  font-weight: 720;
  line-height: 1;
  white-space: nowrap;
}

.kpi-note {
  color: var(--muted);
  font-size: 12px;
}

.trend-up {
  color: var(--success);
  font-weight: 650;
}

.trend-down {
  color: var(--danger);
  font-weight: 650;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr);
  gap: 18px;
}

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

.grid-2 > *,
.grid-equal > *,
.detail-grid > * {
  min-width: 0;
}

.chart {
  position: relative;
  min-height: 240px;
  overflow: hidden;
}

.chart-grid {
  position: absolute;
  inset: 12px 0 30px;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
}

.chart-grid i {
  border-top: 1px solid #edf0ed;
}

.chart svg {
  position: absolute;
  inset: 12px 0 30px;
  width: 100%;
  height: calc(100% - 42px);
  overflow: visible;
}

.chart svg path {
  fill: none;
  stroke: #313733;
  stroke-width: 2.2;
  vector-effect: non-scaling-stroke;
}

.chart svg circle {
  fill: white;
  stroke: #313733;
  stroke-width: 2;
}

.chart-labels {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

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

.status-row {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1px solid #edf0ed;
}

.status-row:last-child {
  border-bottom: 0;
}

.status-row > div {
  min-width: 0;
  flex: 1;
}

.status-row p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.status-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
}

.status-icon svg {
  width: 17px;
  height: 17px;
}

.status-icon.danger { background: var(--danger-bg); color: var(--danger); }
.status-icon.warning { background: var(--warning-bg); color: var(--warning); }
.status-icon.success { background: var(--success-bg); color: var(--success); }
.status-icon.info { background: var(--info-bg); color: var(--info); }

.toolbar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}

.search-field {
  position: relative;
  min-width: 220px;
  flex: 1;
}

.search-field svg {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  padding-left: 39px;
}

.field,
.form-field {
  display: grid;
  gap: 6px;
}

.field > span,
.form-field > span,
.field-label {
  color: #4f5852;
  font-size: 12px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #929a94;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #aeb7b0;
}

.field-error input,
.field-error select,
.field-error textarea {
  border-color: var(--danger);
}

.field-message {
  color: var(--muted);
  font-size: 11px;
}

.field-message.error {
  color: var(--danger);
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  text-align: left;
}

.data-table th {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-strong);
  background: #fafbf9;
  color: #5f6862;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 14px;
  border-bottom: 1px solid #e8ece8;
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: #fafbf9;
}

.cell-main {
  display: flex;
  min-width: 190px;
  align-items: center;
  gap: 11px;
}

.cell-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.cell-copy strong,
.cell-copy a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-copy small,
.muted {
  color: var(--muted);
}

.thumb {
  position: relative;
  display: grid;
  width: 48px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: #e8ece8;
  color: #536057;
}

.thumb::before {
  content: "";
  position: absolute;
  inset: 8px 9px;
  border: 1px solid #bbc4bc;
  border-radius: 4px;
}

.thumb svg {
  position: relative;
  z-index: 1;
  width: 17px;
  height: 17px;
}

.badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 680;
  white-space: nowrap;
}

.badge::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.badge-neutral { background: #f1f3f1; color: #59625c; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }

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

.platform {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  color: #39423c;
  font-size: 11px;
  font-weight: 650;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.pagination-controls {
  display: flex;
  gap: 4px;
}

.page-button {
  display: grid;
  min-width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.page-button.is-active {
  border-color: var(--action);
  background: var(--action);
  color: white;
}

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.tab {
  min-height: 44px;
  padding: 10px 13px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 620;
  white-space: nowrap;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  border-bottom-color: var(--action);
  color: var(--text);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(250px, .72fr) minmax(0, 1.5fr);
  gap: 18px;
}

.media-preview {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 480px;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius);
  background: #242824;
  color: white;
}

.media-preview::before,
.media-preview::after {
  position: absolute;
  content: "";
  opacity: .14;
}

.media-preview::before {
  inset: 10% 18%;
  border: 1px solid white;
}

.media-preview::after {
  width: 140%;
  height: 1px;
  background: white;
  transform: rotate(-35deg);
}

.play-button {
  position: relative;
  z-index: 1;
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 40%);
  border-radius: 50%;
  background: rgb(255 255 255 / 14%);
  color: white;
}

.play-button svg {
  width: 25px;
  height: 25px;
  margin-left: 3px;
}

.watermark {
  position: absolute;
  right: 14px;
  bottom: 12px;
  color: rgb(255 255 255 / 55%);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.description-list {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  margin: 0;
}

.description-list dt,
.description-list dd {
  margin: 0;
  padding: 11px 0;
  border-bottom: 1px solid #edf0ed;
}

.description-list dt {
  color: var(--muted);
}

.description-list dd {
  font-weight: 560;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid;
  border-radius: var(--radius);
}

.alert svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.alert p:last-child {
  margin-bottom: 0;
}

.alert-danger { border-color: #efc3bf; background: var(--danger-bg); color: #78231d; }
.alert-warning { border-color: #ead79a; background: var(--warning-bg); color: #654b0b; }
.alert-success { border-color: #b9ddca; background: var(--success-bg); color: #145c3e; }
.alert-info { border-color: #c6dce9; background: var(--info-bg); color: #274e67; }

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

.span-2 {
  grid-column: span 2;
}

.dropzone {
  display: grid;
  min-height: 260px;
  place-items: center;
  padding: 28px;
  border: 1.5px dashed #abb5ad;
  border-radius: var(--radius);
  background: #fafbf9;
  text-align: center;
}

.dropzone-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 8px;
  background: #e9ece8;
}

.dropzone p {
  max-width: 420px;
  margin: 6px auto 0;
  color: var(--muted);
}

.progress {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #e5e9e5;
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--action);
}

.timeline {
  display: grid;
  gap: 0;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 11px;
  padding-bottom: 18px;
}

.timeline-item:not(:last-child)::before {
  position: absolute;
  top: 12px;
  bottom: 0;
  left: 5px;
  width: 1px;
  background: var(--line-strong);
  content: "";
}

.timeline-dot {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 4px;
  border: 3px solid white;
  border-radius: 50%;
  background: #7a847d;
  box-shadow: 0 0 0 1px #aeb6b0;
}

.timeline-item.is-success .timeline-dot { background: var(--success); }
.timeline-item.is-warning .timeline-dot { background: var(--warning); }
.timeline-item.is-danger .timeline-dot { background: var(--danger); }

.timeline-item p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.popover {
  position: absolute;
  z-index: 80;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
}

.notification-popover {
  top: 62px;
  right: 28px;
  width: min(390px, calc(100vw - 24px));
  max-height: min(560px, calc(100dvh - 86px));
  overflow-y: auto;
}

.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}

.popover-header h2 {
  margin: 0;
  font-size: 16px;
}

.notification-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid #edf0ed;
}

.notification-item.is-unread {
  background: #fafbf9;
}

.notification-item h3 {
  margin: 0 0 3px;
  font-size: 13px;
}

.notification-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.notification-item time {
  display: block;
  margin-top: 5px;
  color: #858e88;
  font-size: 11px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(16 19 17 / 48%);
}

.modal {
  width: min(620px, 100%);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: 0 24px 70px rgb(0 0 0 / 18%);
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
}

.modal-header {
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
}

.modal-body {
  padding: 18px;
}

.modal-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 130;
  display: grid;
  width: min(360px, calc(100vw - 36px));
  gap: 8px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--action);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
}

.toast.is-success { border-left-color: var(--success); }
.toast.is-danger { border-left-color: var(--danger); }
.toast.is-warning { border-left-color: var(--warning); }

.toast p {
  margin: 0;
}

.auth-root {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  background: #f1f3f0;
}

.auth-layout {
  display: grid;
  width: min(1060px, 100%);
  min-height: calc(100dvh - 48px);
  grid-template-columns: minmax(320px, 440px) minmax(360px, 1fr);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 6vw, 58px);
}

.auth-panel .brand-mark {
  min-height: auto;
  margin-bottom: 48px;
  padding: 0;
  border: 0;
}

.auth-panel h1 {
  margin-bottom: 9px;
  font-size: 28px;
}

.auth-panel > p {
  margin-bottom: 25px;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 15px;
}

.auth-form .button {
  width: 100%;
  margin-top: 3px;
}

.auth-aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(32px, 5vw, 58px);
  background: #252a26;
  color: white;
}

.auth-aside h2 {
  max-width: 420px;
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.16;
}

.auth-aside p {
  max-width: 440px;
  color: #c7cec8;
}

.auth-statuses {
  display: grid;
  gap: 12px;
  margin-top: 36px;
}

.auth-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #e2e7e3;
}

.auth-status span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid #566059;
  border-radius: 6px;
}

.auth-status svg {
  width: 15px;
  height: 15px;
}

.code-inputs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.code-inputs input {
  height: 56px;
  padding: 0;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}

.empty-state {
  display: grid;
  min-height: 280px;
  place-items: center;
  padding: 40px;
  text-align: center;
}

.empty-state > div {
  max-width: 420px;
}

.empty-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 8px;
  background: #eef1ee;
  color: #566058;
}

.empty-state p {
  color: var(--muted);
}

.skeleton {
  overflow: hidden;
  border-radius: 5px;
  background: #e8ece8;
}

.skeleton-line {
  width: 80%;
  height: 12px;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch span {
  width: 100%;
  border-radius: 12px;
  background: #cbd2cc;
  transition: background .16s ease;
}

.switch span::after {
  display: block;
  width: 18px;
  height: 18px;
  margin: 3px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgb(0 0 0 / 18%);
  content: "";
  transition: transform .16s ease;
}

.switch input:checked + span {
  background: var(--success);
}

.switch input:checked + span::after {
  transform: translateX(18px);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid #edf0ed;
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-row p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.metric-stack {
  display: flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}

.metric-stack strong {
  font-size: 15px;
}

.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgb(20 24 21 / 42%);
}

@media (max-width: 1120px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-row {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .detail-grid {
    grid-template-columns: minmax(230px, .8fr) minmax(0, 1.2fr);
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    width: min(86vw, 300px);
    transform: translateX(-102%);
    transition: transform .2s ease;
    box-shadow: var(--shadow);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .workspace {
    width: 100%;
  }

  .mobile-menu {
    display: grid;
  }

  .context-bar label {
    min-width: 140px;
  }

  .topbar {
    padding-inline: 14px;
  }

  .main-content {
    padding-inline: 18px;
  }

  .grid-2,
  .grid-equal,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .media-preview {
    min-height: min(66dvh, 560px);
  }

  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-aside {
    display: none;
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 64px;
  }

  body {
    font-size: 13px;
  }

  .topbar {
    gap: 8px;
  }

  .context-bar {
    flex: 1;
    gap: 5px;
  }

  .context-bar label {
    min-width: 0;
    flex: 1;
  }

  .context-bar label span {
    display: none;
  }

  .context-bar select {
    width: 100%;
    height: 42px;
    padding: 0 24px 0 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background-color: white;
    font-size: 12px;
  }

  .avatar-button {
    display: none;
  }

  .notification-popover {
    position: fixed;
    top: 64px;
    right: 8px;
    left: 8px;
    width: auto;
  }

  .main-content {
    padding: 22px 12px calc(40px + env(safe-area-inset-bottom));
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 18px;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .button {
    flex: 1;
  }

  h1 {
    font-size: 24px;
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .kpi-card {
    min-height: 112px;
    padding: 14px;
  }

  .kpi-card .kpi-value {
    margin-top: 13px;
    font-size: 24px;
  }

  .panel-header,
  .panel-body {
    padding-inline: 14px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toolbar-actions .button {
    flex: 1;
  }

  .filter-row,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .table-wrap {
    overflow: visible;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .data-table tbody {
    display: grid;
    gap: 10px;
    padding: 10px;
  }

  .data-table tbody tr {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: white;
  }

  .data-table tbody tr:hover {
    background: white;
  }

  .data-table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 0;
    border: 0;
    text-align: right;
  }

  .data-table td::before {
    flex: 0 0 39%;
    color: var(--muted);
    content: attr(data-label);
    font-size: 11px;
    font-weight: 650;
    text-align: left;
    text-transform: uppercase;
  }

  .data-table td:first-child {
    display: block;
    padding-top: 0;
    padding-bottom: 11px;
    border-bottom: 1px solid #edf0ed;
    text-align: left;
  }

  .data-table td:first-child::before {
    display: none;
  }

  .cell-main {
    min-width: 0;
  }

  .pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-button {
    min-width: 42px;
    height: 42px;
  }

  .description-list {
    grid-template-columns: 1fr;
  }

  .description-list dt {
    padding-bottom: 2px;
    border-bottom: 0;
  }

  .description-list dd {
    padding-top: 0;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: calc(100dvh - 16px);
    border-radius: 10px 10px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .auth-root {
    padding: 0;
  }

  .auth-layout {
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .auth-panel {
    justify-content: flex-start;
    padding: 26px 20px;
  }

  .auth-panel .brand-mark {
    margin-bottom: 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
