/* Templates preserve navigation permissions and the platform's real data. */
.sidebar-template-lightrail .app-bar { background: #fff !important; color: #2c463d; border-block-end: 1px solid #e1e9e5; box-shadow: none; }
.sidebar-template-lightrail .app-bar__subtitle { color: #62776e !important; }
.sidebar-template-lightrail .app-bar__branch { color: #2c463d !important; border-color: #bbcfc5 !important; }
.sidebar-template-lightrail .app-bar__avatar { background: #e5f1eb; color: #216849; }
.sidebar-template-violet .app-bar { background: #7256a5 !important; color: #fff; }
.sidebar-template-violet .app-bar__subtitle { color: #eee9f6 !important; }
.sidebar-template-violet .app-bar__avatar { background: #eee9f6; color: #5a407d; }
.sidebar-template-midnight .app-bar { background: #142d37 !important; color: #e6f1f6; }
.sidebar-template-midnight .app-bar__subtitle { color: #acc4cf !important; }
.sidebar-template-midnight .app-bar__branch { border-color: #718f9e !important; color: #e6f1f6 !important; }
.sidebar-template-midnight .app-bar__avatar { background: #477bb7; color: #fff; }
.sidebar-template-classic.pos-style-fresh .app-bar { background: #378f84 !important; }
.sidebar-template-classic.pos-style-fresh .app-bar__avatar { background: #c7eddf; color: #106448; }
.sidebar-template-lightrail .app-drawer {
    background: linear-gradient(to left, #f6f8fa 66px, #fff 66px) !important;
    border-inline-start: 1px solid #e4e8ec;
}
.sidebar-template-lightrail .app-drawer .mud-nav-link { border-radius: 8px; }
.sidebar-template-lightrail .app-drawer .mud-nav-link.active { background: #e9f2ed; color: #176947; }
.sidebar-template-lightrail .drawer-profile { padding-block: 12px; }
.sidebar-template-lightrail .app-drawer .mud-nav-link-icon { width: 34px; }

.sidebar-template-violet .app-drawer,
.sidebar-template-midnight .app-drawer {
    inset-block-start: 84px !important;
    height: calc(100% - 96px);
    width: 248px !important;
    margin-inline: 12px;
    border-radius: 20px;
    border: 1px solid #e7e4f1;
}
.sidebar-template-violet .app-drawer { background: #faf9ff !important; }
.sidebar-template-violet .app-drawer .mud-nav-link.active { background: #eee9f6; color: #7256a5; }
.sidebar-template-violet .drawer-profile .mud-avatar { background: #7256a5; }
.sidebar-template-violet .nav-section-label { color: #827793; }
.sidebar-template-violet .app-drawer .mud-nav-link:hover { background: #f0ecfa; }

.sidebar-template-midnight .app-drawer { background: #13272e !important; color: #dce8ee; border-color: #1b343d; }
.sidebar-template-midnight .app-drawer .mud-nav-link,
.sidebar-template-midnight .app-drawer .mud-nav-link-icon { color: #c2d1d8; }
.sidebar-template-midnight .app-drawer .mud-nav-link.active { color: #fff; background: #477bb7; }
.sidebar-template-midnight .app-drawer .mud-nav-link.active .mud-nav-link-icon { color: #fff; }
.sidebar-template-midnight .app-drawer .mud-nav-link:hover { background: #213a44; }
.sidebar-template-midnight .app-drawer .mud-nav-link.active:hover { background: #477bb7; }
.sidebar-template-midnight .nav-section-label,
.sidebar-template-midnight .drawer-profile .mud-text-secondary { color: #94aeb9 !important; }
.sidebar-template-midnight .drawer-profile .mud-avatar { background: #477bb7; color: #fff; }
.sidebar-template-midnight .sidebar-density-toggle { color: #c2d1d8; }
.sidebar-template-midnight .mud-nav-link-expand-icon { color: #94aeb9; }

.sidebar-density-toggle { width: 32px; height: 32px; }
.app-drawer .mud-drawer-header:has(.sidebar-density-toggle) { flex-wrap: wrap; gap: 4px; }
.app-drawer .mud-drawer-header:has(.sidebar-density-toggle) .drawer-profile { padding-block: 0 12px; }
.sidebar-compact .app-drawer .mud-drawer-header { padding: 12px 8px; justify-content: center; }
.sidebar-compact .app-drawer .drawer-profile { justify-content: center; }
.sidebar-compact .app-drawer .drawer-profile > div,
.sidebar-compact .app-drawer .nav-section-label,
.sidebar-compact .app-drawer .mud-nav-link-expand-icon { display: none; }
.sidebar-compact .app-drawer .mud-nav-link-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.sidebar-compact .app-drawer .mud-nav-link {
    display: flex;
    width: 44px;
    min-height: 44px;
    margin: 4px auto !important;
    padding: 10px !important;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    border-radius: 12px;
}
.sidebar-compact .app-drawer .mud-nav-link-icon { margin: 0 !important; width: 24px; height: 24px; min-width: 24px; flex-shrink: 0; }
.sidebar-compact .app-drawer .mud-nav-group .mud-navmenu { margin: 0 !important; padding: 0 !important; }
.sidebar-compact .app-drawer .mud-nav-group { min-width: 0; }
.sidebar-compact .app-drawer .mud-drawer-content { overflow-x: hidden; }
.sidebar-compact.sidebar-template-violet .app-drawer,
.sidebar-compact.sidebar-template-midnight .app-drawer { width: 60px !important; }
.sidebar-compact.sidebar-template-violet .app-drawer .mud-avatar,
.sidebar-compact.sidebar-template-midnight .app-drawer .mud-avatar { width: 32px; height: 32px; font-size: 14px; }

.sidebar-template-grid,
.pos-template-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 20px; }
.sidebar-template-option {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border: 1px solid #e3dded;
    border-radius: 14px;
    background: #fff;
    color: #30283c;
    font: inherit;
    text-align: start;
    cursor: pointer;
}
.sidebar-template-option:hover { border-color: #7256a5; }
.sidebar-template-option.is-selected { border: 2px solid #7256a5; padding: 13px; background: #faf8fc; }
.sidebar-template-option:focus-visible { outline: 3px solid #7256a5; outline-offset: 3px; }
.sidebar-template-option__title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; }
.sidebar-template-option__description { font-size: 14px; color: #71677e; }
.sidebar-preview { display: flex; width: 100%; height: 220px; border-radius: 10px; overflow: hidden; background: #f5f1f9; color: #30283c; border: 1px solid #e0e8e4; }
.sidebar-preview__rail { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 16px 10px; background: #f6f7f9; border-inline-end: 1px solid #e7eaec; }
.sidebar-preview__rail .mud-icon-root { font-size: 18px; }
.sidebar-preview__menu { display: flex; flex-direction: column; flex: 1; padding: 16px 10px; gap: 14px; background: #fff; font-size: 12px; }
.sidebar-preview__menu > span { display: flex; align-items: center; gap: 6px; }
.sidebar-preview__menu .mud-icon-root { font-size: 16px; }
.sidebar-preview__active { background: #eee9f6; color: #5a407d; padding: 8px; border-radius: 6px; }
.sidebar-preview__account { margin-block-start: auto; }
.sidebar-preview--classic .sidebar-preview__rail { display: none; }
.sidebar-preview--violet { padding: 8px; background: #e9e4f5; border: 0; gap: 4px; }
.sidebar-preview--violet .sidebar-preview__menu,
.sidebar-preview--violet .sidebar-preview__rail { background: #faf9ff; border-radius: 8px; }
.sidebar-preview--violet .sidebar-preview__active { background: #eee9f6; color: #7256a5; }
.sidebar-preview--midnight { padding: 8px; background: #e6edf0; border: 0; gap: 4px; }
.sidebar-preview--midnight .sidebar-preview__rail,
.sidebar-preview--midnight .sidebar-preview__menu { background: #13272e; color: #dce8ee; border-radius: 10px; border-color: transparent; }
.sidebar-preview--midnight .sidebar-preview__active { background: #477bb7; color: white; }

.pos-preview { display: flex; gap: 8px; width: 100%; height: 230px; padding: 10px; background: #faf8fc; border-radius: 10px; }
.pos-preview__catalog { flex: 1; min-width: 0; }
.pos-preview__search { display: flex; gap: 6px; align-items: center; background: white; border: 1px solid #e2e9e5; padding: 8px; font-size: 11px; border-radius: 6px; }
.pos-preview__search .mud-icon-root { font-size: 16px; }
.pos-preview__products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-block-start: 9px; }
.pos-preview__products > span { display: flex; flex-direction: column; gap: 6px; padding: 9px; background: white; border-radius: 8px; font-size: 9px; }
.pos-preview__products > span > .mud-icon-root { font-size: 24px; color: #7256a5; }
.pos-preview__products small { font-size: 9px; color: #7256a5; }
.pos-preview__cart { display: flex; flex-direction: column; gap: 12px; width: 26%; padding: 8px; border-radius: 8px; background: #fff; font-size: 11px; }
.pos-preview__cart > span { height: 12px; border-radius: 3px; background: #e8eeeb; }
.pos-preview__cart small { margin-block-start: auto; padding: 8px; border-radius: 6px; color: #fff; background: #7256a5; text-align: center; }
.pos-preview--fresh { background: #e1f4eb; }
.pos-preview--fresh .pos-preview__products > span { align-items: center; }
.pos-preview--fresh .pos-preview__products > span > .mud-icon-root { background: #dcf4e8; border-radius: 50%; padding: 6px; width: 36px; height: 36px; }
.pos-preview--fresh .pos-preview__products small { width: 100%; border-radius: 12px; background: #378f84; color: white; padding: 3px; text-align: center; }
.pos-preview--fresh .pos-preview__cart small { background: #378f84; }

@media (max-width: 959px) {
    .sidebar-template-violet .app-drawer,
    .sidebar-template-midnight .app-drawer { inset-block-start: 72px !important; margin: 0; height: calc(100% - 72px); border-radius: 0; width: 272px !important; }
    .sidebar-compact.sidebar-template-violet .app-drawer,
    .sidebar-compact.sidebar-template-midnight .app-drawer { width: 84px !important; }
}

/* The three Care layouts extend the approved identity; previous selectors stay intact. */
.workspace-template { --care-accent: #5a407d; --care-tint: #eee9f6; background: #faf8fc; }
.workspace-template .app-bar { background: #fff !important; color: #30283c; border-block-end: 1px solid #e3dded; box-shadow: none; }
.workspace-template .app-bar__subtitle { color: #71677e !important; }
.workspace-template .app-bar__branch { color: #5a407d !important; border-color: #b9aacc !important; }
.workspace-template .app-bar__avatar { background: #eee9f6; color: #5a407d; }
.workspace-template .app-bar .mud-icon-button, .workspace-template .app-bar__brand .mud-typography-subtitle1 { color: #30283c !important; }
.workspace-template .app-drawer { background: #fff !important; }
.workspace-template .app-drawer .mud-drawer-header { flex-wrap: wrap; height: auto !important; flex: 0 0 auto; }
.workspace-template .app-drawer .drawer-profile { width: calc(100% - 40px); padding-block: 0; }
.workspace-template.sidebar-compact .app-drawer .drawer-profile { width: 100%; }
.workspace-sidebar-brand { display: flex; align-items: center; gap: 12px; width: 100%; margin-block-end: 16px; }
.workspace-sidebar-brand img { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }
.workspace-sidebar-brand strong { display: block; font-size: 15px; color: #5a407d; }
.workspace-sidebar-brand small { display: block; font-size: 12px; color: #71677e; }
.sidebar-compact .workspace-sidebar-brand { justify-content: center; margin-block-end: 8px; }
.sidebar-compact .workspace-sidebar-brand img { width: 36px; height: 36px; }
.sidebar-compact .workspace-sidebar-brand > div { display: none; }
.workspace-template .page-header__eyebrow, .workspace-template .page-header .mud-typography-overline { display: none; }
.workspace-template .surface-card { border-radius: 14px; background: #fff; box-shadow: none; }
.workspace-template .stat-card { background: var(--care-tint); border-color: transparent; box-shadow: none; }
.workspace-template .mud-table-head .mud-table-cell, .workspace-template .erp-report-table th { background: #f5f1f9; }
.workspace-template .mud-table-cell, .workspace-template .erp-report-table { font-variant-numeric: tabular-nums; }
.workspace-template ::selection { background: #eee9f6; color: #5a407d; }
.workspace-template a:focus-visible, .workspace-template button:focus-visible { outline: 3px solid #378f84; outline-offset: 3px; }
.workspace-template .app-drawer .mud-nav-link.active { background: var(--care-tint); color: var(--care-accent); }
.workspace-navigation { display: flex; align-items: center; gap: 6px; position: fixed; inset: 72px 0 auto; z-index: 1100; min-height: 56px; padding: 7px 24px; overflow-x: auto; background: #fff; border-block-end: 1px solid #e3dded; }
.workspace-navigation a { display: inline-flex; gap: 8px; align-items: center; padding: 9px 12px; min-height: 42px; border-radius: 8px; color: #71677e; text-decoration: none; white-space: nowrap; font-size: 13px; }
.workspace-navigation a.active, .workspace-navigation a:hover { background: #e5f3ed; color: #246d64; }
.workspace-navigation .mud-icon-root { width: 20px; height: 20px; }
.sidebar-template-caremint { --care-accent: #246d64; --care-tint: #e5f3ed; background: #f4f9f7; }
.sidebar-template-caremint .app-bar__branch { color: #246d64 !important; border-color: #98c6ba !important; }
.sidebar-template-caremint .app-bar__avatar { background: #e5f3ed; color: #246d64; }
.sidebar-template-caremint .mud-table-head .mud-table-cell { background: #f4f9f7; }
.sidebar-template-careplum { background: #f7f5fa; }
.sidebar-template-careplum .app-drawer { background: #45315f !important; color: #fff; border: 0; }
.sidebar-template-careplum .app-drawer .mud-nav-link, .sidebar-template-careplum .app-drawer .mud-nav-link-icon, .sidebar-template-careplum .app-drawer .mud-nav-link-expand-icon { color: #e2d6f0; }
.sidebar-template-careplum .app-drawer .mud-nav-link-icon, .sidebar-template-careplum .app-drawer .mud-nav-link-expand-icon { color: #e2d6f0 !important; }
.sidebar-template-careplum .app-drawer .mud-nav-link.active { background: #fff; color: #5a407d; }
.sidebar-template-careplum .app-drawer .mud-nav-link.active .mud-nav-link-icon { color: #5a407d !important; }
.sidebar-template-careplum .app-drawer .mud-nav-link:hover { background: #604779; color: #fff; }
.sidebar-template-careplum .app-drawer .mud-nav-link.active:hover { background: #eee9f6; color: #5a407d; }
.sidebar-template-careplum .nav-section-label, .sidebar-template-careplum .drawer-profile .mud-text-secondary, .sidebar-template-careplum .workspace-sidebar-brand small { color: #e2d6f0 !important; }
.sidebar-template-careplum .workspace-sidebar-brand strong { color: #fff; }
.sidebar-template-careplum .workspace-sidebar-brand img { background: #fff; border-radius: 10px; padding: 3px; }
.sidebar-template-careplum .sidebar-density-toggle { color: #fff; }
.erp-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 22px; }
.erp-workspace h2 { font-size: 18px; font-weight: 700; margin: 0; }
.erp-workspace-summary { grid-column: 1 / -1; background: var(--care-tint); border-radius: 14px; padding: 24px; }
.erp-workspace-title { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin-block-end: 20px; }
.erp-workspace-title > span, .erp-workspace-summary > p { color: #71677e; font-size: 13px; }
.erp-workspace-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 24px 0 16px; }
.erp-workspace-metrics dt { font-size: 14px; color: var(--care-accent); }
.erp-workspace-metrics dd { margin: 8px 0 0; font-size: 27px; font-weight: 700; color: var(--care-accent); font-variant-numeric: tabular-nums; }
.erp-workspace-metrics small { font-size: 13px; font-weight: 400; }
.erp-workspace-journals, .erp-workspace-status, .erp-workspace-links { padding: 24px; min-width: 0; }
.erp-workspace-journals { grid-column: 1; }
.erp-workspace-status { grid-column: 2; grid-row: 2 / 4; }
.erp-workspace-status dl { margin-block: 24px; }
.erp-workspace-status dl > div { display: flex; gap: 12px; justify-content: space-between; padding-block: 18px; border-block-end: 1px solid #e3dded; }
.erp-workspace-status dd { margin: 0; font-weight: 700; color: var(--care-accent); }
.erp-workspace-links { grid-column: 1; }
.erp-workspace-links > a { display: flex; align-items: center; gap: 14px; padding-block: 18px; border-block-end: 1px solid #e3dded; color: #30283c; text-decoration: none; }
.erp-workspace-links > a:last-child { border: 0; }
.erp-workspace-links > a > .mud-icon-root:first-child { color: var(--care-accent); }
.erp-workspace-links > a > .mud-icon-root:last-child { margin-inline-start: auto; flex-shrink: 0; width: 18px; }
.erp-workspace-links span { display: block; margin-block-start: 5px; font-size: 13px; color: #71677e; }
.erp-workspace-links a:hover strong { color: var(--care-accent); }
.sidebar-template-caremint .erp-workspace-summary { grid-column: 2; grid-row: 1 / 3; background: #fff; border: 1px solid #e3dded; }
.sidebar-template-caremint .erp-workspace-title { flex-wrap: wrap; }
.sidebar-template-caremint .erp-workspace-metrics, .sidebar-template-careplum .erp-workspace-metrics { grid-template-columns: 1fr; }
.sidebar-template-caremint .erp-workspace-metrics > div, .sidebar-template-careplum .erp-workspace-metrics > div { padding-block-end: 20px; border-block-end: 1px solid #e3dded; }
.sidebar-template-caremint .erp-workspace-journals { grid-column: 1; grid-row: 1; }
.sidebar-template-caremint .erp-workspace-status { grid-column: 1; grid-row: 2; }
.sidebar-template-caremint .erp-workspace-links { grid-column: 1 / -1; }
.sidebar-template-careplum .erp-workspace { grid-template-columns: 290px minmax(0, 1fr); }
.sidebar-template-careplum .erp-workspace-summary { grid-column: 1; grid-row: 1 / 3; background: transparent; padding-inline: 0; border-radius: 0; border-block-start: 2px solid #7256a5; }
.sidebar-template-careplum .erp-workspace-title { flex-wrap: wrap; }
.sidebar-template-careplum .erp-workspace-journals { grid-column: 2; grid-row: 1; }
.sidebar-template-careplum .erp-workspace-status { grid-column: 2; grid-row: 2; background: #e5f3ed; border: 0; }
.sidebar-template-careplum .erp-workspace-links { grid-column: 1 / -1; }
.sidebar-preview--carelavender .sidebar-preview__rail { display: none; }
.sidebar-preview--carelavender .sidebar-preview__menu { background: #faf8fc; }
.sidebar-preview--caremint { flex-direction: column; padding: 8px; background: #e5f3ed; }
.sidebar-preview--caremint .sidebar-preview__rail { flex-direction: row; gap: 12px; padding: 8px; background: #fff; border: 0; }
.sidebar-preview--caremint .sidebar-preview__menu { gap: 8px; padding: 10px; }
.sidebar-preview--caremint .sidebar-preview__active { background: #e5f3ed; color: #246d64; }
.sidebar-preview--caremint .sidebar-preview__account { display: none; }
.sidebar-preview--careplum .sidebar-preview__rail { background: #45315f; color: #e2d6f0; }
.sidebar-preview--careplum .sidebar-preview__menu { background: #45315f; color: #fff; }
.sidebar-preview--careplum .sidebar-preview__active { background: #fff; color: #5a407d; }
@media (min-width: 960px) {
    .sidebar-template-caremint .mud-main-content { padding-top: 128px !important; }
    .sidebar-template-caremint .app-drawer { inset-block-start: 128px !important; height: calc(100% - 128px); }
}
@media (max-width: 1100px) {
    .erp-workspace, .sidebar-template-careplum .erp-workspace { grid-template-columns: minmax(0, 1fr); }
    .erp-workspace-summary, .erp-workspace-journals, .erp-workspace-status, .erp-workspace-links,
    .sidebar-template-caremint .erp-workspace-summary, .sidebar-template-caremint .erp-workspace-journals, .sidebar-template-caremint .erp-workspace-status, .sidebar-template-caremint .erp-workspace-links,
    .sidebar-template-careplum .erp-workspace-summary, .sidebar-template-careplum .erp-workspace-journals, .sidebar-template-careplum .erp-workspace-status, .sidebar-template-careplum .erp-workspace-links { grid-column: 1; grid-row: auto; }
    .erp-workspace-metrics, .sidebar-template-caremint .erp-workspace-metrics, .sidebar-template-careplum .erp-workspace-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 959px) { .workspace-navigation { display: none; } }
@media (max-width: 600px) {
    .erp-workspace { gap: 16px; }
    .erp-workspace-summary, .erp-workspace-journals, .erp-workspace-status, .erp-workspace-links { padding: 18px; }
    .erp-workspace-title { flex-wrap: wrap; }
    .erp-workspace-metrics { gap: 18px 12px; }
    .erp-workspace-metrics dd { font-size: 23px; }
    .erp-workspace-metrics dt { font-size: 13px; }
}
