@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700&display=swap");

:root {
    --rs-navy: #07182e;
    --rs-navy-2: #0d2947;
    --rs-orange: #ff8a00;
    --rs-orange-strong: #ff4b0a;
    --rs-yellow: #ffb000;
    --rs-bg: #f4f6f9;
    --rs-surface: #ffffff;
    --rs-text: #111827;
    --rs-muted: #667085;
    --rs-line: #e4e7ec;
    --rs-success: #067647;
    --rs-success-bg: #ecfdf3;
    --rs-warning: #b54708;
    --rs-warning-bg: #fffaeb;
    --rs-danger: #b42318;
    --rs-danger-bg: #fff1f0;
    --rs-info: #175cd3;
    --rs-info-bg: #eff8ff;
    --rs-shadow: 0 12px 30px rgba(17, 24, 39, 0.08);
    --rs-radius: 14px;
    --rs-radius-sm: 10px;
    --touch-target: 48px;
    --font-heading: "Poppins", Arial, Helvetica, sans-serif;
    --font-body: Arial, Helvetica, sans-serif;

    --bg: var(--rs-bg);
    --surface: var(--rs-surface);
    --text: var(--rs-text);
    --muted: var(--rs-muted);
    --line: var(--rs-line);
    --primary: var(--rs-orange);
    --danger: var(--rs-danger);
    --success: var(--rs-success);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    margin: 0;
    min-height: 100%;
}

body.sidebar-open {
    overflow: hidden;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(255, 138, 0, 0.32);
    outline-offset: 2px;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin-top: 0;
}

h1 {
    font-family: var(--font-heading);
    font-size: clamp(26px, 2vw, 34px);
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.15;
    margin-bottom: 10px;
}

h2 {
    font-family: var(--font-heading);
    font-size: clamp(20px, 1.4vw, 24px);
    font-weight: 700;
    line-height: 1.2;
}

h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
}

h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.25;
}

button,
input,
select,
textarea {
    font-family: var(--font-body);
}

