:root {
    --color-app-bg: #070B10;
    --color-panel: #DDEBEA;
    --color-section: #BFD4D2;
    --color-card: #F8FBFB;
    --color-input: #FFFFFF;
    --color-accent: #00AFC8;
    --color-accent-text: #06252D;
    --color-text: #1F2933;
    --bg: #F4F7FA;
    --page-bg: var(--color-app-bg);
    --header-bg: #0D141C;
    --header-text: #F8FBFD;
    --header-hover: rgba(0, 207, 239, 0.14);
    --surface: var(--color-input);
    --text: var(--color-text);
    --muted: #667885;
    --border: #D8E0E8;
    --primary: var(--color-accent);
    --primary-dark: var(--color-accent);
    --danger: #D71920;
    --danger-dark: #AA1218;
    --gold: #F6B21A;
    --gold-light: #FFD86B;
    --danger-bg: #FFF1F2;
    --danger-text: #A41118;
    --success-bg: #ECFBFF;
    --success-text: #08758F;
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--page-bg);
}

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

.topbar {
    background: var(--header-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    position: relative;
}

.topbar::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--gold), var(--danger));
}

.topbar__inner {
    width: calc(100% - 48px);
    max-width: none;
    min-height: 96px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
}

.topbar__right {
    display: grid;
    gap: 8px;
    justify-items: end;
    min-width: 0;
}

.user-mini {
    color: rgba(248, 251, 253, 0.84);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    line-height: 1.2;
    max-width: 100%;
}

.user-mini span,
.user-mini strong {
    display: inline-block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-mini strong {
    border-left: 1px solid rgba(255, 255, 255, 0.28);
    color: var(--gold-light);
    font-weight: 800;
    padding-left: 8px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    color: var(--header-text);
    font-weight: 700;
    font-size: 19px;
}

.brand--plain-logo {
    background-color: transparent !important;
    background-image: none !important;
    outline: 0;
}

.brand__logo {
    display: block;
    height: 73px;
    width: auto;
    max-width: 338px;
    max-height: 73px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    object-fit: contain;
}

.topbar .brand__logo--transparent {
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 8px;
    background: var(--primary);
    color: #ffffff;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12);
}

.brand__text {
    white-space: nowrap;
}

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

.nav a {
    color: var(--header-text);
    font-weight: 700;
    text-decoration: none;
    border-radius: 8px;
    padding: 9px 11px;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.nav a:hover {
    background: var(--header-hover);
    color: var(--primary);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown__button {
    border: 0;
    background: transparent;
    color: var(--header-text);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    line-height: 1.3;
    border-radius: 8px;
    padding: 9px 11px;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.nav-dropdown__button::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 6px;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
}

.nav-dropdown__button:hover,
.nav-dropdown:focus-within .nav-dropdown__button,
.nav-dropdown:hover .nav-dropdown__button {
    background: var(--header-hover);
    color: var(--primary);
}

.nav-dropdown__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 10;
    min-width: 180px;
    display: none;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.nav-dropdown:hover .nav-dropdown__menu,
.nav-dropdown:focus-within .nav-dropdown__menu {
    display: grid;
    gap: 4px;
}

.nav-dropdown__menu a {
    display: block;
    color: var(--text);
    padding: 9px 10px;
    border-radius: 6px;
}

.nav-dropdown__menu a:hover {
    background: #F4F7FA;
    color: var(--primary-dark);
}

.page {
    width: calc(100% - 48px);
    max-width: none;
    margin: 32px auto;
}

.panel,
.login-card {
    background: var(--color-panel);
    border: 1px solid #B8D8E4;
    border-radius: 8px;
    padding: 26px;
    box-shadow: var(--shadow);
    color: var(--text);
    position: relative;
    overflow: hidden;
}

.panel--products {
    width: 100%;
    max-width: none;
    background: var(--color-panel);
    border-color: #9DBFD2;
}

.panel--editing {
    border-color: var(--gold);
    box-shadow: 0 18px 42px rgba(246, 178, 26, 0.2);
}

.panel::before,
.login-card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--gold));
}

