:root {
    --color-brand: #0a2050;
    --color-blue: #1f5bd6;
    --color-yellow: #fbcb09;
    --color-red: #e31e2a;
    --color-text: #172033;
    --color-muted: #8a8578;
    --color-border: #e4e0d8;
    --color-soft: #f7f5f1;
    --color-white: #ffffff;
    --shadow-soft: 0 12px 28px rgba(10, 32, 80, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--color-white);
    color: var(--color-text);
    font-family: Arial, Helvetica, sans-serif;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--color-white);
}

a {
    color: var(--color-brand);
    text-decoration: none;
}

input,
button,
select {
    font: inherit;
}

.flag-line {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    height: 5px;
}

.flag-yellow {
    background: var(--color-yellow);
}

.flag-blue {
    background: var(--color-blue);
}

.flag-red {
    background: var(--color-red);
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 72px;
    padding: 14px clamp(18px, 4vw, 48px);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-white);
}

.header-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: var(--color-text);
}

.header-brand img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.header-brand span {
    display: grid;
    gap: 2px;
}

.header-brand strong {
    color: var(--color-brand);
    letter-spacing: 0;
}

.header-brand small {
    color: var(--color-muted);
    font-size: 12px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.main-nav a {
    min-height: 36px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--color-text);
    font-size: 14px;
}

.logout-form {
    margin: 0;
}

.logout-form button {
    min-height: 36px;
    padding: 9px 11px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-white);
    color: var(--color-red);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}

.main-nav a:hover,
.main-nav a:focus,
.logout-form button:hover,
.logout-form button:focus {
    border-color: var(--color-border);
    background: var(--color-soft);
}

.app-main {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0;
}

.login-shell {
    display: grid;
    min-height: calc(100vh - 120px);
    place-items: center;
    padding: 24px 0;
}

.login-panel {
    width: min(460px, 100%);
    padding: 28px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-white);
    box-shadow: var(--shadow-soft);
}

.brand-block {
    display: grid;
    gap: 8px;
    margin-bottom: 22px;
}

.brand-logo {
    width: 220px;
    height: 74px;
    object-fit: contain;
}

.eyebrow {
    margin: 0;
    color: var(--color-brand);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    color: var(--color-text);
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.1;
    letter-spacing: 0;
}

p {
    line-height: 1.5;
}

.brand-block p:last-child,
.page-header p:last-child,
.form-note {
    margin: 0;
    color: var(--color-muted);
}

.form-stack {
    display: grid;
    gap: 16px;
}

.form-stack label {
    display: grid;
    gap: 7px;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 700;
}

.form-stack input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-white);
    color: var(--color-text);
}

.form-stack input:focus {
    border-color: var(--color-blue);
    outline: 3px solid rgba(31, 91, 214, 0.18);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
}

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

.button-secondary {
    border-color: var(--color-border);
    background: var(--color-white);
    color: var(--color-text);
}

.button-danger {
    background: var(--color-red);
    color: var(--color-white);
}

.button-primary:hover,
.button-primary:focus {
    background: #07183c;
}

.alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.45;
}

.alert-error {
    border: 1px solid rgba(227, 30, 42, 0.3);
    background: rgba(227, 30, 42, 0.08);
    color: #8c1018;
}

.alert-success {
    border: 1px solid rgba(10, 32, 80, 0.22);
    background: rgba(10, 32, 80, 0.07);
    color: var(--color-brand);
}

.alert-warning {
    border: 1px solid rgba(251, 203, 9, 0.55);
    background: rgba(251, 203, 9, 0.14);
    color: #5c4700;
}

.alert-info {
    border: 1px solid rgba(31, 91, 214, 0.24);
    background: rgba(31, 91, 214, 0.08);
    color: #113b93;
}

.form-note {
    margin-top: 16px;
    font-size: 13px;
}

.page-header {
    display: grid;
    gap: 8px;
    margin-bottom: 28px;
}

.page-header-row {
    grid-template-columns: 1fr auto;
    align-items: end;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.session-line {
    font-size: 14px;
}

.dashboard-section {
    display: grid;
    gap: 14px;
    margin-bottom: 26px;
}

.dashboard-section h2 {
    margin: 0;
    color: var(--color-brand);
    font-size: 20px;
}

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

.metric-grid-compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card {
    display: grid;
    gap: 12px;
    min-height: 118px;
    padding: 20px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-white);
}

