:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --soft: #f6f1ed;
    --ink: #070707;
    --muted: #5f5552;
    --line: #eee7e1;
    --accent: #6d5b5a;
    --accent-dark: #4e403f;
    --warning: #e77900;
    --danger: #d90000;
    --shadow: 0 14px 36px rgba(73, 58, 52, 0.08);
}

.form-message {
    margin: 12px 0 0;
    color: var(--accent);
    font-weight: 700;
}

.icon-action {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 8px;
    padding: 8px 10px;
    margin-right: 8px;
    cursor: pointer;
}

.icon-action.danger {
    color: #d50000;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: #ffffff;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #ccc5bc;
}

.login-card {
    width: min(560px, 100%);
    padding: 24px 40px 32px;
    background: #ccc5bc;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.login-brand {
    width: min(500px, 100%);
    height: 270px;
    margin: 0 auto 10px;
    display: flex;
    justify-content: center;
    overflow: hidden;
    background: #ccc5bc;
}

.login-brand-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center 48%;
    border-radius: 0;
    background: #ccc5bc;
}

.login-card .eyebrow {
    margin: 2px 0 10px;
    color: #8a7f80;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 12px;
}

.login-card .produto-form {
    display: grid;
    gap: 14px;
    margin-top: 0;
}

.login-card .produto-form input {
    width: 100%;
    height: 54px;
    min-height: 54px;
    border-radius: 16px;
    border-color: rgba(140, 130, 132, 0.34);
    background: rgba(225, 219, 212, 0.96);
    color: #4f464a;
    font-size: 15px;
}

.login-card .produto-form input::placeholder {
    color: #847b7c;
}

.login-card .primary {
    width: 100%;
    height: 52px;
    min-height: 52px;
    margin-top: 6px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #80777d, #5e555b);
    color: white;
    box-shadow: none;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.login-error {
    margin: 8px 0 12px;
    color: var(--danger);
    font-weight: 700;
    text-align: center;
}

.login-tip {
    margin-top: 12px;
    color: #756b6d;
    text-align: center;
    font-size: 13px;
}

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

.sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 26px 18px 22px;
    border-right: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(235, 230, 225, 0.9), rgba(255, 255, 255, 0.8) 44%),
        #f4eee8;
    backdrop-filter: blur(12px);
}

.side-nav,
.sidebar-footer {
    display: grid;
    gap: 12px;
}

.side-link {
    width: 100%;
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 22px;
    border: 0;
    border-radius: 0 18px 18px 0;
    padding: 0 22px;
    color: var(--ink);
    text-decoration: none;
    background: transparent;
    font-weight: 600;
    text-align: left;
}

.side-link.active {
    position: relative;
    background: linear-gradient(90deg, rgba(241, 236, 231, 0.9), rgba(247, 243, 239, 0.78));
    box-shadow: 0 14px 28px rgba(103, 83, 76, 0.08);
}

.side-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 999px;
    background: var(--warning);
}

.side-group {
    display: grid;
    gap: 8px;
}

.side-parent-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px;
    align-items: stretch;
    border-radius: 0 18px 18px 0;
}

.side-parent-row .side-link {
    border-radius: 0;
}

.side-toggle {
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 0 18px 18px 0;
    background: transparent;
    color: var(--accent-dark);
    font-size: 24px;
}

.side-toggle .side-caret {
    transition: transform 0.18s ease;
}

.side-group.open .side-toggle .side-caret {
    transform: rotate(90deg);
}

.side-submenu {
    display: grid;
    gap: 6px;
    padding: 0 0 0 50px;
}

.side-group:not(.open) .side-submenu {
    display: none;
}

.side-sub-link {
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    padding: 0 16px;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    text-align: left;
}

.side-sub-link.active {
    background: rgba(241, 236, 231, 0.95);
    color: var(--accent-dark);
}

.icon {
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 22px;
    color: var(--accent-dark);
    font-size: 22px;
    line-height: 1;
}

.account-card {
    margin-top: 22px;
    padding: 18px 16px;
    display: grid;
    grid-template-columns: 52px 1fr 18px;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--line);
}

.account-avatar {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #ebe5df;
    color: var(--accent-dark);
    font-size: 28px;
    font-weight: 700;
}

