@font-face {
    font-family: Aventa;
    src: url("Aventa-Regular.otf") format("opentype");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: Aventa;
    src: url("Aventa-Bold.otf") format("opentype");
    font-weight: 700;
    font-display: swap;
}

:root {
    --forest: #10312b;
    --dark: #00251d;
    --ivory: #e1c9b1;
    --orange: #ec7700;
    --paper: #faf7f2;
    --line: #e0d9ce;
    --muted: #495d55;
    color: var(--forest);
    background: var(--paper);
    font: 16px/1.5 Aventa, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, p { margin: 0; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
svg { flex: none; vertical-align: middle; }
:focus-visible { outline: 3px solid #a04e00; outline-offset: 4px; }

.brand-background {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: white;
    background: linear-gradient(115deg, var(--dark), var(--forest));
}

.brand-background::before {
    position: absolute;
    z-index: -1;
    content: "";
    width: var(--symbol-width, 680px);
    aspect-ratio: 1;
    top: var(--symbol-top, 50%);
    right: var(--symbol-right, -150px);
    transform: translateY(-50%) rotate(-12deg);
    background: url("simbolo.png") center / contain no-repeat;
    opacity: .095;
    pointer-events: none;
}

.login { display: grid; min-height: 100svh; grid-template-columns: 1.05fr 1fr; }
.login-brand {
    display: grid;
    place-items: center;
    padding: 48px;
    --symbol-width: min(64vw, 940px);
    --symbol-right: -20%;
    --symbol-top: 62%;
}
.login-logo { width: min(100%, 370px); }
.login-area { display: grid; align-items: center; justify-items: center; padding: 56px 36px; }
.login-content { width: min(100%, 400px); }
.eyebrow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 13px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 25px; height: 2px; background: var(--orange); }
h1 { font-size: clamp(2rem, 4.5vw, 3.7rem); line-height: 1.12; letter-spacing: -.035em; overflow-wrap: anywhere; }
.intro { margin: 14px 0 30px; color: var(--muted); }
.login-form { display: grid; }
.login-form label { margin: 0 0 6px; font-weight: 700; font-size: .9rem; }
.login-form input:not([type="hidden"]) {
    width: 100%;
    min-height: 50px;
    margin-bottom: 18px;
    padding: 10px 14px;
    border: 1px solid #aab0a7;
    border-radius: 8px;
    background: white;
    color: var(--forest);
}
.primary-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    margin-top: 6px;
    padding: 10px 18px;
    border: 0;
    border-radius: 8px;
    color: white;
    background: var(--forest);
    font-weight: 700;
}
.primary-button:hover { background: var(--dark); }
.form-error { margin-bottom: 18px; border-radius: 8px; background: #fce9de; color: #7b2d15; padding: 12px; }

.layout { width: min(100% - 64px, 1120px); margin-inline: auto; }
.topbar { background: white; border-bottom: 1px solid var(--line); }
.topbar-content, .session { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar-content { min-height: 86px; }
.home-link img { width: 194px; }
.session-name { color: var(--muted); font-size: .86rem; }
.logout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--paper);
    color: var(--forest);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 700;
    font-size: .9rem;
}
.logout svg { width: 18px; height: 18px; }
.logout:hover { border-color: var(--forest); }
.dashboard { padding-block: 48px 64px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; color: var(--muted); font-size: .9rem; }
.hero {
    display: grid;
    align-content: center;
    min-height: 130px;
    border-radius: 20px;
    padding: 12px clamp(16px, 4vw, 40px);
}
.hero h1 { font-size: clamp(1.5rem, 3.4vw, 2.8rem); }
.hero h1::before { display: block; content: ""; width: 42px; height: 3px; background: var(--orange); margin-bottom: 8px; }
.hero p { margin-top: 6px; color: var(--ivory); }
.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 24px; }
.module-card, .module-status {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 114px;
    padding: 20px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
}
.module-card { text-decoration: none; box-shadow: 0 6px 20px #00251d08; }
.module-card:hover { border-color: var(--forest); box-shadow: 0 8px 24px #00251d12; }
.module-icon { display: grid; flex: none; place-items: center; width: 48px; height: 48px; border-radius: 11px; background: #f2e8dc; }
.module-text { display: grid; min-width: 0; gap: 2px; overflow-wrap: anywhere; }
.module-text strong { font-size: 1.1rem; }
.module-text span, .module-status p { color: var(--muted); font-size: .9rem; }
.module-arrow { margin-left: auto; }
.module-status { margin-top: 24px; }
.database-status { margin-top: 16px; color: var(--muted); font-size: .9rem; }
.database-status-error { color: #7b2d15; }

.billing-card {
    margin-top: 24px;
    padding: clamp(18px, 4vw, 32px);
    border: 1px solid var(--line);
    border-radius: 14px;
    background: white;
}
.billing-card h2 { margin: 0; font-size: 1.35rem; }
.billing-note { margin-block: 4px 16px; color: var(--muted); }
.billing-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
}
.billing-field { display: grid; gap: 5px; }
.sales-fields { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.sales-fields .billing-field { grid-column: span 3; grid-template-rows: 1fr auto; }
.sales-fields .billing-field:nth-child(-n + 3) { grid-column: span 2; }
.billing-field label { font-size: .9rem; font-weight: 700; }
.billing-field input {
    min-width: 0;
    width: 100%;
    min-height: 46px;
    padding: 8px 12px;
    border: 1px solid #aab0a7;
    border-radius: 8px;
    background: white;
    color: var(--forest);
}
.billing-button { gap: 20px; margin-top: 20px; }
.billing-result-heading, .billing-exports { display: flex; flex-wrap: wrap; align-items: start; gap: 8px; }
.billing-result-heading { justify-content: space-between; margin-bottom: 12px; }
.billing-result-heading .billing-note { margin-bottom: 0; }
.billing-raw {
    max-height: 32rem;
    margin: 0;
    padding: 14px;
    overflow: auto;
    color: var(--forest);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    font: .87rem/1.55 Consolas, monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.billing-card button:disabled { opacity: .58; cursor: default; }
.sales-confirmation {
    margin: 0 0 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    overflow-wrap: anywhere;
}
.sales-confirmation h3 { margin: 0 0 6px; }
.sales-confirmation p { margin-bottom: 10px; }

@media (max-width: 750px) {
    .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .login-brand { min-height: 175px; padding: 30px; --symbol-width: 500px; }
    .login-logo { width: min(100%, 255px); }
    .login-area { align-items: start; padding: 42px 24px; }
    .layout { width: calc(100% - 32px); }
    .topbar-content { min-height: 72px; }
    .home-link img { width: 158px; }
    .dashboard { padding-top: 28px; }
    .hero { min-height: 106px; }
    .module-grid { grid-template-columns: 1fr; gap: 12px; margin-top: 16px; }
    .module-card { min-height: 92px; }
}

@media (max-width: 420px) {
    .session-name { display: none; }
    .billing-fields:not(.sales-fields) { grid-template-columns: 1fr; }
    .sales-fields .billing-field:nth-child(-n + 3) { grid-column: 1 / -1; }
}

.bi-upload { display: grid; justify-items: start; gap: 12px; }
.bi-upload label, .bi-counts dd { font-weight: 700; }
.bi-upload p { margin: 0; }
.bi-upload input { max-width: 100%; }
.bi-actions, .bi-counts, .bi-fields { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.bi-counts dd, .bi-fields dd { margin: 0; overflow-wrap: anywhere; }
.bi-fields dt { font-weight: 700; }
.bi-fields > div { min-width: 0; }
.bi-counts dd { font-size: 1.35rem; }