.metric-card span {
    color: var(--color-muted);
    font-size: 14px;
}

.metric-card strong {
    color: var(--color-brand);
    font-size: 36px;
    line-height: 1;
}

.form-panel,
.table-shell {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-white);
}

.form-panel {
    padding: 22px;
    margin-bottom: 20px;
}

.danger-panel {
    border-color: rgba(206, 17, 38, 0.35);
}

.danger-panel h2 {
    margin: 0 0 16px;
    font-size: 20px;
}

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

.form-grid label {
    display: grid;
    gap: 7px;
    font-size: 14px;
    font-weight: 700;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-white);
    color: var(--color-text);
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
    border-color: var(--color-blue);
    outline: 3px solid rgba(31, 91, 214, 0.18);
}

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

.form-section-title {
    grid-column: 1 / -1;
    margin: 8px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
    color: var(--color-brand);
    font-size: 18px;
}

.form-section-title:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.full-span {
    grid-column: 1 / -1;
}

.geo-division-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.checkbox-label {
    align-items: center;
    grid-template-columns: auto 1fr;
}

.checkbox-label input {
    width: 18px;
    min-height: 18px;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    grid-column: 1 / -1;
}

.table-shell {
    overflow-x: auto;
}

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

.pagination p {
    margin: 0;
}

.pagination div {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.data-table th,
.data-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--color-muted);
    font-size: 13px;
    text-transform: uppercase;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
}

.badge-ok {
    background: rgba(10, 32, 80, 0.08);
    color: var(--color-brand);
}

.badge-danger {
    background: rgba(227, 30, 42, 0.08);
    color: var(--color-red);
}

.actions-cell {
    white-space: nowrap;
}

.actions-cell > a,
.actions-cell > form {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.actions-cell form {
    margin: 0;
}

.actions-cell > * + * {
    margin-left: 16px;
}

.link-danger {
    border: 0;
    background: transparent;
    color: var(--color-red);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-panel {
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-white);
}

.detail-panel h2,
.detail-table h2 {
    margin: 0 0 14px;
    color: var(--color-brand);
    font-size: 18px;
}

.detail-panel dl {
    display: grid;
    gap: 10px;
    margin: 0;
}

.detail-panel dt {
    color: var(--color-muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.detail-panel dd {
    margin: -6px 0 0;
}

.report-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--color-border);
}

.report-hero h2 {
    margin: 0 0 6px;
    color: var(--color-brand);
    font-size: 26px;
}

.report-hero p {
    margin: 0;
    color: var(--color-muted);
}

.report-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.report-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--color-border);
}

.report-nav a {
    min-height: 38px;
    padding: 9px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
    font-size: 14px;
}

.report-nav a.is-active {
    border-color: rgba(31, 91, 214, 0.35);
    background: rgba(31, 91, 214, 0.08);
    color: var(--color-brand);
    font-weight: 700;
}

.report-dashboard {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.report-summary-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-white);
}

.report-card-primary {
    grid-column: span 2;
}

.report-export-card {
    border-color: rgba(31, 91, 214, 0.3);
    background: rgba(31, 91, 214, 0.04);
}

.report-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.report-card-header h2 {
    margin: 0;
    color: var(--color-brand);
    font-size: 22px;
}

.report-kpi-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.report-kpi-row span,
.report-note {
    color: var(--color-muted);
    font-size: 13px;
}

.report-kpi-row span {
    display: inline-flex;
    gap: 5px;
    align-items: baseline;
    padding: 7px 9px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
}

.report-kpi-row strong {
    color: var(--color-brand);
    font-size: 18px;
}

.report-stack {
    display: flex;
    width: 100%;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--color-soft);
}

.report-stack span:nth-child(1) {
    background: var(--color-blue);
}

.report-stack span:nth-child(2) {
    background: var(--color-yellow);
}

.report-stack span:nth-child(3) {
    background: var(--color-red);
}

.report-stack span:nth-child(4) {
    background: var(--color-muted);
}

.report-mini-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    margin: 0;
}

.report-mini-list dt {
    color: var(--color-muted);
    font-size: 13px;
}

.report-mini-list dd {
    margin: 0;
    color: var(--color-brand);
    font-weight: 700;
}

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