.login-card {
    max-width: 420px;
    margin: 48px auto;
}

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

h1 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 30px;
    line-height: 1.15;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.muted {
    color: #4B5D6B;
}

.section-title {
    margin: 0 0 14px;
    font-size: 20px;
    line-height: 1.25;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.panel--products .split-layout {
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
}

.products-form-pane,
.products-list-pane {
    border: 1px solid #9FBAB7;
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(8, 20, 31, 0.08);
    padding: 20px;
}

.products-form-pane {
    background: var(--color-section);
}

.products-list-pane {
    background: var(--color-section);
}

.info-box {
    border: 1px solid #C8DDE8;
    border-radius: 8px;
    padding: 18px;
    background: var(--color-card);
    box-shadow: 0 8px 20px rgba(31, 41, 51, 0.07);
}

.label {
    display: block;
    color: #425466;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 4px;
}

.info-box strong {
    display: block;
    color: var(--text);
    font-size: 20px;
    line-height: 1.25;
}

.dashboard-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 340px));
    gap: 22px;
    justify-content: center;
    padding: clamp(20px, 7vw, 72px) 0;
}

.dashboard-tile {
    position: relative;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    min-height: 124px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0) 34%),
        linear-gradient(145deg, #1DE4FF 0%, var(--primary) 48%, #08758F 100%);
    box-shadow:
        0 18px 0 #064A5A,
        0 28px 46px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        inset 0 -10px 22px rgba(0, 0, 0, 0.24);
    color: var(--color-accent-text);
    overflow: hidden;
    padding: 24px;
    text-decoration: none;
    transform: translateY(0);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.dashboard-tile::after {
    content: "";
    position: absolute;
    top: 10px;
    right: 16px;
    left: 16px;
    height: 34%;
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.dashboard-tile:hover,
.dashboard-tile:focus {
    filter: saturate(1.08);
    transform: translateY(4px);
    box-shadow:
        0 14px 0 #064A5A,
        0 22px 36px rgba(0, 0, 0, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        inset 0 -10px 22px rgba(0, 0, 0, 0.24);
}

.dashboard-tile__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: inset 0 -5px 0 rgba(8, 20, 31, 0.16), 0 8px 18px rgba(8, 20, 31, 0.2);
    color: #064A5A;
    font-size: 28px;
    font-weight: 900;
}

.dashboard-tile__text {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.dashboard-tile__text strong {
    font-size: 26px;
    line-height: 1.1;
}

.dashboard-tile__text small {
    color: rgba(6, 37, 45, 0.82);
    font-size: 14px;
    font-weight: 800;
}

.form {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.filter-form {
    margin: 0 0 18px;
}

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

.filter-row input {
    flex: 1 1 220px;
}

.products-filter-form .filter-row {
    align-items: flex-end;
}

.products-filter-form .filter-row input {
    flex: 0 1 620px;
    max-width: 620px;
}

label {
    color: #263746;
    font-size: 15px;
    font-weight: 700;
}

input {
    width: 100%;
    border: 1px solid #B5C8D6;
    border-radius: 8px;
    padding: 13px 12px;
    font: inherit;
    background: var(--color-input);
}

select {
    width: 100%;
    border: 1px solid #B5C8D6;
    border-radius: 8px;
    padding: 13px 12px;
    background: var(--color-input);
    font: inherit;
}

.panel--products input,
.panel--products select,
.panel--products textarea {
    background: var(--color-input);
    border-color: #8FAFC3;
    box-shadow: inset 0 1px 0 rgba(8, 20, 31, 0.06), 0 1px 0 rgba(255, 255, 255, 0.8);
}

.panel--products input:focus,
.panel--products select:focus,
.panel--products textarea:focus {
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 3px rgba(0, 207, 239, 0.18), inset 0 1px 0 rgba(8, 20, 31, 0.04);
}

input:focus {
    outline: 3px solid rgba(0, 207, 239, 0.22);
    border-color: var(--primary);
}

select:focus {
    outline: 3px solid rgba(0, 207, 239, 0.22);
    border-color: var(--primary);
}

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

.checkbox input {
    width: auto;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.appearance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}

.appearance-color-field {
    display: grid;
    gap: 8px;
    border: 1px solid #9FBAB7;
    border-radius: 8px;
    background: var(--color-section);
    padding: 14px;
}

.appearance-color-field input[type="color"] {
    width: 100%;
    height: 48px;
    padding: 4px;
    background: var(--color-input);
    cursor: pointer;
}

.appearance-color-field code {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--color-input);
    color: var(--text);
    font-weight: 800;
    padding: 4px 8px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    padding: 10px 16px;
    background: var(--primary);
    color: var(--color-accent-text);
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
}

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

.button--small {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 14px;
}

.button--light {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}

.button--light:hover {
    background: var(--bg);
}

.button--logout {
    border-color: rgba(0, 207, 239, 0.72);
    background: rgba(0, 207, 239, 0.12);
    color: var(--header-text);
}

.button--logout:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--color-accent-text);
}

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

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

.alert {
    margin: 18px 0;
    border: 1px solid #ffc9c9;
    border-radius: 8px;
    background: var(--danger-bg);
    color: var(--danger-text);
    padding: 12px;
}

.notice {
    margin: 18px 0;
    border: 1px solid #A7EFFF;
    border-radius: 8px;
    background: var(--success-bg);
    color: var(--success-text);
    padding: 12px;
}

.hint {
    margin: -4px 0 4px;
    color: var(--muted);
    font-size: 14px;
}

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

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

.products-table {
    min-width: 1080px;
}

.product-thumb {
    display: block;
    width: 52px;
    height: 52px;
    border: 1px solid var(--border);
    border-radius: 8px;
    object-fit: cover;
    background: #ffffff;
}

.product-photo-current {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4B5D6B;
    font-size: 13px;
}

.product-photo-current img {
    width: 72px;
    height: 72px;
    border: 1px solid var(--border);
    border-radius: 8px;
    object-fit: cover;
    background: #ffffff;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
    gap: 16px;
}

.panel--products .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
}

