:root {
    --primary: #00589b;
    --primary-dark: #1f3a5f;
    --primary-soft: #dceaf5;
    --airnav-red: #d71920;
    --red-soft: #f7dfdf;
    --secondary: #5b7290;
    --background: #f6f8fb;
    --surface: #ffffff;
    --surface-muted: #eef4fa;
    --border: #d7dee8;
    --text: #1f2937;
    --muted: #5b6472;
    --success: #2f6e4f;
    --success-soft: #dcefe4;
    --warning: #8a6a2f;
    --warning-soft: #f6ecd8;
    --danger: #8c3d3d;
    --danger-soft: #f4dfdf;
    --info: #3d5f8c;
    --info-soft: #dee8f5;
    --neutral-soft: #edf1f5;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 14px;
    --shadow: 0 8px 24px rgba(31, 58, 95, 0.06);
    --font-heading: "Sora", "IBM Plex Sans", Arial, sans-serif;
    --font-body: "IBM Plex Sans", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
}

html,
body {
    overflow-x: clip;
}

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

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
}

h1,
h2,
h3 {
    margin: 0;
    font-family: var(--font-heading);
    color: var(--text);
    letter-spacing: 0;
}

h1 {
    font-size: 20px;
    line-height: 1.3;
}

h2 {
    font-size: 26px;
    line-height: 1.25;
}

h3 {
    font-size: 18px;
    line-height: 1.35;
}

p {
    margin: 0;
}

code {
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--neutral-soft);
    color: var(--primary-dark);
}

.muted,
.helper-text,
.subtle {
    color: var(--muted);
}

.helper-text {
    margin-top: 12px;
    font-size: 13px;
}

.eyebrow {
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: var(--surface);
    padding: 18px 14px;
    z-index: 20;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 16px;
    color: var(--text);
}

.sidebar-brand img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.sidebar-brand strong,
.sidebar-brand small {
    display: block;
}

.sidebar-brand strong {
    font-family: var(--font-heading);
    font-size: 17px;
}

.sidebar-brand small {
    color: var(--muted);
}

.sidebar-nav {
    display: grid;
    gap: 4px;
    margin-top: 8px;
}

.sidebar-nav a,
.logout-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 600;
}

.sidebar-nav a svg,
.logout-link svg {
    width: 18px;
    height: 18px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.sidebar-footer {
    display: grid;
    gap: 10px;
    margin-top: auto;
    padding: 12px 10px 4px;
    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sidebar-user strong,
.sidebar-user small {
    display: block;
}

.sidebar-user strong {
    overflow: hidden;
    color: var(--text);
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.role-pill {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 9px;
    background: var(--surface-muted);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
}

.main-area {
    min-width: 0;
    padding: 22px 24px 32px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.topbar-kicker {
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 210px;
    justify-content: flex-end;
}

.user-chip strong,
.user-chip small {
    display: block;
}

.user-chip small {
    color: var(--muted);
}

.avatar {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 800;
    flex: 0 0 auto;
    overflow: hidden;
}

.avatar.image {
    display: block;
    object-fit: cover;
    padding: 0;
}

.page-grid {
    display: grid;
    gap: 16px;
}

.content-grid {
    display: grid;
    gap: 16px;
}

.content-grid.two {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.3fr);
}

.panel,
.login-card,
.install-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel {
    padding: 18px;
}

.narrow-panel {
    max-width: 980px;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 16px;
}

.panel-head > div {
    min-width: 0;
}

.panel-head p {
    margin-top: 3px;
    color: var(--muted);
}

.welcome-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #eef4fa;
    padding: 20px;
}

.welcome-band p:not(.eyebrow) {
    max-width: 680px;
    margin-top: 8px;
    color: var(--muted);
}

.welcome-band img {
    width: 110px;
    height: 76px;
    object-fit: contain;
}

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

.stat-card {
    display: grid;
    gap: 6px;
    min-height: 118px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    background: var(--surface);
}

.stat-card span {
    color: var(--muted);
    font-weight: 600;
}

.stat-card strong {
    color: var(--primary-dark);
    font-family: var(--font-heading);
    font-size: 24px;
    line-height: 1.2;
}

.stat-card small {
    color: var(--muted);
}

.stat-card.blue {
    background: #eef4fa;
}

.stat-card.green {
    background: #eef7f1;
}

.stat-card.sand {
    background: #faf5ec;
}

.stat-card.rose {
    background: #faf0f1;
}

.stat-card.lavender {
    background: #f3f0fa;
}

.stat-card.slate {
    background: #edf1f5;
}

.operator-chart-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
    gap: 14px;
}

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

.dashboard-kpi-grid .stat-card strong {
    font-size: 30px;
    line-height: 1.12;
    word-break: break-word;
}

.dashboard-kpi-grid .stat-card strong.compact-currency {
    font-size: 26px;
    line-height: 1.16;
}

.chart-panel {
    min-height: 230px;
}

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

.stacked-chart {
    display: flex;
    width: 100%;
    height: 28px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--neutral-soft);
}

