.app-shell {
    position: relative;
    display: flex;
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    flex-direction: column;
    overflow: hidden;
    background: #F3F6FA;
    color: #0F172A;
    font-family: var(--font-body);
}

.app-main {
    position: relative;
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    padding: clamp(1rem, 0.9rem + 0.7vw, 1.75rem);
    background-color: #F3F6FA;
}

/* Modern Industrial Precision Design Tokens & Classes */
.app-navbar-obsidian {
    background-color: #0B1120;
    border-bottom: 1px solid #1E293B;
    height: 60px;
    min-height: 60px;
}

.app-footer-telemetry {
    height: 44px;
    min-height: 44px;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid #E2E8F0;
}

.badge-status-pendiente {
    background: #F1F5F9;
    color: #475569;
    border: 1px solid #CBD5E1;
}
.badge-status-preparacion {
    background: #EFF6FF;
    color: #1D4ED8;
    border: 1px solid #BFDBFE;
}
.badge-status-pausada {
    background: #FFFBEB;
    color: #B45309;
    border: 1px solid #FDE68A;
}
.badge-status-completada {
    background: #ECFDF5;
    color: #047857;
    border: 1px solid #A7F3D0;
}
.badge-status-novedad {
    background: #FEF2F2;
    color: #B91C1C;
    border: 1px solid #FECACA;
}
.badge-status-despachada {
    background: #F5F3FF;
    color: #6D28D9;
    border: 1px solid #DDD6FE;
}
.badge-status-cancelada {
    background: #F3F4F6;
    color: #374151;
    border: 1px solid #E5E7EB;
}

.app-table-pro th {
    background-color: #F8FAFC;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #E2E8F0;
}
.app-table-pro td {
    height: 44px;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    border-bottom: 1px solid #F1F5F9;
    vertical-align: middle;
}
.app-table-pro tr:hover td {
    background-color: #F8FAFC;
}
.col-id-cell {
    white-space: nowrap !important;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.8125rem;
    min-width: 140px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-page {
    display: flex;
    width: 100%;
    min-width: 0;
    flex-direction: column;
    gap: 1.25rem;
}

.app-surface,
.app-card,
.app-panel {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(14px);
}

.app-card {
    padding: clamp(1rem, 0.85rem + 0.8vw, 1.5rem);
}

.app-card-muted {
    border: 1px solid rgba(219, 229, 238, 0.9);
    border-radius: var(--radius-md);
    background: var(--bg-muted);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.app-loading-skeleton__line {
    height: .5rem;
    border-radius: 999px;
    background: var(--color-border-strong);
}

.app-loading-skeleton__line--title { width: 13rem; }
.app-loading-skeleton__line--short { width: 12rem; background: var(--color-border-subtle); }
.app-loading-skeleton__line--full { width: 100%; background: var(--color-border-subtle); }
.app-loading-skeleton__line--medium { width: 16rem; background: var(--color-border-subtle); }
.app-loading-skeleton__line--wide { width: 80%; background: var(--color-border-subtle); }

.app-metric-panel {
    border: 1px solid var(--border-strong);
    background: var(--bg-muted);
    color: var(--text-main);
    box-shadow: var(--shadow-soft);
}

.app-metric-panel__label { color: var(--text-muted); }
.app-metric-panel__label--accent { color: var(--color-brand-accent); }
.app-metric-panel__value { color: var(--text-main); }
.app-metric-panel__value--accent { color: var(--color-success); }

.app-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.125rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 252, 0.98));
    box-shadow: var(--shadow-soft);
}

.app-toolbar-group,
.app-toolbar-actions {
    display: flex;
    flex: 1 1 320px;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.app-toolbar-actions {
    justify-content: flex-end;
}

.app-chip-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.app-chip,
.app-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.app-chip strong,
.app-pill strong {
    color: var(--text-main);
}

.app-chip--dark,
.app-pill--dark {
    border-color: rgba(15, 23, 42, 0.08);
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #e2e8f0;
}

.app-chip--dark strong,
.app-pill--dark strong {
    color: #ffffff;
}

.app-chip--success {
    border-color: rgba(5, 150, 105, 0.18);
    background: rgba(236, 253, 245, 0.96);
    color: #047857;
}

.app-chip--warning {
    border-color: rgba(217, 119, 6, 0.18);
    background: rgba(255, 251, 235, 0.98);
    color: #b45309;
}

.app-chip--danger {
    border-color: rgba(220, 38, 38, 0.18);
    background: rgba(254, 242, 242, 0.98);
    color: #b91c1c;
}

.app-caption {
    color: var(--text-soft);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    padding: 3rem 1rem;
    color: var(--text-muted);
    text-align: center;
}

.app-empty-state__icon {
    display: grid;
    height: 3rem;
    width: 3rem;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-soft);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}

