:root {
    --ink: #10231f;
    --ink-soft: #3d524c;
    --muted: #6b7f78;
    --line: rgba(16, 35, 31, 0.10);
    --surface: rgba(255, 255, 255, 0.78);
    --surface-solid: #f7faf8;
    --panel: #ffffff;
    --brand: #0d6b5c;
    --brand-deep: #084c42;
    --brand-soft: #d7f0ea;
    --accent: #e8a317;
    --accent-deep: #c4840a;
    --danger: #c23b3b;
    --warn: #d97706;
    --ok: #1f8a5b;
    --info: #2a6f97;
    --shadow: 0 18px 50px rgba(16, 35, 31, 0.10);
    --radius: 18px;
    --radius-sm: 12px;
    --sidebar-w: 268px;
    --font: "Manrope", system-ui, sans-serif;
    --display: "Sora", "Manrope", system-ui, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(13, 107, 92, 0.14), transparent 55%),
        radial-gradient(900px 500px at 100% 0%, rgba(232, 163, 23, 0.12), transparent 50%),
        linear-gradient(180deg, #eef5f2 0%, #f5f7f6 40%, #e9f0ed 100%);
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: var(--display);
    margin: 0;
    letter-spacing: -0.02em;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; display: block; }

.muted { color: var(--muted); }

/* ===== Login ===== */
.login-body {
    min-height: 100vh;
    overflow-x: hidden;
}

.login-bg {
    position: fixed;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(8, 76, 66, 0.92), rgba(13, 107, 92, 0.75)),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
        #084c42;
    z-index: -1;
}

.login-grid {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
}

.login-hero {
    color: #fff;
    display: flex;
    align-items: center;
    padding: 64px;
}

.login-hero-inner { max-width: 520px; }

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 28px;
}

.brand-lockup h1 {
    font-size: clamp(2.6rem, 5vw, 3.8rem);
    line-height: 0.95;
    font-weight: 800;
}

.brand-sub {
    margin: 4px 0 0;
    font-family: var(--display);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--accent), #f0c14d);
    color: var(--ink);
    display: grid;
    place-items: center;
    font-family: var(--display);
    font-weight: 800;
    font-size: 1rem;
    box-shadow: 0 10px 24px rgba(232, 163, 23, 0.35);
}

.brand-mark.xl {
    width: 72px;
    height: 72px;
    font-size: 1.4rem;
    border-radius: 20px;
}

.login-lead {
    font-size: 1.2rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.88);
    margin: 0 0 28px;
    max-width: 28ch;
}

.login-points {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.login-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.login-points li::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(232, 163, 23, 0.2);
}

.login-panel {
    display: grid;
    place-items: center;
    padding: 40px 24px;
    backdrop-filter: blur(8px);
}

.login-form {
    width: min(420px, 100%);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 28px;
    padding: 36px 32px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 16px;
}

.login-form h2 { font-size: 1.55rem; }
.login-form label {
    display: grid;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ink-soft);
}

.login-hint {
    margin: 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
}

/* ===== App shell ===== */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: linear-gradient(180deg, #0b3d35 0%, #0f4a40 45%, #123f38 100%);
    color: #e8f3ef;
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    z-index: 40;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 16px;
}

.sidebar-brand strong {
    display: block;
    font-family: var(--display);
    font-size: 1.05rem;
    letter-spacing: 0.04em;
}

.sidebar-brand span {
    display: block;
    font-size: 0.78rem;
    color: var(--accent);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
}

.sidebar-nav {
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}

.nav-label {
    margin: 18px 10px 8px;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(232, 243, 239, 0.45);
    font-weight: 700;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    color: rgba(232, 243, 239, 0.82);
    font-weight: 600;
    font-size: 0.92rem;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(232, 163, 23, 0.95), rgba(232, 163, 23, 0.75));
    color: #13231f;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.nav-ico {
    width: 22px;
    text-align: center;
    opacity: 0.9;
}

.sidebar-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 8px 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 12px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    display: grid;
    place-items: center;
    font-weight: 800;
}

.user-chip strong,
.user-chip small {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-chip small {
    color: rgba(232, 243, 239, 0.6);
    font-size: 0.75rem;
}

.btn-logout {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.main-wrap {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 28px;
    backdrop-filter: blur(14px);
    background: rgba(247, 250, 248, 0.78);
    border-bottom: 1px solid var(--line);
}

.topbar-title h1 {
    font-size: 1.45rem;
}

.topbar-title p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-deep);
    font-size: 0.82rem;
    font-weight: 700;
}

.pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 0 rgba(31, 138, 91, 0.55);
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    70% { box-shadow: 0 0 0 10px rgba(31, 138, 91, 0); }
    100% { box-shadow: 0 0 0 0 rgba(31, 138, 91, 0); }
}

.clock {
    font-family: var(--display);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--ink-soft);
    min-width: 170px;
    text-align: right;
}

.menu-toggle {
    display: none;
    border: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    cursor: pointer;
}

.content {
    padding: 24px 28px 40px;
    flex: 1;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 28px 22px;
    color: var(--muted);
    font-size: 0.82rem;
}

/* ===== UI kit ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 12px;
    padding: 11px 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    color: #fff;
    box-shadow: 0 10px 24px rgba(13, 107, 92, 0.28);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    color: #1a1a1a;
    box-shadow: 0 10px 24px rgba(232, 163, 23, 0.28);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink-soft);
}

.btn-danger {
    background: #fde8e8;
    color: var(--danger);
}

.btn-sm {
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: 10px;
}

.btn-block { width: 100%; }

input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
    border-color: rgba(13, 107, 92, 0.55);
    box-shadow: 0 0 0 4px rgba(13, 107, 92, 0.12);
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 600;
}

.alert-error {
    background: #fde8e8;
    color: var(--danger);
}

.alert-ok {
    background: #e6f6ee;
    color: var(--ok);
}

.page-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.page-head .actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.grid {
    display: grid;
    gap: 18px;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(16, 35, 31, 0.04);
    padding: 20px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-head h2,
.panel-head h3 {
    font-size: 1.05rem;
}

.stat {
    position: relative;
    overflow: hidden;
    padding: 18px 18px 16px;
    border-radius: var(--radius);
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: 0 10px 30px rgba(16, 35, 31, 0.04);
    animation: rise 0.55s ease both;
}

.stat::after {
    content: "";
    position: absolute;
    inset: auto -20% -40% auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(13, 107, 92, 0.12), transparent 70%);
}

.stat .label {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stat .value {
    font-family: var(--display);
    font-size: 1.85rem;
    font-weight: 800;
    margin-top: 8px;
    letter-spacing: -0.03em;
}

.stat .hint {
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.stat.accent .value { color: var(--brand); }
.stat.warn .value { color: var(--warn); }
.stat.ok .value { color: var(--ok); }
.stat.gold .value { color: var(--accent-deep); }

@keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.table-wrap { overflow-x: auto; }

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

table.data th,
table.data td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

table.data th {
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 800;
}

table.data tbody tr {
    transition: background 0.15s;
}

table.data tbody tr:hover {
    background: rgba(13, 107, 92, 0.04);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
}

.badge-ok { background: #e6f6ee; color: var(--ok); }
.badge-warn { background: #fff4e5; color: var(--warn); }
.badge-danger { background: #fde8e8; color: var(--danger); }
.badge-info { background: #e7f2f8; color: var(--info); }
.badge-neutral { background: #eef2f0; color: var(--ink-soft); }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-grid .full { grid-column: 1 / -1; }

.form-grid label {
    display: grid;
    gap: 7px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ink-soft);
}

.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.tab {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-soft);
    border-radius: 999px;
    padding: 9px 16px;
    font-weight: 700;
    cursor: pointer;
}

.tab.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: rise 0.35s ease both; }

.ticket-preview {
    background:
        linear-gradient(180deg, #fff 0%, #f8faf9 100%);
    border: 1px dashed rgba(13, 107, 92, 0.35);
    border-radius: 16px;
    padding: 22px;
    font-family: var(--display);
}

.ticket-preview .qr {
    width: 96px;
    height: 96px;
    border-radius: 12px;
    background:
        repeating-linear-gradient(0deg, #10231f 0 2px, transparent 2px 6px),
        repeating-linear-gradient(90deg, #10231f 0 2px, transparent 2px 6px);
    opacity: 0.85;
    margin: 12px auto;
}

.ticket-preview .center { text-align: center; }
.ticket-preview .row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 0.9rem;
}

.spaces-map {
    display: grid;
    gap: 18px;
}

.zone-block h3 {
    margin-bottom: 12px;
    font-size: 0.98rem;
}

.slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 8px;
}

.slot {
    aspect-ratio: 1;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 0.72rem;
    font-weight: 800;
    border: 1px solid transparent;
    cursor: default;
    transition: transform 0.15s;
}

.slot:hover { transform: scale(1.04); }
.slot.free { background: #e6f6ee; color: var(--ok); border-color: rgba(31, 138, 91, 0.2); }
.slot.busy { background: #fde8e8; color: var(--danger); border-color: rgba(194, 59, 59, 0.2); }
.slot.reserved { background: #fff4e5; color: var(--warn); border-color: rgba(217, 119, 6, 0.2); }
.slot.vip { background: linear-gradient(145deg, #fff4d6, #ffe8a8); color: #8a6500; }
.slot.moto { border-radius: 50%; }

.legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--ink-soft);
    font-weight: 600;
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend i {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    display: inline-block;
}

.chart-bars {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    align-items: end;
    gap: 10px;
    height: 180px;
    padding-top: 10px;
}

.chart-bars .bar-wrap {
    display: grid;
    gap: 8px;
    justify-items: center;
    height: 100%;
    align-content: end;
}

.chart-bars .bar {
    width: 100%;
    border-radius: 10px 10px 4px 4px;
    background: linear-gradient(180deg, var(--brand), #178a76);
    min-height: 12px;
    animation: grow 0.8s ease both;
}

@keyframes grow {
    from { transform: scaleY(0.2); transform-origin: bottom; opacity: 0.3; }
    to { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
}

.chart-bars small {
    color: var(--muted);
    font-weight: 700;
    font-size: 0.72rem;
}

.kpi-list {
    display: grid;
    gap: 12px;
}

.kpi-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
}

.report-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.report-card {
    padding: 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #fff, #f8fbfa);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.report-card:hover {
    transform: translateY(-3px);
    border-color: rgba(13, 107, 92, 0.35);
    box-shadow: 0 14px 28px rgba(16, 35, 31, 0.08);
}

.report-card strong {
    display: block;
    font-family: var(--display);
    margin-bottom: 6px;
}

.report-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.role-card {
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: #fff;
}

.role-card h3 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.role-card ul {
    margin: 0;
    padding-left: 18px;
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    background: var(--ink);
    color: #fff;
    padding: 14px 18px;
    border-radius: 14px;
    box-shadow: var(--shadow);
    z-index: 100;
    transform: translateY(20px);
    opacity: 0;
    transition: 0.25s ease;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.reveal {
    animation: rise 0.7s ease both;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

.split-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.money {
    font-family: var(--display);
    font-weight: 800;
    color: var(--brand-deep);
}

.empty-note {
    padding: 28px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: var(--radius-sm);
}

/* Responsive */
@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .login-grid { grid-template-columns: 1fr; }
    .login-hero { padding: 48px 28px 20px; min-height: auto; }
    .login-panel { padding-top: 10px; padding-bottom: 48px; }

    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        width: min(300px, 86vw);
        box-shadow: var(--shadow);
    }
    .sidebar.open { transform: translateX(0); }
    .menu-toggle { display: inline-grid; place-items: center; }
    .content { padding: 18px 16px 32px; }
    .topbar { padding: 14px 16px; }
    .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
    .clock { display: none; }
}

