:root {
    --brand-pink: #facfd8;
    --brand-green: #bdd4c2;
    --bg: #fffaf9;
    --panel: #fffefd;
    --ink: #2a2527;
    --muted: #74686c;
    --line: #eadfe2;
    --accent: #426f57;
    --accent-dark: #2f5743;
    --rose-ink: #8c4155;
    --soft-green: #eaf3ed;
    --soft-pink: #fff7f9;
    --ok: #2f7d5b;
    --warn: #a86913;
    --bad: #a33d3d;
    --shadow: 0 12px 34px rgba(81, 55, 47, .055);
    --deep-brown: #51372f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        linear-gradient(140deg, rgba(250, 207, 216, .12), rgba(189, 212, 194, .10) 44%, rgba(255, 250, 249, 1) 82%),
        var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
}

a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}

input,
select,
textarea,
button,
.button {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 8px;
    min-height: 46px;
    padding: 11px 13px;
    background: rgba(255, 255, 255, .78);
    box-shadow: inset 0 0 0 1px rgba(234, 217, 222, .88);
    color: var(--ink);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(189, 212, 194, .32), inset 0 0 0 1px rgba(66, 111, 87, .25);
}

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

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    cursor: pointer;
    font-weight: 800;
    background: var(--soft-green);
}

.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

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

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 238px;
    background:
        linear-gradient(180deg, rgba(255, 247, 249, .96), rgba(252, 237, 240, .92)),
        #fff7f9;
    color: var(--ink);
    padding: 16px;
    overflow-y: auto;
    scrollbar-width: none;
    border-right: 1px solid rgba(234, 223, 226, .8);
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.brand {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
    padding: 4px 2px 12px;
    border-bottom: 1px solid rgba(81, 55, 47, .08);
}

.brand-logo {
    display: flex;
    align-items: center;
    color: var(--ink);
}

.brand-logo img {
    width: 142px;
    height: auto;
    object-fit: contain;
    flex: 0 0 auto;
    mix-blend-mode: multiply;
}

.sidebar-logo img {
    width: 176px;
    max-width: 100%;
}

.auth-logo {
    justify-content: center;
    width: 100%;
    min-height: 58vh;
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .76), rgba(255, 255, 255, .38)),
        linear-gradient(135deg, rgba(250, 207, 216, .44), rgba(189, 212, 194, .38));
    border: 1px solid rgba(255, 255, 255, .85);
    box-shadow: 0 30px 90px rgba(81, 55, 47, .12);
    padding: clamp(24px, 5vw, 58px);
}

.auth-logo img {
    width: min(620px, 100%);
    filter: drop-shadow(0 18px 30px rgba(81, 55, 47, .08));
}

.invoice-logo img {
    width: 230px;
    max-width: 100%;
}

.user-line {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    padding-left: 2px;
}

.sidebar nav {
    display: grid;
    gap: 3px;
}

.sidebar a {
    color: var(--ink);
    padding: 8px 10px;
    border-radius: 8px;
    font-weight: 700;
}

.sidebar a:hover {
    background: rgba(189, 212, 194, .28);
}

.nav-item {
    display: grid;
    gap: 2px;
    border: 1px solid transparent;
    transition: background .18s ease, transform .18s ease, border-color .18s ease;
}

.nav-item span {
    font-size: 13px;
}

.nav-item small {
    color: rgba(81, 55, 47, .56);
    font-size: 10px;
    font-weight: 800;
}

.nav-item:hover {
    transform: translateX(2px);
}

.nav-item.active {
    background: rgba(255, 255, 255, .72);
    border-color: rgba(234, 223, 226, .82);
    box-shadow: none;
}

.nav-item.active small {
    color: var(--accent-dark);
}

.logout-link {
    margin-top: 10px;
    color: var(--rose-ink);
}

.shell {
    margin-left: 238px;
    padding: 24px 26px;
}

.auth-shell {
    position: relative;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, .95fr) minmax(360px, 500px);
    gap: 42px;
    align-items: center;
    padding: 44px clamp(28px, 5vw, 76px);
    background:
        radial-gradient(circle at 20% 18%, rgba(250, 207, 216, .75), transparent 28%),
        radial-gradient(circle at 85% 75%, rgba(189, 212, 194, .72), transparent 26%),
        linear-gradient(135deg, #fffafb 0%, #fff3f6 48%, #f4fbf6 100%);
}

.page-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(234, 223, 226, .75);
}

.auth-shell .page-head {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    border-bottom: 0;
    margin-bottom: 8px;
    padding: 0;
}

.auth-shell .page-head h1 {
    display: none;
}

h1,
h2 {
    margin: 0;
    letter-spacing: 0;
}

h1 {
    font-size: 30px;
}

h2 {
    font-size: 18px;
}