.app-navbar {
    position: relative;
    z-index: 5;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(203, 213, 225, 0.7);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px);
}

.app-navbar__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.9rem;
    justify-content: space-between;
}

.app-navbar__brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.app-navbar__divider {
    height: 2rem;
    width: 1px;
    background: rgba(203, 213, 225, 0.9);
}

.app-navbar__links {
    display: none;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.app-navbar__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.app-navbar__mobile {
    display: grid;
    gap: 0.9rem;
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 1.4rem;
    background: rgba(248, 250, 252, 0.96);
    box-shadow: var(--shadow-soft);
}

.app-navbar__mobile-links {
    display: grid;
    gap: 0.55rem;
}

.app-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.55rem 0.4rem 0.4rem;
    border: 1px solid rgba(219, 229, 238, 0.92);
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.95);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.app-user-avatar {
    display: grid;
    height: 2.35rem;
    width: 2.35rem;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.app-user-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.app-user-copy strong {
    color: var(--text-main);
    font-size: 0.82rem;
}

.app-user-copy span {
    color: var(--text-soft);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-menu-button {
    display: inline-flex;
    height: 2.2rem;
    width: 2.2rem;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.96);
    color: #334155;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.app-menu-button:hover {
    background: rgba(241, 245, 249, 1);
    color: #0f172a;
}

.app-footer {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 0.9rem;
    padding: 0.5rem 1rem;
    border-top: 1px solid rgba(203, 213, 225, 0.72);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(18px);
}

.app-footer__brand,
.app-footer__status,
.app-footer__user {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.app-footer__brand {
    color: var(--text-muted);
    font-size: 0.78rem;
    justify-content: center;
}

.app-footer__status {
    justify-content: center;
}

.app-footer__user {
    justify-content: center;
}

.app-inline-select {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.2rem;
    padding: 0.25rem 0.7rem;
    border: 1px solid rgba(203, 213, 225, 0.92);
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.96);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.app-inline-select select {
    min-width: 9rem;
    border: none;
    background: transparent;
    color: #334155;
    font-size: 0.84rem;
    font-weight: 700;
    outline: none;
}

.app-weight-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 2.2rem;
    padding: 0.25rem 0.8rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #6ee7b7;
    font-size: 0.85rem;
    font-weight: 800;
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.18);
}

.app-surface-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 2.2rem;
    padding: 0.25rem 0.8rem;
    border: 1px solid rgba(203, 213, 225, 0.92);
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.96);
    color: #475569;
    font-size: 0.84rem;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.app-surface-button:hover {
    background: rgba(241, 245, 249, 1);
    color: #0f172a;
    transform: translateY(-1px);
}

.app-modal-panel {
    display: flex;
    flex-direction: column;
    width: min(100%, 52rem);
    max-height: min(90vh, 960px);
    overflow: hidden;
    border: 1px solid rgba(203, 213, 225, 0.8);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
    box-shadow: var(--shadow-panel);
    padding: 0;
}

.app-modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    inset: 0 !important;
    z-index: 99998 !important;
    background: rgba(11, 17, 32, 0.78) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

.app-modal-host {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    inset: 0 !important;
    z-index: 99999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: clamp(0.75rem, 2vw, 1.5rem);
    pointer-events: none;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

.app-modal-panel {
    pointer-events: auto;
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 2.5rem);
    display: flex;
    flex-direction: column;
    overflow-x: hidden !important;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
}

.app-modal-panel > form,
.app-modal-panel > .modal-body {
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-width: 100%;
}

.app-modal-panel > .modal-body {
    flex: 1 1 auto;
    padding: 1.25rem;
}

.app-modal-panel > .modal-footer {
    flex: 0 0 auto;
}

.app-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-width: 100%;
    padding: clamp(1rem, 0.8rem + 1vw, 1.5rem);
    color: var(--text-main);
}

.app-modal-footer {
    flex: 0 0 auto;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-muted);
}

/* Shared alert surface: follows the active industrial theme and remains interactive. */
.fixed.bottom-4.right-4 {
    width: min(26rem, calc(100vw - 2rem));
    color: var(--text-main);
}
.fixed.bottom-4.right-4 > div {
    background: var(--bg-elevated) !important;
    border-color: var(--border-color);
    box-shadow: var(--shadow-soft);
}