.account-card strong,
.account-card small {
    display: block;
}

.account-card strong {
    font-size: 14px;
}

.account-card small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.page {
    width: min(1500px, calc(100% - 34px));
    margin: 32px auto 36px;
}

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

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: 34px;
    line-height: 1.05;
    letter-spacing: 0;
}

.topbar p {
    margin-top: 16px;
    color: #312a28;
    font-size: 18px;
}

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

.home-page {
    display: grid;
    gap: 26px;
}

.home-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 28px;
}

.home-top h1 {
    font-size: 34px;
    line-height: 1;
}

.home-top h2 {
    margin-top: 26px;
    font-size: 26px;
}

.home-top p {
    margin-top: 18px;
    color: var(--muted);
    font-size: 17px;
}

.home-actions {
    display: flex;
    align-items: center;
    gap: 26px;
}

.home-notification {
    position: relative;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 26px;
}

.home-notification small {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--ink);
    color: white;
    font-size: 11px;
}

.home-datetime {
    min-width: 260px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    color: #2f2827;
}

.home-datetime strong {
    font-size: 16px;
}

.home-summary-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 24px;
}

.home-card,
.home-panel {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 36px rgba(98, 80, 70, 0.06);
}

.home-card {
    position: relative;
    min-height: 174px;
    padding: 34px 38px;
}

.home-card span,
.home-panel th {
    color: #322b29;
    font-size: 16px;
}

.home-card strong {
    display: block;
    margin-top: 28px;
    font-size: 38px;
    line-height: 0.95;
}

.home-card small {
    display: block;
    margin-top: 18px;
    color: var(--muted);
    font-size: 15px;
}

.home-card-link {
    cursor: pointer;
}

.home-card-link button {
    position: absolute;
    right: 34px;
    bottom: 36px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 30px;
}

.home-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
    gap: 24px;
}

.home-panel {
    min-height: 440px;
    padding: 28px 30px;
    overflow: hidden;
}

.home-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
}

.home-panel-head h2 {
    font-size: 20px;
}

.home-count-chip {
    padding: 7px 12px;
    border-radius: 8px;
    background: #f3f1f0;
    color: #2f2927;
    font-size: 13px;
    font-weight: 800;
}

.home-table-wrap {
    width: 100%;
    overflow: hidden;
    margin-top: 6px;
}

.home-low-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: collapse;
    border-spacing: 0;
    overflow: visible;
}

.home-low-table th,
.home-low-table td {
    padding: 15px 10px;
    border-bottom: 1px solid #eee6e0;
    text-align: left;
    font-size: 15px;
    overflow-wrap: anywhere;
    white-space: normal;
}

.home-low-table th:nth-child(2),
.home-low-table td:nth-child(2) {
    width: 24%;
    text-align: left;
}

.home-low-table th:nth-child(3),
.home-low-table td:nth-child(3) {
    width: 20%;
    text-align: left;
}

.home-low-table th:first-child,
.home-low-table td:first-child {
    width: 39%;
    padding-left: 18px;
}

.home-low-table th:last-child,
.home-low-table td:last-child {
    width: 17%;
    padding-right: 18px;
    text-align: left;
}

.home-low-table th {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

.home-low-table .danger {
    color: #d41414;
}

.home-low-table .warning {
    color: #d86600;
}

.home-low-table .ok {
    color: #187a36;
}

.home-link-button {
    margin-top: 24px;
    display: inline-flex;
    align-items: center;
    gap: 16px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-weight: 600;
}

.home-link-button.compact {
    margin-top: 0;
}

.home-timeline {
    display: grid;
    gap: 0;
}

.home-timeline-item {
    display: grid;
    grid-template-columns: 58px 28px minmax(0, 1fr) minmax(76px, auto);
    gap: 14px;
    align-items: start;
    min-height: 78px;
    position: relative;
}

.home-timeline-item::before {
    content: "";
    position: absolute;
    left: 71px;
    top: 18px;
    bottom: -18px;
    width: 1px;
    background: #ded8d3;
}

.home-timeline-item:last-child::before {
    display: none;
}

.home-time {
    font-weight: 600;
}

.home-dot {
    width: 9px;
    height: 9px;
    margin-top: 6px;
    border-radius: 999px;
    background: #77716e;
    z-index: 1;
}

.home-timeline-item strong,
.home-timeline-item small {
    display: block;
}

.home-timeline-item strong {
    font-size: 16px;
}

.home-timeline-item small {
    margin-top: 8px;
    color: var(--muted);
    font-size: 15px;
}

.home-pill {
    padding: 9px 16px;
    border: 1px solid #e7ded8;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    font-weight: 700;
    font-size: 14px;
}

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

.profile-menu {
    position: relative;
}

.profile-trigger,
.notification-button,
.export-button,
.filter-button,
.primary,
.secondary,
.ghost-button,
.edit-button,
.danger-button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--accent-dark);
    box-shadow: var(--shadow);
}