.status-bars {
    display: grid;
    gap: 12px;
}

.status-bar-row {
    display: grid;
    gap: 6px;
}

.status-bar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-weight: 700;
}

.status-bar-head span {
    color: var(--muted);
}

.status-bar-head strong {
    color: var(--primary-dark);
}

.status-bar-track {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--neutral-soft);
}

.status-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.status-fill.valid {
    background: var(--success);
}

.status-fill.invoiced {
    background: var(--primary);
}

.status-fill.draft {
    background: var(--warning);
}

.branch-bars {
    display: grid;
    gap: 10px;
}

.branch-bar-row {
    display: grid;
    gap: 6px;
}

.branch-bar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.branch-bar-head span {
    color: var(--muted);
    font-weight: 700;
}

.branch-bar-head strong {
    color: var(--primary-dark);
}

.branch-bar-track {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--neutral-soft);
}

.branch-bar-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
}

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

.top-branch-row {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.top-branch-rank {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 800;
}

.top-branch-main {
    display: grid;
    gap: 6px;
}

.top-branch-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.top-branch-head span {
    color: var(--muted);
    font-weight: 700;
}

.top-branch-head strong {
    color: var(--primary-dark);
}

.top-branch-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: var(--neutral-soft);
    overflow: hidden;
}

.top-branch-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
}

.stack {
    display: block;
    min-width: 4px;
}

.stack.valid,
.legend-dot.valid {
    background: var(--success);
}

.stack.invoiced,
.legend-dot.invoiced {
    background: var(--primary);
}

.stack.draft,
.legend-dot.draft {
    background: var(--warning);
}

.legend-dot.warning {
    background: var(--warning);
}

.legend-dot.other {
    background: var(--secondary);
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-top: 14px;
}

.chart-legend.vertical {
    display: grid;
    gap: 9px;
    margin-top: 0;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-weight: 600;
}