.empty-state {
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: #ffffff;
    color: #4B5D6B;
    padding: 18px;
}

.product-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 16px;
    border: 1px solid #9FC0D3;
    border-top: 3px solid var(--primary);
    border-radius: 8px;
    background: var(--color-card);
    box-shadow: 0 16px 34px rgba(8, 20, 31, 0.16);
    padding: 18px;
}

.product-card__media {
    width: 96px;
}

.product-card__image,
.product-card__placeholder {
    width: 96px;
    height: 96px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #F4F7FA;
}

.product-card__image {
    display: block;
    object-fit: cover;
}

.product-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667885;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
}

.product-card__body {
    min-width: 0;
}

.product-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.product-card__header > div:first-child {
    min-width: 0;
}

.product-card__badges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.product-card__code {
    color: var(--primary-dark);
    display: block;
    font-size: 13px;
    font-weight: 800;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overflow-wrap: normal;
    scrollbar-width: thin;
    text-transform: uppercase;
    white-space: nowrap;
}

.product-card h3 {
    color: var(--text);
    font-size: 19px;
    line-height: 1.25;
    margin: 4px 0 0;
    overflow-wrap: normal;
    word-break: normal;
}

.status-badge {
    border-radius: 999px;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    padding: 7px 9px;
    white-space: nowrap;
}

.status-badge--active {
    background: #DDF8EF;
    color: #0B6B4B;
}

.status-badge--inactive {
    background: #FFE8E8;
    color: #9B1C1F;
}