.profile-trigger {
    min-width: 295px;
    min-height: 58px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
}

.profile-avatar,
.summary-icon,
.alert-icon {
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--soft);
    color: var(--accent-dark);
}

.profile-avatar {
    width: 36px;
    height: 36px;
    font-size: 18px;
}

.chevron {
    margin-left: auto;
    color: var(--accent-dark);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 260px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow);
    display: none;
    z-index: 10;
}

.profile-dropdown.open {
    display: grid;
    gap: 8px;
}

.profile-item {
    display: block;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
}

.profile-summary {
    background: var(--soft);
    color: var(--accent-dark);
    font-weight: 700;
}

.profile-item-danger {
    color: var(--danger);
    background: #fff4f1;
    font-weight: 700;
}

.notification-button {
    position: relative;
    width: 60px;
    height: 58px;
    display: grid;
    place-items: center;
    font-size: 25px;
}

.notification-button small {
    position: absolute;
    top: -7px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--warning);
    color: white;
    font-size: 11px;
    font-weight: 800;
}

.export-button {
    min-height: 58px;
    padding: 0 26px;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #6c5b5b, #4d403f);
    color: white;
    font-weight: 700;
}

.report-card,
.alertas,
.command-card,
.card,
.summary-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.report-card {
    min-height: 148px;
    padding: 28px;
    display: grid;
    grid-template-columns: 1fr 1fr 1.12fr;
    gap: 58px;
    align-items: end;
}

.field {
    display: grid;
    gap: 12px;
    color: #332c2b;
    font-weight: 500;
}

input,
select {
    width: 100%;
    min-height: 58px;
    border: 1px solid #e7ded8;
    border-radius: 12px;
    padding: 0 18px;
    background: white;
    color: var(--ink);
    font-size: 16px;
    outline: none;
}

select {
    appearance: auto;
}

input::placeholder {
    color: #9a918e;
}

.alertas {
    min-height: 90px;
    margin-top: 30px;
    padding: 18px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 28px;
    color: var(--danger);
    font-weight: 700;
}

.alert-icon {
    width: 58px;
    height: 58px;
    background: #f7eee4;
    color: var(--warning);
    font-size: 28px;
}

.alertas.ok .alert-content {
    color: var(--accent-dark);
}

.alertas a {
    display: inline-flex;
    align-items: center;
    gap: 22px;
    color: #433936;
    text-decoration: none;
    white-space: nowrap;
}

.alertas a span {
    color: var(--danger);
    font-size: 36px;
    line-height: 1;
}

.command-card {
    margin-top: 30px;
    overflow: hidden;
}

.search-row {
    padding: 16px 22px;
    display: grid;
    grid-template-columns: 1fr 160px;
    gap: 26px;
    border-bottom: 1px solid var(--line);
}

.search-box {
    min-height: 60px;
    display: grid;
    grid-template-columns: 32px 1fr;
    align-items: center;
    gap: 12px;
    border: 1px solid #e6dfda;
    border-radius: 12px;
    padding: 0 18px;
}

.search-box span {
    color: var(--accent-dark);
    font-size: 26px;
}

.search-box input {
    min-height: 56px;
    border: 0;
    padding: 0;
    box-shadow: none;
}

