:root {
    --green-950: #0a2419;
    --green-900: #103523;
    --green-800: #174a32;
    --green-700: #1f6744;
    --green-500: #64bf46;
    --green-400: #7bd45a;
    --green-100: #e7f5e2;
    --green-50: #f3faef;
    --surface: #ffffff;
    --canvas: #f5f7f4;
    --ink: #17221c;
    --muted: #6f7c74;
    --line: #dde4df;
    --line-dark: #cbd5ce;
    --danger: #b83a3a;
    --danger-bg: #fcecec;
    --shadow: 0 14px 40px rgba(24, 57, 40, .08);
    --radius: 16px;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: "DM Sans", Arial, sans-serif; font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.brand { display: inline-flex; align-items: center; gap: 11px; font-family: Manrope, sans-serif; font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 1px; opacity: .64; font-family: "DM Sans", sans-serif; font-size: 9px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 11px; background: var(--green-400); color: var(--green-950); font-size: 13px; letter-spacing: -.06em; }
.brand-light { color: white; }
.eyebrow { display: inline-block; color: var(--green-700); font-size: 10px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.btn { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; gap: 9px; padding: 0 18px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-weight: 700; transition: .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { border-color: var(--green-900); background: var(--green-900); color: white; box-shadow: 0 7px 18px rgba(16, 53, 35, .16); }
.btn-primary:hover { background: var(--green-800); }
.btn-secondary { border-color: var(--line-dark); background: white; color: var(--green-900); }
.btn-secondary:hover { border-color: var(--green-700); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-wide { width: 100%; }
.btn.disabled, .btn[disabled] { pointer-events: none; opacity: .45; transform: none; }
.btn-excel { border-color: #b8d8aa; background: #edf8e8; color: #216b37; }
.btn-excel svg { width: 18px; height: 18px; }
.btn-danger { border-color: #a93232; background: var(--danger); color: white; box-shadow: 0 7px 18px rgba(184,58,58,.14); }
.btn-danger:hover { background: #9f2f2f; }

/* Authentication */
.auth-body { min-height: 100vh; background: var(--green-950); }
.login-shell, .installer-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(360px, 44%) 1fr; background: white; }
.login-visual, .installer-intro { position: relative; display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 44px clamp(34px, 5vw, 74px); background: linear-gradient(145deg, rgba(10,36,25,.98), rgba(16,53,35,.96)); color: white; }
.login-pattern { position: absolute; inset: 0; opacity: .18; background-image: radial-gradient(circle at 15% 15%, #7bd45a 0 1px, transparent 1px), linear-gradient(120deg, transparent 47%, rgba(255,255,255,.08) 48%, transparent 49%); background-size: 28px 28px, 180px 180px; }
.login-visual::after, .installer-intro::after { position: absolute; right: -150px; bottom: -180px; width: 440px; height: 440px; border: 80px solid rgba(123,212,90,.12); border-radius: 50%; content: ""; }
.login-visual > *, .installer-intro > * { position: relative; z-index: 1; }
.login-message { max-width: 510px; }
.login-message .eyebrow, .installer-intro .eyebrow { color: var(--green-400); }
.login-message h1, .installer-intro h1 { margin: 13px 0 20px; font-family: Manrope, sans-serif; font-size: clamp(40px, 4.7vw, 68px); font-weight: 600; letter-spacing: -.055em; line-height: 1.03; }
.login-message h1 em { color: var(--green-400); font-family: Georgia, serif; font-weight: 400; }
.login-message p, .installer-intro p { max-width: 480px; margin: 0; color: rgba(255,255,255,.72); font-size: 16px; line-height: 1.75; }
.login-footer { display: flex; gap: 27px; color: rgba(255,255,255,.66); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.login-footer span::before { display: inline-block; width: 5px; height: 5px; margin-right: 8px; border-radius: 50%; background: var(--green-400); content: ""; vertical-align: 2px; }
.login-form-wrap, .installer-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px; background: #fbfcfa; }
.login-card { width: min(100%, 420px); }
.login-heading { margin-bottom: 31px; }
.step-chip { display: inline-flex; padding: 6px 10px; border-radius: 99px; background: var(--green-100); color: var(--green-800); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.login-heading h2, .installer-heading h2 { margin: 13px 0 5px; font-family: Manrope, sans-serif; font-size: 34px; letter-spacing: -.035em; }
.login-heading p, .installer-heading p { margin: 0; color: var(--muted); }
.login-card > label { display: block; margin: 18px 0; }
.login-card label > span, .form-stack label > span, .entity-form label > span, .dni-entry > span { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 45px; border: 1px solid var(--line-dark); border-radius: 9px; outline: none; background: white; color: var(--ink); padding: 0 13px; transition: .16s ease; }
input:focus, select:focus, textarea:focus { border-color: var(--green-700); box-shadow: 0 0 0 3px rgba(100,191,70,.13); }
input::placeholder { color: #a3ada6; }
.password-field { position: relative; }
.password-field input { padding-right: 58px; }
.password-toggle { position: absolute; top: 5px; right: 5px; height: 35px; border: 0; border-radius: 7px; background: var(--green-50); color: var(--green-800); cursor: pointer; font-size: 11px; font-weight: 700; }
.login-help { margin: 19px 0 0; color: #8a958e; font-size: 11px; text-align: center; }
.alert { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 0 0 20px; padding: 13px 15px; border: 1px solid; border-radius: 10px; font-size: 13px; }
.alert-success { border-color: #b7dbae; background: #eef8eb; color: #245f32; }
.alert-error { border-color: #edbdbd; background: var(--danger-bg); color: #852e2e; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert-dismissible button { border: 0; background: none; cursor: pointer; font-size: 19px; line-height: 1; }
.installer-shell { grid-template-columns: minmax(340px, 40%) 1fr; }
.installer-intro h1 { font-size: clamp(35px, 4vw, 57px); }
.setup-steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.setup-steps li { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.8); }
.setup-steps b { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; color: var(--green-400); }
.installer-form-wrap { align-items: flex-start; overflow-y: auto; padding-block: 50px; }
.installer-form-wrap > * { width: min(100%, 660px); }
.installer-heading { margin-bottom: 25px; }
.form-stack fieldset { margin: 0 0 22px; padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.form-stack legend { padding: 0 7px; color: var(--green-900); font-weight: 700; }
.form-grid { display: grid; gap: 17px; }
.two-cols { grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.state-card { padding: 40px; border-radius: var(--radius); background: white; box-shadow: var(--shadow); text-align: center; }
.state-icon { display: grid; width: 60px; height: 60px; margin: 0 auto 18px; place-items: center; border-radius: 50%; background: var(--green-100); color: var(--green-800); font-size: 26px; }

/* Application shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; display: flex; width: 250px; flex-direction: column; padding: 25px 17px 18px; background: var(--green-950); color: white; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; padding: 0 7px 25px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-close { display: none; border: 0; background: none; color: white; cursor: pointer; font-size: 28px; }
.main-nav { display: flex; flex: 1; flex-direction: column; gap: 5px; padding: 27px 0 18px; }
.nav-caption { padding: 0 13px 8px; color: rgba(255,255,255,.35); font-size: 9px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.nav-caption-spaced { margin-top: 19px; }
.nav-link { position: relative; display: flex; min-height: 46px; align-items: center; gap: 13px; padding: 0 13px; border-radius: 9px; color: rgba(255,255,255,.66); font-size: 13px; font-weight: 600; transition: .15s ease; }
.nav-link svg { width: 19px; height: 19px; }
.nav-link:hover { background: rgba(255,255,255,.055); color: white; }
.nav-link.active { background: rgba(123,212,90,.12); color: var(--green-400); }
.nav-link.active::before { position: absolute; left: -17px; width: 3px; height: 24px; border-radius: 0 4px 4px 0; background: var(--green-400); content: ""; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 16px 8px 0; border-top: 1px solid rgba(255,255,255,.08); }
.avatar { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: var(--green-400); color: var(--green-950); font-size: 11px; font-weight: 800; }
.sidebar-user-copy { min-width: 0; flex: 1; }
.sidebar-user-copy strong, .sidebar-user-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-copy strong { font-size: 11px; }
.sidebar-user-copy small { color: rgba(255,255,255,.4); font-size: 9px; }
.logout-link { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 7px; color: rgba(255,255,255,.45); }
.logout-link:hover { background: rgba(255,255,255,.08); color: white; }
.sidebar-overlay { display: none; }
.app-main { width: calc(100% - 250px); min-height: 100vh; margin-left: 250px; }
.topbar { position: sticky; z-index: 30; top: 0; display: flex; height: 72px; align-items: center; justify-content: space-between; padding: 0 clamp(22px, 3.5vw, 52px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(13px); }
.menu-trigger { display: none; width: 38px; height: 38px; align-items: center; justify-content: center; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.menu-trigger span { width: 17px; height: 2px; background: var(--green-900); }
.topbar-title span, .topbar-title strong { display: block; }
.topbar-title span { color: var(--muted); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.topbar-title strong { margin-top: 1px; font-family: Manrope, sans-serif; font-size: 16px; }
.topbar-actions { display: flex; align-items: center; gap: 13px; }
.today-pill { padding-right: 16px; border-right: 1px solid var(--line); text-align: right; }
.today-pill span, .today-pill strong { display: block; }
.today-pill span { color: var(--muted); font-size: 9px; }
.today-pill strong { font-size: 11px; }
.quick-action { display: inline-flex; height: 38px; align-items: center; gap: 8px; padding: 0 13px; border-radius: 8px; background: var(--green-900); color: white; font-size: 11px; font-weight: 700; }
.quick-action span { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; background: var(--green-400); color: var(--green-950); }
.content { width: min(100%, 1500px); min-height: calc(100vh - 108px); margin: 0 auto; padding: 36px clamp(22px, 3.5vw, 52px) 48px; }
.app-footer { display: flex; min-height: 36px; align-items: center; justify-content: space-between; padding: 0 clamp(22px, 3.5vw, 52px); border-top: 1px solid var(--line); color: #8e9891; font-size: 9px; }
.page-heading { margin-bottom: 27px; }
.page-heading h1 { margin: 5px 0 6px; font-family: Manrope, sans-serif; font-size: clamp(29px, 3vw, 40px); letter-spacing: -.045em; line-height: 1.12; }
.page-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.heading-with-action { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; }
.back-link { display: block; margin-bottom: 21px; color: var(--green-700); font-size: 12px; font-weight: 700; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 7px 30px rgba(24,57,40,.045); }
.panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 23px 25px 19px; border-bottom: 1px solid var(--line); }
.panel-heading h2, .section-title-row h2 { margin: 3px 0 0; font-family: Manrope, sans-serif; font-size: 19px; letter-spacing: -.03em; }
.panel-heading .text-link, .section-title-row > a { color: var(--green-700); font-size: 11px; font-weight: 700; }

/* Dashboard */
.summary-grid { display: grid; grid-template-columns: 1.16fr 1fr 1fr; gap: 15px; margin-bottom: 28px; }
.summary-card { position: relative; display: flex; min-height: 128px; align-items: center; gap: 17px; overflow: hidden; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.summary-card-primary { border-color: var(--green-900); background: var(--green-900); color: white; }
.summary-card-primary::after { position: absolute; right: -30px; bottom: -50px; width: 140px; height: 140px; border: 28px solid rgba(123,212,90,.1); border-radius: 50%; content: ""; }
.summary-icon { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border-radius: 13px; background: var(--green-400); color: var(--green-950); }
.summary-icon svg { width: 23px; height: 23px; }
.icon-soft { background: var(--green-100); color: var(--green-800); }
.icon-warm { background: #f8edd8; color: #99631c; }
.summary-card div:nth-child(2) > * { display: block; }
.summary-card div:nth-child(2) > span { color: var(--muted); font-size: 11px; }
.summary-card-primary div:nth-child(2) > span, .summary-card-primary small { color: rgba(255,255,255,.62) !important; }
.summary-card strong { margin: 2px 0 0; font-family: Manrope, sans-serif; font-size: 30px; letter-spacing: -.04em; line-height: 1.1; }
.summary-card small { color: #929c95; font-size: 9px; }
.summary-trend { position: absolute; top: 13px; right: 13px; padding: 5px 8px; border-radius: 99px; background: rgba(123,212,90,.14); color: var(--green-400); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.meal-overview { margin-bottom: 28px; }
.section-title-row { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 13px; }
.meal-stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.meal-stat { padding: 17px 18px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.meal-stat-top { display: flex; align-items: center; gap: 8px; }
.meal-stat-top strong { font-size: 12px; }
.meal-stat-top b { margin-left: auto; font-family: Manrope, sans-serif; font-size: 18px; }
.meal-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #d2d8d4; }
.meal-desayuno .meal-dot, .meal-dot.meal-desayuno, .breakfast-dot { background: #edb843; }
.meal-almuerzo .meal-dot, .meal-dot.meal-almuerzo, .lunch-dot { background: var(--green-500); }
.meal-cena .meal-dot, .meal-dot.meal-cena, .dinner-dot { background: #5a78c4; }
.progress { height: 4px; margin: 13px 0 7px; overflow: hidden; border-radius: 99px; background: #edf0ed; }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--green-500); }
.meal-desayuno .progress i { background: #edb843; }
.meal-cena .progress i { background: #5a78c4; }
.meal-stat small { color: #8d9790; font-size: 9px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 14px 17px; border-bottom: 1px solid #e8ece9; text-align: left; }
th { background: #fafbf9; color: #7d8981; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
td { color: #4c5951; font-size: 11px; }
td strong { color: var(--ink); }
tbody tr:hover { background: #fbfcfa; }
tbody tr:last-child td { border-bottom: 0; }
.mono { font-family: "Courier New", monospace; letter-spacing: .04em; }
.align-right { text-align: right; }
.number-cell { text-align: right; }
.meal-badge, .status { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 99px; font-size: 9px; font-weight: 700; }
.meal-badge::before, .status::before { width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: currentColor; content: ""; }
.meal-badge.meal-desayuno { background: #fff5db; color: #966311; }
.meal-badge.meal-almuerzo { background: var(--green-100); color: #347a33; }
.meal-badge.meal-cena { background: #edf1fb; color: #4764a9; }
.status-success { background: #eaf6e7; color: #367d35; }
.status-muted { background: #f0f2f0; color: #77817a; }
.empty-state { padding: 48px 20px; text-align: center; }
.empty-state > span { display: grid; width: 46px; height: 46px; margin: 0 auto 12px; place-items: center; border-radius: 50%; background: var(--green-50); color: var(--green-700); font-size: 20px; }
.empty-state h3 { margin: 0 0 5px; font-family: Manrope, sans-serif; }
.empty-state p { margin: 0 0 17px; color: var(--muted); }

/* Filters and forms */
.filter-bar { display: flex; align-items: flex-end; gap: 11px; padding: 19px 21px; border-bottom: 1px solid var(--line); }
.search-field { position: relative; min-width: 240px; flex: 1; }
.search-field svg { position: absolute; top: 13px; left: 12px; width: 18px; height: 18px; color: #8d9891; }
.search-field input { padding-left: 39px; }
.select-field, .date-field { display: block; min-width: 135px; }
.select-field > span, .date-field > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.select-field select, .date-field input { min-height: 43px; }
.clear-filter { height: 43px; padding: 13px 4px; color: var(--green-700); font-size: 11px; font-weight: 700; }
.table-meta { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.table-meta strong { color: var(--ink); }
.person-cell { display: flex; align-items: center; gap: 10px; }
.person-cell span:last-child > * { display: block; }
.person-cell small { color: #9ba49e; font-size: 8px; }
.avatar-soft { width: 32px; height: 32px; border-radius: 9px; background: var(--green-100); color: var(--green-800); font-size: 9px; }
.table-action { border: 0; background: transparent; color: var(--green-700); cursor: pointer; font-size: 10px; font-weight: 700; }
.danger-link { color: var(--danger); }
.row-actions { display: inline-flex; align-items: center; gap: 12px; }
.row-actions form { margin: 0; }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-top: 1px solid var(--line); font-size: 10px; }
.pagination a { color: var(--green-700); font-weight: 700; }
.pagination a.disabled { pointer-events: none; color: #aab2ad; }
.form-panel { max-width: 840px; }
.entity-form { padding: 26px; }
.form-section-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 19px; }
.form-section-heading:not(:first-of-type) { margin-top: 31px; padding-top: 26px; border-top: 1px solid var(--line); }
.form-section-heading > span { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: var(--green-100); color: var(--green-800); font-size: 9px; font-weight: 800; }
.form-section-heading h2 { margin: 0; font-family: Manrope, sans-serif; font-size: 17px; }
.form-section-heading p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.entity-form label > span b { color: var(--danger); }
.entity-form label small { display: block; margin-top: 5px; color: #919b94; font-size: 9px; }
.toggle-card { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.toggle-card input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-card i { position: relative; width: 40px; height: 23px; flex: 0 0 auto; border-radius: 99px; background: #cdd4cf; transition: .2s; }
.toggle-card i::after { position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.18); content: ""; transition: .2s; }
.toggle-card input:checked + i { background: var(--green-500); }
.toggle-card input:checked + i::after { transform: translateX(17px); }
.toggle-card span > * { display: block; }
.toggle-card small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }

/* Consumption registration */
.register-heading { text-align: center; }
.registration-layout { display: grid; max-width: 1030px; margin: 0 auto; grid-template-columns: minmax(0, 1fr) 290px; gap: 19px; align-items: start; }
.registration-card { padding: 27px; }
.registration-step { display: flex; align-items: flex-start; gap: 12px; }
.registration-step > span { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 50%; background: var(--green-900); color: white; font-size: 10px; font-weight: 800; }
.registration-step h2 { margin: 0; font-family: Manrope, sans-serif; font-size: 17px; }
.registration-step p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.dni-entry { display: block; margin: 20px 0 13px; }
.dni-entry > div { position: relative; }
.dni-entry input { height: 62px; padding: 0 62px 0 18px; border-width: 2px; font-family: Manrope, sans-serif; font-size: 27px; font-weight: 700; letter-spacing: .2em; }
.dni-counter { position: absolute; top: 23px; right: 15px; color: var(--muted); font-size: 10px; }
.employee-preview { min-height: 87px; border: 1px dashed var(--line-dark); border-radius: 11px; background: #fafbf9; }
.preview-placeholder, .employee-found, .employee-missing { display: flex; min-height: 85px; align-items: center; gap: 13px; padding: 14px 17px; }
.preview-placeholder > span, .employee-found > span, .employee-missing > span { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 10px; background: var(--green-100); color: var(--green-800); font-size: 17px; }
.preview-placeholder p { margin: 0; color: #8a958e; font-size: 11px; }
.employee-found h3, .employee-missing h3 { margin: 0; font-family: Manrope, sans-serif; font-size: 14px; }
.employee-found p, .employee-missing p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.employee-missing > span { background: var(--danger-bg); color: var(--danger); }
.second-step { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.meal-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin: 18px 0; }
.meal-option { position: relative; display: flex; min-height: 118px; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--line-dark); border-radius: 12px; background: white; cursor: pointer; transition: .16s; }
.meal-option input { position: absolute; opacity: 0; pointer-events: none; }
.meal-option > i { display: grid; width: 34px; height: 34px; margin-bottom: 6px; place-items: center; border-radius: 50%; background: #f5f6f4; color: var(--green-800); font-style: normal; font-size: 18px; }
.meal-option strong { font-size: 12px; }
.meal-option small { color: var(--muted); font-size: 8px; }
.meal-option-check { position: absolute; top: 8px; right: 8px; display: none; width: 18px; height: 18px; place-items: center; border-radius: 50%; background: var(--green-500); color: white; font-size: 9px; }
.meal-option:has(input:checked) { border-color: var(--green-500); background: var(--green-50); box-shadow: 0 0 0 2px rgba(100,191,70,.09); }
.meal-option:has(input:checked) .meal-option-check { display: grid; }
.meal-option-desayuno:has(input:checked) { border-color: #e0aa35; background: #fffaf0; }
.meal-option-cena:has(input:checked) { border-color: #6681c7; background: #f4f6fc; }
.btn-register { min-height: 49px; }
.registration-aside { display: grid; gap: 14px; }
.today-card { overflow: hidden; }
.compact-heading { align-items: center; padding: 18px; }
.live-dot { padding: 5px 8px; border-radius: 99px; background: var(--green-100); color: var(--green-700); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.live-dot::before { display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: var(--green-500); content: ""; }
.today-meals { display: grid; gap: 3px; padding: 12px 18px; }
.today-meals > div { display: flex; align-items: center; gap: 9px; min-height: 35px; }
.today-meals strong { font-size: 10px; }
.today-meals b { margin-left: auto; font-family: Manrope, sans-serif; font-size: 16px; }
.today-total { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--green-900); color: white; }
.today-total span { font-size: 10px; }
.today-total strong { font-family: Manrope, sans-serif; font-size: 23px; }
.helper-card { display: flex; align-items: flex-start; gap: 12px; padding: 17px; border: 1px solid #d8e7d3; border-radius: 13px; background: var(--green-50); }
.helper-icon { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--green-500); color: white; font-family: Georgia, serif; font-weight: 700; }
.helper-card h3 { margin: 1px 0 3px; font-size: 11px; }
.helper-card p { margin: 0; color: var(--muted); font-size: 9px; }
.registration-result { display: flex; align-items: center; gap: 14px; margin: 21px 0 0; padding: 17px; border: 1px solid; border-radius: 12px; }
.success-result { border-color: #a9d89c; background: var(--green-50); }
.error-result { border-color: #e9b6b6; background: var(--danger-bg); }
.result-check { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--green-500); color: white; font-size: 20px; }
.error-result .result-check { background: var(--danger); }
.registration-result small, .registration-result h3, .registration-result p { display: block; margin: 0; }
.registration-result small { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.registration-result h3 { margin: 2px 0; font-family: Manrope, sans-serif; font-size: 15px; }
.registration-result p { color: var(--muted); font-size: 10px; }
.registration-result button { margin-left: auto; border: 0; background: transparent; color: var(--green-700); cursor: pointer; font-size: 10px; font-weight: 700; }

/* WhatsApp bulk registration */
.bulk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 18px; align-items: start; }
.bulk-entry-panel { overflow: hidden; }
.bulk-alert { margin: 20px 24px 0; }
.bulk-form { padding: 23px 25px 25px; }
.bulk-options { display: grid; grid-template-columns: minmax(190px, .55fr) 1fr; gap: 13px; margin-bottom: 18px; }
.whatsapp-paste-field { display: block; }
.whatsapp-paste-field > span { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 700; }
.whatsapp-paste-field textarea { min-height: 270px; resize: vertical; padding: 16px; font-family: "Courier New", monospace; font-size: 13px; line-height: 1.65; }
.whatsapp-paste-field small { display: block; margin-top: 7px; color: var(--muted); font-size: 9px; }
.bulk-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.bulk-form-footer > span { color: var(--muted); font-size: 10px; font-weight: 700; }
.bulk-aside { display: grid; gap: 13px; }
.bulk-example-card { padding: 18px; }
.bulk-example-card pre { overflow: hidden; margin: 12px 0; padding: 13px; border-radius: 9px; background: var(--green-950); color: #dff5d6; font-family: "Courier New", monospace; font-size: 9px; line-height: 1.7; white-space: pre-wrap; }
.bulk-example-card p { margin: 0; color: var(--muted); font-size: 9px; }
.bulk-warning-card { border-color: #ead29c; background: #fffaf0; }
.bulk-warning-card .helper-icon { background: #e0aa35; }
.bulk-preview-panel { margin-top: 18px; overflow: hidden; }
.bulk-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: #fafbf9; }
.bulk-summary-grid article { min-height: 85px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.bulk-summary-grid span, .bulk-summary-grid strong, .bulk-summary-grid small { display: block; }
.bulk-summary-grid span { color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.bulk-summary-grid strong { margin: 4px 0 2px; font-family: Manrope, sans-serif; font-size: 20px; }
.bulk-summary-grid small { color: #929c95; font-size: 8px; }
.bulk-summary-ready { border-color: #b7dbae !important; background: var(--green-50) !important; }
.bulk-preview-table table { min-width: 820px; }
.bulk-status-ready { background: #eaf6e7; color: #367d35; }
.bulk-status-existing { background: #fff5db; color: #966311; }
.bulk-status-inactive { background: #f0f2f0; color: #77817a; }
.bulk-status-not_found { background: var(--danger-bg); color: var(--danger); }
.bulk-confirm-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; border-top: 1px solid var(--line); background: #fbfcfa; }
.bulk-confirm-bar strong, .bulk-confirm-bar small { display: block; }
.bulk-confirm-bar strong { font-size: 12px; }
.bulk-confirm-bar small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.bulk-confirm-bar form { margin: 0; }

/* Automatic meal assignment */
.meal-config-panel { max-width: 1080px; }
.meal-config-table input { min-width: 125px; }
.meal-config-table input[type="time"] { min-width: 132px; }
.schedule-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; padding: 13px 15px; border: 1px solid #d8e7d3; border-radius: 10px; background: var(--green-50); color: var(--muted); font-size: 10px; }
.schedule-note span { display: grid; width: 20px; height: 20px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--green-500); color: white; font-family: Georgia, serif; font-weight: 700; }
.schedule-note p { margin: 1px 0 0; }
.automatic-meal { display: flex; min-height: 94px; align-items: center; gap: 14px; margin: 18px 0; padding: 17px; border: 1px solid #b9dcae; border-radius: 13px; background: var(--green-50); }
.automatic-meal-icon { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 12px; background: var(--green-500); color: white; font-size: 20px; }
.automatic-meal div { min-width: 0; flex: 1; }
.automatic-meal small, .automatic-meal strong, .automatic-meal p { display: block; margin: 0; }
.automatic-meal small { color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.automatic-meal strong { margin: 2px 0; font-family: Manrope, sans-serif; font-size: 17px; }
.automatic-meal p { color: var(--muted); font-size: 9px; }
.automatic-meal > b { font-family: Manrope, sans-serif; font-size: 20px; }
.meal-automatic-desayuno { border-color: #ead29c; background: #fffaf0; }
.meal-automatic-desayuno .automatic-meal-icon { background: #e0aa35; }
.meal-automatic-cena { border-color: #c7d0e8; background: #f4f6fc; }
.meal-automatic-cena .automatic-meal-icon { background: #5a78c4; }
.unavailable-meal { border-color: #edbdbd; background: var(--danger-bg); }
.unavailable-meal .automatic-meal-icon { background: var(--danger); }

/* Excel imports */
.import-format-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-bottom: 16px; }
.import-format-grid article { display: flex; min-height: 105px; align-items: flex-start; gap: 13px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.import-format-grid article > span { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: var(--green-100); color: var(--green-800); font-size: 10px; font-weight: 800; }
.import-format-grid h2 { margin: 0 0 4px; font-family: Manrope, sans-serif; font-size: 14px; }
.import-format-grid p { margin: 0; color: var(--muted); font-size: 10px; }
.import-panel { margin-bottom: 16px; }
.import-form { padding: 23px 25px 25px; }
.import-dropzone { display: flex; min-height: 116px; align-items: center; justify-content: center; gap: 15px; padding: 20px; border: 1px dashed #abc3b2; border-radius: 13px; background: #f9fcf8; cursor: pointer; text-align: left; transition: .16s ease; }
.import-dropzone:hover { border-color: var(--green-500); background: var(--green-50); }
.import-dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.import-dropzone > span { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border-radius: 12px; background: var(--green-100); color: var(--green-800); font-size: 23px; }
.import-dropzone strong, .import-dropzone p { display: block; margin: 0; }
.import-dropzone strong { font-family: Manrope, sans-serif; font-size: 14px; }
.import-dropzone p { margin-top: 3px; color: var(--muted); font-size: 10px; }
.import-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 16px; }
.import-actions strong, .import-actions small { display: block; }
.import-actions strong { overflow: hidden; max-width: 650px; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.import-actions small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.import-progress { margin: 0 25px 25px; padding: 18px; border: 1px solid #d8e7d3; border-radius: 12px; background: var(--green-50); }
.import-progress-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; }
.import-progress-heading small, .import-progress-heading strong { display: block; }
.import-progress-heading small { color: var(--green-700); font-size: 8px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.import-progress-heading strong { margin-top: 2px; font-family: Manrope, sans-serif; font-size: 14px; }
.import-progress-heading b { font-family: Manrope, sans-serif; font-size: 21px; }
.import-progress-bar { height: 7px; margin-top: 13px; overflow: hidden; border-radius: 99px; background: #dbe9d6; }
.import-progress-bar i { display: block; height: 100%; border-radius: inherit; background: var(--green-500); transition: width .2s ease; }
.import-progress p { margin: 9px 0 0; color: var(--muted); font-size: 9px; }
.import-panel > .alert { margin: 0 25px 25px; }
.import-history-panel { margin-bottom: 16px; }
.import-history-panel table { min-width: 1040px; }
.cell-note { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; white-space: normal; }
.error-note { max-width: 190px; color: var(--danger); }
.import-status-uploading, .import-status-ready, .import-status-processing { background: #eef3fb; color: #4969a6; }
.import-status-completed { background: #eaf6e7; color: #367d35; }
.import-status-failed, .import-status-cancelled { background: var(--danger-bg); color: var(--danger); }
.import-helper { margin-bottom: 10px; }

/* Reports */
.history-filters { flex-wrap: wrap; }
.history-delete-form { margin: 0; }
.history-delete-toolbar { display: flex; min-height: 62px; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: #fffafa; }
.history-delete-toolbar strong, .history-delete-toolbar small { display: block; }
.history-delete-toolbar strong { color: var(--ink); font-size: 11px; }
.history-delete-toolbar small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.history-delete-toolbar .btn { min-height: 36px; padding-inline: 14px; font-size: 10px; }
.history-table { min-width: 1180px; }
.history-select-col { width: 42px; padding-right: 8px; padding-left: 14px; text-align: center; }
.history-checkbox { width: 16px; min-height: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--green-700); cursor: pointer; vertical-align: middle; }
.history-table .danger-link { padding: 6px 8px; border-radius: 7px; }
.history-table .danger-link:hover { background: var(--danger-bg); }
.report-filter-panel { margin-bottom: 16px; }
.report-filter { display: flex; align-items: flex-end; gap: 12px; padding: 18px 21px; }
.report-filter > div:first-child { margin-right: auto; }
.report-filter h2 { margin: 2px 0 0; font-family: Manrope, sans-serif; font-size: 17px; }
.date-separator { padding-bottom: 13px; color: #a0aaa3; }
.report-summary-grid { display: grid; grid-template-columns: 1.25fr repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.report-summary-grid article { position: relative; min-height: 113px; padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.report-summary-grid span, .report-summary-grid strong, .report-summary-grid small { display: block; }
.report-summary-grid span { color: var(--muted); font-size: 9px; font-weight: 600; }
.report-summary-grid strong { margin-top: 5px; font-family: Manrope, sans-serif; font-size: 27px; letter-spacing: -.04em; }
.report-summary-grid small { color: #929c95; font-size: 8px; }
.report-dot { position: absolute; top: 18px; right: 18px; width: 8px; height: 8px; border-radius: 50%; }
.range-chip { padding: 6px 9px; border-radius: 99px; background: var(--green-50); color: var(--green-800); font-size: 9px; font-weight: 700; }
.report-table .total-cell { background: #f3faef; color: var(--green-900); }
.report-table tfoot td { border-top: 2px solid var(--green-900); border-bottom: 0; background: #eef6ea; color: var(--green-900); font-weight: 800; }

@media (max-width: 1120px) {
    .summary-grid { grid-template-columns: 1fr 1fr; }
    .summary-card-primary { grid-column: 1 / -1; }
    .report-summary-grid { grid-template-columns: repeat(3, 1fr); }
    .registration-layout { grid-template-columns: minmax(0, 1fr) 255px; }
    .bulk-layout { grid-template-columns: minmax(0, 1fr) 235px; }
    .bulk-summary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 850px) {
    .login-shell, .installer-shell { grid-template-columns: 1fr; }
    .login-visual, .installer-intro { min-height: 330px; padding: 28px; }
    .login-message h1, .installer-intro h1 { margin-block: 8px 11px; font-size: 38px; }
    .login-footer, .setup-steps { display: none; }
    .login-form-wrap, .installer-form-wrap { min-height: calc(100vh - 330px); padding: 40px 24px; }
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
    .sidebar.open { transform: translateX(0); }
    .sidebar.open + .sidebar-overlay { display: block; position: fixed; z-index: 45; inset: 0; background: rgba(8,22,15,.5); }
    .sidebar-close { display: block; }
    .app-main { width: 100%; margin-left: 0; }
    .menu-trigger { display: flex; }
    .topbar-title { margin-right: auto; margin-left: 12px; }
    .registration-layout { grid-template-columns: 1fr; }
    .registration-aside { grid-template-columns: 1fr 1fr; }
    .bulk-layout { grid-template-columns: 1fr; }
    .bulk-aside { grid-template-columns: repeat(3, 1fr); }
    .report-filter { flex-wrap: wrap; }
    .report-filter > div:first-child { width: 100%; margin: 0 0 5px; }
    .report-summary-grid { grid-template-columns: repeat(2, 1fr); }
    .import-format-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .topbar { height: 64px; padding-inline: 15px; }
    .topbar-title span, .today-pill, .quick-action { display: none; }
    .content { padding: 26px 15px 40px; }
    .app-footer { display: none; }
    .heading-with-action { align-items: stretch; flex-direction: column; }
    .heading-with-action .btn { width: 100%; }
    .summary-grid, .meal-stat-grid, .report-summary-grid, .registration-aside { grid-template-columns: 1fr; }
    .summary-card-primary { grid-column: auto; }
    .filter-bar { align-items: stretch; flex-direction: column; }
    .search-field, .select-field, .date-field { min-width: 0; width: 100%; }
    .history-filters { display: grid; grid-template-columns: 1fr 1fr; }
    .history-filters .search-field { grid-column: 1 / -1; }
    .history-filters .btn { grid-column: 1 / -1; }
    .two-cols { grid-template-columns: 1fr; }
    .form-grid .full { grid-column: auto; }
    .entity-form, .registration-card { padding: 19px; }
    .meal-selector { grid-template-columns: 1fr; }
    .meal-option { min-height: 76px; align-items: center; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 17px; }
    .meal-option > i { margin: 0; }
    .meal-option small { margin-left: auto; }
    .report-filter { align-items: stretch; flex-direction: column; }
    .date-separator { display: none; }
    .login-visual, .installer-intro { min-height: 280px; }
    .login-form-wrap, .installer-form-wrap { min-height: calc(100vh - 280px); }
    .login-message p, .installer-intro p { font-size: 13px; }
    .panel-heading { align-items: flex-start; flex-direction: column; }
    .table-meta { gap: 10px; }
    .automatic-meal { align-items: flex-start; }
    .automatic-meal > b { font-size: 15px; }
    .import-form { padding: 18px; }
    .import-dropzone { align-items: flex-start; justify-content: flex-start; }
    .import-actions { align-items: stretch; flex-direction: column; }
    .import-actions .btn { width: 100%; }
    .import-progress, .import-panel > .alert { margin-right: 18px; margin-left: 18px; }
    .bulk-form { padding: 18px; }
    .bulk-alert { margin: 18px 18px 0; }
    .bulk-options, .bulk-summary-grid, .bulk-aside { grid-template-columns: 1fr; }
    .bulk-form-footer, .bulk-confirm-bar { align-items: stretch; flex-direction: column; }
    .bulk-form-footer .btn, .bulk-confirm-bar .btn { width: 100%; }
    .history-delete-toolbar { align-items: stretch; flex-direction: column; }
    .history-delete-toolbar .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