.sr-only {
    clip: rect(0, 0, 0, 0);
    border: 0;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

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

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

.sidebar {
    background: linear-gradient(180deg, var(--rs-navy) 0%, var(--rs-navy-2) 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-height: 100vh;
    padding: 22px 18px;
    position: sticky;
    top: 0;
}

.sidebar-close {
    align-items: center;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    color: #ffffff;
    cursor: pointer;
    display: none;
    font-size: 18px;
    font-weight: 900;
    height: 44px;
    justify-content: center;
    position: absolute;
    right: 14px;
    top: 14px;
    width: 44px;
}

.restosys-brand {
    padding: 2px 4px 10px;
}

.brand {
    align-items: center;
    color: inherit;
    display: inline-flex;
    gap: 12px;
    min-height: var(--touch-target);
}

.restosys-logo-image {
    display: block;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

.restosys-logo-sidebar {
    filter: drop-shadow(0 10px 18px rgba(255, 138, 0, 0.22)) drop-shadow(0 2px 8px rgba(255, 255, 255, 0.16));
    max-height: 96px;
    width: min(100%, 210px);
}

.restosys-logo-header {
    max-height: 64px;
    width: min(48vw, 230px);
}

.restosys-logo-login {
    margin: 0 auto;
    max-height: 128px;
    width: min(100%, 320px);
}

.restosys-logo-mobile {
    max-height: 42px;
    width: min(46vw, 156px);
}

.mobile-brand {
    display: none;
}

.restosys-logo {
    align-items: center;
    background: linear-gradient(135deg, var(--rs-orange), var(--rs-orange-strong));
    border-radius: 14px;
    box-shadow: 0 12px 24px rgba(255, 75, 10, 0.22);
    color: #ffffff;
    display: inline-flex;
    flex: 0 0 44px;
    font-size: 21px;
    font-weight: 900;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.restosys-wordmark {
    color: inherit;
    display: block;
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
}

.restosys-tagline {
    color: rgba(255, 255, 255, 0.72);
    display: block;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    margin-top: 5px;
}

.tenant-card {
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--rs-radius);
    display: flex;
    gap: 12px;
    padding: 12px;
}

.tenant-logo {
    align-items: center;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    color: #ffffff;
    display: inline-flex;
    flex: 0 0 42px;
    font-family: var(--font-heading);
    font-weight: 800;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.tenant-logo img {
    display: block;
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.tenant-label {
    color: rgba(255, 255, 255, 0.64);
    display: block;
    font-size: 12px;
}

.tenant-card strong {
    color: #ffffff;
    display: block;
    font-size: 14px;
    line-height: 1.2;
}

.nav {
    display: flex;
}

.sidebar-nav {
    flex-direction: column;
    gap: 6px;
}

.nav-link {
    align-items: center;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    font-family: var(--font-heading);
    font-weight: 600;
    gap: 10px;
    min-height: var(--touch-target);
    padding: 12px 14px;
}

.nav-link::before {
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    content: "";
    display: inline-flex;
    flex: 0 0 26px;
    height: 26px;
    justify-content: center;
    width: 26px;
}

.nav-link[href*="dashboard"]::before {
    background:
        linear-gradient(currentColor 0 0) 7px 8px / 4px 10px no-repeat,
        linear-gradient(currentColor 0 0) 13px 5px / 4px 13px no-repeat,
        linear-gradient(currentColor 0 0) 19px 11px / 4px 7px no-repeat,
        rgba(255, 255, 255, 0.08);
}

.nav-link[href*="restaurants"]::before {
    background:
        linear-gradient(currentColor 0 0) 8px 11px / 10px 8px no-repeat,
        linear-gradient(135deg, transparent 48%, currentColor 49% 54%, transparent 55%) 7px 5px / 12px 10px no-repeat,
        rgba(255, 255, 255, 0.08);
}

.nav-link[href*="users"]::before {
    background:
        radial-gradient(circle at 50% 38%, currentColor 0 3px, transparent 3.5px),
        radial-gradient(ellipse at 50% 78%, currentColor 0 7px, transparent 7.5px),
        rgba(255, 255, 255, 0.08);
}

.sidebar-nav .nav-link[href*="/reservations"]::before {
    background:
        linear-gradient(currentColor 0 0) 8px 4px / 2px 5px no-repeat,
        linear-gradient(currentColor 0 0) 16px 4px / 2px 5px no-repeat,
        linear-gradient(currentColor 0 0) 6px 7px / 14px 2px no-repeat,
        linear-gradient(currentColor 0 0) 6px 11px / 14px 2px no-repeat,
        linear-gradient(currentColor 0 0) 6px 19px / 14px 2px no-repeat,
        linear-gradient(currentColor 0 0) 6px 7px / 2px 14px no-repeat,
        linear-gradient(currentColor 0 0) 18px 7px / 2px 14px no-repeat,
        linear-gradient(currentColor 0 0) 10px 15px / 2px 2px no-repeat,
        linear-gradient(currentColor 0 0) 14px 15px / 2px 2px no-repeat,
        rgba(255, 255, 255, 0.08);
}

.sidebar-nav .nav-link[href*="/tables"]::before {
    background:
        linear-gradient(currentColor 0 0) 5px 8px / 16px 3px no-repeat,
        linear-gradient(currentColor 0 0) 7px 11px / 2px 9px no-repeat,
        linear-gradient(currentColor 0 0) 17px 11px / 2px 9px no-repeat,
        linear-gradient(currentColor 0 0) 9px 14px / 8px 2px no-repeat,
        rgba(255, 255, 255, 0.08);
}

.sidebar-nav .nav-link[href*="/subscriptions"]::before {
    background:
        linear-gradient(currentColor 0 0) 5px 6px / 16px 2px no-repeat,
        linear-gradient(currentColor 0 0) 5px 18px / 16px 2px no-repeat,
        linear-gradient(currentColor 0 0) 5px 6px / 2px 14px no-repeat,
        linear-gradient(currentColor 0 0) 19px 6px / 2px 14px no-repeat,
        linear-gradient(currentColor 0 0) 7px 10px / 12px 2px no-repeat,
        linear-gradient(currentColor 0 0) 9px 14px / 5px 2px no-repeat,
        rgba(255, 255, 255, 0.08);
}

.sidebar-nav .nav-link[href*="/inventory"]::before {
    background:
        linear-gradient(currentColor 0 0) 5px 7px / 16px 2px no-repeat,
        linear-gradient(currentColor 0 0) 5px 19px / 16px 2px no-repeat,
        linear-gradient(currentColor 0 0) 5px 7px / 2px 14px no-repeat,
        linear-gradient(currentColor 0 0) 19px 7px / 2px 14px no-repeat,
        linear-gradient(currentColor 0 0) 12px 9px / 2px 5px no-repeat,
        linear-gradient(currentColor 0 0) 9px 16px / 4px 2px no-repeat,
        rgba(255, 255, 255, 0.08);
}

.nav-link[href*="categories"]::before {
    background:
        linear-gradient(currentColor 0 0) 7px 7px / 12px 2px no-repeat,
        linear-gradient(currentColor 0 0) 7px 12px / 12px 2px no-repeat,
        linear-gradient(currentColor 0 0) 7px 17px / 12px 2px no-repeat,
        rgba(255, 255, 255, 0.08);
}

.nav-link[href*="orders"]::before {
    background:
        linear-gradient(currentColor 0 0) 6px 7px / 14px 2px no-repeat,
        linear-gradient(currentColor 0 0) 7px 11px / 12px 2px no-repeat,
        linear-gradient(currentColor 0 0) 8px 15px / 10px 2px no-repeat,
        linear-gradient(currentColor 0 0) 9px 19px / 8px 2px no-repeat,
        rgba(255, 255, 255, 0.08);
}

.nav-link[href*="invoices"]::before {
    background:
        linear-gradient(currentColor 0 0) 8px 6px / 10px 2px no-repeat,
        linear-gradient(currentColor 0 0) 8px 11px / 10px 2px no-repeat,
        linear-gradient(currentColor 0 0) 8px 16px / 7px 2px no-repeat,
        linear-gradient(currentColor 0 0) 6px 5px / 2px 16px no-repeat,
        linear-gradient(currentColor 0 0) 18px 5px / 2px 16px no-repeat,
        rgba(255, 255, 255, 0.08);
}

.nav-link[href*="cash-register"]::before {
    background:
        linear-gradient(currentColor 0 0) 6px 9px / 14px 9px no-repeat,
        linear-gradient(currentColor 0 0) 8px 6px / 10px 3px no-repeat,
        radial-gradient(circle at 50% 52%, rgba(255, 255, 255, 0.08) 0 3px, transparent 3.5px),
        rgba(255, 255, 255, 0.08);
}

.nav-link[href*="reports"]::before {
    background:
        linear-gradient(currentColor 0 0) 7px 14px / 3px 6px no-repeat,
        linear-gradient(currentColor 0 0) 12px 9px / 3px 11px no-repeat,
        linear-gradient(currentColor 0 0) 17px 5px / 3px 15px no-repeat,
        rgba(255, 255, 255, 0.08);
}

.nav-link[href*="kitchen"]::before {
    background:
        radial-gradient(circle at 50% 10px, currentColor 0 4px, transparent 4.5px),
        linear-gradient(currentColor 0 0) 8px 12px / 10px 8px no-repeat,
        rgba(255, 255, 255, 0.08);
}

.nav-link:hover,
.nav-link:focus-visible,
.nav-link.is-active {
    background: rgba(255, 138, 0, 0.15);
    color: #ffffff;
}

.nav-link.is-active {
    border-left: 4px solid var(--rs-orange);
    padding-left: 10px;
}

.sidebar-footer {
    margin: auto 0 0;
}

.sidebar-logout {
    margin: 0;
}

.sidebar-copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.58);
    font-family: var(--font-body);
    font-size: 11px;
    line-height: 1.45;
    margin: 16px 4px 0;
    padding-top: 14px;
}

.sidebar-copyright strong {
    color: rgba(255, 255, 255, 0.82);
    font-family: var(--font-heading);
    font-weight: 600;
}

.sidebar-logout button,
.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
    align-items: center;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    justify-content: center;
    min-height: var(--touch-target);
    padding: 12px 18px;
    text-align: center;
}

.sidebar-logout button,
.primary-button {
    background: linear-gradient(135deg, var(--rs-orange), var(--rs-orange-strong));
    color: #ffffff;
}

.secondary,
.secondary-button {
    background: var(--rs-navy-2);
    color: #ffffff;
}

.ghost-button {
    background: transparent;
    color: var(--rs-info);
}

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

.primary-button[disabled],
.sidebar-logout button[disabled] {
    cursor: wait;
    opacity: 0.72;
}

.app-main {
    min-width: 0;
}

.topbar,
.app-header {
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    min-height: 72px;
    padding: 14px clamp(18px, 2.4vw, 34px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-title {
    flex: 1;
    min-width: 0;
}

.header-title h1 {
    font-family: var(--font-heading);
    font-size: clamp(20px, 1.7vw, 28px);
    font-weight: 700;
    margin: 0;
}

.header-context {
    color: var(--muted);
    display: grid;
    font-size: 13px;
    justify-items: end;
    line-height: 1.25;
}

.header-context strong {
    color: var(--text);
}

.menu-toggle {
    align-items: center;
    background: var(--rs-surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
    display: none;
    flex: 0 0 var(--touch-target);
    height: var(--touch-target);
    justify-content: center;
    padding: 0;
    width: var(--touch-target);
}

.menu-toggle span:not(.sr-only) {
    background: var(--rs-navy);
    border-radius: 99px;
    display: block;
    height: 2px;
    position: absolute;
    width: 20px;
}

.menu-toggle span:nth-child(1) {
    transform: translateY(-7px);
}

.menu-toggle span:nth-child(3) {
    transform: translateY(7px);
}

.app-overlay {
    background: rgba(7, 24, 46, 0.44);
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 160ms ease;
    z-index: 60;
}

.container {
    margin: 0 auto;
    max-width: none;
    padding: clamp(20px, 2.5vw, 34px);
    width: 100%;
}

.app-content {
    min-width: 0;
}

.narrow {
    margin: 0 auto;
    max-width: 780px;
}

.restaurant-form-page.narrow {
    max-width: 1040px;
}

.user-form-page.narrow {
    max-width: 920px;
}

.auth-body {
    background:
        radial-gradient(circle at top left, rgba(255, 138, 0, 0.16), transparent 32rem),
        linear-gradient(135deg, #f8fafc 0%, var(--rs-bg) 100%);
}

.auth-header {
    align-items: center;
    display: flex;
    min-height: 76px;
    padding: 16px clamp(20px, 4vw, 52px);
}

.auth-header .brand {
    color: var(--rs-navy);
}

.auth-header .restosys-tagline {
    color: var(--rs-muted);
}

.auth-container {
    padding-top: 0;
}

.auth-shell {
    display: grid;
    min-height: calc(100vh - 120px);
    place-items: center;
}

.auth-panel {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(228, 231, 236, 0.86);
    border-radius: 18px;
    box-shadow: var(--rs-shadow);
    max-width: 460px;
    padding: clamp(26px, 4vw, 38px);
    width: 100%;
}

.auth-brand {
    align-items: center;
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.auth-brand .restosys-wordmark {
    color: var(--rs-navy);
}

.auth-brand .restosys-tagline {
    color: var(--rs-muted);
}

.eyebrow {
    color: var(--rs-orange-strong);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.form {
    display: grid;
    gap: 14px;
    margin-top: 24px;
}

.form label {
    color: var(--rs-text);
    font-family: var(--font-body);
    font-weight: 700;
}

.form input,
.form select,
.form textarea,
.metric input[type="number"] {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    font-size: 16px;
    min-height: var(--touch-target);
    padding: 11px 13px;
    width: 100%;
}

.form textarea {
    min-height: 104px;
    resize: vertical;
}

.form input:disabled,
.form select:disabled,
.form textarea:disabled {
    background: #f2f4f7;
    color: var(--muted);
    cursor: not-allowed;
}

.admin-form {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--rs-radius);
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
    padding: clamp(18px, 2vw, 24px);
}

.restaurant-form-page .panel-heading > a {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--rs-info);
    display: inline-flex;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    justify-content: center;
    min-height: var(--touch-target);
    padding: 9px 13px;
}

.restaurant-form {
    gap: 18px;
    max-width: 1040px;
}

.restaurant-form-section {
    border: 1px solid var(--line);
    border-radius: 14px;
    display: grid;
    gap: 14px;
    padding: 16px;
}

.restaurant-form-section h2 {
    color: var(--rs-navy);
    font-size: 16px;
    line-height: 1.25;
    margin: 0;
}

.restaurant-form-grid {
    display: grid;
    gap: 14px 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-field {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.form-field-wide,
.form-section-wide {
    grid-column: 1 / -1;
}

.field-help,
.logo-preview p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
    margin: 0;
    overflow-wrap: anywhere;
}

.logo-preview {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.logo-preview img {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
    flex: 0 0 78px;
    height: 78px;
    object-fit: contain;
    padding: 8px;
    width: 78px;
}

.logo-preview span {
    overflow-wrap: anywhere;
}

.restaurant-form input[type="color"] {
    min-width: 100%;
}

.user-form-page .panel-heading > a {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--rs-info);
    display: inline-flex;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    justify-content: center;
    min-height: var(--touch-target);
    padding: 9px 13px;
}

.user-form {
    gap: 18px;
    max-width: 920px;
}

.user-form-section {
    border: 1px solid var(--line);
    border-radius: 14px;
    display: grid;
    gap: 14px;
    padding: 16px;
}

.user-form-section h2 {
    color: var(--rs-navy);
    font-size: 16px;
    line-height: 1.25;
    margin: 0;
}

.user-form-grid {
    display: grid;
    gap: 14px 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.user-form select {
    min-width: 0;
    overflow-wrap: anywhere;
}

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

.inline-form {
    align-items: end;
    grid-template-columns: minmax(180px, 1fr) 160px auto;
}

.customer-fields {
    display: none;
    gap: 12px;
}

.customer-fields.is-visible {
    display: grid;
}

.alert {
    border: 1px solid transparent;
    border-radius: 12px;
    font-weight: 700;
    margin-bottom: 18px;
    padding: 13px 15px;
}

.alert-error {
    background: var(--rs-danger-bg);
    border-color: #fecdca;
    color: var(--danger);
}

.alert-success {
    background: var(--rs-success-bg);
    border-color: #abefc6;
    color: var(--success);
}

.alert-warning {
    background: var(--rs-warning-bg);
    border-color: #fedf89;
    color: var(--rs-warning);
}

.alert-info {
    background: var(--rs-info-bg);
    border-color: #b2ddff;
    color: var(--rs-info);
}

.dashboard {
    display: grid;
    gap: 20px;
}

.dashboard-hero {
    background: linear-gradient(135deg, rgba(7, 24, 46, 0.98), rgba(13, 41, 71, 0.94));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--rs-radius);
    box-shadow: var(--rs-shadow);
    color: #ffffff;
    padding: clamp(18px, 2.2vw, 26px);
}

.dashboard-hero h1 {
    color: #ffffff;
    margin-bottom: 6px;
}

.dashboard-hero .muted {
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 0;
}

.dashboard-hero .muted strong {
    color: #ffffff;
}

.secure-pill {
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.92);
    gap: 8px;
}

.secure-pill svg {
    fill: var(--rs-orange);
    height: 18px;
    width: 18px;
}

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

.kpi-card {
    align-items: center;
    display: grid;
    gap: 16px;
    grid-template-columns: 52px minmax(0, 1fr);
    min-height: 136px;
}

.kpi-card p {
    margin: 0;
}

.kpi-card a {
    align-items: center;
    display: inline-flex;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    min-height: 36px;
}

.kpi-icon {
    align-items: center;
    background: rgba(255, 138, 0, 0.12);
    border: 1px solid rgba(255, 138, 0, 0.22);
    border-radius: 16px;
    color: var(--rs-orange-strong);
    display: flex;
    flex: 0 0 52px;
    height: 52px;
    min-width: 52px;
    justify-content: center;
    width: 52px;
}

.kpi-icon-success {
    background: var(--rs-success-bg);
    border-color: #abefc6;
    color: var(--rs-success);
}

.kpi-icon svg {
    display: block;
    fill: currentColor;
    height: 26px;
    margin: 0;
    padding: 0;
    position: static;
    transform: none;
    width: 26px;
}

.section-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.section-heading h2 {
    margin: 0;
}

.super-admin-table-card {
    gap: 18px;
}

.super-admin-table td:first-child strong {
    color: var(--rs-navy);
}

.plan-chip {
    border-radius: 999px;
    display: inline-flex;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
}

.plan-chip-active {
    background: rgba(255, 138, 0, 0.12);
    color: #b54708;
}

.plan-chip-empty {
    background: #f2f4f7;
    color: #667085;
}

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

.table-action {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--rs-info);
    display: inline-flex;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    justify-content: center;
    min-height: 44px;
    padding: 9px 13px;
}

.table-action-primary {
    background: var(--rs-navy-2);
    border-color: var(--rs-navy-2);
    color: #ffffff;
}

.panel-heading {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: space-between;
}

.restaurant-card,
.metric {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--rs-radius);
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
    padding: clamp(18px, 2vw, 24px);
}

.restaurant-card {
    display: grid;
    gap: 16px;
}

.reservation-restaurant-selector {
    display: grid;
    gap: 14px;
    width: 100%;
    max-width: 720px;
}

.reservation-restaurant-choice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    color: var(--text);
    cursor: pointer;
    overflow-wrap: anywhere;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.reservation-restaurant-choice:hover,
.reservation-restaurant-choice:focus-visible {
    border-color: var(--rs-info);
    box-shadow: var(--rs-shadow);
}

.metric span {
    color: var(--muted);
    display: block;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}

.metric .kpi-icon {
    align-items: center;
    display: flex;
    justify-content: center;
    margin-bottom: 0;
}

.metric strong {
    color: var(--rs-navy);
    display: block;
    font-family: var(--font-heading);
    font-size: clamp(22px, 2vw, 28px);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 8px;
}

.brand-line {
    background: var(--brand-color, var(--rs-orange));
    border-radius: 999px;
    height: 8px;
    width: 100%;
}

.admin-dashboard-hero {
    padding: clamp(16px, 2vw, 22px);
}

.admin-restaurant-context {
    align-items: center;
    border-top: 8px solid var(--brand-color, var(--rs-orange));
    display: grid;
    gap: 16px;
    grid-template-columns: 78px minmax(0, 1fr) minmax(220px, auto);
}

.admin-restaurant-logo {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 16px;
    display: flex;
    height: 78px;
    justify-content: center;
    overflow: hidden;
    padding: 8px;
    width: 78px;
}

.admin-restaurant-logo img {
    display: block;
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.admin-restaurant-summary {
    min-width: 0;
}

.admin-restaurant-summary h2 {
    margin-bottom: 6px;
    overflow-wrap: anywhere;
}

.admin-restaurant-summary p {
    margin-bottom: 4px;
    overflow-wrap: anywhere;
}

.admin-restaurant-meta {
    align-items: flex-end;
    display: grid;
    gap: 8px;
    justify-items: end;
    min-width: 0;
}

.admin-plan-chip {
    background: rgba(255, 138, 0, 0.12);
    border-radius: 999px;
    color: #b54708;
    display: inline-flex;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    padding: 8px 12px;
    text-align: center;
}

.admin-kpi-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-kpi-card {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: 52px minmax(0, 1fr);
    min-height: 132px;
}

.admin-kpi-card p {
    margin: 0;
}

.admin-kpi-card a {
    align-items: center;
    display: inline-flex;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    min-height: 44px;
}

.admin-kpi-icon {
    align-items: center;
    background: rgba(255, 138, 0, 0.12);
    border: 1px solid rgba(255, 138, 0, 0.22);
    border-radius: 16px;
    color: var(--rs-orange-strong);
    display: flex;
    flex: 0 0 52px;
    height: 52px;
    justify-content: center;
    line-height: 1;
    margin-bottom: 0;
    width: 52px;
}

.metric .admin-kpi-icon {
    align-items: center;
    display: flex;
    justify-content: center;
    margin-bottom: 0;
}

.admin-kpi-icon-success {
    background: var(--rs-success-bg);
    border-color: #abefc6;
    color: var(--rs-success);
}

.admin-kpi-icon-info {
    background: var(--rs-info-bg);
    border-color: #b2ddff;
    color: var(--rs-info);
}

.admin-kpi-icon svg {
    display: block;
    fill: currentColor;
    height: 26px;
    width: 26px;
}

.admin-quick-actions {
    gap: 14px;
}

.admin-quick-actions h2 {
    margin-bottom: 0;
}

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

.admin-quick-grid a {
    align-items: center;
    background: #f9fafb;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--rs-info);
    display: inline-flex;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    justify-content: center;
    min-height: var(--touch-target);
    padding: 11px 14px;
    text-align: center;
}

.cashier-dashboard-hero {
    padding: clamp(16px, 2vw, 22px);
}

.cashier-restaurant-context {
    align-items: center;
    border-top: 8px solid var(--brand-color, var(--rs-orange));
    display: grid;
    gap: 16px;
    grid-template-columns: 72px minmax(0, 1fr) auto;
}

.cashier-restaurant-logo {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 16px;
    display: flex;
    height: 72px;
    justify-content: center;
    overflow: hidden;
    padding: 8px;
    width: 72px;
}

.cashier-restaurant-logo img {
    display: block;
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.cashier-restaurant-summary {
    min-width: 0;
}

.cashier-restaurant-summary h2,
.cashier-restaurant-summary p {
    overflow-wrap: anywhere;
}

.cashier-restaurant-status {
    justify-self: end;
}

.cashier-kpi-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cashier-kpi-card {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: 52px minmax(0, 1fr);
    min-height: 128px;
}

.cashier-kpi-card p {
    margin: 0;
}

.cashier-kpi-card a {
    align-items: center;
    display: inline-flex;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    min-height: 44px;
}

.cashier-kpi-icon {
    align-items: center;
    background: rgba(255, 138, 0, 0.12);
    border: 1px solid rgba(255, 138, 0, 0.22);
    border-radius: 16px;
    color: var(--rs-orange-strong);
    display: flex;
    flex: 0 0 52px;
    height: 52px;
    justify-content: center;
    line-height: 1;
    margin-bottom: 0;
    width: 52px;
}

.metric .cashier-kpi-icon {
    align-items: center;
    display: flex;
    justify-content: center;
    margin-bottom: 0;
}

.cashier-kpi-icon-success {
    background: var(--rs-success-bg);
    border-color: #abefc6;
    color: var(--rs-success);
}

.cashier-kpi-icon-info {
    background: var(--rs-info-bg);
    border-color: #b2ddff;
    color: var(--rs-info);
}

.cashier-kpi-icon-warning {
    background: var(--rs-warning-bg);
    border-color: #fedf89;
    color: var(--rs-warning);
}

.cashier-kpi-icon svg {
    display: block;
    fill: currentColor;
    height: 26px;
    width: 26px;
}

.cashier-quick-actions {
    gap: 14px;
}

.cashier-quick-actions h2 {
    margin-bottom: 0;
}

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

.cashier-quick-grid a {
    align-items: center;
    background: #f9fafb;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--rs-info);
    display: inline-flex;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    justify-content: center;
    min-height: 48px;
    padding: 11px 14px;
    text-align: center;
}

.cashier-quick-grid .cashier-quick-primary {
    background: linear-gradient(135deg, var(--rs-orange), var(--rs-orange-strong));
    border-color: transparent;
    color: #ffffff;
}

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

.table-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--rs-radius);
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
    overflow-x: auto;
    width: 100%;
}

table {
    border-collapse: collapse;
    font-family: var(--font-body);
    min-width: 840px;
    width: 100%;
}

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

th {
    background: #f9fafb;
    color: #475467;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

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

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

.row-actions form {
    margin: 0;
}

.row-actions a,
.row-actions button {
    align-items: center;
    background: #f9fafb;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--rs-info);
    cursor: pointer;
    display: inline-flex;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    justify-content: center;
    min-height: var(--touch-target);
    padding: 8px 11px;
}

.danger-link {
    color: var(--danger) !important;
}

.status-pill {
    background: var(--rs-info-bg);
    border-radius: 999px;
    color: #1849a9;
    display: inline-flex;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    padding: 8px 12px;
}

.status-success {
    background: var(--rs-success-bg);
    color: var(--rs-success);
}

.status-danger {
    background: var(--rs-danger-bg);
    color: var(--rs-danger);
}

.status-warning {
    background: var(--rs-warning-bg);
    color: var(--rs-warning);
}

.status-muted {
    background: #f2f4f7;
    color: #475467;
}

.category-create-form {
    align-items: end;
    gap: 14px 16px;
    grid-template-columns: minmax(220px, 1fr) 180px auto;
}

.category-form-heading {
    display: grid;
    gap: 4px;
    grid-column: 1 / -1;
}

.category-form-heading h2 {
    color: var(--rs-navy);
    font-size: 18px;
    line-height: 1.25;
    margin: 0;
}

.categories-table {
    min-width: 0;
}

body:has(.categories-page) .header-title h1 {
    font-size: 0;
}

body:has(.categories-page) .header-title h1::after {
    content: "Categorías";
    font-family: var(--font-heading);
    font-size: clamp(20px, 1.7vw, 28px);
    font-weight: 700;
    line-height: 1.15;
}

body:has(.invoices-page) .header-title h1 {
    font-size: 0;
}

body:has(.invoices-page) .header-title h1::after {
    content: "Facturación";
    font-family: var(--font-heading);
    font-size: clamp(20px, 1.7vw, 28px);
    font-weight: 700;
    line-height: 1.15;
}

.category-name-cell,
.category-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.category-name {
    color: var(--rs-navy);
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
}

.category-edit-form {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(180px, 1fr) 150px auto;
}

.category-edit-form input,
.category-edit-form select {
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    font: inherit;
    min-height: var(--touch-target);
    min-width: 0;
    padding: 8px 10px;
    width: 100%;
}

.category-edit-form button {
    min-height: var(--touch-target);
}

.category-empty-row td {
    color: var(--muted);
    font-weight: 600;
    padding: 30px 16px;
    text-align: center;
}

.product-heading-actions {
    align-items: center;
}

.product-heading-actions a {
    min-height: var(--touch-target);
}

.products-table {
    min-width: 0;
    table-layout: fixed;
}

.products-table th:nth-child(1),
.products-table td:nth-child(1) {
    width: 32%;
}

.products-table th:nth-child(2),
.products-table td:nth-child(2) {
    width: 18%;
}

.products-table th:nth-child(3),
.products-table td:nth-child(3),
.products-table th:nth-child(4),
.products-table td:nth-child(4),
.products-table th:nth-child(5),
.products-table td:nth-child(5) {
    width: 13%;
}

.products-table th:nth-child(6),
.products-table td:nth-child(6) {
    width: 11%;
}

.product-identity {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.product-thumb {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
    flex: 0 0 56px;
    height: 56px;
    object-fit: contain;
    padding: 4px;
    width: 56px;
}

.product-title {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.product-title strong,
.product-category-cell,
.product-tax-cell {
    overflow-wrap: anywhere;
}

.product-title strong {
    color: var(--rs-navy);
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
}

.product-title span {
    color: var(--muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.product-price-cell strong {
    color: var(--rs-navy);
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
}

.product-tax-cell {
    color: #475467;
    font-weight: 600;
}

.product-actions-cell {
    min-width: 0;
}

.product-action {
    min-height: var(--touch-target);
}

.product-empty-row td {
    color: var(--muted);
    font-weight: 600;
    padding: 30px 16px;
    text-align: center;
}

.product-form-page.narrow {
    max-width: 1080px;
}

.product-form {
    gap: 18px;
    margin-top: 0;
}

.product-form-section {
    border: 1px solid var(--line);
    border-radius: 14px;
    display: grid;
    gap: 14px;
    padding: 16px;
}

.product-form-section h2 {
    color: var(--rs-navy);
    font-size: 16px;
    line-height: 1.25;
    margin: 0;
}

.product-form-grid {
    display: grid;
    gap: 14px 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-description-field textarea {
    min-height: 124px;
}

.product-form input[type="file"] {
    font-size: 14px;
    min-width: 0;
    overflow: hidden;
}

.product-current-image {
    align-items: flex-start;
}

.product-current-image > span {
    color: var(--text);
    font-weight: 700;
}

.product-preview-image {
    background: #ffffff;
    height: 180px;
    max-width: min(100%, 220px);
    object-fit: contain;
    padding: 8px;
    width: 220px;
}

.product-form-actions {
    justify-content: flex-end;
}

.color-dot {
    border: 1px solid var(--line);
    border-radius: 50%;
    display: inline-block;
    height: 14px;
    margin-left: 8px;
    vertical-align: middle;
    width: 14px;
}

.thumb {
    border: 1px solid var(--line);
    border-radius: 10px;
    height: 42px;
    margin-right: 10px;
    object-fit: cover;
    vertical-align: middle;
    width: 42px;
}

.mobile-only {
    display: none;
}

.restaurant-identity {
    align-items: center;
    display: flex;
    gap: 10px;
    min-width: 0;
}

.restaurant-logo {
    background: #ffffff;
    flex: 0 0 42px;
    margin-right: 0;
    object-fit: contain;
}

.restaurant-title {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.restaurant-title strong,
.contact-cell {
    overflow-wrap: anywhere;
}

.restaurant-meta {
    background: #fbfcfe;
    font-size: 13px;
}

.restaurant-meta span {
    display: inline-flex;
    gap: 6px;
    margin-right: 16px;
}

.restaurant-actions {
    align-items: flex-start;
}

.restaurant-actions > .table-action-primary {
    min-height: var(--touch-target);
}

.restaurants-table .actions-menu-panel {
    max-height: min(520px, calc(100dvh - 80px));
    overflow-y: auto;
}

.actions-menu {
    position: relative;
}

.actions-menu summary {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--rs-info);
    cursor: pointer;
    display: inline-flex;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    justify-content: center;
    list-style: none;
    min-height: 44px;
    padding: 9px 13px;
}

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

.actions-menu summary::after {
    content: "v";
    font-size: 11px;
    margin-left: 8px;
}

.actions-menu[open] summary::after {
    transform: rotate(180deg);
}

.actions-menu-panel {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: var(--rs-radius);
    box-shadow: var(--rs-shadow);
    display: grid;
    gap: 12px;
    min-width: 220px;
    padding: 12px;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 30;
}

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

.actions-group span {
    color: var(--muted);
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.actions-group a,
.actions-group button {
    align-items: center;
    background: #f9fafb;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--rs-info);
    cursor: pointer;
    display: flex;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    justify-content: flex-start;
    min-height: 44px;
    padding: 9px 11px;
    text-align: left;
    width: 100%;
}

.actions-group form {
    margin: 0;
}

.actions-group-danger button,
.actions-group-danger .danger-link {
    color: var(--danger) !important;
}

.users-table th,
.users-table td {
    vertical-align: middle;
}

.user-identity {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.user-identity strong {
    color: var(--rs-navy);
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.user-identity span,
.user-restaurant {
    overflow-wrap: anywhere;
}

.role-badge {
    background: #f2f4f7;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #344054;
    display: inline-flex;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    padding: 8px 12px;
}

.user-actions {
    align-items: flex-start;
}

.user-actions a,
.user-actions button {
    min-height: var(--touch-target);
}

.preview-image,
.product-image {
    border: 1px solid var(--line);
    border-radius: 12px;
    max-width: 100%;
    object-fit: cover;
}

.preview-image {
    height: 180px;
    width: 260px;
}

.product-image {
    aspect-ratio: 16 / 10;
    width: 100%;
}

.product-form .product-preview-image {
    object-fit: contain;
}

.orders-heading > a,
.order-pos-heading > a,
.order-detail-actions a,
.order-status-form button,
.order-submit-bar button {
    min-height: var(--touch-target);
}

.orders-table {
    min-width: 980px;
    table-layout: fixed;
}

.orders-table th,
.orders-table td {
    padding: 12px 10px;
}

.orders-table th:nth-child(1),
.orders-table td:nth-child(1) {
    width: 11%;
}

.orders-table th:nth-child(2),
.orders-table td:nth-child(2),
.orders-table th:nth-child(3),
.orders-table td:nth-child(3),
.orders-table th:nth-child(4),
.orders-table td:nth-child(4) {
    width: 10%;
}

.orders-table th:nth-child(5),
.orders-table td:nth-child(5),
.orders-table th:nth-child(6),
.orders-table td:nth-child(6),
.orders-table th:nth-child(7),
.orders-table td:nth-child(7),
.orders-table th:nth-child(8),
.orders-table td:nth-child(8) {
    width: 9%;
}

.orders-table th:nth-child(9),
.orders-table td:nth-child(9) {
    width: 15%;
}

.orders-table th:nth-child(10),
.orders-table td:nth-child(10) {
    width: 7%;
}

.order-number-cell {
    display: grid;
    gap: 2px;
}

.order-number-cell strong,
.order-total-cell strong {
    color: var(--rs-navy);
    font-family: var(--font-heading);
    font-weight: 700;
}

.order-action {
    min-height: var(--touch-target);
}

.order-empty-row td {
    color: var(--muted);
    font-weight: 600;
    padding: 30px 16px;
    text-align: center;
}

.invoices-heading > a,
.invoice-form-heading > a,
.invoice-detail-heading > a,
.payment-form-heading > a,
.invoice-pdf-link a {
    min-height: var(--touch-target);
}

.invoices-table {
    min-width: 1000px;
    table-layout: fixed;
}

.invoices-table th,
.invoices-table td {
    padding: 12px 10px;
}

.invoices-table th:nth-child(1),
.invoices-table td:nth-child(1) {
    width: 15%;
}

.invoices-table th:nth-child(2),
.invoices-table td:nth-child(2) {
    width: 7%;
}

.invoices-table th:nth-child(4),
.invoices-table td:nth-child(4),
.invoices-table th:nth-child(5),
.invoices-table td:nth-child(5) {
    width: 7%;
}

.invoices-table th:nth-child(5),
.invoices-table td:nth-child(5) {
    width: 8%;
}

.invoices-table th:nth-child(6),
.invoices-table td:nth-child(6) {
    width: 16%;
}

.invoices-table th:nth-child(7),
.invoices-table td:nth-child(7) {
    width: 11%;
}

.invoices-table th:nth-child(3),
.invoices-table td:nth-child(3) {
    width: 14%;
}

.invoices-table th:nth-child(8),
.invoices-table td:nth-child(8) {
    width: 22%;
}

.invoice-number-cell,
.invoice-customer-cell {
    overflow-wrap: anywhere;
}

.invoices-table td[data-label="Pedido"] a {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-height: var(--touch-target);
    min-width: var(--touch-target);
}

.invoice-number-cell,
.invoice-total-cell strong {
    color: var(--rs-navy);
    font-family: var(--font-heading);
    font-weight: 700;
}

.invoice-actions-cell {
    align-items: flex-start;
    display: table-cell;
    justify-content: flex-start;
}

.invoice-action,
.invoice-cancel-form button {
    flex: 0 0 auto;
    min-height: var(--touch-target);
    min-width: var(--touch-target);
    white-space: nowrap;
}

.invoices-table .invoice-actions-cell .invoice-action,
.invoices-table .invoice-cancel-form {
    margin: 0 8px 8px 0;
}

.invoice-cancel-form {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.invoice-cancel-form input {
    border: 1px solid var(--line);
    border-radius: 10px;
    min-height: var(--touch-target);
    min-width: 150px;
    padding: 8px 10px;
}

.invoice-empty-row td {
    color: var(--muted);
    font-weight: 600;
    padding: 30px 16px;
    text-align: center;
}

.invoice-form,
.payment-form {
    gap: 18px;
    margin-top: 0;
}

.invoice-form-section,
.payment-form-section {
    border: 1px solid var(--line);
    border-radius: 14px;
    display: grid;
    gap: 14px;
    padding: 16px;
}

.invoice-form-section h2,
.payment-form-section h2,
.invoice-info-card h2,
.invoice-finance-card h2,
.invoice-payments-card h2,
.invoice-refunds-card h2 {
    color: var(--rs-navy);
    font-size: 16px;
    line-height: 1.25;
    margin: 0;
}

.invoice-form-grid,
.payment-form-grid,
.payment-cash-fields {
    display: grid;
    gap: 14px 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.invoice-customer-fields {
    display: none;
}

.invoice-customer-fields.is-visible {
    display: block;
}

.invoice-fiscal-card,
.invoice-info-card,
.invoice-finance-card,
.invoice-payments-card,
.invoice-refunds-card {
    display: grid;
    gap: 14px;
}

.invoice-info-grid,
.invoice-summary-grid,
.invoice-totals-grid,
.invoice-table-summary {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.invoice-info-grid p,
.invoice-summary-grid p,
.invoice-totals-grid p,
.invoice-table-summary p,
.payment-change-box {
    background: #f9fafb;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: grid;
    gap: 4px;
    margin: 0;
    min-width: 0;
    padding: 12px;
}

.invoice-info-grid span,
.invoice-summary-grid span,
.invoice-totals-grid span,
.invoice-table-summary span {
    color: var(--muted);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.invoice-info-grid strong,
.invoice-summary-grid strong,
.invoice-totals-grid strong,
.invoice-table-summary strong {
    color: var(--rs-navy);
    font-family: var(--font-heading);
    font-size: 15px;
    overflow-wrap: anywhere;
}

.invoice-total-line {
    background: var(--rs-info-bg) !important;
    border-color: rgba(24, 73, 169, 0.18) !important;
}

.invoice-total-line strong {
    font-size: 18px;
}

.invoice-show-totals {
    margin-top: 2px;
}

.invoice-payments-table,
.invoice-refunds-table {
    min-width: 920px;
}

.invoice-payments-table th,
.invoice-payments-table td,
.invoice-refunds-table th,
.invoice-refunds-table td {
    padding: 12px 10px;
}

.invoice-refund-form {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: 96px 130px minmax(160px, 1fr) auto;
}

.invoice-refund-form input,
.invoice-refund-form select,
.payment-form input,
.payment-form select {
    min-width: 0;
}

/* Keep payment history within the card; refund controls wrap independently. */
.invoice-payments-card,
.invoice-payments-wrap {
    min-width: 0;
    max-width: 100%;
}

.invoice-payments-table {
    min-width: 0;
    table-layout: auto;
}

.invoice-payments-table th,
.invoice-payments-table td {
    text-align: center;
    vertical-align: middle;
    overflow-wrap: normal;
    word-break: normal;
}

.invoice-payments-table td:not(:first-child):not(.invoice-refund-cell) {
    white-space: nowrap;
}

.invoice-payments-table th:last-child:nth-child(7) {
    width: 40%;
}

.invoice-payments-table .invoice-refund-cell {
    min-width: 240px;
    text-align: left;
}

.invoice-payments-table .invoice-refund-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin: 0;
}

.invoice-payments-table .invoice-refund-form input[name="amount"] {
    flex: 0 1 5rem;
    width: 5rem;
}

.invoice-payments-table .invoice-refund-form select {
    flex: 1 1 9rem;
    width: 9rem;
}

.invoice-payments-table .invoice-refund-form input[name="reason"] {
    flex: 1 1 10rem;
    width: 10rem;
}

.invoice-payments-table .invoice-refund-form button {
    flex: 0 0 auto;
    width: auto;
}

.invoice-payments-table .invoice-refund-cell > .muted {
    margin: 8px 0 0;
}

@media (max-width: 767px) {
    .invoice-payments-table .invoice-payment-row .invoice-refund-cell {
        grid-template-columns: minmax(0, 1fr);
        min-width: 0;
    }

    .invoice-payments-table .invoice-payment-row td {
        text-align: left;
    }
}

.payment-change-box {
    align-content: center;
    color: var(--rs-navy);
    font-family: var(--font-heading);
    font-weight: 700;
    min-height: var(--touch-target);
}

.cash-register-heading > a,
.cash-register-heading .primary-button,
.cash-detail-heading .primary-button,
.cash-form-heading > a,
.cash-form > button,
.cash-action,
.cash-movement-form button {
    min-height: var(--touch-target);
}

.cash-status-card,
.cash-history-card,
.cash-session-overview,
.cash-method-card,
.cash-movement-card,
.cash-payments-card,
.cash-refunds-card,
.cash-manual-movements-card,
.cash-close-summary,
.cash-warning-card {
    display: grid;
    gap: 14px;
}

.cash-card-title {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.cash-card-title h2,
.cash-form-section h2,
.cash-method-card h2,
.cash-movement-card h2,
.cash-payments-card h2,
.cash-refunds-card h2,
.cash-manual-movements-card h2,
.cash-close-summary h2,
.cash-warning-card h2 {
    color: var(--rs-navy);
    font-size: 16px;
    line-height: 1.25;
    margin: 0;
}

.cash-info-grid,
.cash-method-grid,
.cash-table-summary {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cash-info-grid p,
.cash-method-card p {
    background: #f9fafb;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: grid;
    gap: 4px;
    margin: 0;
    min-width: 0;
    padding: 12px;
}

.cash-info-grid span,
.cash-method-card span {
    color: var(--muted);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.cash-info-grid strong,
.cash-method-card strong {
    color: var(--rs-navy);
    font-family: var(--font-heading);
    font-size: 15px;
    overflow-wrap: anywhere;
}

.cash-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cash-kpi strong {
    overflow-wrap: anywhere;
}

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

.cash-movement-form {
    align-items: end;
    grid-template-columns: minmax(130px, 0.7fr) minmax(150px, 0.8fr) minmax(130px, 0.7fr) minmax(180px, 1fr) auto;
}

.cash-movement-form input,
.cash-movement-form select,
.cash-form input {
    min-width: 0;
}

.cash-form {
    gap: 18px;
    margin-top: 0;
}

.cash-form-section {
    border: 1px solid var(--line);
    border-radius: 14px;
    display: grid;
    gap: 14px;
    padding: 16px;
}

.cash-close-form .primary-button,
.cash-open-form .primary-button {
    min-height: 48px;
}

.cash-sessions-table {
    min-width: 1040px;
    table-layout: fixed;
}

.cash-payments-table,
.cash-movements-table {
    min-width: 900px;
}

.cash-refunds-table {
    min-width: 780px;
}

.cash-sessions-table th,
.cash-sessions-table td,
.cash-payments-table th,
.cash-payments-table td,
.cash-refunds-table th,
.cash-refunds-table td,
.cash-movements-table th,
.cash-movements-table td {
    padding: 12px 10px;
}

.cash-actions-cell {
    align-items: center;
}

.cash-action {
    align-items: center;
    background: #f9fafb;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--rs-info);
    display: inline-flex;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    justify-content: center;
    padding: 8px 11px;
}

.cash-empty-row td {
    color: var(--muted);
    font-weight: 600;
    padding: 30px 16px;
    text-align: center;
}

.reports-heading-actions a,
.reports-heading-actions button,
.reports-filter-form button {
    min-height: var(--touch-target);
}

.reports-action {
    align-items: center;
    background: #f9fafb;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--rs-info);
    display: inline-flex;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    justify-content: center;
    padding: 8px 11px;
}

.reports-filter-form {
    display: grid;
    gap: 12px;
    margin-top: 0;
}

.reports-filter-grid {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
}

.reports-filter-grid input {
    min-width: 0;
}

.reports-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.reports-quick-links a {
    align-items: center;
    background: #f9fafb;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--rs-info);
    display: inline-flex;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    min-height: 40px;
    padding: 8px 12px;
}

.reports-summary-section,
.reports-list-card,
.reports-detail-card,
.reports-note-card {
    display: grid;
    gap: 14px;
}

.reports-summary-section h2,
.reports-list-card h2,
.reports-detail-card h2 {
    color: var(--rs-navy);
    font-size: 16px;
    line-height: 1.25;
    margin: 0;
}

.reports-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.reports-money-grid,
.reports-tax-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.reports-kpi strong {
    overflow-wrap: anywhere;
}

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

.reports-list-card p {
    background: #f9fafb;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: grid;
    gap: 4px;
    margin: 0;
    min-width: 0;
    padding: 12px;
}

.reports-list-card p.muted {
    background: transparent;
    border: 0;
    padding: 0;
}

.reports-list-card span {
    color: var(--muted);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 600;
    overflow-wrap: anywhere;
    text-transform: uppercase;
}

.reports-list-card strong {
    color: var(--rs-navy);
    font-family: var(--font-heading);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.reports-section-heading {
    display: grid;
    gap: 4px;
}

.reports-section-heading p {
    margin: 0;
}

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

.reports-detail-table {
    min-width: 1520px;
}

.reports-detail-table th,
.reports-detail-table td {
    padding: 12px 10px;
}

.reports-detail-table td:nth-child(6),
.reports-detail-table td:nth-child(7),
.reports-detail-table td:nth-child(8),
.reports-detail-table td:nth-child(9),
.reports-detail-table td:nth-child(10),
.reports-detail-table td:nth-child(11) {
    text-align: right;
}

.report-invoice-cell,
.report-total-cell strong {
    color: var(--rs-navy);
    font-family: var(--font-heading);
    font-weight: 700;
}

.reports-empty-row td {
    color: var(--muted);
    font-weight: 600;
    padding: 30px 16px;
    text-align: center;
}

.order-pos-form {
    display: grid;
    gap: 18px;
}

.order-pos-meta {
    align-items: end;
    display: grid;
    gap: 14px 16px;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.55fr);
    margin-top: 0;
}

.order-pos-meta-heading {
    display: grid;
    gap: 4px;
    grid-column: 1 / -1;
}

.order-pos-meta-heading h2,
.order-pos-section-heading h2 {
    color: var(--rs-navy);
    font-size: 18px;
    line-height: 1.25;
    margin: 0;
}

.order-delivery-fields {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.order-pos-section-heading {
    display: grid;
    gap: 4px;
}

.order-pos-section-heading p {
    margin: 0;
}

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

.order-product-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 12px;
}

.order-existing-card {
    align-content: start;
}

.order-product-image {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
    height: 132px;
    object-fit: contain;
    padding: 6px;
    width: 100%;
}

.order-product-category {
    color: var(--muted);
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.2;
    overflow-wrap: anywhere;
    text-transform: uppercase;
}

.order-product-name {
    color: var(--rs-navy);
    display: -webkit-box;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    min-height: 35px;
    overflow: hidden;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.order-product-price {
    color: var(--rs-navy);
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.15;
    margin: 0;
}

.order-product-tax {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    margin: 0;
}

.order-qty-label {
    display: grid;
    gap: 5px;
    margin-top: 2px;
}

.order-qty-label span {
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.order-qty-label input {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    min-height: var(--touch-target);
    padding: 8px 10px;
    text-align: center;
    width: 100%;
}

.order-submit-bar {
    display: flex;
    justify-content: flex-end;
}

.order-detail-actions {
    justify-content: flex-end;
}

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

.order-summary-card,
.order-info-card,
.order-total-card,
.order-events-card {
    overflow-wrap: anywhere;
}

.order-summary-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
    display: grid;
    gap: 4px;
    padding: 16px;
}

.order-summary-card span {
    color: var(--muted);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.order-summary-card strong {
    color: var(--rs-navy);
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
}

.order-items-table {
    min-width: 760px;
}

.order-item-product {
    color: var(--rs-navy);
    font-weight: 700;
}

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

.order-total-grid p {
    margin: 0;
}

.order-grand-total {
    color: var(--rs-navy);
    font-family: var(--font-heading);
    font-size: 18px;
    grid-column: 1 / -1;
}

.order-status-form {
    grid-template-columns: minmax(180px, 1fr) auto;
    margin-top: 0;
}

.error-page {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--rs-radius);
    box-shadow: var(--rs-shadow);
    margin: 48px auto;
    max-width: 560px;
    padding: 32px;
    text-align: center;
}

@media (min-width: 1440px) {
    .app-shell {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .container {
        padding-left: 40px;
        padding-right: 40px;
    }

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

    .narrow {
        max-width: 800px;
    }
}

@media (max-width: 1199px) {
    .app-shell {
        grid-template-columns: 228px minmax(0, 1fr);
    }

    .sidebar {
        padding: 18px 12px;
    }

    .container {
        padding-left: 20px;
        padding-right: 20px;
    }

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

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

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

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

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

    .order-pos-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .order-product-image {
        height: 126px;
    }

    .restaurants-table th,
    .restaurants-table td,
    .users-table th,
    .users-table td {
        padding: 12px;
    }

    .super-admin-table {
        table-layout: fixed;
        min-width: 0;
        width: 100%;
    }

    .super-admin-table th,
    .super-admin-table td {
        padding: 10px;
    }

    .super-admin-table th:nth-child(1),
    .super-admin-table td:nth-child(1) {
        width: 27%;
    }

    .super-admin-table th:nth-child(2),
    .super-admin-table td:nth-child(2) {
        width: 16%;
    }

    .super-admin-table th:nth-child(3),
    .super-admin-table td:nth-child(3) {
        width: 26%;
    }

    .super-admin-table th:nth-child(4),
    .super-admin-table td:nth-child(4) {
        width: 16%;
    }

    .super-admin-table th:nth-child(5),
    .super-admin-table td:nth-child(5) {
        width: 15%;
    }

    .super-admin-table .table-actions {
        display: grid;
        gap: 8px;
        grid-template-columns: 1fr;
    }

    .super-admin-table .table-action {
        min-height: 44px;
        padding: 8px;
        white-space: nowrap;
        width: 100%;
    }

    .restaurant-actions,
    .user-actions {
        gap: 6px;
    }
}

@media (max-width: 991px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        gap: 16px;
        height: 100vh;
        height: 100dvh;
        left: 0;
        max-width: 300px;
        overflow-y: auto;
        padding: 18px 14px;
        position: fixed;
        top: 0;
        transform: translateX(-105%);
        transition: transform 180ms ease;
        width: min(82vw, 300px);
        z-index: 70;
    }

    .sidebar-close {
        display: inline-flex;
    }

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

    .sidebar-open .app-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .menu-toggle {
        display: inline-flex;
        position: relative;
    }

    .mobile-brand {
        display: inline-flex;
    }

    .restosys-brand {
        padding: 0 40px 4px 0;
        text-align: center;
    }

    .restosys-logo-sidebar {
        max-height: 82px;
        width: min(100%, 190px);
    }

    .tenant-card {
        padding: 10px;
    }

    .sidebar-nav {
        gap: 4px;
    }

    .header-context {
        justify-items: start;
    }

    .super-kpi-grid {
        gap: 12px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .admin-restaurant-context {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .cashier-restaurant-context {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .admin-restaurant-meta {
        align-items: flex-start;
        grid-column: 1 / -1;
        justify-items: start;
    }

    .cashier-restaurant-status {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .kpi-card {
        gap: 12px;
        grid-template-columns: 52px minmax(0, 1fr);
        min-height: 116px;
        padding: 16px;
    }

    .kpi-icon {
        flex-basis: 52px;
        border-radius: 14px;
        height: 52px;
        min-width: 52px;
        width: 52px;
    }

    .kpi-icon svg {
        height: 26px;
        width: 26px;
    }

    .super-admin-table th,
    .super-admin-table td {
        padding: 12px;
    }

    .super-admin-table .table-action {
        min-height: 44px;
        padding: 8px 11px;
    }

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

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

@media (max-width: 767px) {
    .topbar,
    .panel-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .app-header {
        display: grid;
        gap: 8px 10px;
        grid-template-areas:
            "menu brand"
            "title title"
            "context context";
        grid-template-columns: var(--touch-target) minmax(0, 1fr);
        min-height: 0;
        padding: 10px 12px 12px;
        position: relative;
    }

    .menu-toggle {
        align-self: flex-start;
        grid-area: menu;
    }

    .mobile-brand {
        grid-area: brand;
        justify-self: center;
        max-width: 190px;
        position: static;
        transform: none;
        width: 100%;
    }

    .header-title {
        grid-area: title;
    }

    .header-title .eyebrow {
        margin-bottom: 4px;
    }

    .header-title h1 {
        font-size: 21px;
    }

    body:has(.categories-page) .header-title h1 {
        font-size: 0;
    }

    body:has(.categories-page) .header-title h1::after {
        font-size: 21px;
    }

    .header-context {
        color: var(--muted);
        font-size: 12px;
        gap: 1px;
        grid-area: context;
        justify-items: start;
    }

    .header-context strong {
        font-size: 13px;
    }

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

    .restaurant-form-grid {
        grid-template-columns: 1fr;
    }

    .user-form-grid {
        grid-template-columns: 1fr;
    }

    .restaurant-form-section {
        padding: 14px;
    }

    .user-form-section {
        padding: 14px;
    }

    .super-kpi-grid {
        grid-template-columns: 1fr;
    }

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

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

    .admin-kpi-card {
        gap: 12px;
        grid-template-columns: 48px minmax(0, 1fr);
        min-height: 116px;
        padding: 16px;
    }

    .admin-kpi-icon {
        border-radius: 14px;
        height: 48px;
        width: 48px;
    }

    .admin-kpi-icon svg {
        height: 24px;
        width: 24px;
    }

    .cashier-kpi-card {
        gap: 12px;
        grid-template-columns: 48px minmax(0, 1fr);
        min-height: 116px;
        padding: 16px;
    }

    .cashier-kpi-icon {
        border-radius: 14px;
        height: 48px;
        width: 48px;
    }

    .cashier-kpi-icon svg {
        height: 24px;
        width: 24px;
    }

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

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

    .dashboard {
        gap: 16px;
    }

    .dashboard-hero {
        padding: 16px;
    }

    .dashboard-hero h1 {
        font-size: 24px;
        margin-bottom: 4px;
    }

    .secure-pill {
        align-self: flex-start;
        max-width: 100%;
        white-space: normal;
    }

    .kpi-card {
        gap: 12px;
        grid-template-columns: 48px max-content;
        justify-content: center;
        min-height: 112px;
        padding: 16px;
    }

    .kpi-card > div {
        min-width: 0;
        text-align: left;
    }

    .kpi-icon {
        flex-basis: 48px;
        height: 48px;
        min-width: 48px;
        width: 48px;
    }

    .super-admin-table-card {
        padding: 16px;
    }

    .super-admin-table-card .table-wrap {
        background: transparent;
        border: 0;
        box-shadow: none;
        overflow-x: visible;
    }

    .super-admin-table {
        border-collapse: separate;
        border-spacing: 0 14px;
        min-width: 0;
        table-layout: auto;
        width: 100%;
    }

    .super-admin-table thead {
        display: none;
    }

    .super-admin-table tbody,
    .super-admin-table tr,
    .super-admin-table td {
        display: block;
        max-width: none;
        width: 100%;
    }

    .super-admin-table th:nth-child(1),
    .super-admin-table td:nth-child(1),
    .super-admin-table th:nth-child(2),
    .super-admin-table td:nth-child(2),
    .super-admin-table th:nth-child(3),
    .super-admin-table td:nth-child(3),
    .super-admin-table th:nth-child(4),
    .super-admin-table td:nth-child(4),
    .super-admin-table th:nth-child(5),
    .super-admin-table td:nth-child(5) {
        max-width: none;
        width: 100%;
    }

    .super-admin-table tr {
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--rs-radius);
        box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
        padding: 16px;
    }

    .super-admin-table td {
        border-bottom: 0;
        padding: 8px 0;
        text-align: center;
    }

    .super-admin-table td::before {
        color: var(--muted);
        display: block;
        font-family: var(--font-heading);
        font-size: 12px;
        font-weight: 600;
        margin-bottom: 4px;
        text-transform: uppercase;
    }

    .super-admin-table td:nth-child(1)::before {
        content: "Restaurante";
    }

    .super-admin-table td:nth-child(2)::before {
        content: "Estado";
    }

    .super-admin-table td:nth-child(3)::before {
        content: "Plan activo";
    }

    .super-admin-table td:nth-child(4)::before {
        content: "Suscripción";
    }

    .super-admin-table td:nth-child(5)::before {
        content: "Acciones";
    }

    .super-admin-table .table-actions {
        align-items: center;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .super-admin-table .table-action {
        max-width: 100%;
        min-width: 132px;
        min-height: var(--touch-target);
        white-space: nowrap;
        width: fit-content;
    }

    .super-admin-table .status-pill,
    .super-admin-table .plan-chip {
        line-height: 1.2;
        margin-left: auto;
        margin-right: auto;
        max-width: 100%;
        width: fit-content;
    }

    .category-create-form {
        grid-template-columns: 1fr;
    }

    .categories-table-wrap {
        background: transparent;
        border: 0;
        box-shadow: none;
        overflow-x: visible;
    }

    .categories-table {
        border-collapse: separate;
        border-spacing: 0 14px;
        min-width: 0;
    }

    .categories-table thead {
        display: none;
    }

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

    .categories-table .category-row {
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--rs-radius);
        box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
        padding: 16px;
    }

    .categories-table .category-row td {
        align-items: center;
        border-bottom: 0;
        display: grid;
        gap: 8px;
        grid-template-columns: minmax(110px, 0.36fr) minmax(0, 1fr);
        padding: 8px 0;
    }

    .categories-table .category-row td::before {
        color: var(--muted);
        content: attr(data-label);
        font-family: var(--font-heading);
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .category-edit-form {
        grid-template-columns: minmax(0, 1fr) minmax(124px, 0.42fr) auto;
        width: 100%;
    }

    .category-actions-cell {
        align-items: stretch !important;
    }

    .category-empty-row {
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--rs-radius);
        box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
    }

    .products-table-wrap {
        background: transparent;
        border: 0;
        box-shadow: none;
        overflow-x: visible;
    }

    .products-table {
        border-collapse: separate;
        border-spacing: 0 14px;
        min-width: 0;
        table-layout: auto;
    }

    .products-table thead {
        display: none;
    }

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

    .products-table th:nth-child(1),
    .products-table td:nth-child(1),
    .products-table th:nth-child(2),
    .products-table td:nth-child(2),
    .products-table th:nth-child(3),
    .products-table td:nth-child(3),
    .products-table th:nth-child(4),
    .products-table td:nth-child(4),
    .products-table th:nth-child(5),
    .products-table td:nth-child(5),
    .products-table th:nth-child(6),
    .products-table td:nth-child(6) {
        width: 100%;
    }

    .products-table .product-row {
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--rs-radius);
        box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
        padding: 16px;
    }

    .products-table .product-row td {
        align-items: center;
        border-bottom: 0;
        display: grid;
        gap: 8px;
        grid-template-columns: minmax(110px, 0.36fr) minmax(0, 1fr);
        padding: 8px 0;
    }

    .products-table .product-row td::before {
        color: var(--muted);
        content: attr(data-label);
        font-family: var(--font-heading);
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .products-table .product-row .product-cell {
        align-items: start;
        display: block;
        padding-top: 0;
    }

    .products-table .product-row .product-cell::before,
    .products-table .product-row .product-actions-cell::before {
        content: none;
        display: none;
    }

    .product-thumb {
        flex-basis: 76px;
        height: 76px;
        width: 76px;
    }

    .product-actions-cell {
        display: grid !important;
        gap: 10px;
        padding-bottom: 0;
    }

    .product-action {
        min-height: var(--touch-target);
        width: fit-content;
    }

    .product-empty-row {
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--rs-radius);
        box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
    }

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

    .product-form-section {
        padding: 14px;
    }

    .orders-heading > a,
    .order-pos-heading > a,
    .order-detail-actions a,
    .order-submit-bar button,
    .order-status-form button {
        width: 100%;
    }

    .orders-table-wrap,
    .order-items-wrap {
        background: transparent;
        border: 0;
        box-shadow: none;
        overflow-x: visible;
    }

    .orders-table,
    .order-items-table {
        border-collapse: separate;
        border-spacing: 0 14px;
        min-width: 0;
        table-layout: auto;
    }

    .orders-table thead,
    .order-items-table thead {
        display: none;
    }

    .orders-table tbody,
    .orders-table tr,
    .orders-table td,
    .order-items-table tbody,
    .order-items-table tr,
    .order-items-table td {
        display: block;
        width: 100%;
    }

    .orders-table .order-row,
    .order-items-table .order-item-row {
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--rs-radius);
        box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
        padding: 16px;
    }

    .orders-table .order-row td,
    .order-items-table .order-item-row td {
        align-items: center;
        border-bottom: 0;
        display: grid;
        gap: 8px;
        grid-template-columns: minmax(110px, 0.36fr) minmax(0, 1fr);
        padding: 8px 0;
    }

    .orders-table .order-row td::before,
    .order-items-table .order-item-row td::before {
        color: var(--muted);
        content: attr(data-label);
        font-family: var(--font-heading);
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .orders-table .order-row .order-number-cell {
        align-items: start;
        display: grid;
        padding-top: 0;
    }

    .orders-table .order-row .order-number-cell::before,
    .orders-table .order-row .order-actions-cell::before,
    .order-items-table .order-item-row .order-item-product::before {
        content: none;
        display: none;
    }

    .order-actions-cell {
        display: grid !important;
        gap: 10px;
        padding-bottom: 0;
    }

    .order-action {
        width: fit-content;
    }

    .order-empty-row {
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--rs-radius);
        box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
    }

    .order-pos-meta {
        grid-template-columns: 1fr;
    }

    .order-delivery-fields {
        grid-template-columns: 1fr;
    }

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

    .order-product-card {
        padding: 10px;
    }

    .order-product-image {
        height: 112px;
    }

    .order-product-name {
        font-size: 13px;
        min-height: 33px;
    }

    .order-product-price {
        font-size: 17px;
    }

    .order-summary-grid,
    .order-total-grid {
        grid-template-columns: 1fr;
    }

    .order-detail-actions {
        display: grid;
        gap: 10px;
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    .order-status-form {
        grid-template-columns: 1fr;
    }

    .cash-register-heading .primary-button,
    .cash-detail-heading .primary-button,
    .cash-form-heading > a,
    .cash-form > button {
        width: 100%;
    }

    .cash-info-grid,
    .cash-method-grid,
    .cash-kpi-grid {
        grid-template-columns: 1fr;
    }

    .cash-card-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .cash-movement-form {
        grid-template-columns: 1fr;
    }

    .cash-movement-form button {
        width: 100%;
    }

    .cash-sessions-table-wrap,
    .cash-payments-table-wrap,
    .cash-refunds-table-wrap,
    .cash-movements-table-wrap {
        background: transparent;
        border: 0;
        box-shadow: none;
        overflow-x: visible;
    }

    .cash-sessions-table,
    .cash-payments-table,
    .cash-refunds-table,
    .cash-movements-table {
        border-collapse: separate;
        border-spacing: 0 14px;
        min-width: 0;
        table-layout: auto;
    }

    .cash-sessions-table thead,
    .cash-payments-table thead,
    .cash-refunds-table thead,
    .cash-movements-table thead {
        display: none;
    }

    .cash-sessions-table tbody,
    .cash-sessions-table tr,
    .cash-sessions-table td,
    .cash-payments-table tbody,
    .cash-payments-table tr,
    .cash-payments-table td,
    .cash-refunds-table tbody,
    .cash-refunds-table tr,
    .cash-refunds-table td,
    .cash-movements-table tbody,
    .cash-movements-table tr,
    .cash-movements-table td {
        display: block;
        width: 100%;
    }

    .cash-sessions-table .cash-session-row,
    .cash-payments-table .cash-payment-row,
    .cash-refunds-table .cash-refund-row,
    .cash-movements-table .cash-movement-row {
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--rs-radius);
        box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
        padding: 16px;
    }

    .cash-sessions-table .cash-session-row td,
    .cash-payments-table .cash-payment-row td,
    .cash-refunds-table .cash-refund-row td,
    .cash-movements-table .cash-movement-row td {
        align-items: center;
        border-bottom: 0;
        display: grid;
        gap: 8px;
        grid-template-columns: minmax(115px, 0.38fr) minmax(0, 1fr);
        overflow-wrap: anywhere;
        padding: 8px 0;
    }

    .cash-sessions-table .cash-session-row td::before,
    .cash-payments-table .cash-payment-row td::before,
    .cash-refunds-table .cash-refund-row td::before,
    .cash-movements-table .cash-movement-row td::before {
        color: var(--muted);
        content: attr(data-label);
        font-family: var(--font-heading);
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .cash-actions-cell {
        display: grid !important;
        gap: 10px;
        padding-bottom: 0;
    }

    .cash-sessions-table .cash-session-row .cash-actions-cell::before {
        content: none;
        display: none;
    }

    .cash-action {
        width: fit-content;
    }

    .reports-heading-actions,
    .reports-heading-actions a,
    .reports-heading-actions button,
    .reports-filter-form button {
        width: 100%;
    }

    .reports-filter-grid,
    .reports-kpi-grid,
    .reports-money-grid,
    .reports-tax-grid,
    .reports-side-grid {
        grid-template-columns: 1fr;
    }

    .reports-quick-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reports-quick-links a {
        justify-content: center;
        min-height: var(--touch-target);
        text-align: center;
    }

    .reports-detail-table-wrap {
        background: transparent;
        border: 0;
        box-shadow: none;
        overflow-x: visible;
    }

    .reports-detail-table {
        border-collapse: separate;
        border-spacing: 0 14px;
        min-width: 0;
        table-layout: auto;
    }

    .reports-detail-table thead {
        display: none;
    }

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

    .reports-detail-table .report-detail-row {
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--rs-radius);
        box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
        padding: 16px;
    }

    .reports-detail-table .report-detail-row td {
        align-items: center;
        border-bottom: 0;
        display: grid;
        gap: 8px;
        grid-template-columns: minmax(120px, 0.38fr) minmax(0, 1fr);
        overflow-wrap: anywhere;
        padding: 8px 0;
        text-align: left;
    }

    .reports-detail-table .report-detail-row td::before {
        color: var(--muted);
        content: attr(data-label);
        font-family: var(--font-heading);
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .reports-detail-table .report-detail-row .report-invoice-cell {
        align-items: start;
        display: grid;
        padding-top: 0;
    }

    .reports-detail-table .report-detail-row .report-invoice-cell::before {
        content: none;
        display: none;
    }

    .invoices-heading > a,
    .invoice-form-heading > a,
    .invoice-detail-heading > a,
    .payment-form-heading > a,
    .invoice-form > button,
    .payment-form > button {
        width: 100%;
    }

    .invoices-table-wrap,
    .invoice-payments-wrap,
    .invoice-refunds-wrap {
        background: transparent;
        border: 0;
        box-shadow: none;
        overflow-x: visible;
    }

    .invoices-table,
    .invoice-payments-table,
    .invoice-refunds-table {
        border-collapse: separate;
        border-spacing: 0 14px;
        min-width: 0;
        table-layout: auto;
    }

    .invoices-table thead,
    .invoice-payments-table thead,
    .invoice-refunds-table thead {
        display: none;
    }

    .invoices-table tbody,
    .invoices-table tr,
    .invoices-table td,
    .invoice-payments-table tbody,
    .invoice-payments-table tr,
    .invoice-payments-table td,
    .invoice-refunds-table tbody,
    .invoice-refunds-table tr,
    .invoice-refunds-table td {
        display: block;
        width: 100%;
    }

    .invoices-table .invoice-row,
    .invoice-payments-table .invoice-payment-row,
    .invoice-refunds-table .invoice-refund-row {
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--rs-radius);
        box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
        padding: 16px;
    }

    .invoices-table .invoice-row td,
    .invoice-payments-table .invoice-payment-row td,
    .invoice-refunds-table .invoice-refund-row td {
        align-items: center;
        border-bottom: 0;
        display: grid;
        gap: 8px;
        grid-template-columns: minmax(115px, 0.38fr) minmax(0, 1fr);
        padding: 8px 0;
    }

    .invoices-table .invoice-row td::before,
    .invoice-payments-table .invoice-payment-row td::before,
    .invoice-refunds-table .invoice-refund-row td::before {
        color: var(--muted);
        content: attr(data-label);
        font-family: var(--font-heading);
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .invoices-table .invoice-row .invoice-number-cell {
        align-items: start;
        display: grid;
        padding-top: 0;
    }

    .invoices-table .invoice-row .invoice-number-cell::before,
    .invoices-table .invoice-row .invoice-actions-cell::before,
    .invoice-payments-table .invoice-payment-row .invoice-refund-cell::before {
        content: none;
        display: none;
    }

    .invoice-actions-cell {
        display: grid !important;
        gap: 10px;
        padding-bottom: 0;
    }

    .invoice-actions-cell .invoice-action,
    .invoice-cancel-form {
        width: fit-content;
    }

    .invoice-cancel-form {
        align-items: stretch;
        display: grid;
        grid-template-columns: minmax(180px, 1fr) auto;
    }

    .invoice-form-grid,
    .payment-form-grid,
    .payment-cash-fields,
    .invoice-info-grid,
    .invoice-summary-grid,
    .invoice-totals-grid,
    .invoice-table-summary {
        grid-template-columns: 1fr;
    }

    .invoice-refund-cell {
        display: grid !important;
        gap: 8px;
    }

    .invoice-refund-form {
        grid-template-columns: 1fr;
    }

    .invoice-refund-form button {
        min-height: var(--touch-target);
        width: 100%;
    }

    .restaurants-table-wrap {
        background: transparent;
        border: 0;
        box-shadow: none;
        overflow-x: visible;
    }

    .restaurants-table {
        border-collapse: separate;
        border-spacing: 0 14px;
        min-width: 0;
    }

    .restaurants-table thead {
        display: none;
    }

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

    .restaurants-table .restaurant-row {
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--rs-radius);
        box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
        padding: 16px;
    }

    .restaurants-table .restaurant-row.has-meta {
        border-radius: var(--rs-radius) var(--rs-radius) 0 0;
    }

    .restaurants-table .restaurant-row td {
        border-bottom: 0;
        padding: 8px 0;
    }

    .restaurants-table .restaurant-row td::before {
        color: var(--muted);
        content: attr(data-label);
        display: block;
        font-family: var(--font-heading);
        font-size: 12px;
        font-weight: 600;
        margin-bottom: 4px;
        text-transform: uppercase;
    }

    .restaurants-table .restaurant-row .restaurant-cell::before,
    .restaurants-table .restaurant-row .restaurant-actions::before {
        content: none;
        display: none;
    }

    .restaurants-table .restaurant-cell {
        padding-top: 0;
    }

    .restaurant-identity {
        align-items: flex-start;
        gap: 12px;
    }

    .restaurant-logo {
        border-radius: 12px;
        height: 54px;
        width: 54px;
    }

    .restaurant-title strong {
        color: var(--rs-navy);
        font-family: var(--font-heading);
        font-size: 17px;
        line-height: 1.25;
    }

    .mobile-only {
        display: block;
    }

    .desktop-slug {
        display: none !important;
    }

    .restaurant-mobile-slug {
        color: var(--muted);
        font-size: 13px;
        overflow-wrap: anywhere;
    }

    .restaurant-meta-row {
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 0 0 var(--rs-radius) var(--rs-radius);
        border-top: 0;
        box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
        display: block;
        margin-top: -15px;
        padding: 0 16px 16px;
    }

    .restaurant-meta-row td {
        border-bottom: 0;
        display: grid;
        gap: 10px;
        padding: 0;
    }

    .restaurant-meta {
        background: transparent;
    }

    .restaurant-meta span {
        display: grid;
        gap: 2px;
        margin-right: 0;
    }

    .restaurant-actions {
        display: grid;
        gap: 10px;
        padding-bottom: 0;
    }

    .restaurant-actions > .table-action-primary,
    .restaurant-actions > .actions-menu > summary {
        min-height: var(--touch-target);
        width: 100%;
    }

    .restaurants-table .actions-menu-panel,
    .actions-menu-panel {
        max-height: 42dvh;
        position: static;
        width: 100%;
    }

    .users-table-wrap {
        background: transparent;
        border: 0;
        box-shadow: none;
        overflow-x: visible;
    }

    .users-table {
        border-collapse: separate;
        border-spacing: 0 14px;
        min-width: 0;
    }

    .users-table thead {
        display: none;
    }

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

    .users-table .user-row {
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--rs-radius);
        box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
        padding: 16px;
    }

    .users-table .user-row td {
        align-items: center;
        border-bottom: 0;
        display: grid;
        gap: 8px;
        grid-template-columns: minmax(110px, 0.42fr) minmax(0, 1fr);
        padding: 8px 0;
    }

    .users-table .user-row td::before {
        color: var(--muted);
        content: attr(data-label);
        font-family: var(--font-heading);
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .users-table .user-row .user-cell {
        align-items: flex-start;
        display: block;
        padding-top: 0;
    }

    .users-table .user-row .user-cell::before {
        content: none;
        display: none;
    }

    .user-identity strong {
        font-size: 17px;
        line-height: 1.25;
    }

    .user-actions {
        display: grid !important;
        gap: 10px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding-bottom: 0;
    }

    .users-table .user-row .user-actions::before {
        content: none;
        display: none;
    }

    .user-actions a,
    .user-actions button {
        min-height: var(--touch-target);
        width: 100%;
    }

    .user-actions form {
        margin: 0;
    }

    .inline-form {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 16px 12px;
    }

    .auth-header {
        padding: 14px 18px;
    }

    .auth-panel {
        border-radius: 16px;
    }
}

@media (min-width: 481px) and (max-width: 767px) {
    .super-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 599px) {
    .order-pos-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .order-product-image {
        height: 104px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .restosys-wordmark {
        font-size: 17px;
    }

    .restosys-logo {
        flex-basis: 40px;
        height: 40px;
        width: 40px;
    }

    .restosys-logo-login {
        max-height: 112px;
        width: min(100%, 280px);
    }

    .restosys-logo-header {
        width: min(66vw, 210px);
    }

    .restosys-logo-mobile {
        max-height: 44px;
        width: min(58vw, 172px);
    }

    .app-header {
        gap: 7px 10px;
        grid-template-areas:
            "menu brand"
            "title title"
            "context context";
        padding: 9px 12px 11px;
    }

    .mobile-brand {
        justify-self: center;
        max-width: 176px;
    }

    .header-title {
        padding-top: 2px;
    }

    .header-title .eyebrow {
        font-size: 11px;
        margin-bottom: 2px;
    }

    .header-title h1 {
        font-size: 20px;
        line-height: 1.15;
    }

    body:has(.categories-page) .header-title h1 {
        font-size: 0;
    }

    body:has(.categories-page) .header-title h1::after {
        font-size: 20px;
    }

    body:has(.invoices-page) .header-title h1 {
        font-size: 0;
    }

    body:has(.invoices-page) .header-title h1::after {
        font-size: 20px;
    }

    .header-context {
        border-top: 1px solid var(--line);
        margin-top: 2px;
        padding-top: 7px;
    }

    .header-context strong {
        color: var(--rs-navy);
        font-family: var(--font-heading);
        font-size: 13px;
        font-weight: 600;
    }

    .row-actions a,
    .row-actions button,
    .table-action,
    .primary-button,
    .secondary-button,
    .ghost-button,
    .danger-button {
        width: 100%;
    }

    .restaurant-form-page .panel-heading > a,
    .restaurant-form-actions a,
    .restaurant-form-actions button {
        width: 100%;
    }

    .admin-restaurant-context {
        grid-template-columns: 1fr;
        justify-items: stretch;
        text-align: left;
    }

    .admin-restaurant-logo {
        height: 72px;
        width: 72px;
    }

    .admin-restaurant-meta {
        grid-column: auto;
    }

    .cashier-restaurant-context {
        grid-template-columns: 1fr;
        justify-items: stretch;
        text-align: left;
    }

    .cashier-restaurant-logo {
        height: 72px;
        width: 72px;
    }

    .cashier-restaurant-status {
        grid-column: auto;
    }

    .admin-kpi-grid,
    .admin-quick-grid {
        grid-template-columns: 1fr;
    }

    .admin-kpi-card {
        grid-template-columns: 48px max-content;
        justify-content: center;
    }

    .admin-kpi-card > div {
        min-width: 0;
        text-align: left;
    }

    .user-form-page .panel-heading > a,
    .user-form-actions button {
        width: 100%;
    }

    .logo-preview {
        align-items: flex-start;
        flex-direction: column;
    }

    .auth-brand {
        align-items: flex-start;
    }

    .users-table .user-row td {
        grid-template-columns: 1fr;
    }

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

    .categories-table .category-row td {
        grid-template-columns: 1fr;
    }

    .category-edit-form {
        grid-template-columns: 1fr;
    }

    .products-table .product-row td {
        grid-template-columns: 1fr;
    }

    .product-heading-actions a,
    .product-form-heading > a,
    .product-form-actions button {
        width: 100%;
    }

    .product-identity {
        align-items: flex-start;
    }

    .product-thumb {
        flex-basis: 72px;
        height: 72px;
        width: 72px;
    }

    .product-action {
        width: 100%;
    }

    .orders-table .order-row td,
    .order-items-table .order-item-row td {
        grid-template-columns: 1fr;
    }

    .order-action {
        width: 100%;
    }

    .cash-sessions-table .cash-session-row td,
    .cash-payments-table .cash-payment-row td,
    .cash-refunds-table .cash-refund-row td,
    .cash-movements-table .cash-movement-row td {
        grid-template-columns: 1fr;
    }

    .cash-action,
    .cash-heading-actions,
    .cash-heading-actions .primary-button {
        width: 100%;
    }

    .cash-form-section,
    .cash-status-card,
    .cash-session-overview,
    .cash-method-card,
    .cash-movement-card,
    .cash-payments-card,
    .cash-refunds-card,
    .cash-manual-movements-card,
    .cash-close-summary,
    .cash-warning-card {
        padding: 14px;
    }

    .reports-detail-table .report-detail-row td {
        grid-template-columns: 1fr;
    }

    .reports-quick-links {
        grid-template-columns: 1fr;
    }

    .reports-summary-section,
    .reports-list-card,
    .reports-detail-card,
    .reports-note-card {
        padding: 14px;
    }

    .invoices-table .invoice-row td,
    .invoice-payments-table .invoice-payment-row td,
    .invoice-refunds-table .invoice-refund-row td {
        grid-template-columns: 1fr;
    }

    .invoice-actions-cell .invoice-action,
    .invoice-cancel-form,
    .invoice-cancel-form button,
    .invoice-pdf-link a {
        width: 100%;
    }

    .invoice-cancel-form {
        grid-template-columns: 1fr;
    }

    .order-product-image {
        height: 96px;
        padding: 5px;
    }

    .order-product-card {
        gap: 5px;
        padding: 8px;
    }

    .order-product-category {
        font-size: 10px;
        line-height: 1.15;
    }

    .order-product-name {
        font-size: 12.5px;
        line-height: 1.2;
        min-height: 30px;
    }

    .order-product-price {
        font-size: 16px;
    }

    .order-product-tax {
        font-size: 11px;
        line-height: 1.2;
    }

    .order-qty-label {
        gap: 4px;
        margin-top: 0;
    }

    .order-qty-label span {
        font-size: 11px;
    }

    .order-qty-label input {
        min-height: 44px;
        padding: 7px 8px;
    }
}

@media print {
    .sidebar,
    .topbar,
    .app-overlay,
    .primary-button,
    .row-actions,
    form {
        display: none !important;
    }

    body {
        background: #ffffff;
    }

    .app-shell {
        display: block;
    }

    .container {
        max-width: none;
        padding: 0;
    }
}

/* Panel de restaurantes fuera del overflow de la tabla, también en móvil. */
.actions-menu-panel.restaurant-actions-floating {
    position: fixed;
    z-index: 1000;
    right: auto;
    width: 240px;
    min-width: 0;
    max-width: calc(100vw - 16px);
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
}

/* Fondo claro exclusivo del logo corporativo del sidebar. */
.sidebar .restosys-brand > .brand {
    background: #fffdf9;
    border-radius: 16px;
    padding: 12px;
    width: 100%;
    min-width: 0;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Activación nativa de la tarjeta sin interceptar sus controles de cantidad. */
.order-product-selectable {
    position: relative;
}
.order-product-selectable > .order-product-add {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: inherit;
    background: transparent;
    cursor: pointer;
    touch-action: manipulation;
}
.order-product-add:focus-visible {
    outline: 2px solid var(--rs-info);
    outline-offset: 2px;
}
.order-product-selectable .order-qty-label,
.order-product-selectable :is(a, input, select, textarea, button:not(.order-product-add)) {
    position: relative;
    z-index: 2;
}
/* POS: presentation only; original form fields and submission are preserved. */
.order-pos-page:has([data-pos-workspace]) { max-width: none; width: 100%; min-width: 0; }
.pos-enhanced { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }
.pos-enhanced > .order-pos-meta { grid-column: 1 / -1; }
.pos-enhanced .order-pos-meta-heading { grid-column: auto; align-self: center; }
.pos-enhanced > .order-pos-meta { grid-template-columns: minmax(160px, .8fr) repeat(2, minmax(0, 1fr)); }
.pos-enhanced [hidden] { display: none !important; }
.pos-catalog { min-width: 0; display: grid; gap: 16px; }
.pos-filters { margin: 0; display: grid; gap: 12px; }
.pos-filters label { display: grid; gap: 6px; }
.pos-categories { display: flex; flex-wrap: wrap; gap: 8px; }
.pos-enhanced .pos-touch { min-height: 44px; min-width: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--rs-navy); font: inherit; cursor: pointer; touch-action: manipulation; }
.pos-enhanced .pos-touch:hover, .pos-enhanced .pos-touch[aria-pressed="true"] { background: var(--rs-navy); border-color: var(--rs-navy); color: #fff; }
.pos-enhanced .pos-touch:focus-visible { outline: 2px solid var(--rs-info); outline-offset: 3px; }
.pos-enhanced .order-pos-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; }
.pos-enhanced .order-product-card { padding: 10px; align-content: start; transition: border-color .15s, box-shadow .15s; }
.pos-enhanced .order-product-card.pos-selected { border-color: var(--rs-info); box-shadow: 0 0 0 1px var(--rs-info); }
.pos-enhanced .order-product-image { aspect-ratio: 4 / 3; height: auto; object-fit: contain; padding: 4px; }
.pos-enhanced .order-product-name { font-size: 15px; min-height: 38px; }
.pos-enhanced .order-product-price { font-size: 20px; }
.pos-enhanced .order-qty-label { grid-template-columns: 1fr 64px; align-items: center; }
.pos-enhanced .order-qty-label input { padding: 4px; }
.pos-current-order[open] { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; margin: 0; width: 100%; min-width: 0; max-width: none; max-height: calc(100dvh - 32px); border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: var(--surface); color: var(--text); box-shadow: 0 4px 20px rgba(19,36,58,.06); }
.pos-cart-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pos-cart-heading h2 { margin: 0; font-size: 20px; color: var(--rs-navy); }
.pos-cart-lines { overflow-y: auto; overscroll-behavior: contain; min-height: 0; box-sizing: border-box; padding-right: 12px; scrollbar-gutter: stable; }
.pos-cart-line { display: grid; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pos-cart-line > strong { overflow-wrap: anywhere; }
.pos-line-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.pos-line-quantity { min-width: 26px; text-align: center; font-weight: 700; }
.pos-line-total { text-align: right; }
.pos-cart-totals { border-top: 1px solid var(--line); padding-top: 10px; }
.pos-cart-totals > p:not(.muted) { display: flex; justify-content: space-between; gap: 10px; margin: 8px 0; }
.pos-cart-totals .muted { font-size: 12px; margin: 8px 0 0; }
.pos-cart-totals strong { white-space: nowrap; }
.pos-grand-total { font-size: 20px; color: var(--rs-navy); }
.pos-current-order .order-submit-bar { margin: 0; padding: 0; background: none; position: static; }
.pos-current-order .order-submit-bar button { width: 100%; min-height: 48px; }
.pos-enhanced .pos-mobile-cart, .pos-enhanced .pos-cart-close { display: none; }
@media (max-width: 1023px) {
    .pos-enhanced { grid-template-columns: minmax(0, 1.6fr) minmax(265px, 1fr); }
    .pos-enhanced .order-pos-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .pos-enhanced .order-pos-meta-heading { grid-column: 1 / -1; }
    .pos-enhanced > .order-pos-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pos-current-order[open] { padding: 12px; }
}
@media (max-width: 767px) {
    .pos-enhanced { grid-template-columns: minmax(0, 1fr); padding-bottom: 76px; }
    .pos-enhanced .order-pos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pos-enhanced > .order-pos-meta { grid-template-columns: minmax(0, 1fr); }
    .pos-enhanced .pos-mobile-cart { display: block; position: fixed; z-index: 35; bottom: max(12px, env(safe-area-inset-bottom)); left: 16px; right: 16px; width: calc(100% - 32px); background: var(--rs-navy); color: #fff; box-shadow: 0 4px 20px rgba(19,36,58,.2); }
    .pos-enhanced .pos-cart-close { display: inline-flex; }
    .pos-cart-lines { padding-right: 8px; scrollbar-gutter: auto; }
    .pos-current-order[open] { position: fixed; inset: auto 0 0; width: 100%; max-height: 88dvh; margin: 0; padding: 18px 16px max(18px, env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; }
    .pos-current-order::backdrop { background: rgba(19,36,58,.5); }
}
/* Keep the POS scroll below the actual header height, including wrapped titles. */
.app-main:has([data-pos-workspace]) > .app-header { background: #fff; }
@media (min-width: 768px) {
    .app-main:has([data-pos-workspace]) { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100dvh; }
    .app-main:has([data-pos-workspace]) > .app-header { position: relative; }
    .app-main:has([data-pos-workspace]) > .app-content { min-height: 0; overflow-y: auto; container-type: size; }
    .app-main:has([data-pos-workspace]) .pos-current-order[open] { max-height: calc(100cqh - 32px); }
}