/* ============================================================
   ADMINIX 2.0 — multiempresa + pantalla única de operación
   ============================================================ */
[hidden] { display: none !important; }
input[type="checkbox"], input[type="radio"] { width: auto; padding: 0; accent-color: var(--brand); }
.content > .alert { margin-bottom: 16px; overflow-wrap: anywhere; }
.logout-form { margin: 0; }
button.btn-logout { border: 0; cursor: pointer; font-size: 1.1rem; }
button.btn-logout:hover { background: rgba(255, 255, 255, 0.18); }
kbd { background: #eef2f0; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 0.8rem; font-family: var(--font); }
details.panel > summary { list-style: none; }
details.panel > summary::-webkit-details-marker { display: none; }
.alert + .alert { margin-top: 10px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; padding-top: 14px; }
tr.clickable { cursor: pointer; }
.tarifas-tabla input[type="text"] { min-width: 96px; padding: 9px 10px; }

/* Anular ticket (acordeón en la fila) */
details.anular { display: inline-block; vertical-align: middle; }
details.anular summary { list-style: none; cursor: pointer; }
details.anular summary::-webkit-details-marker { display: none; }
.anular-form { display: flex; gap: 6px; margin-top: 8px; min-width: 260px; }
.anular-form input { padding: 7px 10px; }

/* Pantalla de operación */
.op-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.op-label { display: block; font-weight: 700; margin-bottom: 8px; color: var(--ink-soft); }
.op-input-row { display: flex; gap: 10px; }
.op-placa {
    flex: 1; min-width: 0; text-transform: uppercase; text-align: center;
    font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 5vw, 3.2rem);
    letter-spacing: 0.18em; padding: 14px 16px; border-radius: 16px; border-width: 2px;
}
.op-go { padding: 0 28px; font-size: 1.05rem; }
.op-help { margin: 8px 0 0; font-size: 0.85rem; }
#opMsg { margin-top: 14px; }
#opResultado { margin-top: 18px; }