.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    background: #eaf6ef;
    color: #1f6a49;
    border: 1px solid #cce8d8;
}

.alert.error {
    background: #fff0f0;
    border-color: #f3cccc;
    color: var(--bad);
}

.panel,
.auth-card {
    min-width: 0;
    background: rgba(255, 255, 255, .78);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 18px;
}

.filter-panel {
    background: rgba(255, 255, 255, .76);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 16px;
}

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

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

.filter-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

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

.mini-stats article {
    background: linear-gradient(135deg, #fff, var(--soft-pink));
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.mini-stats small {
    color: var(--muted);
    display: block;
    margin-bottom: 8px;
}

.mini-stats strong {
    font-size: 22px;
}

.auth-card {
    width: 100%;
    max-width: 500px;
    padding: 30px;
    background: rgba(255, 255, 255, .82);
    border: 1px solid rgba(234, 217, 222, .85);
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 70px rgba(81, 55, 47, .13);
}

.auth-card::before {
    content: "Acceso privado";
    display: inline-flex;
    margin-bottom: 18px;
    padding: 7px 11px;
    border-radius: 999px;
    background: var(--soft-green);
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.auth-alert {
    margin: 0 0 16px;
    padding: 10px 12px;
    font-size: 13px;
    box-shadow: none;
}

.auth-card .form-grid {
    gap: 16px;
}

.auth-card label {
    color: var(--deep-brown);
    font-size: 13px;
}

.auth-card input {
    min-height: 52px;
    border: 1px solid transparent;
    background: #fff7f9;
    box-shadow: inset 0 0 0 1px rgba(234, 217, 222, .9);
}

.auth-card input:focus {
    outline: none;
    border-color: rgba(66, 111, 87, .25);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(189, 212, 194, .35);
}

.auth-card .primary {
    width: 100%;
    min-height: 52px;
    margin-top: 4px;
    border-radius: 8px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.stats article {
    background: rgba(255, 255, 255, .72);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: var(--shadow);
}

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

.quick-actions a {
    min-height: 64px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .76);
    border: 1px solid var(--line);
    box-shadow: none;
    color: var(--deep-brown);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.quick-actions a:hover {
    background: #fff;
    border-color: #cabdb8;
    transform: translateY(-1px);
}

.quick-action-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--deep-brown);
}

.quick-action-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rental-icon {
    background: #e5f1e9;
    color: #35654e;
}

.client-icon {
    background: #f9e9ed;
    color: #914f60;
}

.dress-icon {
    background: #eee9f5;
    color: #66517e;
}

.sale-icon {
    background: #f6eedc;
    color: #7c632e;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.dashboard-grid > * {
    min-width: 0;
}

.wide-panel {
    grid-column: 1 / -1;
}

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

.today-metrics div {
    padding: 18px 12px;
    border-radius: 8px;
    background: var(--soft-green);
    text-align: center;
}

.today-metrics strong {
    display: block;
    font-size: 28px;
}

.today-metrics small,
.muted {
    color: var(--muted);
}

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

.compact-list a {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 12px;
    border-radius: 8px;
    background: rgba(255, 247, 249, .58);
}

.rental-builder {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 16px;
    align-items: start;
}

.invoice-builder {
    position: sticky;
    top: 18px;
    display: grid;
    gap: 12px;
}

.accessory-picker {
    display: grid;
    gap: 8px;
    max-height: 320px;
    overflow: auto;
    padding-right: 4px;
}

.accessory-picker label {
    grid-template-columns: 1fr 76px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.accessory-picker small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
}

.accessory-picker input {
    min-height: 38px;
}

.stats small {
    color: var(--muted);
    display: block;
    margin-bottom: 10px;
}

.stats strong {
    font-size: 25px;
}

.split {
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr;
    gap: 16px;
    align-items: start;
}

.dress-layout {
    grid-template-columns: minmax(340px, 430px) 1fr;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

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

.form-grid h2,
.form-grid .wide,
.form-grid button {
    grid-column: 1 / -1;
}

.dress-form {
    position: sticky;
    top: 18px;
}

.photo-uploader {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 14px;
    align-items: center;
    padding: 12px;
    background: linear-gradient(135deg, var(--soft-pink), #fff);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.photo-preview {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: #fff;
    border: 1px dashed #ddbfc8;
    color: var(--muted);
    font-weight: 800;
    text-align: center;
}

.photo-preview img,
.dress-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.subtle-field {
    opacity: .82;
}

.inventory-panel {
    padding: 16px;
}

.dress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
}

.dress-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(140, 65, 85, .08);
}

.dress-photo {
    aspect-ratio: 4 / 5;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--soft-pink), var(--soft-green));
    color: var(--rose-ink);
    font-size: 28px;
    font-weight: 900;
}

.dress-info,
.dress-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
}