.app-page-container { display: grid; gap: 1.25rem; width: 100%; max-width: 80rem; margin: 0 auto; }
.app-page-header { display: grid; gap: .35rem; }
.app-page-title, .app-section-title { margin: 0; color: var(--text-main); font-family: var(--font-display); font-weight: 700; }
.app-page-title { font-size: clamp(1.35rem, 1.1rem + .7vw, 2rem); }
.app-section-title { font-size: 1.2rem; }
.app-page-subtitle { margin: 0; color: var(--text-muted); }
.app-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: end; }
.app-field { display: grid; gap: .4rem; }
.app-field-wide { min-width: 0; }
.app-field-actions { display: flex; gap: .5rem; }
.app-input { width: 100%; min-height: 3rem; resize: vertical; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg-elevated); color: var(--text-main); padding: .7rem .9rem; }
.app-input:focus-visible { outline: 3px solid var(--border-focus); border-color: var(--color-brand-accent); }
.app-button { min-height: 3rem; border: 1px solid transparent; border-radius: var(--radius-sm); padding: .65rem 1rem; font-weight: 700; cursor: pointer; }
.app-button:disabled { cursor: not-allowed; opacity: .55; }
.app-button-primary { background: var(--color-brand-primary); color: #fff; }
.app-button-primary:hover:not(:disabled) { background: var(--primary-hover); }
.app-button-secondary { border-color: var(--border-strong); background: var(--bg-elevated); color: var(--text-main); }
.app-button-secondary:hover:not(:disabled) { background: var(--bg-muted); }
.app-table { width: 100%; border-collapse: collapse; color: var(--text-main); }
.app-table th, .app-table td { border-bottom: 1px solid var(--border-color); padding: .75rem; text-align: left; }
.app-table th { background: var(--bg-muted); color: var(--text-muted); font-size: .75rem; text-transform: uppercase; }
.app-status-badge { border: 1px solid var(--border-color); border-radius: 999px; background: var(--bg-muted); color: var(--text-muted); padding: .4rem .7rem; font-size: .75rem; font-weight: 800; }
.app-state-success, .app-state-error { border-radius: var(--radius-sm); padding: .75rem 1rem; }
.app-state-success { background: var(--success-light); color: var(--success-hover); }
.app-state-error { background: var(--error-light); color: var(--error-hover); }
.app-modal-footer { display: flex; justify-content: flex-end; gap: .75rem; }

/* Recipe form surfaces use the active application tokens rather than fixed light utility colors. */
.app-recipe-form .bg-slate-50,
.app-recipe-form .bg-white { background-color: var(--bg-elevated); }
.app-recipe-form .bg-slate-100 { background-color: var(--bg-muted); }
.app-recipe-form .text-slate-900,
.app-recipe-form .text-slate-800,
.app-recipe-form .text-slate-700 { color: var(--text-main); }
.app-recipe-form .text-slate-600,
.app-recipe-form .text-slate-500 { color: var(--text-muted); }
.app-recipe-form .border-slate-200,
.app-recipe-form .border-slate-300 { border-color: var(--border-color); }
.app-recipe-form select,
.app-recipe-form input,
.app-recipe-form textarea { background: var(--bg-elevated); color: var(--text-main); border-color: var(--border-strong); }

@media (max-width: 700px) {
    .app-form-grid { grid-template-columns: 1fr; }
    .app-field-actions .app-button { width: 100%; }
    .app-modal-footer { flex-wrap: wrap; }
    .app-modal-footer .app-button { flex: 1 1 10rem; }
}

.app-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(219, 229, 238, 0.92);
    padding: 1.25rem 1.25rem 1rem;
}