.op-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: #fff; display: grid; gap: 16px; animation: rise 0.25s ease both; }
.op-card-nuevo { border-color: rgba(31, 138, 91, 0.35); background: linear-gradient(180deg, #fff, #f3faf6); }
.op-card-dentro { border-color: rgba(232, 163, 23, 0.5); background: linear-gradient(180deg, #fff, #fffaf0); }
.op-card-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.op-plate-tag { font-family: var(--display); font-size: 1.6rem; letter-spacing: 0.12em; }
.op-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.op-facts small { display: block; color: var(--muted); font-weight: 600; font-size: 0.78rem; }
.op-facts strong { font-size: 1rem; }
.op-total { text-align: center; padding: 14px; border-radius: 14px; background: #fff; border: 1px dashed rgba(196, 132, 10, 0.5); }
.op-total small { display: block; color: var(--muted); font-weight: 700; }
.op-total strong { font-family: var(--display); font-size: clamp(2.2rem, 6vw, 3.4rem); color: var(--accent-deep); letter-spacing: -0.02em; }
.op-confirm { width: 100%; padding: 16px; font-size: 1.1rem; }
.op-cash { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.op-cash label { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.op-cash input { width: 150px; text-align: right; font-weight: 700; }
.op-ok { background: #e6f6ee; border-color: rgba(31, 138, 91, 0.4); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.op-ok strong { color: var(--ok); flex: 1 1 100%; }
.op-ok .btn { margin-left: auto; }

.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-btn {
    border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 11px 16px;
    font-weight: 700; cursor: pointer; color: var(--ink-soft); transition: all 0.15s;
}
.seg-btn:hover { border-color: rgba(13, 107, 92, 0.45); }
.seg-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.seg-btn-nuevo {
    border-style: dashed; color: var(--brand); font-weight: 700;
}
.seg-btn-nuevo:hover { background: rgba(13, 107, 92, 0.06); }
.tipo-nuevo {
    margin: 10px 0 4px; padding: 12px; border-radius: 12px;
    border: 1px dashed rgba(13, 107, 92, 0.35); background: rgba(13, 107, 92, 0.04);
}
.tipo-nuevo-fila { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.tipo-nuevo-fila input { flex: 1 1 120px; min-width: 100px; }
.tipo-nuevo-acciones { display: flex; gap: 8px; flex-wrap: wrap; }

.op-side .op-recent { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.op-recent li { display: flex; justify-content: space-between; gap: 8px; padding: 9px 10px; border-radius: 10px; background: rgba(16, 35, 31, 0.03); font-size: 0.9rem; }
.op-recent a:hover strong { text-decoration: underline; }
.op-check { display: flex; gap: 8px; align-items: center; font-weight: 600; color: var(--ink-soft); font-size: 0.9rem; }
.print-frame { position: fixed; right: 0; bottom: 0; width: 1px; height: 1px; border: 0; opacity: 0; pointer-events: none; }

@media (max-width: 1100px) { .op-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
    .op-facts { grid-template-columns: 1fr 1fr; }
    .op-go { padding: 0 16px; }
}

/* ---------- Facturación electrónica ---------- */
.fe-check { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fe-check li { display: flex; gap: 10px; align-items: baseline; font-weight: 600; }
.fe-check .fe-mark { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .8rem; flex: none; }
.fe-check li.ok .fe-mark { background: #e6f6ee; color: var(--ok); }
.fe-check li.falta .fe-mark { background: #fff4e5; color: var(--warn); }
.fe-amb { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fe-amb-op { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; background: #fff; }
.fe-amb-op:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(15, 118, 110, .15); }
.fe-amb-op input { margin-top: 4px; }
.fe-solo-iva { padding: 0; }
@media (max-width: 700px) { .fe-amb { grid-template-columns: 1fr; } }

/* Facturar al cobrar (pantalla de operación) */
.fe-bloque { border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; margin: 12px 0; background: #fafcfb; }
.fe-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 1rem; }
.fe-toggle input { width: 20px; height: 20px; }
.fe-cliente { margin-top: 10px; display: grid; gap: 10px; }
.fe-radios { display: flex; gap: 18px; flex-wrap: wrap; font-weight: 600; }
.fe-radios label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.fe-campos { display: grid; gap: 8px; }
.fe-campos[hidden], .fe-cliente[hidden] { display: none; }
.fe-fila { display: grid; grid-template-columns: minmax(120px, 170px) 1fr; gap: 8px; }
.fe-fila:last-child { grid-template-columns: 1fr 2fr; }
.fe-acciones { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.fe-error-msg { margin: 6px 0 0; white-space: pre-line; }
.op-fallo { display: grid; gap: 8px; }
#feForm .form-grid { align-items: start; }

/* Logos */
.sidebar-brand { padding: 4px 4px 18px; }
.sidebar-logo { display: block; background: #fff; border-radius: 14px; padding: 10px 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.sidebar-logo img { display: block; width: 100%; height: auto; }
.login-logo { display: inline-block; background: #fff; border-radius: 22px; padding: 22px 30px; margin-bottom: 28px; box-shadow: 0 18px 40px rgba(0, 0, 0, .25); }
.login-logo img { display: block; width: min(380px, 70vw); height: auto; }
.dash-empresa { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; padding: 14px 20px; }
.dash-empresa img { max-height: 72px; max-width: 220px; width: auto; height: auto; object-fit: contain; }
.dash-empresa div { display: grid; gap: 2px; }
.dash-empresa strong { font-family: var(--display); font-size: 1.15rem; }
.logo-prev { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.logo-caja { margin-top: 6px; min-width: 220px; min-height: 90px; border: 1px dashed var(--line); border-radius: 12px; background: #fff; display: grid; place-items: center; padding: 12px; }
.logo-caja img { max-width: 260px; max-height: 110px; object-fit: contain; }
.logo-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Logo de la empresa: tamaño fijo, sin deformarse */
.sidebar-logo-empresa { box-sizing: border-box; height: 84px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.sidebar-logo-empresa img { width: auto; height: auto; max-width: 100%; max-height: 64px; object-fit: contain; }
.sidebar-powered { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; margin: 8px 6px 0; background: rgba(255, 255, 255, .95); border-radius: 10px; }
.sidebar-powered span { font-size: .62rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #5b6f69; }
.sidebar-powered img { height: 26px; width: auto; display: block; }
.dash-empresa img { height: 72px; width: 220px; max-width: 40vw; object-fit: contain; object-position: left center; }

/* Token de Taxxa */
.fe-token { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: #fafcfb; display: grid; gap: 12px; }
.fe-token-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.fe-token-vigente, .fe-token-por_renovar { border-left: 4px solid var(--ok); }
.fe-token-vencido { border-left: 4px solid var(--danger); }
.fe-token-sin_token { border-left: 4px solid var(--warn); }
.fe-token-datos { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.fe-token-datos dt { color: var(--muted); font-size: .85rem; font-weight: 700; }
.fe-token-datos dd { margin: 0; font-weight: 600; word-break: break-all; }
.fe-token-datos .mono { font-family: ui-monospace, "Courier New", monospace; font-size: .85rem; background: #eef2f0; padding: 3px 8px; border-radius: 6px; }
.fe-token-pie { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.fe-token-pie small { flex: 1 1 260px; }

/* Nombre largo de usuario: no pisa el botón de salir */
.user-chip > div:not(.user-avatar) { min-width: 0; flex: 1; }
.user-avatar { flex: 0 0 38px; }
.btn-logout, .logout-form { flex: 0 0 auto; }