.dress-info {
    align-items: flex-start;
}

.dress-info small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.4;
}

.dress-meta {
    align-items: center;
    border-top: 1px solid var(--line);
    background: #fff9fb;
    font-weight: 900;
}

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

.field-help {
    min-height: 32px;
    color: #847873;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
}

.invoice-builder .field-help {
    min-height: auto;
}

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

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

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

.toolbar {
    justify-content: flex-start;
}

.toolbar label {
    min-width: 220px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

.table-scroll table {
    min-width: 1040px;
}

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

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    background: #fff7f9;
}

td small {
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--soft-pink);
    color: var(--rose-ink);
    font-size: 12px;
    font-weight: 900;
}

.paid,
.activo,
.disponible,
.devuelta {
    background: var(--soft-green);
    color: var(--ok);
}

.pending,
.partial,
.reservado,
.reservada,
.en-prueba,
.entregada {
    background: #fff5df;
    color: var(--warn);
}

.cancelled,
.inactivo,
.fuera-de-servicio,
.mantenimiento {
    background: #ffeded;
    color: var(--bad);
}

.por-devolver {
    background: #fff5df;
    color: var(--warn);
}

.retenido {
    background: #ffeded;
    color: var(--bad);
}

.no-recibido {
    background: #f1efee;
    color: var(--muted);
}

.invoice-wrap {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 16px;
    align-items: start;
}

.invoice {
    background: #fff;
}