.status-badge--favorite {
    background: #FFF8E7;
    color: #7C5B00;
}

.product-card__details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    margin: 14px 0 0;
    padding: 10px;
    background: var(--color-panel);
    border: 1px solid #C9DDE8;
    border-radius: 8px;
}

.product-card__details div {
    min-width: 0;
    padding: 9px;
    background: var(--color-input);
    border: 1px solid #D6E5EE;
    border-radius: 7px;
}

.product-card__details dt {
    color: #526879;
    font-size: 13px;
    font-weight: 800;
    margin: 0 0 3px;
    text-transform: uppercase;
}

.product-card__details dd {
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    overflow-wrap: normal;
    word-break: normal;
}

.product-card__details dd.product-card__barcode {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    white-space: nowrap;
}

.product-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.product-card__actions form {
    margin: 0;
}

.reservation-layout {
    display: grid;
    gap: 24px;
}

.panel--reservations {
    background: var(--color-panel);
}

.reservation-form {
    gap: 12px;
}

.reservations-textareas {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
    gap: 12px;
}

.reservations-textareas textarea {
    min-height: 86px;
}

.reservations-textareas label:last-child textarea {
    min-height: 70px;
}

.section-title-row {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-title-row .section-title {
    margin-bottom: 0;
}

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

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

.form-grid--reservation-main {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.form label span,
.mapping-grid label span {
    display: block;
    margin-bottom: 6px;
}

textarea {
    width: 100%;
    border: 1px solid #B5C8D6;
    border-radius: 8px;
    padding: 13px 12px;
    background: var(--color-input);
    font: inherit;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #7B8D9B;
}

textarea:focus {
    outline: 3px solid rgba(0, 207, 239, 0.22);
    border-color: var(--primary);
}

.reservation-items {
    display: grid;
    gap: 12px;
    margin-top: 8px;
}

.reservations-products-section {
    border: 1px solid #BFD5E2;
    border-radius: 8px;
    background: var(--color-section);
    padding: 12px;
}

.reservation-items__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.reservation-items__header h3 {
    color: var(--text);
    font-size: 17px;
    margin: 0;
}

.reservation-item-row {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) minmax(96px, 120px) minmax(124px, 150px) auto;
    gap: 10px;
    align-items: end;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--color-panel);
    justify-content: start;
    padding: 10px;
}

.reservation-item-row__remove {
    margin-bottom: 0;
}

.readonly-field {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--color-panel);
    color: var(--text);
    min-height: 48px;
    padding: 11px 12px;
}

.readonly-field span {
    color: var(--muted);
    display: block;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 4px;
}

.readonly-field strong {
    color: var(--text);
    display: block;
    font-size: 18px;
}

.readonly-field small {
    color: var(--muted);
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-top: 3px;
}

.product-search-field {
    position: relative;
}

.product-search-results {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 34px rgba(8, 20, 31, 0.18);
    display: grid;
    gap: 2px;
    left: 0;
    max-height: 280px;
    overflow-y: auto;
    padding: 6px;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 20;
}

.product-search-results[hidden] {
    display: none;
}

.product-search-results__item {
    border: 0;
    border-radius: 6px;
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    padding: 8px 10px;
    text-align: left;
}

.product-search-results__item:hover,
.product-search-results__item:focus {
    background: #ECFBFF;
    outline: none;
}

.product-search-results__empty {
    color: var(--muted);
    font-weight: 800;
    padding: 8px 10px;
}

.product-favorites {
    display: grid;
    gap: 6px;
    margin-top: 8px;
}

.product-favorites > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    margin: 0;
}

