.l-auth { min-height: 100vh; display: grid; align-content: center; padding: var(--space-4); }
.l-auth[data-context="store"] { --role-color: var(--color-teal); }
.l-auth[data-context="master"], .l-auth[data-context="submaster"] { --role-color: var(--color-purple); }
.l-auth[data-brand="kochi"] {
  --role-color: #5D3907;
  background: #FBF8F4;
}
.l-auth[data-brand="kochi"] .c-card h1 { font-size: 1.2rem; }
.l-entry { min-height: 100vh; padding: var(--space-4); }
.l-entry[data-context="company"] { --role-color: var(--color-orange); }
.l-entry[data-context="store"] { --role-color: var(--color-teal); }
.l-shell { min-height: 100vh; }
.l-shell[data-role="member"] { --role-color: var(--color-blue); }
.l-shell[data-role="company"] { --role-color: var(--color-orange); }
.l-shell[data-role="store"] { --role-color: var(--color-teal); }
.l-shell[data-role="master"], .l-shell[data-role="submaster"] { --role-color: var(--color-purple); }
.l-shell__header { background: var(--role-color); color: #fff; }
.l-shell__header-inner, .l-shell__main { width: min(100% - 2rem, var(--content-width)); margin-inline: auto; }
.l-shell__header-inner { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; padding-block: var(--space-4); }
.l-shell__header .c-button--secondary { color: var(--color-ink); }
.l-shell__nav { overflow-x: auto; border-bottom: 1px solid var(--color-border); background: #fff; }
.l-shell__nav-list { display: flex; gap: var(--space-2); width: min(100% - 2rem, var(--content-width)); min-width: max-content; margin: 0 auto; padding: var(--space-3) 0; list-style: none; }
.l-shell__nav a { display: block; min-height: 2.75rem; padding: .55rem .9rem; border-radius: var(--radius-sm); color: var(--color-ink); font-weight: 700; text-decoration: none; white-space: nowrap; }
.l-shell__nav a[aria-current="page"] { background: var(--role-color); color: #fff; }
.l-shell__main { padding-block: var(--space-6); }
.l-shell__panel { padding: var(--space-5); border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow-card); }
.l-loading, .l-message { min-height: 100vh; display: grid; place-items: center; padding: var(--space-5); text-align: center; }
.l-admin-screen { min-width: 0; }
.l-admin-screen__heading { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: start; justify-content: space-between; margin-bottom: var(--space-5); }
.l-admin-screen__results { min-width: 0; }
.l-admin-section { margin-top: var(--space-5); padding: var(--space-5); border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow-card); }
.l-admin-section--accent { border-top: .3rem solid var(--role-color); }
.l-admin-section--danger { border: 1px solid #e3b7b3; box-shadow: none; }
.c-check-grid { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-bottom: var(--space-4); border: 0; padding: 0; }
.c-check-grid legend { width: 100%; margin-bottom: var(--space-2); font-weight: 700; }
.c-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-2); margin-top: var(--space-3); }
.c-calendar__day { min-width: 0; min-height: 2.75rem; padding-inline: 0; border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: #fff; }
.c-calendar__day[data-closed="true"] { border-color: var(--color-orange); background: #fff0df; color: #743a00; font-weight: 700; }
.c-subnav { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-5); border-bottom: 1px solid var(--color-border); }
.c-subnav a { padding: var(--space-3); color: var(--color-ink); font-weight: 700; text-decoration: none; }
.c-subnav a[aria-current="page"] { border-bottom: .25rem solid var(--role-color); }
.c-direct-store-tabs button {
  padding: var(--space-3);
  border: 0;
  border-bottom: .25rem solid transparent;
  background: transparent;
  color: var(--color-ink);
  font-weight: 700;
}
.c-direct-store-tabs button[data-current="true"] { border-bottom-color: var(--role-color); }
.c-daily-tabs button {
  padding: var(--space-3);
  border: 0;
  border-bottom: .25rem solid transparent;
  background: transparent;
  color: var(--color-ink);
  font-weight: 700;
}
.c-daily-tabs button[data-current="true"] { border-bottom-color: var(--role-color); }
.l-direct-store-selector { margin-bottom: var(--space-4); }
.c-direct-store-current { color: var(--role-color); font-size: 1.15rem; font-weight: 800; }
.c-direct-store-link { display: inline-flex; align-items: center; text-decoration: none; }
.c-direct-store-selector { margin-bottom: var(--space-4); }
.c-row-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); width: 12rem; max-width: 100%; }
.c-button--compact { min-height: 2.25rem; padding: .35rem .6rem; font-size: .875rem; }
.c-inline-form { min-width: min(26rem, 80vw); }
.c-product-image { display: grid; gap: var(--space-2); min-width: 8rem; }
.c-product-image img { width: 6rem; height: 6rem; border-radius: var(--radius-sm); object-fit: cover; }
.c-product-image input { max-width: 12rem; }
.c-product-card-list { display: grid; gap: var(--space-4); min-width: 0; }
.c-product-card { min-width: 0; overflow: hidden; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: #fff; }
.c-product-card__image { display: grid; width: 100%; aspect-ratio: 4 / 3; place-items: center; overflow: hidden; background: var(--color-canvas); }
.c-product-card__image img { width: 100%; height: 100%; object-fit: cover; }
.c-product-card__image--empty { color: var(--color-muted); font-size: .875rem; }
.c-product-card__upload { position: relative; width: 100%; overflow: hidden; border-radius: 0; }
.c-product-card__upload[data-busy="true"] { opacity: .7; cursor: wait; }
.c-product-card__file { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.c-product-card__upload:focus-within { outline: .2rem solid var(--role-color); outline-offset: -.2rem; }
.c-product-card__content { display: grid; gap: var(--space-2); min-width: 0; padding: var(--space-4); }
.c-product-card__content p { margin: 0; }
.c-product-card__name { margin: 0; font-size: 1.15rem; overflow-wrap: anywhere; }
.c-product-card__price { font-weight: 800; }
.c-product-card__status { color: var(--color-muted); overflow-wrap: anywhere; }
.c-product-card__description { white-space: pre-wrap; overflow-wrap: anywhere; }
.c-product-card__actions { padding: 0 var(--space-4) var(--space-4); }
.c-store-option { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--color-border); }
.c-store-option h3, .c-store-option p { margin-block: 0 var(--space-2); }
.l-member-order { min-width: 0; }
.l-member-order__heading { margin-bottom: var(--space-4); }
.c-calendar-toolbar { display: grid; grid-template-columns: minmax(5.5rem, 1fr) auto minmax(5.5rem, 1fr); gap: var(--space-2); align-items: center; }
.c-calendar-toolbar h2 { margin: 0; text-align: center; }
.c-calendar-toolbar button:last-child { justify-self: stretch; }
.c-month-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-1); min-width: 0; }
.c-month-calendar__weekday { padding-block: var(--space-2); color: var(--color-muted); font-size: .8rem; font-weight: 800; text-align: center; }
.c-member-calendar__day { position: relative; display: grid; align-content: center; min-width: 0; min-height: 4.5rem; padding: var(--space-1);
  border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: #fff; color: var(--color-ink); }
.c-member-calendar__day:not(:disabled):hover { border-color: var(--role-color); }
.c-member-calendar__day[data-ordered="true"] { border-color: var(--role-color); background: #dcecff; }
.c-member-calendar__day:disabled { background: #eef1f3; color: #7b858e; cursor: not-allowed; }
.c-member-calendar__number { font-size: 1rem; font-weight: 800; }
.c-member-calendar__count { color: var(--role-color); font-size: .75rem; font-weight: 800; }
.c-member-calendar__status { font-size: .65rem; }
.c-member-calendar__large { width: .45rem; height: .45rem; margin: var(--space-1) auto 0; overflow: hidden; border-radius: 50%; background: var(--color-orange); color: transparent; }
.c-order-rules { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin-top: var(--space-4); padding: var(--space-4); border-radius: var(--radius-sm); background: #eef2f6; }
.c-order-rules p { margin: 0; }
.l-member-history, .l-member-messages, .l-report-screen, .l-master-messages, .l-company-spec { min-width: 0; }
.c-master-message-layout { display: grid; gap: var(--space-5); margin-top: var(--space-5); }
.c-master-thread-panel,
.c-master-conversation { min-width: 0; padding: var(--space-4); border-radius: var(--radius-md); background: #fff; box-shadow: var(--shadow-card); }
.c-master-thread-panel h2,
.c-master-conversation h2 { margin-top: 0; }
.c-master-thread-list { display: grid; gap: var(--space-2); max-height: 42rem; overflow-y: auto; }
.c-master-thread {
  display: grid;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--color-ink);
  font: inherit;
  text-align: left;
}
.c-master-thread:hover,
.c-master-thread[data-current="true"] { border-color: var(--role-color); }
.c-master-thread[data-unread="true"] { border-left: .35rem solid var(--role-color); background: #f4efff; }
.c-master-thread__heading { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.c-master-thread__kind,
.c-master-thread__unread { padding: .15rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 800; }
.c-master-thread__kind { background: #e8ecf0; }
.c-master-thread__unread { margin-left: auto; background: var(--role-color); color: #fff; }
.c-master-thread__body { overflow: hidden; color: var(--color-ink); text-overflow: ellipsis; white-space: nowrap; }
.c-master-thread time { color: var(--color-muted); font-size: .8rem; }
.l-daily-menu { min-width: 0; }
.c-daily-product-select { margin-bottom: var(--space-5); }
.c-daily-selected-product { color: var(--role-color); font-size: 1.2rem; font-weight: 800; }
.c-daily-panel { min-width: 0; margin-top: 0; }
.c-daily-calendar__day {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 4.5rem;
  padding: var(--space-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--color-ink);
}
.c-daily-calendar__day[data-registered="true"] { border-color: var(--role-color); background: #dff7f3; }
.c-daily-calendar__day span { font-size: 1rem; font-weight: 800; }
.c-daily-calendar__day small { color: var(--color-muted); font-size: .68rem; }
.c-daily-menu-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--space-3); }
.c-daily-menu-fields .c-field { margin-bottom: 0; }
.c-daily-week-select { max-width: 22rem; }
.c-daily-week-list { display: grid; gap: var(--space-4); margin-bottom: var(--space-4); }
.c-daily-week-row { padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.c-daily-week-row h3 { margin-top: 0; }
.c-daily-csv-description { margin-bottom: var(--space-4); padding: var(--space-4); border-radius: var(--radius-sm); background: #eef2f6; }
.c-daily-csv-description li + li { margin-top: var(--space-2); }
.c-announcement-manager { min-width: 0; }
.c-announcement-form { max-width: 42rem; }
.c-announcement-admin-list { display: grid; gap: var(--space-3); }
.c-announcement-admin { padding: var(--space-4); border-left: .3rem solid var(--role-color); border-radius: var(--radius-sm); background: #f5f0ff; }
.c-announcement-admin[data-expired="true"] { border-left-color: var(--color-muted); background: #eef1f3; }
.c-announcement-admin__status { display: inline-block; margin-bottom: var(--space-2); }
.c-announcement-admin__body,
.c-announcement-delete-excerpt { overflow-wrap: anywhere; white-space: pre-wrap; }
.c-announcement-delete-excerpt { max-height: 12rem; overflow-y: auto; padding: var(--space-3); background: #eef1f3; }
.c-company-manager-actions { align-items: flex-start; }
.c-company-manager-action-note { flex-basis: 100%; max-width: 16rem; color: var(--color-muted); }
.c-sfs-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 48rem; }
.c-sfs-note { max-width: 52rem; }
.c-report-summary--delivery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.c-delivery-date { font-size: 1.1rem; font-weight: 800; }
.c-delivery-collections { margin-bottom: var(--space-6); }
.c-delivery-company {
  margin-top: var(--space-5);
  padding: var(--space-5);
  border-top: .3rem solid var(--role-color);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-card);
}
.c-delivery-company h3 { margin-top: 0; font-size: 1.35rem; }
.c-delivery-company h4 { margin-bottom: var(--space-2); }
.c-delivery-company .c-table-wrap + h4 { margin-top: var(--space-5); }
.c-delivery-note { padding: var(--space-3); border-radius: var(--radius-sm); background: #fff4cf; font-weight: 700; }
.c-delivery-details { margin-bottom: var(--space-4); }
.c-delivery-empty { border: 1px solid var(--color-border); border-radius: var(--radius-md); background: #fff; }
@media (max-width: 47.99rem) {
  .c-product-card__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
  .c-product-card__actions .c-button { width: 100%; }
}
@media (max-width: 35rem) {
  .c-detail-list { grid-template-columns: 1fr; }
  .c-detail-list dt { border-bottom: 0; }
  .c-detail-list dd { padding-top: 0; }
  .c-filter-bar .c-button { flex-basis: 100%; width: 100%; }
  .c-calendar-toolbar .c-button { min-height: 2.75rem; padding-inline: var(--space-2); }
  .c-month-calendar { gap: 2px; }
  .c-member-calendar__day { min-height: 4rem; border-radius: .35rem; }
  .c-daily-calendar__day { min-height: 4rem; border-radius: .35rem; }
  .c-daily-calendar__day small { font-size: .6rem; }
  .c-daily-menu-fields { grid-template-columns: 1fr; }
  .c-history-item { grid-template-columns: 1fr; gap: var(--space-1); }
  .c-chat-message { width: 92%; }
  .c-report-summary { grid-template-columns: 1fr; }
  .c-delivery-company { padding: var(--space-3); }
}
@media (min-width: 48rem) {
  .l-auth, .l-entry { padding: var(--space-6); }
  .l-shell__panel { padding: var(--space-6); }
  .c-entry-card__header, .c-entry-form { padding: var(--space-6); }
  .c-entry-card > .c-alert { margin: var(--space-6) var(--space-6) 0; }
  .l-shell__nav-list { min-width: 0; flex-wrap: wrap; }
  .c-master-message-layout { grid-template-columns: minmax(18rem, .85fr) minmax(0, 1.4fr); align-items: start; }
}
.l-sfs-report .c-sfs-note { margin-bottom: var(--space-4); }
.l-company-period .c-period-range,
.l-master-store-proxy .c-store-proxy-notice { margin-bottom: var(--space-4); }
.c-period-payment {
  display: flex;
  gap: var(--space-3);
  align-items: baseline;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  background: #f2f6f9;
}
.c-period-payment span { color: #4a5b66; }
.c-period-payment strong { font-size: 1.125rem; }
.c-period-daily { margin-top: var(--space-5); }
.c-period-employee-select { max-width: 24rem; margin-bottom: var(--space-4); }
.c-store-proxy-select { max-width: 24rem; margin: var(--space-4) 0; }
.c-store-proxy-tabs { margin-bottom: var(--space-4); }

@media print {
  body.u-printing { overflow: visible; }
  .l-shell__header,
  .l-shell__nav,
  .c-filter-bar,
  .c-export-actions,
  .l-kitchen-controls,
  .c-direct-store-tabs,
  .c-toast-region,
  .u-skip-link { display: none !important; }
  .l-shell__main { width: 100%; padding: 0; }
  .c-table-wrap { overflow: visible; border: 0; }
  .c-table { min-width: 0; font-size: 9pt; }
  .c-table th:last-child,
  .c-table td:last-child { position: static; box-shadow: none; }
  .c-production-totals, .c-report-summary p { box-shadow: none; break-inside: avoid; }
  .l-delivery-sheet { color: #000; }
  .l-delivery-sheet h2 { break-after: avoid; page-break-after: avoid; }
  .l-delivery-sheet .c-delivery-collections,
  .l-delivery-sheet .c-delivery-company { break-inside: avoid; }
  .l-delivery-sheet .c-delivery-collections { break-after: page; page-break-after: always; }
  .l-delivery-sheet .c-delivery-company { break-before: page; page-break-before: always; }
  .l-delivery-sheet .c-delivery-company:first-of-type { break-before: auto; page-break-before: auto; }
  .l-delivery-sheet .c-delivery-company {
    margin-top: 8mm;
    padding: 4mm;
    border: 1px solid #777;
    border-top: 2px solid #000;
    box-shadow: none;
  }
  .l-delivery-sheet .c-delivery-note { padding: 2mm; border: 1px solid #999; background: #fff; }
  .l-delivery-sheet .c-detail-list dt,
  .l-delivery-sheet .c-detail-list dd,
  .l-delivery-sheet .c-table th,
  .l-delivery-sheet .c-table td { padding: 1.2mm 1.5mm; overflow-wrap: anywhere; }
  body.u-printing #app,
  body.u-printing .c-toast-region { display: none !important; }
  body.u-printing .c-print-preview { position: static; background: #fff; }
  body.u-printing .c-print-preview__bar { display: none !important; }
  body.u-printing .c-print-preview__scroll { overflow: visible; padding: 0; }
  body.u-printing .c-print-sheet { width: auto; min-width: 0; max-width: none; padding: 0; box-shadow: none; }
}

@page { size: A4; margin: 12mm; }