.invoice-top {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.invoice-top p {
    color: var(--muted);
    line-height: 1.5;
}

.invoice-number {
    display: grid;
    justify-items: end;
    align-content: start;
    gap: 8px;
}

.invoice-number strong {
    font-size: 24px;
}

.totals {
    margin-left: auto;
    margin-top: 18px;
    width: min(360px, 100%);
    display: grid;
    gap: 8px;
}

.totals span {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.deposit-summary {
    width: min(420px, 100%);
    margin-top: 18px;
    margin-left: auto;
    padding: 12px 14px;
    border: 1px solid #d4e6d9;
    border-radius: 8px;
    background: var(--soft-green);
    color: var(--accent-dark);
}

.deposit-summary span {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.deposit-summary small {
    display: block;
    margin-top: 5px;
    color: var(--muted);
}

.actions {
    display: grid;
    gap: 14px;
}

.action-section {
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.fiscal-note {
    margin: 0;
    padding: 10px;
    border-radius: 8px;
    background: #fff5df;
    color: var(--warn);
    font-size: 12px;
    line-height: 1.45;
}

.invoice-link {
    background: var(--soft-green);
    border: 1px solid #d7e8dc;
    border-radius: 8px;
    padding: 10px 12px;
    overflow-wrap: anywhere;
}

.message-menu {
    position: relative;
    min-width: 168px;
}

.message-menu summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 999px;
    background: var(--soft-green);
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 900;
}

.message-menu summary::-webkit-details-marker {
    display: none;
}

.message-menu div {
    position: absolute;
    z-index: 5;
    top: 40px;
    right: 0;
    width: 210px;
    display: grid;
    gap: 6px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(81, 55, 47, .14);
}

.message-menu a {
    padding: 9px 10px;
    border-radius: 7px;
    color: var(--deep-brown);
}

.message-menu a:hover,
.message-menu a.strong {
    background: var(--soft-pink);
    color: var(--rose-ink);
}

.public-invoice-page {
    background: linear-gradient(135deg, #fffafb, #f4fbf6);
}

.public-invoice-shell {
    width: min(920px, calc(100% - 32px));
    margin: 32px auto;
}

.inline-form {
    display: inline;
}

.inline-form button {
    min-height: 34px;
    padding: 7px 10px;
}

.row-actions {
    min-width: 154px;
    display: grid;
    gap: 7px;
}

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

.danger-button {
    border-color: #efcaca;
    background: #fff1f1;
    color: var(--bad);
}

.deposit-button {
    border-color: #cfe2d4;
    background: var(--soft-green);
    color: var(--ok);
}

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

.user-create-form {
    align-items: end;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.user-create-form h2 {
    grid-column: 1 / -1;
}

.user-create-form button {
    width: 100%;
}

.users-table-scroll table {
    min-width: 860px;
}

.users-table-scroll td {
    vertical-align: top;
}

.user-actions {
    min-width: 170px;
    vertical-align: top;
}

.user-manage {
    width: min(280px, 100%);
}

.user-manage > summary {
    align-items: center;
    background: var(--soft-green);
    border: 1px solid #cfe2d4;
    border-radius: 7px;
    color: var(--ok);
    cursor: pointer;
    display: flex;
    font-weight: 800;
    justify-content: space-between;
    list-style: none;
    min-height: 38px;
    padding: 8px 12px;
}

.user-manage > summary::-webkit-details-marker,
.user-password-details > summary::-webkit-details-marker {
    display: none;
}

.user-manage > summary::after {
    border-bottom: 2px solid currentColor;
    border-right: 2px solid currentColor;
    content: "";
    height: 7px;
    margin-left: 12px;
    transform: rotate(45deg) translateY(-2px);
    transition: transform .18s ease;
    width: 7px;
}

.user-manage[open] > summary::after {
    transform: rotate(225deg) translate(-2px, -2px);
}

.user-manage-menu {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 7px;
    box-shadow: 0 10px 24px rgba(81, 55, 47, .08);
    display: grid;
    gap: 12px;
    margin-top: 7px;
    padding: 12px;
}

.user-manage-form {
    display: grid;
    gap: 8px;
}

.user-manage-form label {
    display: grid;
    gap: 5px;
}

.user-manage-form label > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.user-manage-form select,
.user-manage-form input {
    min-width: 0;
    width: 100%;
}

.user-manage-form button,
.user-status-form button {
    width: 100%;
}

.user-password-details {
    border-bottom: 1px solid var(--line);
    border-top: 1px solid var(--line);
    padding: 10px 0;
}

.user-password-details > summary {
    align-items: center;
    color: var(--ok);
    cursor: pointer;
    display: flex;
    font-weight: 700;
    justify-content: space-between;
    list-style: none;
}

.user-password-details > summary::after {
    content: "+";
    font-size: 18px;
    font-weight: 500;
}

.user-password-details[open] > summary::after {
    content: "−";
}

.user-password-details .user-manage-form {
    margin-top: 12px;
}

@media (max-width: 980px) {
    .user-create-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .shell {
        margin-left: 0;
        padding: 18px;
    }

    .brand {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 10px;
        padding: 0 2px 10px;
    }

    .sidebar-logo img {
        width: 132px;
    }

    .user-line {
        text-align: right;
        white-space: nowrap;
    }

    .sidebar nav {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 3px;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }

    .sidebar nav::-webkit-scrollbar {
        display: none;
    }

    .nav-item {
        flex: 0 0 auto;
        min-width: 126px;
        min-height: 48px;
        scroll-snap-align: start;
    }

    .logout-link {
        margin-top: 0;
    }

    .stats,
    .mini-stats,
    .quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid,
    .split,
    .dress-layout,
    .invoice-wrap,
    .rental-builder,
    .form-grid.roomy,
    .filter-grid {
        grid-template-columns: 1fr;
    }

    .dress-form {
        position: static;
    }

    .invoice-builder {
        position: static;
    }

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

    .auth-shell {
        grid-template-columns: 1fr;
        gap: 22px;
        padding: 24px;
        justify-items: center;
        align-content: center;
    }

    .auth-shell .page-head,
    .auth-card {
        width: min(620px, 100%);
    }

    .auth-logo {
        min-height: auto;
        padding: 22px;
    }

    .auth-logo img {
        width: min(430px, 100%);
    }

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

    table {
        width: 100%;
        max-width: 100%;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media (max-width: 600px) {
    .user-create-form {
        grid-template-columns: 1fr;
    }

    body {
        font-size: 14px;
    }

    .sidebar {
        padding: 10px 12px;
    }

    .brand {
        gap: 10px;
    }

    .sidebar-logo img {
        width: 112px;
    }

    .user-line {
        max-width: 150px;
        white-space: normal;
        line-height: 1.3;
    }

    .nav-item {
        min-width: 112px;
    }

    .shell {
        padding: 14px 12px;
    }

    .page-head {
        margin-bottom: 14px;
    }

    h1 {
        font-size: 25px;
    }

    .stats,
    .mini-stats,
    .quick-actions {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .panel,
    .filter-panel,
    .auth-card {
        padding: 15px;
    }

    .auth-shell {
        gap: 14px;
        padding: 14px;
        align-content: start;
    }

    .auth-logo {
        padding: 12px;
    }

    .auth-logo img {
        width: min(300px, 100%);
    }

    .auth-card {
        padding: 22px 18px;
    }

    input,
    select,
    textarea,
    button,
    .button {
        min-height: 48px;
    }

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

    .invoice-top {
        display: grid;
    }

    .invoice-number {
        justify-items: start;
    }

    .filter-actions,
    .panel-head,
    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-actions > *,
    .panel-head > .button,
    .toolbar > * {
        width: 100%;
    }

    .toolbar label {
        min-width: 0;
    }
}

@media print {
    body {
        background: #fff;
    }

    .sidebar,
    .page-head,
    .actions,
    .alert {
        display: none;
    }

    .shell {
        margin: 0;
        padding: 0;
    }

    .invoice-wrap {
        display: block;
    }

    .panel {
        box-shadow: none;
        border: none;
    }
}