.app-modal-title {
    margin: 0;
    color: var(--text-main);
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 1rem + 0.45vw, 1.45rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.app-modal-subtitle {
    margin-top: 0.35rem;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.app-modal-close {
    display: inline-flex;
    height: 2.6rem;
    width: 2.6rem;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(203, 213, 225, 0.95);
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.98);
    color: #64748b;
    font-size: 1.2rem;
    line-height: 1;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.app-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.app-alert-stack {
    position: fixed;
    inset: auto 1rem 1rem 1rem;
    z-index: 60;
    display: grid;
    gap: 0.75rem;
    pointer-events: none;
}

.app-alert {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(203, 213, 225, 0.88);
    border-left-width: 5px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    color: #334155;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(14px);
}

.app-alert--success {
    border-left-color: #10b981;
}

.app-alert--error {
    border-left-color: #ef4444;
}

.app-alert--warning {
    border-left-color: #f59e0b;
}

.app-alert--info {
    border-left-color: #0ea5e9;
}

.app-alert-close {
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.receta-form-context [class*="bg-slate-800"] {
    background-color: var(--bg-muted) !important;
}

.receta-form-context [class*="border-slate-700"] {
    border-color: var(--border-strong) !important;
}

.receta-form-context [class*="text-white"] {
    color: var(--text-main) !important;
}

.receta-form-context [class*="text-slate-300"],
.receta-form-context [class*="text-slate-400"] {
    color: var(--text-muted) !important;
}

.receta-form-context .receta-form-version {
    background-color: var(--bg-muted) !important;
    border-color: var(--border-strong) !important;
}

.app-modal-alert-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    inset: 0 !important;
    z-index: 99999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1rem;
    background: rgba(11, 17, 32, 0.78) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    overflow-x: hidden !important;
}

.app-modal-alert {
    width: min(100%, 30rem);
    max-width: 100%;
    overflow-x: hidden !important;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
    padding: 1.5rem;
}

.app-modal-alert__title { margin: 0; color: var(--text-main); font-size: 1.1rem; font-weight: 800; }
.app-modal-alert__message { margin: 0; color: var(--text-muted); font-size: .9rem; line-height: 1.55; }
.app-modal-alert__actions { display: flex; justify-content: flex-end; gap: .5rem; padding-top: .75rem; border-top: 1px solid var(--border-color); }

.app-toast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--color-info);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-soft);
    color: var(--text-main);
    padding: .8rem 1rem;
    pointer-events: auto;
}
.app-toast--success { border-left-color: var(--color-success); }
.app-toast--error { border-left-color: var(--color-danger); }
.app-toast--warning { border-left-color: var(--color-warning); }
.app-toast__message { font-size: .85rem; line-height: 1.45; }
.app-toast__close, .app-inline-alert__close { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 1.2rem; line-height: 1; }
.app-toast__close:hover, .app-inline-alert__close:hover { color: var(--text-main); }

.app-inline-alert { display: flex; align-items: flex-start; gap: .75rem; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: var(--bg-muted); color: var(--text-main); padding: 1rem; box-shadow: var(--shadow-soft); }
.app-inline-alert__icon { flex: 0 0 auto; color: var(--color-info); font-size: 1.1rem; }
.app-inline-alert--success .app-inline-alert__icon { color: var(--color-success); }
.app-inline-alert--danger .app-inline-alert__icon, .app-inline-alert--error .app-inline-alert__icon { color: var(--color-danger); }
.app-inline-alert--warning .app-inline-alert__icon { color: var(--color-warning); }

.app-modal-alert__meta {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-modal-alert__meta--success {
    background: rgba(236, 253, 245, 1);
    color: #047857;
}

.app-modal-alert__meta--error {
    background: rgba(254, 242, 242, 1);
    color: #b91c1c;
}

.app-modal-alert__meta--warning {
    background: rgba(255, 251, 235, 1);
    color: #b45309;
}

.app-modal-alert__meta--info {
    background: rgba(239, 246, 255, 1);
    color: #0369a1;
}

.app-ticket-sheet {
    width: min(100%, 22rem);
    border: 1px dashed rgba(148, 163, 184, 0.7);
    border-radius: 1.4rem;
    background: #ffffff;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

.app-auth-shell {
    display: flex;
    min-height: 100%;
    width: 100%;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 0.8rem + 1vw, 2rem);
}

.app-auth-card {
    display: grid;
    width: min(100%, 1180px);
    overflow: hidden;
    border: 1px solid rgba(219, 229, 238, 0.85);
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-panel);
    backdrop-filter: blur(18px);
}

.app-auth-hero {
    position: relative;
    display: none;
    min-height: 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.app-auth-hero::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.22), rgba(15, 23, 42, 0.06));
}

.app-auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
    padding: clamp(1.5rem, 1rem + 1.4vw, 3rem);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.95));
}

.app-form-grid-2,
.app-form-grid-4 {
    display: grid;
    gap: 1rem;
}

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

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

.app-field-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-form-hint {
    color: var(--text-soft);
    font-size: 0.72rem;
    line-height: 1.45;
}

.app-native-input,
.app-native-select {
    width: 100%;
    min-height: 3rem;
    border: 1px solid rgba(203, 213, 225, 0.95);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.96);
    padding: 0.7rem 1rem;
    color: var(--text-main);
    font-size: 0.92rem;
    font-weight: 600;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease,
        color 0.2s ease;
}

.app-native-input:focus,
.app-native-select:focus {
    outline: none;
    border-color: rgba(100, 116, 139, 0.55);
    box-shadow:
        0 8px 18px rgba(15, 23, 42, 0.04),
        0 0 0 4px rgba(15, 23, 42, 0.08);
}