.chart-legend strong {
    color: var(--text);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.donut-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.donut-chart {
    position: relative;
    display: grid;
    place-items: center;
    width: 132px;
    height: 132px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.donut-chart::after {
    position: absolute;
    inset: 22px;
    border-radius: 50%;
    background: var(--surface);
    content: "";
}

.donut-chart span {
    position: relative;
    z-index: 1;
    color: var(--primary-dark);
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
}

.progress-card {
    display: grid;
    gap: 12px;
}

.progress-card strong {
    color: var(--primary-dark);
    font-family: var(--font-heading);
    font-size: 36px;
    line-height: 1;
}

.progress-card p {
    color: var(--muted);
}

.progress-track {
    width: 100%;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--neutral-soft);
}

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

.mini-bars {
    display: flex;
    align-items: end;
    gap: 14px;
    height: 150px;
    border-bottom: 1px solid var(--border);
    padding: 8px 4px 0;
}

.mini-bar-item {
    display: grid;
    grid-template-rows: 1fr auto;
    align-items: end;
    justify-items: center;
    gap: 8px;
    height: 100%;
    flex: 1;
    min-width: 34px;
}

.mini-bar-item span {
    display: block;
    width: 100%;
    max-width: 42px;
    border-radius: 8px 8px 0 0;
    background: var(--primary);
}

.mini-bar-item small {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.monthly-invoice-bars .mini-bar-item {
    grid-template-rows: auto 1fr auto;
}

.monthly-invoice-bars .mini-bar-item em {
    color: var(--primary-dark);
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.1;
}

.chart-flat-value {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.chart-flat-value strong {
    color: var(--primary-dark);
}

.compact-bars {
    height: 126px;
    gap: 10px;
    padding-top: 4px;
}

.compact-bars .mini-bar-item {
    min-width: 28px;
    gap: 6px;
}

.compact-bars .mini-bar-item span {
    max-width: 28px;
    border-radius: 6px 6px 0 0;
}

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

html.js-enabled:not(.tables-ready) .table-wrap table tbody {
    visibility: hidden;
}

.table-pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.table-pager .btn.small {
    min-height: 32px;
    padding: 6px 10px;
}

.table-pager-pages {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.table-page-btn {
    min-width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.table-page-btn.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.table-page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th,
td {
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #f0f4f8;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

td {
    color: var(--text);
    font-size: 13px;
}

tbody tr:hover {
    background: #f8fafc;
}

tfoot td {
    background: #f8fafc;
    font-weight: 600;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.badge.success {
    background: var(--success-soft);
    color: var(--success);
}

.badge.warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.badge.danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.badge.info {
    background: var(--info-soft);
    color: var(--info);
}

.badge.neutral {
    background: var(--neutral-soft);
    color: var(--muted);
}

.btn,
button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.btn svg {
    width: 17px;
    height: 17px;
}

.btn.primary {
    background: var(--primary);
    color: #ffffff;
}

.btn.primary:hover {
    background: var(--primary-dark);
    color: #ffffff;
}

.btn.secondary {
    border-color: var(--border);
    background: var(--surface);
    color: var(--primary-dark);
}

.btn.secondary:hover {
    background: var(--primary-soft);
}

.btn.success {
    background: var(--success);
    color: #ffffff;
}

.btn.danger {
    background: var(--danger);
    color: #ffffff;
}

.btn.small {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 13px;
}

.btn.full {
    width: 100%;
}

.button-row,
.filter-actions,
.form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.stack {
    display: grid;
    gap: 12px;
}

.form-grid,
.filter-bar {
    display: grid;
    gap: 12px;
}

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

.filter-bar {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    align-items: end;
    gap: 10px;
}

.filter-bar input,
.filter-bar select {
    min-height: 36px;
    padding: 7px 10px;
}

.filter-bar label span {
    font-size: 12px;
}

.filter-bar .filter-actions {
    justify-content: flex-end;
}

.compact-filter-panel {
    padding: 14px;
}

.flight-filter {
    grid-template-columns: minmax(220px, 1.6fr) repeat(5, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}

.flight-filter .filter-search {
    grid-column: auto;
}

.flight-filter label {
    min-width: 0;
    gap: 7px;
}

.flight-filter input,
.flight-filter .pretty-select-trigger {
    min-height: 40px;
}

.flight-filter .filter-actions {
    grid-column: 1 / -1;
    align-self: end;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.ops-flight-filter {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 12px;
}

.ops-flight-filter .filter-search {
    grid-column: 1 / span 2;
}

.ops-flight-filter .ops-filter-movement {
    grid-column: 3;
}

.ops-flight-filter .ops-filter-status {
    grid-column: 4;
}

.ops-flight-filter .ops-filter-month {
    grid-column: 1;
}

.ops-flight-filter .ops-filter-year {
    grid-column: 2;
}

.ops-flight-filter .filter-actions {
    grid-column: 3 / span 2;
    justify-content: flex-end;
}

.ops-branch-select-panel {
    margin-left: 18px;
}

.ops-branch-select-table table th:last-child,
.ops-branch-select-table table td:last-child {
    text-align: right;
    width: 148px;
}

.ops-branch-select-action .btn {
    min-width: 114px;
}

.invoice-filter.finance-filter {
    grid-template-columns: 1.2fr 0.9fr 0.9fr 1fr auto;
}

.invoice-filter.branch-filter {
    grid-template-columns: 1fr 1fr 1.2fr auto;
}

.invoice-filter .filter-actions {
    align-self: end;
}

.invoice-table th,
.invoice-table td {
    padding: 8px 6px;
    font-size: 12px;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.invoice-table th {
    font-size: 10px;
    letter-spacing: 0;
}

.invoice-table td strong {
    font-weight: 700;
}

.invoice-table .badge {
    min-height: 20px;
    padding: 2px 7px;
    font-size: 10px;
    max-width: 100%;
}

.invoice-table .table-actions {
    gap: 5px;
}

.invoice-table .icon-link,
.invoice-table button.icon-link {
    width: 30px;
    height: 30px;
}

.invoice-table .payment-cell a {
    font-size: 11px;
    font-weight: 600;
}

.invoice-table .invoice-action-cell {
    min-width: 0;
    overflow: visible;
}

.invoice-table {
    width: 100%;
    table-layout: fixed;
}

.invoice-table th:nth-child(1),
.invoice-table td:nth-child(1) { width: 17%; }
.invoice-table th:nth-child(2),
.invoice-table td:nth-child(2) { width: 9%; }
.invoice-table th:nth-child(3),
.invoice-table td:nth-child(3) { width: 8%; }
.invoice-table th:nth-child(4),
.invoice-table td:nth-child(4) { width: 8%; }
.invoice-table th:nth-child(5),
.invoice-table td:nth-child(5) { width: 10%; }
.invoice-table th:nth-child(6),
.invoice-table td:nth-child(6) { width: 9%; }
.invoice-table th:nth-child(7),
.invoice-table td:nth-child(7) { width: 16%; }
.invoice-table th:nth-child(8),
.invoice-table td:nth-child(8) { width: 13%; }
.invoice-table th:nth-child(9),
.invoice-table td:nth-child(9) { width: 10%; }

.invoice-table .table-actions {
    justify-content: center;
}

.payment-filter {
    grid-template-columns: 1.2fr 1fr auto;
}

.payment-filter .filter-actions {
    align-self: end;
}

.report-filter {
    grid-template-columns: 0.9fr 0.9fr 1.2fr auto;
}

.report-filter .filter-actions {
    align-self: end;
}

.dashboard-filter {
    grid-template-columns: 0.9fr 0.9fr 1.2fr auto;
}

.dashboard-filter.no-branch {
    grid-template-columns: 0.9fr 0.9fr auto;
}

.dashboard-filter .filter-actions {
    align-self: end;
}

.compact-filter-panel input,
.compact-filter-panel select {
    min-height: 36px;
    padding: 7px 10px;
}

.compact-filter-panel label span {
    font-size: 12px;
}

label {
    display: grid;
    gap: 6px;
    color: var(--text);
    font-weight: 700;
}

label span {
    font-size: 13px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    min-height: 40px;
    padding: 9px 11px;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(0, 88, 155, 0.18);
    outline-offset: 2px;
    border-color: var(--primary);
}

input:disabled {
    background: #f0f4f8;
    color: var(--muted);
}

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

.check-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.check-line input {
    width: 16px;
    height: 16px;
    min-height: 16px;
}

.alert {
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 12px;
    font-weight: 700;
}

.alert.success {
    background: var(--success-soft);
    color: var(--success);
}

.alert.warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.alert.danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.empty-state {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 160px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    background: #fafcff;
    color: var(--muted);
    text-align: center;
}

.empty-state svg {
    width: 28px;
    height: 28px;
    color: var(--secondary);
}

.table-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.table-actions form {
    margin: 0;
}

.icon-link,
button.icon-link {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--primary-dark);
    cursor: pointer;
}

.icon-link svg {
    width: 16px;
    height: 16px;
}

.icon-link:hover {
    background: var(--primary-soft);
}

.icon-link.primary-action {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.icon-link.primary-action:hover {
    background: var(--primary-dark);
    color: #ffffff;
}

.icon-link.danger-action {
    border-color: var(--danger);
    background: var(--danger-soft);
    color: var(--danger);
}

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

.detail-grid > div,
.summary-lines > div {
    display: grid;
    gap: 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    background: #fafcff;
}

.detail-grid span,
.summary-lines span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.detail-grid strong,
.summary-lines strong {
    color: var(--primary-dark);
}

.note-box {
    margin-top: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fafcff;
    padding: 12px;
}

.note-box span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-weight: 700;
}

.summary-panel .summary-lines {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

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

.tariff-card {
    display: grid;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #eef4fa;
    padding: 16px;
}

.tariff-card span {
    color: var(--muted);
    font-weight: 700;
}

.tariff-card strong {
    color: var(--primary-dark);
    font-family: var(--font-heading);
    font-size: 22px;
}

.tariff-card div {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tariff-card em {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 4px 8px;
    font-style: normal;
    color: var(--muted);
}

.invoice-document {
    max-width: 1100px;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

.invoice-header img {
    width: 100px;
    height: 70px;
    object-fit: contain;
}

.invoice-header p {
    color: var(--muted);
}

.invoice-header > div:last-child {
    text-align: right;
}

.inline-verify {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto auto;
    gap: 6px;
    align-items: center;
}

.inline-edit {
    display: inline-block;
}

.inline-delete {
    display: inline-block;
    margin-left: 4px;
}

.inline-edit summary {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--primary-dark);
    padding: 0;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.inline-edit summary::-webkit-details-marker {
    display: none;
}

.inline-edit summary svg {
    width: 16px;
    height: 16px;
}

.inline-edit[open] summary {
    margin-bottom: 10px;
    background: var(--primary-soft);
}

.inline-edit form {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 70;
    width: min(520px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    overflow: visible;
    transform: translate(-50%, -50%);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: 0 24px 60px rgba(31, 58, 95, 0.18);
    padding: 18px;
}

.inline-edit-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
}

.inline-edit form::before {
    display: block;
    margin-bottom: 10px;
    padding-right: 42px;
    color: var(--primary-dark);
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    content: "Edit Data";
}

.inline-edit[open]::before {
    position: fixed;
    inset: 0;
    z-index: 69;
    background: rgba(31, 41, 55, 0.42);
    content: "";
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 60;
}

.modal.open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(31, 41, 55, 0.42);
}

.modal-panel {
    position: relative;
    width: min(880px, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: 0 24px 60px rgba(31, 58, 95, 0.18);
    padding: 18px;
}

.modal-panel.small-modal {
    width: min(560px, calc(100vw - 24px));
    overflow: visible;
}

.modal-head {
    margin-bottom: 16px;
    padding-right: 42px;
}

.modal-head p {
    margin-top: 3px;
    color: var(--muted);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--primary-dark);
    cursor: pointer;
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-actions {
    margin-top: 14px;
    justify-content: flex-end;
}

.notice-panel {
    width: min(480px, calc(100vw - 24px));
}

.notice-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-right: 38px;
}

.notice-head h3 {
    margin-bottom: 4px;
    color: var(--primary-dark);
    font-size: 17px;
}

.notice-head p {
    color: var(--muted);
    font-weight: 500;
}

.notice-icon {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
}

.notice-icon svg {
    width: 18px;
    height: 18px;
}

.notice-icon.danger {
    background: #fee2e2;
    color: #b91c1c;
}

.notice-icon.warning {
    background: #fef3c7;
    color: #b45309;
}

.notice-icon.success {
    background: #dcfce7;
    color: #15803d;
}

.notice-icon.info {
    background: #dbeafe;
    color: #1d4ed8;
}

.profile-photo-field {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #fafcff;
    padding: 14px;
}

.profile-photo-field img,
.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-photo-preview {
    width: 72px;
    height: 72px;
}

.profile-photo-stack {
    display: grid;
    justify-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.profile-photo-meta {
    display: grid;
    gap: 4px;
    min-width: 0;
    align-content: center;
    flex: 1;
}

.profile-photo-meta strong {
    color: var(--primary-dark);
    font-family: var(--font-heading);
    font-size: 14px;
}

.profile-photo-field small {
    color: var(--muted);
    font-weight: 500;
}

.profile-form {
    gap: 14px;
}

.file-input-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.file-input-native {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.file-input-trigger {
    width: auto;
    min-height: 30px;
    padding: 4px 8px;
    white-space: nowrap;
}

.file-name-label {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
    word-break: break-word;
}

.flight-form .flight-airport-field {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fafcff;
    padding: 10px 12px;
}

.flight-form .flight-airport-field .helper-text {
    margin-top: 2px;
}

.pretty-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.pretty-select {
    position: relative;
}

.pretty-select.open {
    z-index: 120;
}

.pretty-select-trigger {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    text-align: left;
    padding: 9px 11px;
    cursor: pointer;
}

.pretty-select-trigger.is-placeholder {
    color: var(--muted);
}

.pretty-select-trigger:disabled {
    background: #f0f4f8;
    color: var(--muted);
    cursor: not-allowed;
}

.pretty-select-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 140;
    max-height: 220px;
    overflow: auto;
    display: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: 0 12px 26px rgba(31, 58, 95, 0.14);
    padding: 4px;
}

.pretty-select.open .pretty-select-menu {
    display: grid;
    gap: 2px;
}

.pretty-select-option {
    width: 100%;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    padding: 7px 8px;
    cursor: pointer;
}

.pretty-select-option:hover,
.pretty-select-option.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.role-operasional input[type="date"],
.role-operasional input[type="time"] {
    background: #fafcff;
    border-color: #cfd9e5;
}

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

.activity-item {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.activity-item svg {
    width: 18px;
    height: 18px;
    color: var(--success);
}

.activity-item small {
    color: var(--muted);
}

.mobile-only {
    display: none;
}

.is-hidden {
    display: none !important;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--primary-dark);
    cursor: pointer;
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

.login-body,
.install-body {
    min-height: 100vh;
    background: #eef4fa;
}

.login-shell,
.install-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) 420px;
    gap: 20px;
    width: min(1080px, 100%);
}

.brand-block {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 14% 12%, rgba(255, 255, 255, 0.95) 0 16%, rgba(255, 255, 255, 0) 40%),
        radial-gradient(circle at 84% 12%, rgba(183, 206, 241, 0.7) 0 24%, rgba(183, 206, 241, 0) 56%),
        linear-gradient(150deg, #eef4fb 6%, #d4e2f7 48%, #9dbde9 100%);
    padding: 28px;
}

.brand-block::before {
    position: absolute;
    right: -160px;
    bottom: -210px;
    width: 620px;
    height: 430px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 28%, #5f8fd3 0%, #2f67b6 58%, #174a93 100%);
    content: "";
}

.brand-block::after {
    position: absolute;
    left: -18%;
    bottom: 56px;
    width: 150%;
    height: 210px;
    border-top: 7px solid rgba(255, 255, 255, 0.84);
    border-radius: 50%;
    transform: rotate(-9deg);
    content: "";
}

.brand-sky {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.brand-sky::before {
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: 18%;
    height: 28%;
    background-image:
        repeating-linear-gradient(
            to right,
            rgba(255, 255, 255, 0.12) 0 1px,
            transparent 1px 18px
        ),
        repeating-linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.12) 0 1px,
            transparent 1px 18px
        );
    mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.8) 0 55%, transparent 78%);
    opacity: 0.45;
    content: "";
}

.brand-sky::after {
    position: absolute;
    left: -4%;
    right: -4%;
    bottom: -4%;
    height: 44%;
    background:
        radial-gradient(circle at 14% 100%, rgba(255, 255, 255, 0.88) 0 24%, transparent 30%),
        radial-gradient(circle at 38% 108%, rgba(255, 255, 255, 0.78) 0 22%, transparent 30%),
        radial-gradient(circle at 58% 108%, rgba(255, 255, 255, 0.8) 0 21%, transparent 30%),
        radial-gradient(circle at 84% 104%, rgba(255, 255, 255, 0.78) 0 19%, transparent 30%);
    opacity: 0.9;
    content: "";
}

.brand-plane {
    position: absolute;
    right: 48px;
    top: 108px;
    color: #2d5f9e;
    font-size: 18px;
    opacity: 0.9;
    transform: rotate(18deg);
}

.brand-plane::before {
    position: absolute;
    right: 12px;
    top: 6px;
    width: 160px;
    height: 60px;
    border-top: 2px solid rgba(255, 255, 255, 0.78);
    border-radius: 50%;
    transform: rotate(16deg);
    content: "";
}

.brand-logo-large {
    position: relative;
    z-index: 1;
    width: 150px;
    height: 110px;
    object-fit: contain;
    margin-bottom: 18px;
    mix-blend-mode: multiply;
}

.brand-block h1 {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 8px 0 10px;
    font-size: 32px;
}

.brand-block p:not(.eyebrow) {
    max-width: 620px;
    color: var(--muted);
    font-size: 15px;
}

.brand-subtitle {
    position: relative;
    z-index: 1;
    margin-top: 10px;
    max-width: 520px;
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
}

.login-card,
.install-card {
    padding: 24px;
}

.login-card-head {
    margin-bottom: 16px;
}

.login-card-head p {
    margin-top: 5px;
    color: var(--muted);
}

.login-demo {
    display: grid;
    gap: 5px;
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fafcff;
    padding: 12px;
    color: var(--muted);
    font-size: 13px;
}

.install-card {
    width: min(720px, 100%);
}

.install-logo {
    width: 120px;
    height: 88px;
    object-fit: contain;
    margin-bottom: 10px;
}

.install-card h1 {
    margin: 5px 0 8px;
}

.install-card form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.print-body {
    background: #ffffff;
    color: #111827;
    font-size: 12px;
}

.print-page {
    width: min(210mm, 100%);
    margin: 0 auto;
    padding: 12mm;
}

.print-header {
    margin-bottom: 18px;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 12px;
}

.print-header p {
    color: var(--muted);
}

.print-invoice-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.print-invoice-head img {
    width: 100px;
    height: 70px;
    object-fit: contain;
}

.print-meta {
    margin-bottom: 16px;
}

.print-meta td:nth-child(odd) {
    color: var(--muted);
    font-weight: 700;
}

.print-report-table th,
.print-report-table td {
    font-size: 11px;
    padding: 7px 8px;
    border: 1px solid #cbd5e1;
}

.print-report-table thead th {
    background: #f1f5f9;
    text-transform: uppercase;
}

.print-invoice-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
}

.print-invoice-table th,
.print-invoice-table td {
    font-size: 11px;
    padding: 7px 8px;
    border: 1px solid #cbd5e1;
    word-break: break-word;
}

.print-invoice-table thead th {
    background: #f1f5f9;
    text-transform: uppercase;
}

.print-invoice-table th:nth-child(1),
.print-invoice-table td:nth-child(1) { width: 16%; }
.print-invoice-table th:nth-child(2),
.print-invoice-table td:nth-child(2) { width: 19%; }
.print-invoice-table th:nth-child(3),
.print-invoice-table td:nth-child(3) { width: 29%; }
.print-invoice-table th:nth-child(4),
.print-invoice-table td:nth-child(4) { width: 18%; }
.print-invoice-table th:nth-child(5),
.print-invoice-table td:nth-child(5) { width: 18%; }

.print-invoice-table td:last-child,
.print-invoice-table th:last-child,
.print-invoice-table tfoot td:last-child {
    text-align: right;
    white-space: nowrap;
}

.print-invoice-table tfoot td {
    font-weight: 700;
}

.print-signature {
    width: 280px;
    margin-left: auto;
    margin-top: 22px;
    text-align: center;
}

.print-signature .sign-space {
    height: 52px;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 10mm;
    }

    body {
        background: #ffffff;
    }

    .print-page {
        width: 100%;
        padding: 0;
    }

    .print-page table,
    .print-meta,
    .print-report-table,
    .print-invoice-table {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .print-page thead {
        display: table-header-group;
    }

    .print-page tfoot {
        display: table-row-group;
    }

    .print-page tr,
    .print-page td,
    .print-page th {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .btn {
        display: none;
    }
}

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

    .operator-chart-grid {
        grid-template-columns: 1fr;
    }

    .content-grid.two,
    .login-panel {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }

    .filter-bar .filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

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

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

    .ops-flight-filter .filter-search,
    .ops-flight-filter .filter-actions {
        grid-column: 1 / -1;
    }

    .ops-flight-filter .ops-filter-movement,
    .ops-flight-filter .ops-filter-status,
    .ops-flight-filter .ops-filter-month,
    .ops-flight-filter .ops-filter-year {
        grid-column: auto;
    }

    .invoice-filter.finance-filter,
    .invoice-filter.branch-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

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

@media (max-width: 820px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        width: auto;
        height: auto;
        transform: none;
        padding: 12px;
    }

    .mobile-only {
        display: none;
    }

    .main-area {
        padding: 16px;
    }

    .topbar {
        gap: 10px;
        align-items: flex-start;
    }

    .topbar-kicker {
        font-size: 11px;
    }

    .topbar h1 {
        font-size: 18px;
    }

    .welcome-band,
    .panel-head,
    .invoice-header,
    .print-invoice-head {
        flex-direction: column;
    }

    .invoice-header > div:last-child {
        text-align: left;
    }

    .stats-grid,
    .operator-chart-grid,
    .form-grid,
    .detail-grid,
    .filter-bar,
    .tariff-groups {
        grid-template-columns: 1fr;
    }

    .dashboard-kpi-grid .stat-card strong {
        font-size: 26px;
    }

    .ops-branch-select-panel {
        margin-left: 0;
    }

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

    .profile-photo-field {
        align-items: flex-start;
        flex-direction: column;
    }

    .file-input-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .profile-photo-stack {
        justify-items: flex-start;
    }

    .profile-photo-preview {
        width: 68px;
        height: 68px;
    }

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

    .brand-block h1 {
        font-size: 26px;
    }

    .filter-bar .filter-actions,
    .modal-actions {
        justify-content: stretch;
    }

    .filter-bar .filter-actions .btn,
    .modal-actions .btn {
        flex: 1 1 0;
        min-width: 0;
    }

    table {
        min-width: 640px;
    }
}

@media (max-width: 560px) {
    .main-area {
        padding: 12px;
    }

    .panel {
        padding: 14px;
    }

    .sidebar-brand {
        padding: 6px 8px 12px;
    }

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

    .sidebar-nav a,
    .logout-link {
        min-height: 38px;
        padding: 8px 9px;
    }

    .compact-filter-panel {
        padding: 12px;
    }

    .modal {
        padding: 12px;
    }

    .modal-panel {
        padding: 14px;
        border-radius: 10px;
    }

    .modal-close {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
    }

    .donut-chart {
        width: 118px;
        height: 118px;
    }

    .donut-chart span {
        font-size: 22px;
    }

    .progress-card strong {
        font-size: 30px;
    }

    table {
        min-width: 560px;
    }
}