.filter-button {
    min-height: 60px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    font-weight: 700;
    box-shadow: none;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.summary-grid {
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 20px;
}

.summary-card {
    min-height: 170px;
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 28px;
}

.summary-icon {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    color: var(--accent-dark);
    font-size: 36px;
}

.summary-icon.warn {
    color: var(--warning);
}

.summary-label {
    display: block;
    color: #2f2827;
    font-size: 15px;
}

.summary-card strong {
    display: block;
    margin-top: 12px;
    font-size: 30px;
    line-height: 1;
}

.summary-card small {
    display: block;
    margin-top: 16px;
    color: var(--muted);
    font-size: 15px;
}

.summary-card .warning-text {
    color: var(--warning);
}

.card {
    margin-top: 28px;
    padding: 28px;
}

.card > h2:first-child {
    margin-bottom: 22px;
}

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

h2 {
    font-size: 24px;
    line-height: 1.15;
}

.stock-month-toolbar,
.pagination-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
}

.stock-month-toolbar select {
    min-width: 150px;
}

.pagination-info {
    min-width: 110px;
    text-align: center;
    color: var(--muted);
    font-weight: 700;
}

.table-card {
    overflow: auto;
}

table {
    width: 100%;
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
}

th,
td {
    padding: 21px 22px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
}

th {
    background: #fbf7f4;
    font-size: 14px;
    font-weight: 800;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 600;
}

.status::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
}

.status-acabou {
    color: var(--danger);
    background: #fff1ee;
}

.status-encomendar {
    color: #e36f00;
    background: #fff4e8;
}

.status-bom {
    color: #22704a;
    background: #ecf8f1;
}

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

.edit-button,
.danger-button {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 50%;
    background: white;
    box-shadow: 0 8px 18px rgba(73, 58, 52, 0.08);
    font-size: 20px;
}

.edit-button {
    color: var(--accent-dark);
}

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

.produto-form,
.supplier-form {
    display: grid;
    gap: 16px;
}

.produto-form-compact {
    max-width: 1280px;
    width: 100%;
}

.supplier-form {
    grid-template-columns: 1.3fr 1fr 1fr auto;
    align-items: center;
}

.supplier-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.primary,
.secondary,
.ghost-button {
    min-height: 54px;
    padding: 0 24px;
    font-weight: 800;
    white-space: nowrap;
}

.primary {
    background: linear-gradient(135deg, #7c6968, #604f4e);
    color: white;
}

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

.ghost-button {
    background: white;
    color: var(--accent-dark);
    box-shadow: none;
}

.product-core-grid,
.current-month-grid,
.months-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 16px;
}

.product-quantity-grid {
    grid-template-columns: 260px 110px;
    justify-content: start;
}

.product-catalog-grid {
    grid-template-columns: 300px 380px auto;
    justify-content: start;
    align-items: center;
}

.produto-form-compact input,
.produto-form-compact select {
    min-height: 52px;
    width: 100%;
}

.produto-form-compact select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 38px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--accent-dark) 50%),
        linear-gradient(135deg, var(--accent-dark) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 13px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.catalog-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.catalog-actions .edit-button,
.catalog-actions .danger-button {
    width: 38px;
    height: 38px;
    box-shadow: none;
    font-size: 16px;
}

.catalog-actions button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.current-month-card,
.month-field {
    display: grid;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffaf6;
}

.produto-form-compact .current-month-card {
    width: min(1240px, 100%);
    max-width: none;
    box-sizing: border-box;
}

.current-month-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.month-nav-button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: white;
    color: var(--accent-dark);
    font-size: 26px;
    line-height: 1;
}

.current-month-title-wrap {
    text-align: center;
}

.current-month-title-wrap strong {
    display: block;
    margin-top: 6px;
}

.current-month-grid {
    grid-template-columns: minmax(520px, 1fr) 340px;
}

.empty-table-cell {
    padding: 28px 22px;
    color: var(--muted);
    text-align: center;
}

.month-field label,
.field span,
.stock-month-toolbar label {
    color: #403634;
    font-size: 15px;
}

.hidden {
    display: none !important;
}

.daily-summary-grid .summary-card {
    display: grid;
    gap: 8px;
    align-items: start;
}

.daily-summary-grid .summary-card strong {
    margin-top: 4px;
}

