:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #172033;
    --muted: #687386;
    --line: #dfe5ef;
    --primary: #1463ff;
    --primary-dark: #0e47ba;
    --danger: #d92d20;
    --success: #087443;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    min-height: 100vh;
}

body.menu-locked {
    left: 0;
    overflow: hidden;
    position: fixed;
    right: 0;
    width: 100%;
}

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

.topbar {
    align-items: center;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 20px;
    justify-content: space-between;
    padding: 14px 24px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    color: var(--text);
    display: grid;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.15;
}

.brand-greeting {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.nav a {
    color: var(--text);
    font-weight: 600;
}

.menu-toggle {
    display: none;
}

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

.app-shell.sidebar-collapsed {
    grid-template-columns: 76px minmax(0, 1fr);
}

.sidebar {
    background: #eaf1ff;
    border-right: 1px solid #d7e2f5;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 100vh;
    padding: 20px 16px;
    position: sticky;
    top: 0;
}

.sidebar-brand {
    color: var(--text);
    padding: 6px 8px 14px;
}

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

.sidebar .nav {
    align-items: stretch;
    display: grid;
    gap: 18px;
}

.nav-group {
    display: grid;
    gap: 6px;
}

.nav-group > span {
    color: #5b6f95;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 0 8px;
    text-transform: uppercase;
}

.nav-group a {
    align-items: center;
    border-radius: 8px;
    color: #21345a;
    display: flex;
    gap: 10px;
    font-weight: 700;
    padding: 10px 12px;
}

.nav-icon {
    fill: none;
    flex: 0 0 20px;
    height: 20px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 20px;
}

.nav-text {
    min-width: 0;
}

.nav-group a:hover,
.nav-group a.active {
    background: #dce8ff;
    color: #0d3c9a;
}

.sidebar-collapse {
    align-items: center;
    background: #fff;
    border: 1px solid #cfdbef;
    border-radius: 999px;
    color: #244372;
    cursor: pointer;
    display: inline-flex;
    font-size: 22px;
    font-weight: 800;
    height: 32px;
    justify-content: center;
    position: absolute;
    right: -16px;
    top: 18px;
    width: 32px;
    z-index: 2;
}

.app-shell.sidebar-collapsed .sidebar {
    align-items: center;
    padding: 66px 10px 20px;
}

.app-shell.sidebar-collapsed .sidebar-collapse {
    color: #244372;
    left: 50%;
    right: auto;
    top: 18px;
    transform: translateX(-50%) rotate(180deg);
}

.app-shell.sidebar-collapsed .sidebar-brand {
    display: none;
}

.app-shell.sidebar-collapsed .nav-group {
    justify-items: center;
}

.app-shell.sidebar-collapsed .nav-group > span {
    display: none;
}

.app-shell.sidebar-collapsed .nav-group a {
    align-items: center;
    display: flex;
    height: 42px;
    justify-content: center;
    padding: 0;
    width: 42px;
}

.app-shell.sidebar-collapsed .nav-text {
    display: none;
}

.app-shell.sidebar-collapsed .nav-icon {
    flex-basis: 22px;
    height: 22px;
    width: 22px;
}

.menu-backdrop {
    display: none;
}

.container {
    margin: 0 auto;
    max-width: 1180px;
    padding: 24px;
}

.help-float {
    align-items: center;
    background: var(--primary);
    border-radius: 999px;
    bottom: 18px;
    box-shadow: 0 12px 28px rgba(20, 99, 255, 0.28);
    color: #fff;
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    position: fixed;
    right: 18px;
    z-index: 20;
}

.help-float span {
    align-items: center;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    display: inline-flex;
    font-weight: 800;
    height: 24px;
    justify-content: center;
    width: 24px;
}

.help-float strong {
    color: #fff;
    font-size: 14px;
}

h1, h2 {
    margin: 0 0 14px;
}

p {
    color: var(--muted);
}

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

.page-head p {
    margin: 0;
}

.auth-box {
    margin: 8vh auto;
    max-width: 430px;
}

body:has(.login-box) {
    background: linear-gradient(135deg, #0d2a78 0%, #143fa3 55%, #0b1b44 100%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover;
}

body:has(.login-box) .container {
    align-items: center;
    display: flex;
    justify-content: center;
    max-width: none;
    min-height: 100vh;
    padding: 24px;
}

body:has(.login-box) .auth-box {
    margin: 0 auto;
}

.login-box {
    background: #102f85;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(11, 27, 68, 0.32);
    padding: 28px;
}

.login-box h1 {
    color: #fff;
}

.login-box .form-card {
    background: var(--panel);
}

.login-box .developer-credit {
    color: rgba(255, 255, 255, 0.82);
}

.login-brand {
    display: grid;
    gap: 14px;
    justify-items: center;
    margin-bottom: 18px;
    text-align: center;
}

.login-brand img {
    max-height: 92px;
    max-width: 220px;
    object-fit: contain;
}

.developer-credit {
    color: var(--muted);
    font-size: 13px;
    margin-top: 14px;
    text-align: center;
}

.form-card, .form-inline, .stat-card, .list-row, section {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.form-card {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.form-card.subtle {
    background: #f8fbff;
}

.field-title {
    color: var(--muted);
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
}

.check-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.check-card {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    gap: 10px;
    padding: 12px;
}

.check-card input,
.inline-check input {
    width: auto;
}

.inline-check {
    align-items: center;
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

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

.info-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

.info-card-head {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.info-card-head strong,
.info-card-head span {
    display: block;
}

.info-card-head span {
    color: var(--muted);
}

.form-inline {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
    padding: 14px;
}

.filter-form {
    align-items: end;
    display: flex;
    gap: 10px;
}

.section-switcher {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 14px;
}

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

.section-head h2 {
    margin-bottom: 0;
}

.compact-filter {
    flex-wrap: wrap;
}

.compact-filter label {
    min-width: 170px;
}

label {
    color: var(--muted);
    display: grid;
    font-size: 14px;
    gap: 6px;
}

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

.readonly-field {
    align-items: center;
    background: #f6f8fc;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    display: flex;
    min-height: 40px;
    padding: 9px 10px;
    width: 100%;
}

textarea {
    resize: vertical;
}

button, .button {
    background: var(--primary);
    border: 0;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    justify-content: center;
    padding: 10px 14px;
}

button:hover, .button:hover {
    background: var(--primary-dark);
}

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

.danger-button:hover {
    background: #b42318;
}

button:focus {
    outline: none;
}

button:focus-visible, .button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid rgba(20, 99, 255, 0.45);
    outline-offset: 2px;
}

.button.secondary {
    background: #e8eefc;
    color: var(--primary-dark);
}

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

.stat-card {
    padding: 18px;
}

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

.stat-card strong {
    display: block;
    font-size: 34px;
    margin-top: 8px;
}

.stat-card.danger strong {
    color: var(--danger);
}

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

.grid.three {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 22px;
}

section {
    margin-bottom: 22px;
    padding: 18px;
}

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

.list-row {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 12px;
}

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

.dashboard-call-row {
    align-items: stretch;
    gap: 12px;
}

.dashboard-call-row > div {
    display: grid;
    gap: 4px;
}

.dashboard-call-row .status-form {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.call-detail {
    display: grid;
    gap: 14px;
}

.call-detail-head {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.call-detail-head div {
    display: grid;
    gap: 4px;
}

.call-detail-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.detail-list {
    display: grid;
    gap: 8px;
    margin: 0;
}

.detail-list dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.detail-list dd {
    margin: 0 0 4px;
}

.photo-preview-link {
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--primary);
    display: grid;
    gap: 8px;
    padding: 10px;
    text-decoration: none;
}

.photo-preview-link img {
    border-radius: 6px;
    max-height: 220px;
    object-fit: cover;
    width: 100%;
}

.photo-link-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.manual-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.manual-card {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 6px;
    padding: 14px;
}

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

.manual-list {
    color: var(--muted);
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 20px;
}

.manual-list strong {
    color: var(--text);
}

.empty {
    margin: 0;
}

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

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

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

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

.messages {
    display: grid;
    gap: 8px;
    left: 50%;
    max-width: min(460px, calc(100vw - 32px));
    position: fixed;
    top: 24px;
    transform: translateX(-50%);
    width: max-content;
    z-index: 80;
}

.message {
    border-radius: 6px;
    box-shadow: 0 14px 30px rgba(9, 27, 58, 0.16);
    padding: 10px 12px;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.message.is-hiding {
    opacity: 0;
    transform: translateY(-8px);
}

.message.success {
    background: #e8f7ef;
    color: var(--success);
}

.message.error {
    background: #fdecec;
    color: var(--danger);
}

.page-loader {
    align-items: center;
    background: rgba(7, 20, 45, 0.28);
    display: flex;
    inset: 0;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 0.18s ease;
    z-index: 120;
}

.page-loader.is-active {
    opacity: 1;
    pointer-events: all;
}

.page-loader-card {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(9, 27, 58, 0.22);
    color: var(--text);
    display: flex;
    font-weight: 700;
    gap: 12px;
    padding: 16px 18px;
}

.page-loader-spinner {
    animation: spin 0.75s linear infinite;
    border: 3px solid #dbe6ff;
    border-top-color: var(--primary);
    border-radius: 999px;
    height: 24px;
    width: 24px;
}

.app-splash {
    align-items: center;
    background: radial-gradient(circle at center, #1f55bd 0%, #153f91 52%, #102c67 100%);
    display: flex;
    inset: 0;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 0.32s ease, visibility 0.32s ease;
    visibility: hidden;
    z-index: 300;
}

.app-splash.is-active {
    opacity: 1;
    pointer-events: all;
    visibility: visible;
}

.app-splash.is-leaving {
    opacity: 0;
}

.app-splash-content {
    align-items: center;
    animation: splash-rise 0.78s cubic-bezier(.22, .9, .28, 1) both;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px;
    text-align: center;
}

.app-splash-content img {
    animation: splash-logo 1.1s ease both;
    filter: drop-shadow(0 22px 38px rgba(0, 0, 0, 0.2));
    max-width: min(68vw, 260px);
}

.app-splash-content strong {
    font-size: clamp(28px, 7vw, 44px);
    line-height: 1.05;
}

.app-splash-content span {
    color: rgba(255, 255, 255, 0.78);
    font-weight: 700;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes splash-logo {
    0% {
        opacity: 0;
        transform: scale(0.86);
    }
    60% {
        opacity: 1;
        transform: scale(1.04);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes splash-rise {
    0% {
        opacity: 0;
        transform: translateY(18px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes login-mobile-card {
    0% {
        opacity: 0;
        transform: translateY(28px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes login-mobile-logo {
    0% {
        opacity: 0;
        transform: translateY(-14px) scale(0.9);
    }
    58% {
        opacity: 1;
        transform: translateY(0) scale(1.04);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.check {
    align-items: center;
    display: flex;
    gap: 8px;
}

.check input {
    min-height: auto;
    width: auto;
}

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

.checkbox-stack {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.tile {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 12px;
}

.visit-form {
    max-width: 920px;
}

.visit-details {
    display: grid;
    gap: 16px;
}

.hidden {
    display: none !important;
}

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

.check-section {
    display: grid;
    gap: 12px;
    margin: 0;
}

.check-section h3 {
    margin: 0;
}

.check-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 14px;
}

.nok-extra {
    display: grid;
    gap: 10px;
}

.evidence-photo {
    background: #f8fafc;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    display: grid;
    font-size: 14px;
    gap: 8px;
    padding: 10px;
}

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

.photo-actions label {
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    font-weight: 700;
    justify-content: center;
    min-height: 44px;
    padding: 10px;
    text-align: center;
}

.photo-actions input[type="file"] {
    height: 1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    width: 1px;
}

.photo-status {
    color: var(--muted);
    font-size: 13px;
}

.photo-status.selected {
    color: var(--success);
    font-weight: 700;
}

.pending-alert {
    background: #fff4db;
    border: 1px solid #f4c76b;
    border-radius: 8px;
    color: #5f3900;
    display: grid;
    gap: 12px;
    padding: 14px;
}

.pending-alert h2 {
    margin: 0;
}

.pending-alert p {
    color: #6f4300;
    margin: 0;
}

.pending-item {
    background: #fff;
    border: 1px solid #f4d795;
    border-radius: 8px;
    display: grid;
    gap: 10px;
    padding: 12px;
}

.pending-item small {
    color: var(--muted);
    display: block;
    margin-top: 4px;
}

.maintenance-pending-item {
    grid-template-columns: minmax(220px, 1fr) auto;
}

.maintenance-pending-item .status-form {
    align-items: stretch;
    flex-wrap: wrap;
    grid-column: 1 / -1;
}

.maintenance-pending-item .status-form input {
    min-width: 150px;
}

.check-item legend {
    color: var(--text);
    font-weight: 700;
    padding: 0 6px;
}

.segmented {
    display: flex;
    gap: 10px;
}

.segmented label {
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    display: flex;
    gap: 6px;
    padding: 8px 10px;
}

.segmented input {
    min-height: auto;
    width: auto;
}

.badge {
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    text-transform: uppercase;
}

.muted {
    color: var(--muted);
}

.badge.ok, .badge.resolvida, .badge.concluido, .badge.finalizado, .badge.aprovado, .badge.pago {
    background: #e8f7ef;
    color: var(--success);
}

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

.badge.warning {
    background: #fff4db;
    color: #9a5b00;
}

.badge.nok, .badge.cancelada, .badge.cancelado, .badge.reprovado, .badge.reprovado_gerente {
    background: #fdecec;
    color: var(--danger);
}

.badge.aberta, .badge.aberto, .badge.pendente, .badge.atribuido {
    background: #e8eefc;
    color: var(--primary-dark);
}

.badge.info {
    background: #eef2f7;
    color: var(--muted);
}

.badge.em_andamento, .badge.em_analise, .badge.a_caminho, .badge.no_local {
    background: #fff4db;
    color: #9a5b00;
}

.badge.aguardando_material {
    background: #fff0e6;
    color: #b45309;
}

.badge.pronto_conferencia {
    background: #eef2ff;
    color: #4338ca;
}

.occurrence-thumb {
    border-radius: 6px;
    height: 48px;
    object-fit: cover;
    width: 64px;
}

.status-form {
    align-items: center;
    display: flex;
    gap: 8px;
}

.status-form select {
    min-width: 150px;
}

.positive {
    color: var(--success);
    font-weight: 700;
}

.negative {
    color: var(--danger);
    font-weight: 700;
}

.balance-store-list {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.balance-store {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

.balance-store-head {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.balance-store-head h3 {
    margin: 0 0 6px;
}

.balance-store-head strong {
    font-size: 24px;
}

.balance-total-box {
    text-align: right;
}

.balance-total-box small {
    color: var(--muted);
    display: block;
    margin-bottom: 4px;
}

.table-section-row td {
    background: #f2f6ff;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.coming-soon {
    align-items: center;
    display: grid;
    justify-items: center;
    min-height: 240px;
    text-align: center;
}

.coming-soon strong {
    color: var(--text);
    font-size: 26px;
}

.coming-soon p {
    font-size: 16px;
    margin: 0;
}

.finance-store-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.finance-store-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    padding: 14px;
}

.finance-store-card h3 {
    margin: 0;
}

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

.finance-store-card dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.finance-store-card dl div {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.finance-store-card dt {
    color: var(--muted);
}

.finance-store-card dd {
    font-weight: 800;
    margin: 0;
}

.finance-quick-note {
    padding-bottom: 16px;
    padding-top: 16px;
}

.finance-quick-note p {
    color: var(--muted);
    margin: 6px 0 0;
}

.finance-expense-list {
    display: grid;
    gap: 12px;
}

.finance-expense-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    padding: 14px;
}

.finance-expense-head {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.finance-expense-head > div {
    display: grid;
    gap: 4px;
}

.finance-expense-head span,
.finance-expense-notes {
    color: var(--muted);
}

.finance-expense-total {
    justify-items: end;
    text-align: right;
}

.finance-expense-total strong {
    font-size: 22px;
}

.finance-expense-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.finance-expense-tags span,
.finance-expense-tags a {
    background: #eef4ff;
    border-radius: 999px;
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 700;
    padding: 6px 10px;
    text-decoration: none;
}

.finance-expense-description {
    margin: 0;
}

.finance-expense-notes {
    display: grid;
    gap: 4px;
}

.finance-expense-action {
    border-top: 1px solid var(--line);
    padding-top: 12px;
}

.finance-toggle-area {
    display: grid;
    gap: 12px;
    margin: 16px 0;
}

.finance-toggle-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.finance-toggle-button {
    align-items: center;
    background: #e8eefc;
    border: 1px solid #d7e2fb;
    border-radius: 999px;
    color: var(--primary-dark);
    display: flex;
    font-size: 15px;
    font-weight: 800;
    justify-content: space-between;
    line-height: 1.2;
    min-width: 210px;
    padding: 10px 14px;
    text-align: left;
    text-transform: uppercase;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    width: auto;
}

.finance-toggle-button::after {
    content: "+";
    font-size: 18px;
    line-height: 1;
    margin-left: 12px;
}

.finance-toggle-button:hover,
.finance-toggle-button.is-open {
    background: #c9d9ff;
    border-color: #9db9ff;
    color: #12316f;
}

.finance-toggle-button.is-open::after {
    content: "-";
}

.finance-toggle-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

@media (max-width: 820px) {
    body:has(.login-box) {
        background: radial-gradient(circle at 50% 10%, #245bd0 0%, #143f9e 44%, #0b1f57 100%);
        min-height: 100dvh;
    }

    body:has(.login-box) .container {
        min-height: 100dvh;
        padding: 18px;
    }

    .login-page-body:not(.splash-done) .app-splash {
        opacity: 1;
        pointer-events: all;
        visibility: visible;
    }

    .login-page-body:not(.splash-done) .login-box {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }

    .login-box {
        border-color: rgba(255, 255, 255, 0.3);
        box-shadow: 0 22px 54px rgba(5, 19, 58, 0.34);
        max-width: 420px;
        padding: 24px 18px 20px;
        width: min(100%, 420px);
    }

    .splash-done .login-box {
        animation: login-mobile-card 0.64s cubic-bezier(.22, .9, .28, 1) both;
    }

    .login-brand {
        gap: 12px;
        margin-bottom: 16px;
    }

    .login-brand img {
        max-height: 116px;
        max-width: min(76vw, 260px);
    }

    .splash-done .login-brand img {
        animation: login-mobile-logo 0.86s cubic-bezier(.22, .9, .28, 1) both;
    }

    .login-box h1 {
        font-size: clamp(28px, 8vw, 34px);
        line-height: 1.06;
    }

    .login-box .form-card {
        border-radius: 8px;
        padding: 18px;
    }

    .app-splash {
        background: radial-gradient(circle at 50% 24%, #2d68dc 0%, #1746a7 48%, #081a48 100%);
    }

    .app-splash-content {
        animation: splash-rise 0.9s cubic-bezier(.16, .95, .28, 1) both;
        gap: 12px;
        min-height: 100dvh;
        justify-content: center;
        padding: 28px;
        width: 100%;
    }

    .app-splash-content img {
        animation: splash-logo 1.25s cubic-bezier(.16, .95, .28, 1) both;
        max-width: min(78vw, 310px);
    }

    .app-splash-content strong {
        font-size: clamp(34px, 10vw, 48px);
    }

    .app-splash-content span {
        font-size: 15px;
    }

    .app-shell {
        display: block;
        min-height: 100vh;
    }

    .sidebar {
        box-shadow: 18px 0 38px rgba(15, 47, 134, 0.22);
        left: 0;
        max-height: 100dvh;
        max-width: 82vw;
        min-height: 100dvh;
        overscroll-behavior: contain;
        overflow-y: auto;
        position: fixed;
        top: 0;
        transform: translateX(-105%);
        transition: transform 0.2s ease;
        width: 280px;
        z-index: 40;
    }

    .sidebar-collapse {
        display: none;
    }

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

    .sidebar .nav {
        display: grid;
    }

    .menu-backdrop {
        background: rgba(15, 32, 51, 0.42);
        bottom: 0;
        display: none;
        left: 0;
        position: fixed;
        right: 0;
        top: 0;
        z-index: 35;
    }

    .menu-backdrop.open {
        display: block;
    }

    .topbar {
        align-items: center;
        border-bottom: 1px solid var(--line);
        box-shadow: 0 8px 24px rgba(23, 32, 51, 0.08);
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 14px;
    }

    .menu-toggle {
        align-items: center;
        background: #eef3ff;
        border: 1px solid #d8e3ff;
        border-radius: 8px;
        display: grid;
        gap: 4px;
        height: 42px;
        justify-items: center;
        padding: 9px;
        position: fixed;
        right: 14px;
        top: 12px;
        width: 46px;
        z-index: 45;
    }

    .menu-toggle:hover, .menu-toggle:focus, .menu-toggle:active {
        background: #eef3ff;
        color: var(--primary-dark);
    }

    .menu-toggle span {
        background: var(--primary-dark);
        border-radius: 99px;
        display: block;
        height: 2px;
        width: 20px;
    }

    .nav {
        background: #f8faff;
        border: 1px solid var(--line);
        border-radius: 8px;
        display: none;
        flex-direction: column;
        gap: 4px;
        margin-top: 4px;
        padding: 8px;
        width: 100%;
    }

    .nav.open {
        display: flex;
    }

    .sidebar .nav {
        background: transparent;
        border: 0;
        display: grid;
        gap: 18px;
        margin: 0;
        padding: 0;
        width: 100%;
    }

    .nav a {
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 8px;
        padding: 12px 14px;
        width: 100%;
    }

    .nav a:active {
        background: #eef3ff;
    }

    .sidebar .nav-group a {
        background: transparent;
        border: 0;
        color: #21345a;
        padding: 10px 12px;
    }

    .sidebar .nav-group a:active,
    .sidebar .nav-group a:hover,
    .sidebar .nav-group a.active {
        background: #dce8ff;
        color: #0d3c9a;
    }

    .container {
        padding: 66px 16px 16px;
    }

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

    .stats-grid, .grid.two, .grid.three, .checkbox-grid {
        grid-template-columns: 1fr;
    }

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

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

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

    .list-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .maintenance-pending-item {
        grid-template-columns: 1fr;
    }

    .maintenance-pending-item .status-form,
    .maintenance-pending-item .status-form input,
    .maintenance-pending-item .status-form select,
    .maintenance-pending-item .status-form button {
        width: 100%;
    }

    .table-wrap {
        overflow: visible;
    }

    .mobile-card-table {
        border-collapse: separate;
        border-spacing: 0;
        min-width: 0;
    }

    .mobile-card-table thead {
        display: none;
    }

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

    .mobile-card-table tr {
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 8px;
        margin-bottom: 12px;
        overflow: hidden;
    }

    .mobile-card-table td {
        align-items: flex-start;
        border-bottom: 1px solid #edf1f7;
        display: flex;
        gap: 12px;
        justify-content: space-between;
        min-height: 44px;
        padding: 11px 12px;
        text-align: right;
    }

    .mobile-card-table td:last-child {
        border-bottom: 0;
    }

    .mobile-card-table td::before {
        color: var(--muted);
        content: attr(data-label);
        flex: 0 0 42%;
        font-size: 12px;
        font-weight: 700;
        text-align: left;
        text-transform: uppercase;
    }

    .mobile-card-table td:first-child {
        background: #f8faff;
        color: var(--text);
        font-size: 16px;
        font-weight: 700;
        text-align: left;
    }

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

    .mobile-card-table .table-section-row {
        border: 0;
        margin: 6px 0 8px;
    }

    .mobile-card-table .table-section-row td {
        display: block;
        min-height: 0;
        text-align: left;
    }

    .mobile-card-table .table-section-row td::before {
        display: none;
    }

    .mobile-card-table td input,
    .mobile-card-table td select,
    .mobile-card-table td textarea {
        text-align: left;
    }

    .finance-store-grid {
        grid-template-columns: 1fr;
    }

    .finance-store-card {
        padding: 12px;
    }

    .finance-expense-head {
        display: grid;
    }

    .finance-expense-total {
        justify-items: start;
        text-align: left;
    }

    .finance-expense-action input,
    .finance-expense-action select,
    .finance-expense-action button {
        width: 100%;
    }

    .status-form {
        align-items: stretch;
        display: grid;
        gap: 8px;
    }

    .photo-actions {
        grid-template-columns: 1fr;
    }

    .help-float {
        bottom: 12px;
        padding: 10px;
        right: 12px;
    }

    .help-float strong {
        display: none;
    }

    .balance-store-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .balance-store-head strong {
        font-size: 22px;
    }
}