.product-favorites > div {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.product-favorites--empty {
    background: var(--color-panel);
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 8px 10px;
}

.product-favorite-button {
    border: 1px solid #B8D8E4;
    border-radius: 999px;
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 9px;
}

.product-favorite-button:hover,
.product-favorite-button:focus {
    border-color: var(--primary);
    background: #ECFBFF;
    outline: none;
}

.reservation-totals {
    border-left: 3px solid var(--gold);
    border-radius: 8px;
    background: #FFF8E7;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 0;
    padding: 10px;
    position: sticky;
    bottom: 12px;
    z-index: 5;
}

.reservation-totals .readonly-field {
    background: #ffffff;
}

.reservation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.reservation-card {
    border: 1px solid #C8DDE8;
    border-top: 3px solid var(--primary);
    border-radius: 8px;
    background: var(--color-card);
    box-shadow: 0 12px 28px rgba(8, 20, 31, 0.12);
    padding: 16px;
}

.reservation-card--aperta {
    background: #F6FDFF;
    border-color: #9EDDEA;
    border-top-color: var(--primary);
}

.reservation-card--preparata {
    background: #FFF9EA;
    border-color: #F3D282;
    border-top-color: var(--gold);
}

.reservation-card--consegnata {
    background: #F1FBF6;
    border-color: #A8DFC8;
    border-top-color: #21A67A;
}

.reservation-card--annullata {
    background: #FFF2F2;
    border-color: #F2B7B9;
    border-top-color: var(--danger);
}

.reservation-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.reservation-card h3 {
    color: var(--text);
    font-size: 19px;
    line-height: 1.25;
    margin: 4px 0 0;
}

.reservation-card__description {
    border-left: 3px solid var(--primary);
    border-radius: 8px;
    background: var(--color-panel);
    color: var(--text);
    margin-top: 14px;
    padding: 10px 12px;
}

.reservation-card__items {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.reservation-card__items div {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    display: grid;
    gap: 3px;
    padding: 9px 10px;
}

.reservation-card__items strong,
.reservation-card__items span,
.reservation-card__items small {
    overflow-wrap: anywhere;
}

.reservation-card__items small {
    color: var(--muted);
    font-weight: 700;
}

.reservation-card__actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.reservation-card__actions form {
    margin: 0;
}

.status-badge--aperta {
    background: #ECFBFF;
    color: #08758F;
}

.status-badge--preparata {
    background: #FFF8E7;
    color: #7C5B00;
}

.status-badge--consegnata {
    background: #DDF8EF;
    color: #0B6B4B;
}

.status-badge--annullata {
    background: #FFE8E8;
    color: #9B1C1F;
}

.import-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0 24px;
}

.import-step {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #F8FBFD;
    color: #5D6F7D;
    font-size: 13px;
    font-weight: 800;
    padding: 10px;
    text-align: center;
}

.import-step--active {
    border-color: var(--primary);
    background: #ECFBFF;
    color: var(--primary-dark);
}

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

.mapping-grid label {
    display: grid;
    gap: 6px;
}

.import-rule-list {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.import-rule-list div {
    border-left: 3px solid var(--primary);
    background: #F8FBFD;
    border-radius: 8px;
    color: #405363;
    padding: 10px 12px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0 24px;
}

.summary-card {
    border: 1px solid #C8DDE8;
    border-radius: 8px;
    background: #F8FBFD;
    padding: 16px;
}

.summary-card span {
    color: #607181;
    display: block;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.summary-card strong {
    color: var(--text);
    display: block;
    font-size: 28px;
    line-height: 1.1;
    margin-top: 6px;
}

.import-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.import-preview-card {
    border: 1px solid #C8DDE8;
    border-top: 3px solid var(--primary);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(8, 20, 31, 0.1);
    padding: 14px;
}

.import-preview-card--error {
    border-top-color: var(--danger);
}

.import-preview-card__header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.import-preview-card__header span {
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.import-preview-card dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.import-preview-card dt {
    color: #607181;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.import-preview-card dd {
    color: var(--text);
    font-weight: 700;
    margin: 0;
    overflow-wrap: anywhere;
}

.import-errors {
    border-radius: 8px;
    background: var(--danger-bg);
    color: var(--danger-text);
    font-size: 13px;
    font-weight: 700;
    margin-top: 12px;
    padding: 10px;
}

.import-error-list {
    display: grid;
    gap: 10px;
    margin: 0 0 22px;
}

.import-error-list div {
    border: 1px solid #ffc9c9;
    border-radius: 8px;
    background: var(--danger-bg);
    color: var(--danger-text);
    display: grid;
    gap: 4px;
    padding: 10px 12px;
}

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

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

tbody tr:hover {
    background: #FAFDFF;
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.table-actions form {
    margin: 0;
}

.footer {
    width: calc(100% - 48px);
    max-width: none;
    margin: 32px auto;
    color: #D5DEE8;
    font-size: 13px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.footer__dot {
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: var(--gold);
}

@media (max-width: 1100px) {
    .reservation-item-row {
        grid-template-columns: minmax(260px, 1fr) minmax(100px, 125px) minmax(130px, 155px);
    }

    .reservation-item-row__remove {
        justify-self: start;
    }

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

@media (max-width: 640px) {
    .topbar__inner,
    .page,
    .footer {
        width: min(100% - 24px, 1080px);
    }

    .page {
        margin-top: 20px;
    }

    .panel,
    .login-card {
        padding: 18px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .split-layout {
        grid-template-columns: 1fr;
    }

    .topbar__inner {
        align-items: flex-start;
        flex-direction: column;
        min-height: 0;
        padding: 16px 0;
    }

    .topbar__right {
        justify-items: stretch;
        width: 100%;
    }

    .user-mini {
        justify-content: flex-end;
        width: 100%;
    }

    .nav {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .brand__logo {
        height: 57px;
        max-width: 273px;
        max-height: 57px;
    }

    .brand__text {
        white-space: normal;
    }

    .nav a {
        width: 100%;
        min-height: 42px;
    }

    .dashboard-menu {
        grid-template-columns: 1fr;
        padding: 10px 0 24px;
    }

    .dashboard-tile {
        grid-template-columns: 56px minmax(0, 1fr);
        min-height: 112px;
        padding: 20px;
    }

    .dashboard-tile__icon {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }

    .dashboard-tile__text strong {
        font-size: 23px;
    }

    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown__button {
        width: 100%;
        min-height: 42px;
        padding: 9px 11px;
        text-align: left;
    }

    .nav-dropdown__menu {
        position: static;
        display: grid;
        width: 100%;
        min-width: 0;
        margin: 2px 0 4px 12px;
        padding: 6px 0 6px 12px;
        border: 0;
        border-left: 2px solid var(--border);
        border-radius: 0;
        box-shadow: none;
    }

    .nav-dropdown__menu a {
        min-height: 38px;
        padding: 8px 10px;
    }

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

    .products-filter-form .filter-row input {
        flex-basis: auto;
        max-width: none;
    }

    .form-grid--two,
    .form-grid--reservation-main,
    .reservations-textareas,
    .reservation-item-row,
    .reservation-totals,
    .reservation-grid {
        grid-template-columns: 1fr;
    }

    .reservation-items__header,
    .section-title-row,
    .reservation-card__header {
        align-items: stretch;
        flex-direction: column;
    }

    .reservation-totals {
        position: static;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-card {
        grid-template-columns: 72px minmax(0, 1fr);
        padding: 14px;
    }

    .product-card__media,
    .product-card__image,
    .product-card__placeholder {
        width: 72px;
    }

    .product-card__image,
    .product-card__placeholder {
        height: 72px;
    }

    .product-card__header {
        flex-direction: column;
    }

    .product-card__details {
        grid-template-columns: 1fr;
    }

    .product-card__actions .button {
        flex: 1 1 auto;
        justify-content: center;
    }

    .import-steps,
    .mapping-grid,
    .summary-grid {
        grid-template-columns: 1fr;
    }
}