.report-bar-row {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr) 58px;
    gap: 10px;
    align-items: center;
    color: var(--color-muted);
    font-size: 13px;
}

.report-bar-row i {
    display: block;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--color-soft);
}

.report-bar-row b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--color-blue);
}

.report-bar-row strong {
    color: var(--color-brand);
    text-align: right;
}

.report-progress {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--color-soft);
}

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

.report-check-list {
    display: grid;
    gap: 8px;
}

.report-check-inline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-check-list div {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
}

.report-check-list strong {
    color: var(--color-brand);
}

.report-check-list span {
    color: var(--color-text);
    font-weight: 700;
}

.report-check-list small {
    color: var(--color-muted);
}

.report-check-list .is-ok {
    background: rgba(31, 91, 214, 0.04);
}

.report-check-list .is-warning {
    border-color: rgba(227, 30, 42, 0.35);
    background: rgba(227, 30, 42, 0.04);
}

.report-filter-panel {
    margin-bottom: 18px;
}

.report-section {
    margin-bottom: 22px;
}

.report-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.report-section-header h2 {
    margin: 0 0 4px;
    color: var(--color-brand);
    font-size: 20px;
}

.report-section-header p {
    margin: 0;
    color: var(--color-muted);
}

.report-metric-grid {
    margin-bottom: 22px;
}

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

.detail-panel h3 {
    margin: 0 0 14px;
    color: var(--color-brand);
    font-size: 18px;
}

.monthly-activity {
    display: grid;
    gap: 16px;
    margin-bottom: 22px;
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-white);
}

.monthly-activity-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.monthly-activity-header h2 {
    margin: 0 0 4px;
    color: var(--color-brand);
    font-size: 20px;
}

.monthly-activity-header p {
    margin: 0;
    color: var(--color-muted);
}

.monthly-activity-summary {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.monthly-activity-summary span {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    min-height: 32px;
    padding: 6px 9px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-muted);
    font-size: 12px;
}

.monthly-activity-summary strong {
    color: var(--color-brand);
    font-size: 16px;
}

.month-controls {
    display: flex;
    align-items: end;
    gap: 8px;
    flex-wrap: wrap;
}

.month-controls label {
    display: grid;
    gap: 4px;
    color: var(--color-muted);
    font-size: 12px;
    font-weight: 700;
}

.month-controls input {
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-text);
}

.report-legend {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.report-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-muted);
    font-size: 12px;
}

.report-legend strong {
    color: var(--color-brand);
}

.month-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.month-weekday {
    color: var(--color-muted);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
}

.month-day {
    display: grid;
    gap: 3px;
    min-height: 86px;
    padding: 7px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-white);
}

.month-day-empty {
    border-color: transparent;
    background: transparent;
}

.month-day-active {
    border-color: rgba(31, 91, 214, 0.28);
    background: rgba(31, 91, 214, 0.05);
}

.month-day strong {
    color: var(--color-brand);
    font-size: 13px;
    line-height: 1;
}

.month-day span {
    color: var(--color-muted);
    font-size: 11px;
    line-height: 1.1;
}

.compact-table {
    max-height: 360px;
    overflow: auto;
}

.compact-table .data-table,
.report-daily-table {
    min-width: 860px;
}

.activity-chart {
    display: grid;
    grid-template-columns: repeat(31, minmax(12px, 1fr));
    gap: 4px;
    align-items: end;
    min-height: 130px;
    padding: 12px 8px 6px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-soft);
}

.activity-day-bar {
    display: grid;
    grid-template-rows: minmax(80px, 1fr) auto;
    gap: 6px;
    align-items: end;
    min-width: 0;
}

.activity-day-bar span {
    display: block;
    width: 100%;
    min-height: 1px;
    border-radius: 4px 4px 0 0;
    background: var(--color-blue);
}

.activity-day-bar small {
    color: var(--color-muted);
    font-size: 10px;
    text-align: center;
}

.report-calendar-compact .month-day {
    min-height: 80px;
}

.analytics-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-white);
}

.analytics-hero h2 {
    margin: 0 0 6px;
    color: var(--color-brand);
    font-size: 28px;
}

.analytics-hero p {
    margin: 0;
    color: var(--color-muted);
}