.app-native-input:disabled,
.app-native-select:disabled {
    cursor: not-allowed;
    background: rgba(241, 245, 249, 0.96);
    color: #94a3b8;
    box-shadow: none;
}

.app-native-input--mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    letter-spacing: 0.01em;
}

.app-native-select {
    appearance: none;
    padding-right: 2.8rem;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%2364748b' d='m4.47 6.97 3.53 3.53 3.53-3.53.94.94-4.47 4.47-4.47-4.47z'/%3E%3C/svg%3E");
    background-position: right 1rem center;
    background-repeat: no-repeat;
    background-size: 0.9rem auto;
}

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

.app-kpi-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(219, 229, 238, 0.92);
    border-radius: 1.35rem;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.app-kpi-card strong {
    color: var(--text-main);
    font-size: clamp(1rem, 0.9rem + 0.35vw, 1.32rem);
    font-weight: 800;
}

.app-boot-screen {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at top, rgba(16, 185, 129, 0.12), transparent 30%),
        linear-gradient(180deg, #f8fafc 0%, #f1f5f9 48%, #ecfdf5 100%);
}

.app-boot-card {
    width: min(100%, 26rem);
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 1.8rem;
    background: rgba(255, 255, 255, 0.92);
    padding: 1.4rem;
    box-shadow: var(--shadow-panel);
    backdrop-filter: blur(18px);
}

.app-boot-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.25rem;
}

.app-boot-brand__mark {
    display: grid;
    height: 3rem;
    width: 3rem;
    place-items: center;
    border-radius: 1rem;
    background: linear-gradient(135deg, #0f172a, #1f2937);
    color: #6ee7b7;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
}

.app-boot-skeleton {
    display: grid;
    gap: 0.95rem;
}

.app-boot-line {
    height: 0.8rem;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(226, 232, 240, 0.75), rgba(203, 213, 225, 0.95), rgba(226, 232, 240, 0.75));
    background-size: 200% 100%;
    animation: shimmer 1.35s linear infinite;
}

.app-boot-line--sm {
    width: 42%;
}

.app-boot-line--md {
    width: 68%;
}

.app-boot-line--lg {
    width: 100%;
}

.app-boot-line--xl {
    width: 82%;
}

.app-boot-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.app-paginator {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.125rem 1.125rem;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.7), rgba(255, 255, 255, 0.98));
}

.app-paginator__summary {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid rgba(203, 213, 225, 0.88);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

@media (min-width: 640px) {
    .app-alert-stack {
        left: auto;
        width: min(26rem, calc(100vw - 2rem));
    }
}

@media (min-width: 768px) {
    .app-auth-card {
        grid-template-columns: minmax(0, 1.25fr) minmax(350px, 0.9fr);
    }

    .app-auth-hero {
        display: block;
        min-height: 480px;
    }
}

@media (min-width: 1024px) {
    .app-navbar__links {
        display: flex;
    }

    .app-auth-card {
        grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.82fr);
    }

    .app-auth-hero {
        display: block;
    }
}

@media (min-width: 1120px) {
    .app-footer {
        grid-template-columns: minmax(0, 1fr) auto auto;
        align-items: center;
    }

    .app-footer__brand {
        justify-content: flex-start;
    }

    .app-footer__status {
        justify-content: center;
    }

    .app-footer__user {
        justify-content: flex-end;
    }
}

@media (max-width: 1023.98px) {
    .app-toolbar-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 767.98px) {
    .app-form-grid-2,
    .app-form-grid-4,
    .app-kpi-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .app-modal-host { align-items: end; }
    .app-modal-panel {
        width: 100% !important;
        max-height: calc(100dvh - 1rem);
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }
}

@media print {
    body * {
        visibility: hidden;
    }
    #print-ticket,
    #print-ticket * {
        visibility: visible;
    }
    #print-ticket {
        position: absolute;
        left: 0;
        top: 0;
        width: 320px;
        margin: 0;
        padding: 0;
        border: none;
        box-shadow: none;
        background: white;
    }
}

/* Toast & Notification Stack */
.app-alert-stack {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.app-toast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-radius: 1rem;
    background: #ffffff;
    box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(226, 232, 240, 0.8);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #0f172a;
    pointer-events: auto;
    max-width: 24rem;
}

.app-toast--success {
    border-left: 4px solid #10b981;
}

.app-toast--error,
.app-toast--danger {
    border-left: 4px solid #ef4444;
}

.app-toast--warning {
    border-left: 4px solid #f59e0b;
}

.app-toast--info {
    border-left: 4px solid #2563eb;
}

.app-toast__close {
    background: none;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
}

.app-toast__close:hover {
    color: #0f172a;
}
