/* Focused management-page layouts. The selectors are intentionally scoped so the
   established Autana shell and navigation remain untouched. */

.au-hours-manager {
    display: grid;
    grid-template-areas:
        "tabs tabs"
        "heading heading"
        "summary summary"
        "week bulk"
        "week policy"
        "save save";
    grid-template-columns: minmax(0, 2fr) minmax(300px, .9fr);
    gap: 16px;
    padding: 0;
    overflow: hidden;
}

.au-hours-tabs {
    grid-area: tabs;
    display: flex;
    gap: 8px;
    padding: 0 20px;
    border-bottom: 1px solid var(--line);
}

.au-hours-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 12px;
    color: var(--muted);
    font-weight: 800;
    text-decoration: none;
    border-bottom: 3px solid transparent;
}

.au-hours-tabs a.is-active { color: var(--primary-dark); border-color: var(--primary); }
.au-hours-tabs strong { min-width: 24px; padding: 3px 7px; border-radius: 999px; background: #e8f1f5; text-align: center; }
.au-hours-heading { grid-area: heading; padding: 0 20px; }
.au-hours-location { padding: 7px 12px; border-radius: 999px; background: #dcf8ed; color: #08764b; font-size: .78rem; font-weight: 850; }

.au-hours-summary {
    grid-area: summary;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 0 20px;
}

.au-hours-summary article,
.au-delivery-summary article,
.au-customers-metrics article {
    position: relative;
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 15px 17px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(14, 42, 67, .04);
}

.au-hours-summary span,
.au-delivery-summary span,
.au-customers-metrics span { color: var(--muted); font-size: .78rem; font-weight: 700; }
.au-hours-summary strong,
.au-delivery-summary strong,
.au-customers-metrics strong { color: var(--ink); font-size: 1.05rem; }
.au-hours-summary a { position: absolute; top: 16px; right: 16px; color: var(--primary-dark); font-size: .78rem; font-weight: 850; }
.autana-backoffice[data-section="business-commerce-hours"] > .AppShell .au-hours-tabs { padding-inline: 0; margin-bottom: 14px; }
.autana-backoffice[data-section="business-commerce-hours"] > .AppShell .au-hours-summary { padding: 0; margin-bottom: 16px; }
.au-hours-desktop-manager { gap: 14px; }
.au-hours-desktop-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.au-hours-desktop-layout > aside { display: grid; gap: 12px; position: sticky; top: 16px; }
.au-hours-desktop-layout > aside > .au-v2-callout { box-sizing: border-box; display: grid; width: 320px; max-width: 100%; }
.au-hours-desktop-layout > aside > .au-v2-callout strong { white-space: normal; }
.au-hours-desktop-layout .au-v2-hours-copy { box-sizing: border-box; width: 320px; min-width: 0; max-width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.au-hours-desktop-layout .au-v2-hours-copy > div,
.au-hours-desktop-layout .au-v2-hours-copy fieldset,
.au-hours-desktop-layout .au-v2-hours-copy > label:nth-last-of-type(1),
.au-hours-desktop-layout .au-v2-hours-copy button { grid-column: 1 / -1; }
.au-hours-desktop-layout .au-v2-hours-copy fieldset { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.au-hours-desktop-layout .au-v2-hours-copy fieldset label { min-width: 0; padding: 5px 7px; }
.au-hours-desktop-layout .au-v2-hours-copy > label,
.au-hours-desktop-layout .au-v2-hours-copy input { min-width: 0; max-width: 100%; }
.au-hours-week-table { display: grid; grid-template-columns: 1fr; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.au-hours-week-table article { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: center; padding: 11px 14px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.au-hours-week-table article:last-child { border-bottom: 0; }
.au-hours-week-table article header { display: grid; gap: 6px; }
.au-hours-week-table article header label { color: var(--muted); font-size: .75rem; }
.au-hours-week-table article > div { display: grid; grid-template-columns: repeat(4, minmax(88px, 1fr)); gap: 8px; }
.au-hours-week-table article > div label { color: var(--muted); font-size: .7rem; }
.au-hours-week-table article input[type="time"] { width: 100%; min-width: 0; min-height: 38px; margin-top: 4px; padding: 7px 8px; }
.au-hours-week-table article > div,
.au-hours-week-table article > div label { min-width: 0; }

.au-hours-week { grid-area: week; margin: 0 0 0 20px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.au-hours-week > header { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.au-hours-week h3 { margin: 0; font-size: 1.08rem; }
.au-hours-week p { margin: 3px 0 0; color: var(--muted); font-size: .82rem; }
.au-hours-manager .commerce-week-grid { grid-template-columns: 1fr; gap: 0; }
.au-hours-manager .commerce-day-hours { grid-template-columns: 145px minmax(0, 1fr); align-items: center; gap: 12px; padding: 11px 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: #fff; }
.au-hours-manager .commerce-day-hours:last-child { border-bottom: 0; }
.au-hours-manager .commerce-day-hours > div:first-child { display: grid; grid-template-columns: 1fr; align-content: center; gap: 6px; }
.au-hours-manager .commerce-day-hours .check-help { width: max-content; padding: 0; border: 0; background: transparent; color: var(--muted); }
.au-hours-manager .commerce-day-hours .check-help input { appearance: none; width: 34px; height: 20px; margin: 0; border: 0; border-radius: 999px; background: #22ae78; cursor: pointer; }
.au-hours-manager .commerce-day-hours .check-help input::after { content: ""; display: block; width: 14px; height: 14px; margin: 3px; border-radius: 50%; background: #fff; transform: translateX(14px); transition: transform .18s; }
.au-hours-manager .commerce-day-hours .check-help input:checked { background: #a9b5c3; }
.au-hours-manager .commerce-day-hours .check-help input:checked::after { transform: translateX(0); }
.au-hours-manager .commerce-hour-tracks { grid-template-columns: repeat(4, minmax(105px, 1fr)); gap: 8px; }
.au-hours-manager .commerce-hour-tracks label { color: var(--muted); font-size: .7rem; }
.au-hours-manager .commerce-hour-tracks input { min-height: 38px; margin-top: 4px; padding: 7px 9px; }

.au-hours-manager .hours-bulk-panel { grid-area: bulk; align-self: start; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 20px 0 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.au-hours-manager .hours-bulk-panel > div:first-child,
.au-hours-manager .hours-bulk-days,
.au-hours-manager .hours-bulk-panel .check-help,
.au-hours-manager .hours-bulk-panel button { grid-column: 1 / -1; }
.au-hours-manager .hours-bulk-panel > div:first-child { display: grid; gap: 3px; }
.au-hours-manager .hours-bulk-panel > div:first-child span { color: var(--muted); font-size: .8rem; }
.au-hours-manager .hours-bulk-days { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; border: 0; }
.au-hours-manager .hours-bulk-days legend { width: 100%; margin-bottom: 5px; font-size: .76rem; font-weight: 800; }
.au-hours-manager .hours-bulk-days label { display: inline-flex; gap: 4px; padding: 6px 8px; border-radius: 7px; background: #eef6fa; font-size: .74rem; }
.au-hours-manager .hours-bulk-panel .check-help { min-height: auto; padding: 8px 10px; }
.au-hours-manager > .form-fieldset { grid-area: policy; align-self: start; margin: 0 20px 0 0; background: #fff; }
.au-hours-manager > .au-hours-save { grid-area: save; }
.au-hours-save { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 20px; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); }
.au-hours-save span { color: var(--muted); font-size: .8rem; }
.au-hours-desktop-manager > .au-hours-save { position: static; }

.au-hours-settings-page { display: grid; gap: 16px; }
.au-hours-settings-page > .au-hours-tabs { padding-inline: 0; }
.au-settings-location { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 16px; border: 1px solid #bfe1e7; border-radius: 11px; background: #f3fbfc; }
.au-settings-location > div { display: flex; align-items: center; gap: 10px; }
.au-settings-location span { padding: 5px 9px; border-radius: 999px; background: #dcf8ed; color: #08764b; font-size: .74rem; font-weight: 850; }
.au-settings-location small { color: var(--muted); }
.au-hours-settings-page > .au-hours-summary { padding: 0; }
.au-settings-hours-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(290px, .75fr); gap: 0 16px; align-items: start; }
.au-settings-hours-grid > .hours-bulk-panel { grid-column: 2; grid-row: 1 / span 8; position: sticky; top: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.au-settings-hours-grid > .hours-bulk-panel > div:first-child,
.au-settings-hours-grid > .hours-bulk-panel .check-label,
.au-settings-hours-grid > .hours-bulk-panel button { grid-column: 1 / -1; }
.au-settings-hours-grid > .hours-bulk-panel > div:first-child { display: grid; gap: 3px; }
.au-settings-hours-grid > .hours-bulk-panel > div:first-child span { color: var(--muted); font-size: .8rem; }
.au-settings-hours-grid > .hours-row { grid-column: 1; display: grid; grid-template-columns: 130px repeat(2, minmax(120px, 1fr)) 110px; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--line); border-bottom: 0; background: #fff; }
.au-settings-hours-grid > .hours-row:nth-of-type(2) { border-radius: 12px 12px 0 0; }
.au-settings-hours-grid > .hours-row:nth-last-child(2) { border-bottom: 1px solid var(--line); border-radius: 0 0 12px 12px; }
.au-settings-hours-grid > .hours-row.is-closed { background: #f7f9fb; color: var(--muted); }
.au-settings-hours-grid > .hours-row label { font-size: .72rem; color: var(--muted); }
.au-settings-hours-grid > .hours-row input[type="time"] { min-height: 38px; margin-top: 4px; padding: 7px 9px; }
.au-settings-hours-grid > .hours-row .check-label { display: flex; align-items: center; gap: 6px; padding-top: 18px; }
.au-settings-hours-grid > .au-hours-save { grid-column: 1 / -1; margin-top: 16px; border: 1px solid var(--line); border-radius: 11px; }

.au-customers-page { display: grid; gap: 14px; }
.au-customers-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.au-customers-metrics article::before,
.au-delivery-summary article::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; border-radius: 12px 0 0 12px; background: #14a6b0; }
.au-customers-metrics article.is-pending::before,
.au-delivery-summary article.is-alert::before { background: #e59a20; }
.au-customers-metrics strong { font-size: 1.42rem; }
.au-customers-metrics small,
.au-delivery-summary small { color: var(--muted); font-size: .74rem; }
.au-customers-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); }
.au-customers-tabs a { display: inline-flex; gap: 8px; padding: 11px 4px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 800; text-decoration: none; }
.au-customers-tabs a.is-active { color: var(--ink); border-color: var(--primary); }
.au-customers-tabs strong { min-width: 24px; padding: 2px 7px; border-radius: 999px; background: #e9f3f5; text-align: center; }
.au-customers-panel { padding: 0; overflow: hidden; }
.au-customers-panel > .panel-header { padding: 16px 18px 8px; }
.au-customers-panel > .filter-bar { margin: 0 18px 14px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbfd; }
.au-customers-list { gap: 0; border-top: 1px solid var(--line); }
.au-customers-list .au-customer-row { grid-template-columns: minmax(260px, 1.5fr) minmax(240px, 1fr) auto; gap: 16px; padding: 13px 18px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: #fff; }
.au-customers-list .au-customer-row:hover { background: #f5fbfc; }
.au-customer-row > div:first-child { position: relative; min-height: 42px; padding-left: 50px; }
.au-customer-avatar { position: absolute; left: 0; top: 0; display: grid !important; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #e6eef5; color: #163554; font-weight: 900; }
.au-customer-row .status { display: inline-flex; width: max-content; margin-top: 5px; }
.au-customers-pending-heading { margin-top: 10px; padding-top: 18px !important; border-top: 8px solid #f2f6f8; }
.au-customers-pending .au-customer-row:first-child { background: #f2fbfc; }

.au-delivery-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.au-delivery-summary strong { font-size: 1.22rem; }
.au-delivery-manager { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.au-delivery-manager .panel-header { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.au-delivery-manager > label:not(.check-help) { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdfe; }
.au-delivery-manager .au-delivery-toggle { min-height: 78px; border-radius: 10px; background: #f2fbfa; }
.au-delivery-manager .au-delivery-pause { background: #fff8f3; border-color: #f5d6be; }
.au-delivery-manager > .primary-button { width: max-content; min-width: 260px; justify-self: end; }
.au-delivery-riders { margin-top: 16px; border-left: 4px solid #16a0aa; }

.commerce-options-name > img { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 10px; border: 1px solid var(--line); object-fit: cover; background: #f3f6f8; }

@media (max-width: 1180px) {
    .au-hours-manager { grid-template-areas: "tabs" "heading" "summary" "week" "bulk" "policy" "save"; grid-template-columns: 1fr; }
    .au-hours-week { margin-right: 20px; }
    .au-hours-manager .hours-bulk-panel,
    .au-hours-manager > .form-fieldset { margin-left: 20px; }
    .au-customers-metrics,
    .au-delivery-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .au-settings-hours-grid { grid-template-columns: 1fr; gap: 14px; }
    .au-settings-hours-grid > .hours-bulk-panel { grid-column: 1; grid-row: auto; position: static; }
    .au-settings-hours-grid > .hours-row { grid-column: 1; }
    .au-hours-desktop-layout { grid-template-columns: 1fr; }
    .au-hours-desktop-layout > aside { position: static; }
}

@media (max-width: 760px) {
    .commerce-options-manager { width: 100%; max-width: 100%; overflow: hidden; }
    .commerce-options-manager .commerce-options-manager__header { display: grid; grid-template-columns: 1fr; min-width: 0; }
    .commerce-options-manager .commerce-options-manager__header > div:first-child { min-width: 0; }
    .commerce-options-manager .commerce-options-manager__tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; min-width: 0; overflow: hidden; }
    .commerce-options-manager .commerce-options-manager__tabs button { min-width: 0; padding-inline: .5rem; justify-content: center; white-space: normal; }
    .commerce-options-manager .commerce-options-manager__header > .au-button { width: 100%; white-space: normal; }
    .commerce-options-manager .commerce-options-manager__filters,
    .commerce-options-manager .commerce-options-search,
    .commerce-options-manager .commerce-options-search input { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
    .commerce-options-manager .commerce-options-table-wrap,
    .commerce-options-manager .commerce-options-table,
    .commerce-options-manager .commerce-options-table tbody,
    .commerce-options-manager .commerce-options-table tr { box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; }
    .commerce-options-manager .commerce-options-table td,
    .commerce-options-manager .commerce-options-name { min-width: 0; max-width: 100%; }
    .au-hours-tabs { overflow-x: auto; padding-inline: 12px; }
    .au-hours-tabs a { white-space: nowrap; }
    .au-hours-heading,
    .au-hours-summary { padding-inline: 12px; }
    .au-hours-summary,
    .au-customers-metrics,
    .au-delivery-summary,
    .au-delivery-manager { grid-template-columns: 1fr; }
    .au-hours-week,
    .au-hours-manager .hours-bulk-panel,
    .au-hours-manager > .form-fieldset { margin-inline: 12px; }
    .au-hours-manager .commerce-day-hours { grid-template-columns: 1fr; }
    .au-hours-manager .commerce-hour-tracks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .au-hours-save { align-items: stretch; flex-direction: column; }
    .au-hours-week-table article { grid-template-columns: 1fr; }
    .au-hours-week-table article > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .au-settings-location { align-items: flex-start; flex-direction: column; }
    .au-settings-hours-grid > .hours-row { grid-template-columns: 1fr 1fr; }
    .au-settings-hours-grid > .hours-row > strong,
    .au-settings-hours-grid > .hours-row .check-label { grid-column: 1 / -1; padding-top: 0; }
    .au-hours-save .primary-button,
    .au-delivery-manager > .primary-button { width: 100%; min-width: 0; }
    .au-customers-tabs { overflow-x: auto; }
    .au-customers-tabs a { white-space: nowrap; }
    .au-customers-list .au-customer-row { grid-template-columns: 1fr; padding: 14px; }
    .au-customers-list .au-customer-row .row-actions { grid-column: 1; justify-content: stretch; }
    .au-customers-list .au-customer-row .row-actions a { width: 100%; text-align: center; }
}