.analytics-hero-metrics {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.analytics-hero-metrics span {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    color: var(--color-muted);
    font-size: 13px;
}

.analytics-hero-metrics strong {
    color: var(--color-brand);
    font-size: 18px;
}

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

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

.analytics-panel {
    display: grid;
    gap: 14px;
}

.analytics-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.analytics-panel-header h2 {
    margin: 0;
    color: var(--color-brand);
    font-size: 20px;
}

.analytics-split {
    display: flex;
    width: 100%;
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--color-soft);
}

.analytics-split span {
    display: block;
}

.analytics-public {
    background: var(--color-yellow);
}

.analytics-private {
    background: var(--color-blue);
}

.analytics-kv {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px 14px;
    margin: 0;
}

.analytics-kv dt {
    color: var(--color-muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.analytics-kv dd {
    margin: 0;
    color: var(--color-brand);
    font-weight: 700;
}

.analytics-bar-list,
.analytics-list {
    display: grid;
    gap: 11px;
}

.analytics-bar-row,
.analytics-route-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr) 70px;
    gap: 10px;
    align-items: center;
}

.analytics-bar-row span,
.analytics-route-row span,
.analytics-route-row em,
.analytics-day-row span,
.analytics-day-row small {
    color: var(--color-muted);
    font-size: 13px;
    font-style: normal;
}

.analytics-bar-row i,
.analytics-route-row i {
    display: block;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--color-soft);
}

.analytics-bar-row b,
.analytics-route-row b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--color-blue);
}

.analytics-bar-row strong,
.analytics-route-row em {
    color: var(--color-brand);
    font-weight: 700;
    text-align: right;
}

.analytics-route-row {
    grid-template-columns: minmax(160px, 1fr) minmax(100px, 220px) 78px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
}

.analytics-route-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.analytics-route-row div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.analytics-route-row strong {
    color: var(--color-brand);
    overflow-wrap: anywhere;
}

.analytics-daily-chart {
    display: grid;
    grid-template-columns: repeat(14, minmax(18px, 1fr));
    gap: 6px;
    align-items: end;
    min-height: 132px;
    padding: 12px 10px 8px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-soft);
}

.analytics-day-bar {
    display: grid;
    grid-template-rows: minmax(82px, 1fr) auto;
    gap: 6px;
    align-items: end;
    min-width: 0;
}

.analytics-day-bar span {
    display: block;
    width: 100%;
    min-height: 1px;
    border-radius: 4px 4px 0 0;
    background: var(--color-blue);
}

.analytics-day-bar small {
    color: var(--color-muted);
    font-size: 10px;
    text-align: center;
}

.analytics-daily-list {
    max-height: 220px;
    overflow: auto;
    padding-right: 4px;
}

.analytics-day-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto;
    gap: 4px 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
}

.analytics-day-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.analytics-day-row strong {
    color: var(--color-brand);
}

.analytics-day-row small {
    grid-column: 1 / -1;
}

.analytics-table {
    margin-bottom: 20px;
}

.analytics-table .data-table {
    min-width: 1040px;
}

.analytics-area-badge {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
}

.analytics-area-badge.is-public {
    background: rgba(251, 203, 9, 0.22);
    color: var(--color-brand);
}

.analytics-area-badge.is-private {
    background: rgba(31, 91, 214, 0.1);
    color: var(--color-brand);
}

.detail-table {
    padding: 18px;
}

.audit-table .data-table {
    min-width: 980px;
}

.metadata-code {
    display: block;
    max-width: 360px;
    color: var(--color-muted);
    font-size: 12px;
    overflow-wrap: anywhere;
    white-space: normal;
}

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

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

.warning-panel {
    margin-bottom: 20px;
}

.inline-table {
    grid-column: 1 / -1;
    margin-bottom: 18px;
    overflow-x: auto;
}

.inline-table .data-table {
    min-width: 680px;
}

.compact-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.coordinate-picker {
    display: grid;
    gap: 12px;
}

.coordinate-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.coordinate-picker-header h2 {
    margin: 0;
    color: var(--color-brand);
    font-size: 18px;
}

.coordinate-picker-header output {
    min-width: 170px;
    color: var(--color-muted);
    font-size: 13px;
    text-align: right;
}

.coordinate-map {
    position: relative;
    min-height: 420px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #edf2f7;
    cursor: crosshair;
    overflow: hidden;
}

.coordinate-map:focus {
    border-color: var(--color-blue);
    outline: 3px solid rgba(31, 91, 214, 0.18);
}

