.admin-body { background: #f4f6ef; }
.auth-view { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 19px; min-height: 100dvh; padding: 20px; }
.auth-card { width: min(100%, 430px); padding: 25px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow); }
.auth-card h1 { font-size: 25px; margin-bottom: 6px; }
.auth-card p { margin-bottom: 15px; }
.auth-card .button { margin-top: 14px; width: 100%; }
.auth-card .form-error { margin-bottom: 0; }
.admin-shell { display: grid; grid-template-columns: 218px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { display: flex; flex-direction: column; padding: 25px 15px 18px; gap: 14px; border-right: 1px solid #dae2d6; background: #ebf0e7; position: sticky; top: 0; height: 100dvh; }
.sidebar .brand { padding-left: 7px; margin-bottom: 18px; }
.nav-label { color: #5a715e; letter-spacing: .08em; font-weight: 650; font-size: 11px; padding-left: 10px; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.admin-nav a { flex-shrink: 0; }
.admin-nav a { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 10px; border: 1px solid transparent; border-radius: 8px; color: #375345; font-size: 14px; font-weight: 620; white-space: nowrap; }
.admin-nav a:hover { background: #e1e9dd; }
.admin-nav a[aria-current="page"] { color: #f4f8ef; background: #24523c; }
.admin-nav svg { width: 18px; height: 18px; }
.sidebar-footer { margin-top: auto; display: grid; gap: 7px; }
.admin-main { min-width: 0; }
.admin-top { height: 63px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 27px; color: #506558; font-size: 13px; background: #fafbf6; border-bottom: 1px solid var(--line); }
.admin-top > span > span { margin-inline: 5px; color: #8a9a8d; }
.timezone { display: flex; align-items: center; gap: 7px; border: 1px solid #dce6d8; border-radius: 100px; padding: 4px 9px; background: #f1f5ec; font-size: 12px; white-space: nowrap; }
.timezone i { width: 7px; height: 7px; background: #68935d; border-radius: 50%; }
.admin-content { width: min(1300px, 100%); padding: 26px 27px 46px; margin-inline: auto; }
.admin-content:focus { outline: none; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 21px; }
.page-head h1 { font-size: clamp(25px, 3vw, 33px); letter-spacing: .015em; line-height: 1.35; }
.page-head p { color: var(--muted); margin-top: 4px; font-size: 14px; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.workflow-tabs { display: flex; gap: 7px; flex-wrap: wrap; margin: 0 0 13px; }
.workflow-filter, .source-panel { margin-bottom: 14px; }
.workflow-hint { margin-top: 10px; }
.workflow-answer { margin-top: 10px; padding: 12px; border-radius: 8px; background: #f1f5ed; white-space: pre-wrap; overflow-wrap: anywhere; }
.source-note { padding: 12px 16px; }
.source-count-labels { display: block; margin-top: 2px; font-weight: 500; }
.source-mobile-label { display: none; }
.source-panel .source-name { min-width: 90px; }
.source-panel .source-credited { color: var(--green); font-weight: 680; }
.source-panel .source-status { white-space: nowrap; }
.source-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 200px; }
.source-row-actions .button { padding-inline: 8px; }
.channel-fees { padding: 13px 16px; background: #f7f9f4; border-bottom: 1px solid var(--line); }
.channel-fees-select { max-width: 285px; margin-bottom: 10px; }
.channel-fees .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 6px; gap: 8px; }
.channel-fees .metric { padding: 9px 11px; box-shadow: none; }
.channel-fees .metric strong { font-size: clamp(18px, 2.2vw, 28px); }
.channel-cumulative { margin: 7px 0 4px; }
.share-editor { border-top: 1px solid var(--line); padding-top: 12px; }
.share-editor .field, .share-actions { margin-top: 8px; }
.managed-project-list { display: grid; gap: 13px; }
.managed-project { padding: 15px 16px; }
.managed-project + .managed-project { margin-top: 0; }
.managed-project-head, .project-note-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.managed-project-head h2 { font-size: 18px; overflow-wrap: anywhere; }
.managed-project-badges, .managed-project-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.managed-project-head + .managed-project-actions { margin: 10px 0 12px; }
.project-visibility.outline { background: #eef4ea; border-color: #a8c1a4; }
.project-note-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 9px; }
.project-note-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #f8faf5; min-width: 0; }
.project-note-head h3 { font-size: 14px; }
.project-note-text { margin: 6px 0 9px; font-size: 13px; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
[data-channel-grants] { border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
[data-channel-grants] .checkbox-label + .checkbox-label { margin-top: 7px; }
[data-channel-grants] .form-hint { margin: 0 0 8px; }
.role-guide { margin-top: 10px; }
.role-guide summary { cursor: pointer; font-size: 14px; font-weight: 650; }
.role-guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 9px; margin-top: 9px; }
.role-detail { padding: 10px 12px; border-radius: 8px; background: #edf3e9; border: 1px solid #dce6d8; }
.role-detail h3 { font-size: 14px; }
.role-permissions { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.role-permissions li + li { margin-top: 4px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow); }
.panel.padded { padding: 18px; }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 16px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
.data-table th { padding: 11px 14px; color: #4d6454; background: #f3f6ef; font-size: 12px; font-weight: 680; white-space: nowrap; }
.data-table td { padding: 11px 14px; border-top: 1px solid #edf0eb; vertical-align: middle; }
.data-table td strong { overflow-wrap: anywhere; }
.data-table .actions { white-space: nowrap; }
.data-table .actions .button { min-height: 32px; padding: 5px 8px; }
.data-table .actions .button + .button { margin-left: 3px; }
.data-table .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.data-table .numeric { font-variant-numeric: tabular-nums; white-space: nowrap; }
.project-cell { min-width: 170px; }
.project-cell small { display: block; color: var(--muted); }
.report-description { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 130px; max-width: 360px; }
.danger-text { color: #9e332c !important; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric { padding: 15px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.metric span { font-size: 13px; color: #4b6353; font-weight: 620; }
.metric strong { display: block; font-size: clamp(25px, 3vw, 39px); line-height: 1.3; color: #1d4531; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric small { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }
.submetrics { display: flex; gap: 19px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin: -2px 0 18px; }
.submetrics strong { color: var(--ink); }
.lifetime-strip { margin: 17px 0 10px; }
.range-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 11px; padding: 11px 13px; margin-bottom: 14px; }
.range-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.range-date { color: #4f6958; font-variant-numeric: tabular-nums; font-size: 12px; white-space: nowrap; }
.range-tools .select { width: auto; max-width: min(260px, 100%); min-height: 36px; padding: 6px 9px; font-size: 13px; }
.chart-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px 12px; font-size: 12px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend span::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: #a9c7b1; }
.chart-legend span + span::before { background: #28563d; }
.trend-chart { padding: 8px 11px 2px; overflow-x: auto; }
.trend-chart svg { width: 100%; min-width: 490px; max-height: 240px; }
.trend-chart text { fill: #526b5c; font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-line { stroke: #e4ebe1; }
.chart-visits { fill: #a9c7b1; }
.chart-credits { fill: #28563d; }
.report-footnote { margin-top: 10px; }

.landing-panel { margin-bottom: 14px; }
.landing-body { padding: 14px 16px; }
.landing-addresses { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 0 12px; font-size: 13px; }
.landing-addresses div { display: flex; gap: 7px; min-width: 0; }
.landing-addresses dt { color: var(--muted); flex-shrink: 0; }
.landing-addresses dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.landing-actions, .landing-registration { display: flex; align-items: end; gap: 7px; flex-wrap: wrap; }
.landing-actions .field { flex: 1 1 230px; }
.landing-registration { align-items: center; }
.landing-body .form-hint { margin-top: 7px; }
.landing-registration .button { margin-top: 7px; }
.rule-note { padding: 11px 14px; margin-bottom: 14px; background: #e9f0e3; border: 1px solid #d9e5d4; border-radius: 9px; color: #355944; font-size: 13px; }
.qr-preview { width: min(210px, 100%); margin: 0 auto 12px; padding: 7px; border: 1px solid #dae4d6; border-radius: 11px; background: #fff; }
.qr-links { display: grid; gap: 10px; }
.input-action { display: flex; align-items: center; gap: 7px; }
.input-action input { flex: 1; min-width: 0; }
.qr-actions { justify-content: space-between; }
.checkbox-label { display: flex; gap: 8px; align-items: center; color: #395344; font-size: 14px; }
.checkbox-label input { accent-color: var(--green); width: 17px; height: 17px; }
.upload-group { display: grid; gap: 5px; min-width: 0; }
.upload-preview { display: flex; align-items: center; gap: 10px; }
.upload-preview img { width: 64px; height: 55px; object-fit: contain; background: #edf1e9; border: 1px solid var(--line); border-radius: 7px; }
.qr-thumb { width: 54px; height: 54px; object-fit: contain; padding: 3px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.current-qr { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 13px; }
.current-qr img { width: 92px; height: 92px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 5px; }
.dialog:has(.editor-layout) { width: min(990px, calc(100vw - 28px)); }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(255px, 305px); align-items: start; gap: 18px; }
.editor-preview { min-width: 0; position: sticky; top: 5px; border: 1px solid #d4dfd0; border-radius: 12px; background: #edf2e9; overflow: hidden; }
.editor-preview summary { padding: 9px 12px; cursor: pointer; color: #284d39; font-size: 14px; font-weight: 650; }
.editor-preview summary .tag { float: right; min-height: 22px; font-size: 11px; }
.editor-actions { position: sticky; z-index: 1; bottom: 0; align-items: center; margin: 15px -20px -23px; padding: 10px 20px 13px; background: var(--surface); border-top: 1px solid var(--line); }
.editor-actions .form-error { flex: 1 1 200px; margin: 0; }
.phone-preview { display: grid; gap: 9px; padding: 10px; }
.phone-preview .project-card { border-radius: 11px; }
.phone-preview .project-body { padding: 12px; }
.phone-preview .project-body h2 { font-size: 16px; }
.phone-preview .project-tail { flex-wrap: wrap; }
.preview-contact { display: grid; gap: 4px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; font-size: 12px; overflow-wrap: anywhere; }
.preview-contact img { width: 76px; height: 76px; object-fit: contain; }
.activity-filter { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; padding: 13px 15px; }
.activity-filter .field { min-width: 140px; }
.risk-lookup .field { flex: 1; }
.risk-reason { display: block; max-width: 220px; margin-top: 4px; color: var(--muted); overflow-wrap: anywhere; }
.pagination { display: flex; gap: 9px; align-items: center; justify-content: flex-end; padding: 12px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.panel-empty { color: var(--muted); padding: 24px 16px; text-align: center; }

@media (max-width: 970px) {
  .admin-shell { grid-template-columns: 174px minmax(0, 1fr); }
  .admin-content { padding-inline: 17px; }
  .admin-top { padding-inline: 17px; }
}
@media (max-width: 900px) {
  .source-panel .panel-head { flex-wrap: wrap; }
  .source-panel .data-table, .source-panel .data-table tbody { display: block; }
  .source-panel .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .source-panel .data-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px; padding: 12px 16px; }
  .source-panel .data-table tbody tr + tr { border-top: 1px solid var(--line); }
  .source-panel .data-table td { display: block; padding: 0; border: 0; }
  .source-panel .source-name, .source-panel .source-operations { grid-column: 1 / -1; }
  .source-panel .source-operations:not(:has(.source-row-actions)) { display: none; }
  .source-mobile-label { display: block; margin-bottom: 2px; color: var(--muted); font-size: 11px; font-weight: 550; }
  .source-row-actions { min-width: 0; }
}
@media (max-width: 415px) {
  .channel-fees .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .channel-fees .metric:last-child { grid-column: 1 / -1; }
}
@media (max-width: 759px) {
  .editor-layout { grid-template-columns: minmax(0, 1fr); gap: 11px; }
  .editor-preview { grid-row: 1; position: static; }
  .phone-preview { max-width: 365px; margin-inline: auto; }
}
@media (max-width: 680px) {
  .admin-shell { display: block; }
  .sidebar { position: static; display: grid; grid-template-columns: minmax(0, 1fr) auto; height: auto; gap: 11px; padding: 12px 13px 0; border: 0; border-bottom: 1px solid #dae2d6; }
  .sidebar .brand { padding-left: 0; margin: 0; }
  .nav-label { display: none; }
  .sidebar-footer { margin: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; grid-column: 2; grid-row: 1; }
  .sidebar-footer .button { font-size: 11px; padding: 5px 8px; }
  .admin-nav { grid-column: 1 / -1; flex-direction: row; overflow-x: auto; padding-bottom: 9px; }
  .admin-nav a { min-height: 35px; padding: 5px 8px; font-size: 13px; }
  .admin-nav svg { display: none; }
  .admin-top { height: 43px; padding-inline: 13px; font-size: 12px; }
  .admin-content { padding: 16px 12px 29px; }
  .page-head { align-items: flex-start; margin-bottom: 15px; }
  .page-head p { font-size: 12px; }
  .toolbar .button { min-height: 37px; padding: 6px 10px; font-size: 12px; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric { padding: 11px 10px; }
  .data-table th, .data-table td { padding-inline: 9px; }
  .activity-filter .field { flex: 1; min-width: 110px; }
  .range-bar { padding: 9px; }
  .range-tools { gap: 6px; }
  .range-tools .select { max-width: 145px; }
  .range-bar .chip { min-height: 31px; }
  .editor-actions { margin-inline: -14px; padding-inline: 14px; }
  .panel-head:has(#quick-search) { align-items: flex-start; flex-direction: column; }
}