.module-head {
    margin-top: 28px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

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

.finance-summary-grid .summary-card {
    min-height: 132px;
}

.finance-toolbar {
    margin-top: 28px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
}

.finance-new-button {
    min-width: 180px;
}

.finance-editor {
    margin-top: 28px;
}

.finance-editor-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--line);
}

.finance-editor-head p {
    margin-top: 8px;
    color: var(--muted);
}

.icon-button {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ink);
    font-size: 28px;
    box-shadow: none;
}

.finance-form {
    margin-top: 26px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
}

.finance-main-form,
.finance-side-panel {
    display: grid;
    gap: 18px;
}

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

.finance-form label,
.finance-form label span {
    display: grid;
    gap: 8px;
}

.finance-form label span {
    color: #3d3431;
    font-weight: 700;
}

.finance-form textarea {
    min-height: 105px;
    border: 1px solid #e7ded8;
    border-radius: 12px;
    padding: 16px 18px;
    font: inherit;
    resize: vertical;
}

.finance-form-wide {
    grid-column: 1 / -1;
}

.finance-side-panel {
    align-self: start;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
}

.impact-card,
.success-impact,
.info-box {
    display: grid;
    gap: 10px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
}

.impact-card strong {
    font-size: 26px;
}

.success-impact {
    background: #edf8ef;
    color: #16713c;
}

.success-impact strong {
    font-size: 24px;
}

.info-box {
    background: #f5f9ff;
    color: var(--muted);
}

.finance-editor-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.finance-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
}

.detail-card {
    align-self: start;
    min-height: 320px;
}

.empty-detail {
    min-height: 220px;
    display: grid;
    place-items: center;
    color: var(--muted);
    text-align: center;
    line-height: 1.5;
}

.detail-list {
    display: grid;
    gap: 12px;
    color: var(--muted);
}

.detail-list strong {
    color: var(--ink);
    font-size: 18px;
}

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

    .sidebar {
        position: static;
        height: auto;
        padding: 12px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .side-brand {
        display: none;
    }

    .side-nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
    }

    .side-group {
        display: flex;
        gap: 8px;
    }

    .side-parent-row {
        display: flex;
    }

    .side-link {
        min-width: max-content;
        min-height: 50px;
        border-radius: 8px;
    }

    .side-parent-row .side-link {
        border-radius: 8px;
    }

    .side-toggle {
        min-width: 44px;
        min-height: 50px;
        border-radius: 8px;
        background: white;
        border: 1px solid var(--line);
    }

    .side-submenu {
        display: flex;
        padding: 0;
        gap: 8px;
    }

    .side-sub-link {
        min-width: max-content;
        border: 1px solid var(--line);
        background: white;
    }

    .side-link.active::before,
    .sidebar-footer {
        display: none;
    }

    .page {
        width: min(100% - 28px, 1450px);
        margin-top: 24px;
    }
}

@media (max-width: 920px) {
    .topbar,
    .alertas,
    .section-header {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar-actions {
        justify-content: flex-start;
        gap: 12px;
    }

    .profile-trigger {
        min-width: min(100%, 295px);
    }

    .report-card,
    .home-summary-grid,
    .home-content-grid,
    .summary-grid,
    .search-row,
    .finance-form,
    .finance-form-grid,
    .finance-grid,
    .product-core-grid,
    .current-month-grid,
    .months-grid,
    .supplier-form {
        grid-template-columns: 1fr;
    }

    .home-top,
    .home-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .home-datetime {
        min-width: 0;
        width: 100%;
    }

    .home-panel {
        min-height: auto;
    }

    .home-timeline-item {
        grid-template-columns: 52px 22px minmax(0, 1fr);
    }

    .home-pill {
        grid-column: 3;
        width: max-content;
    }

    .finance-form-wide {
        grid-column: auto;
    }

    .summary-card {
        min-height: 140px;
    }
}

@media (max-width: 560px) {
    .page {
        width: calc(100% - 18px);
    }

    h1 {
        font-size: 28px;
    }

    .topbar p {
        font-size: 16px;
    }

    .report-card,
    .card,
    .summary-card,
    .home-card,
    .home-panel,
    .alertas {
        padding: 18px;
    }

    .home-low-table {
        min-width: 560px;
    }

    .home-panel {
        overflow: auto;
    }

}