.coordinate-map .leaflet-control-attribution {
    font-size: 11px;
}

.coordinate-map .leaflet-control-attribution a {
    color: var(--color-blue);
}

.coordinate-picker-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.public-main {
    max-width: 1280px;
}

.public-header .main-nav {
    justify-content: flex-end;
}

.public-map-section {
    margin-bottom: 24px;
}

.public-map {
    min-height: 460px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #edf2f7;
    overflow: hidden;
}

.public-map-large {
    min-height: 560px;
}

.public-map .leaflet-popup-content {
    min-width: 190px;
    color: var(--color-ink);
}

.public-map .leaflet-popup-content strong,
.public-map .leaflet-popup-content span,
.public-map .leaflet-popup-content a {
    display: block;
    margin-bottom: 5px;
}

.public-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.public-card {
    display: grid;
    gap: 14px;
    min-height: 100%;
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-white);
}

.public-card h3 {
    margin: 4px 0 8px;
    color: var(--color-brand);
    font-size: 19px;
}

.public-card p {
    margin: 0;
    color: var(--color-muted);
}

.public-card-meta {
    display: grid;
    grid-template-columns: minmax(88px, auto) minmax(0, 1fr);
    gap: 6px 10px;
    margin: 0;
}

.public-card-meta dt {
    color: var(--color-muted);
    font-size: 12px;
}

.public-card-meta dd {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
}

.empty-state {
    padding: 22px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-soft);
}

.empty-state h2 {
    margin: 0 0 8px;
    color: var(--color-brand);
    font-size: 20px;
}

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

@media (max-width: 760px) {
    .app-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .main-nav {
        justify-content: flex-start;
    }

    .app-main {
        width: min(100% - 24px, 1120px);
        padding: 28px 0;
    }

    .login-panel {
        padding: 22px;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .page-header-row,
    .analytics-hero,
    .analytics-grid,
    .report-hero,
    .report-dashboard,
    .report-columns,
    .detail-grid,
    .compact-form,
    .geo-division-fields,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .report-card-primary {
        grid-column: auto;
    }

    .report-card-header {
        flex-direction: column;
    }

    .report-card-header .button {
        width: 100%;
    }

    .report-bar-row {
        grid-template-columns: 104px minmax(0, 1fr) 48px;
    }

    .report-check-inline,
    .report-check-list div {
        grid-template-columns: 1fr;
    }

    .report-nav a {
        flex: 1 1 150px;
        text-align: center;
    }

    .analytics-metrics {
        grid-template-columns: 1fr;
    }

    .analytics-hero-metrics {
        justify-content: flex-start;
    }

    .analytics-hero-metrics span {
        width: 100%;
    }

    .analytics-bar-row,
    .analytics-route-row,
    .analytics-day-row {
        grid-template-columns: 1fr;
    }

    .analytics-bar-row strong,
    .analytics-route-row em {
        text-align: left;
    }

    .analytics-daily-chart {
        overflow-x: auto;
        grid-template-columns: repeat(14, minmax(22px, 1fr));
    }

    .header-actions {
        justify-content: stretch;
    }

    .header-actions .button {
        width: 100%;
    }

    .form-actions {
        justify-content: stretch;
    }

    .form-actions .button,
    .form-actions button {
        width: 100%;
    }

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

    .coordinate-picker-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .coordinate-picker-header output {
        min-width: 0;
        text-align: left;
    }

    .coordinate-map {
        min-height: 240px;
    }

    .coordinate-picker-actions .button {
        width: 100%;
    }

    .public-map,
    .public-map-large {
        min-height: 360px;
    }

    .public-card-grid {
        grid-template-columns: 1fr;
    }

    .monthly-activity-header {
        flex-direction: column;
    }

    .monthly-activity-summary {
        justify-content: flex-start;
    }

    .month-controls,
    .month-controls .button,
    .month-controls button,
    .month-controls label,
    .month-controls input {
        width: 100%;
    }

    .month-calendar {
        gap: 4px;
    }

    .month-day {
        min-height: 72px;
        padding: 6px 5px;
    }

    .month-day span {
        font-size: 10px;
    }

    .activity-chart {
        overflow-x: auto;
        grid-template-columns: repeat(31, minmax(18px, 1fr));
    }
}
