:root {
    --navy-950: #08111f;
    --navy-900: #0d1b2d;
    --navy-850: #12243a;
    --blue-700: #1559d6;
    --blue-600: #246bfd;
    --blue-100: #e8f0ff;
    --green-600: #0a9b6c;
    --green-100: #dcfce7;
    --orange-600: #d97706;
    --orange-100: #fff1d6;
    --violet-600: #7454e8;
    --violet-100: #eee9ff;
    --red-600: #dc3545;
    --red-100: #ffe7ea;
    --ink-900: #152238;
    --ink-700: #394861;
    --ink-500: #6e7c91;
    --line: #e5eaf1;
    --surface: #ffffff;
    --canvas: #f4f7fb;
    --shadow-sm: 0 5px 16px rgba(20, 42, 76, .07);
    --shadow-lg: 0 24px 70px rgba(8, 22, 44, .18);
    --radius: 14px;
    --sidebar-width: 272px;
    --topbar-height: 78px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: "Inter", system-ui, sans-serif; color: var(--ink-900); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--ink-500); }
.eyebrow { margin: 0 0 7px; font-size: 10px; line-height: 1; letter-spacing: .14em; font-weight: 800; color: var(--blue-600); }
.eyebrow-light { color: #8eb7ff; }
.positive { color: var(--green-600) !important; }

/* Login */
.login-body { min-height: 100vh; background: #fff; }
.login-shell { display: grid; grid-template-columns: minmax(430px, 1.05fr) minmax(480px, .95fr); min-height: 100vh; }
.login-brand-panel { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 58px 64px; color: #fff; background: radial-gradient(circle at 76% 12%, rgba(46, 118, 255, .52), transparent 26%), radial-gradient(circle at 20% 86%, rgba(56, 189, 248, .15), transparent 30%), linear-gradient(145deg, #07111f, #102c54 62%, #16489b); }
.login-brand-panel::after { content: ""; position: absolute; width: 520px; height: 520px; right: -190px; bottom: -230px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.018); }
.brand-mark { display: inline-grid; place-items: center; flex: 0 0 auto; width: 39px; height: 39px; border-radius: 11px; color: #fff; background: linear-gradient(135deg, #2f7cff, #164bc5); font-size: 13px; font-weight: 800; box-shadow: 0 8px 20px rgba(30, 105, 255, .3); }
.brand-mark-large { width: 54px; height: 54px; border-radius: 15px; font-size: 16px; }
.login-brand-panel h1 { max-width: 650px; margin: 0; font-size: clamp(38px, 4vw, 62px); line-height: 1.04; letter-spacing: -.045em; }
.login-intro { max-width: 580px; margin: 25px 0 0; font-size: 17px; line-height: 1.7; color: #bfd0e7; }
.login-stat-row { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.login-stat-row div { padding: 17px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(255,255,255,.05); backdrop-filter: blur(8px); }
.login-stat-row strong, .login-stat-row span { display: block; }
.login-stat-row strong { margin-bottom: 5px; font-size: 15px; }
.login-stat-row span { font-size: 11px; color: #aac0dd; }
.login-form-panel { display: grid; place-items: center; padding: 50px; }
.login-card { width: min(420px, 100%); }
.login-card h2 { margin: 0 0 7px; font-size: 30px; letter-spacing: -.03em; }
.login-card > .muted { margin: 0 0 30px; font-size: 14px; }
.mobile-brand { display: none; margin-bottom: 38px; align-items: center; gap: 11px; font-weight: 800; }
.form-label { display: flex; justify-content: space-between; margin: 18px 0 8px; font-size: 12px; font-weight: 700; color: var(--ink-700); }
.form-label small { font-weight: 500; color: var(--ink-500); }
.form-input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid #d9e0ea; border-radius: 10px; color: var(--ink-900); background: #fff; outline: 0; transition: .18s; }
.form-input:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(36, 107, 253, .1); }
.password-field { position: relative; }
.password-field .form-input { padding-right: 65px; }
.password-toggle { position: absolute; right: 7px; top: 7px; height: 34px; border: 0; padding: 0 9px; color: var(--blue-600); background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.login-help { margin-top: 18px; text-align: center; font-size: 11px; color: var(--ink-500); }
.login-help code { color: var(--ink-700); }
.alert { margin: 18px 0; padding: 12px 14px; border-radius: 9px; font-size: 12px; }
.alert-error { color: #9e2633; background: var(--red-100); }
.alert-success { color: #087354; background: var(--green-100); }

/* Shared controls */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; font-weight: 700; cursor: pointer; transition: .18s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button-primary { color: #fff; background: linear-gradient(135deg, var(--blue-600), var(--blue-700)); box-shadow: 0 7px 18px rgba(36, 107, 253, .22); }
.button-secondary { color: var(--ink-700); border-color: #dfe5ed; background: #fff; }
.button-danger { color: #fff; background: linear-gradient(135deg, #e24757, #bd2435); box-shadow: 0 7px 18px rgba(220, 53, 69, .2); }
.button-light { color: var(--navy-900); background: #fff; box-shadow: 0 8px 24px rgba(5, 20, 45, .16); }
.button-full { width: 100%; }
.button-lg { min-height: 49px; margin-top: 24px; }
.button-count { min-width: 19px; height: 19px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 10px; color: #fff; background: var(--blue-600); font-size: 9px; }
.icon-button { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid #e0e6ee; border-radius: 10px; color: var(--ink-700); background: #fff; cursor: pointer; }
.text-button { padding: 0; border: 0; color: var(--blue-600); background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; }
.text-button.danger { color: var(--red-600); }

/* App shell */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; flex-direction: column; width: var(--sidebar-width); color: #d9e5f6; background: linear-gradient(180deg, var(--navy-950), var(--navy-900)); box-shadow: 9px 0 35px rgba(6, 17, 34, .13); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; min-height: var(--topbar-height); padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-copy strong, .brand-copy small { display: block; }
.brand-copy strong { color: #fff; font-size: 15px; }
.brand-copy small { margin-top: 2px; color: #7990ae; font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }
.sidebar-close { display: none; margin-left: auto; border-color: rgba(255,255,255,.1); color: #fff; background: rgba(255,255,255,.05); }
.sidebar-nav { overflow-y: auto; flex: 1; padding: 15px 13px 24px; scrollbar-width: thin; scrollbar-color: #29415f transparent; }
.nav-label { margin: 22px 11px 7px; color: #617993; font-size: 8px; font-weight: 800; letter-spacing: .15em; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 39px; margin: 2px 0; padding: 0 12px; border-radius: 9px; color: #9eb0c7; font-size: 11px; font-weight: 600; transition: .16s ease; }
.nav-link > i { width: 17px; color: #7790ad; text-align: center; }
.nav-link > span:not(.status-dot) { flex: 1; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-link.active { color: #fff; background: linear-gradient(90deg, rgba(36,107,253,.33), rgba(36,107,253,.08)); box-shadow: inset 3px 0 0 #4d8dff; }
.nav-link.active > i { color: #6fa2ff; }
.nav-link kbd { padding: 2px 5px; border: 1px solid rgba(255,255,255,.12); border-radius: 4px; color: #6f88a4; background: rgba(255,255,255,.04); font: 8px Inter, sans-serif; }
.status-dot { display: inline-block; flex: 0 0 auto !important; width: 7px; height: 7px; border-radius: 50%; }
.status-dot.online { background: #29d493; box-shadow: 0 0 0 3px rgba(41,212,147,.1); }
.sidebar-footer { padding: 13px; border-top: 1px solid rgba(255,255,255,.06); }
.sync-card { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid rgba(255,255,255,.07); border-radius: 10px; background: rgba(255,255,255,.035); }
.sync-icon { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; color: #66a0ff; background: rgba(36,107,253,.15); font-size: 11px; }
.sync-card div { flex: 1; }
.sync-card strong, .sync-card small { display: block; }
.sync-card strong { color: #dce8f8; font-size: 10px; }
.sync-card small { margin-top: 3px; color: #69829d; font-size: 8px; }
.workspace { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; min-height: var(--topbar-height); padding: 0 25px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.menu-button { display: none; margin-right: 12px; }
.page-heading { display: flex; align-items: center; gap: 11px; }
.page-icon { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 10px; color: var(--blue-600); background: var(--blue-100); }
.page-heading small { display: block; margin-bottom: 2px; color: var(--ink-500); font-size: 8px; font-weight: 700; letter-spacing: .07em; }
.page-heading h1 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.topbar-actions { display: flex; align-items: center; gap: 11px; margin-left: auto; }
.business-date { padding-right: 17px; border-right: 1px solid var(--line); text-align: right; }
.business-date small, .business-date strong { display: block; }
.business-date small { color: var(--ink-500); font-size: 8px; }
.business-date strong { margin-top: 2px; font-size: 10px; }
.notification-button { position: relative; }
.notification-button span { position: absolute; right: -3px; top: -4px; display: grid; place-items: center; width: 15px; height: 15px; border: 2px solid #fff; border-radius: 50%; color: #fff; background: var(--red-600); font-size: 7px; }
.user-menu { display: flex; align-items: center; gap: 9px; min-width: 130px; }
.avatar { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, #243b62, #0c1a2e); font-size: 10px; font-weight: 800; }
.user-menu strong, .user-menu small { display: block; }
.user-menu strong { font-size: 10px; text-transform: capitalize; }
.user-menu small { margin-top: 2px; color: var(--ink-500); font-size: 8px; }
.app-view { min-height: calc(100vh - var(--topbar-height)); }
.page-content { padding: 24px; }
.page-loader { display: grid; place-items: center; min-height: 55vh; color: var(--ink-500); font-size: 11px; }
.page-loader span, .catalog-loading span { width: 25px; height: 25px; border: 3px solid #dce4ef; border-top-color: var(--blue-600); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Dashboard */
.hero-panel { display: flex; align-items: center; justify-content: space-between; min-height: 155px; padding: 30px 34px; overflow: hidden; border-radius: var(--radius); color: #fff; background: radial-gradient(circle at 78% -80%, rgba(95,150,255,.8), transparent 45%), linear-gradient(120deg, #0a1d37, #12386c 70%, #164aa0); box-shadow: var(--shadow-sm); }
.hero-panel h2 { margin: 8px 0 8px; font-size: 24px; letter-spacing: -.035em; }
.hero-panel p { margin: 0; color: #b9cce5; font-size: 12px; }
.hero-tag { display: inline-flex; align-items: center; gap: 6px; color: #89b3ff; font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin: 17px 0; }
.metric-card { display: flex; align-items: center; gap: 14px; min-height: 108px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.metric-icon { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 11px; font-size: 15px; }
.metric-icon.blue { color: var(--blue-600); background: var(--blue-100); }
.metric-icon.green { color: var(--green-600); background: var(--green-100); }
.metric-icon.orange { color: var(--orange-600); background: var(--orange-100); }
.metric-icon.violet { color: var(--violet-600); background: var(--violet-100); }
.metric-copy { min-width: 0; }
.metric-copy span, .metric-copy strong, .metric-copy small { display: block; }
.metric-copy span { color: var(--ink-500); font-size: 9px; font-weight: 600; }
.metric-copy strong { margin: 5px 0; font-size: 20px; letter-spacing: -.04em; }
.metric-copy small { color: var(--ink-500); font-size: 8px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 17px; }
.panel { border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.panel-header { display: flex; align-items: center; justify-content: space-between; min-height: 65px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-header h3 { margin: 0; font-size: 14px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.data-table th { padding: 11px 14px; color: var(--ink-500); background: #f8fafc; text-align: left; font-size: 8px; letter-spacing: .04em; text-transform: uppercase; }
.data-table td { padding: 13px 14px; border-top: 1px solid #edf0f5; white-space: nowrap; }
.data-table td strong, .data-table td small { display: block; }
.data-table td small { margin-top: 3px; color: var(--ink-500); font-size: 8px; }
.badge, .channel-badge { display: inline-flex; align-items: center; min-height: 20px; padding: 0 7px; border-radius: 10px; font-size: 8px; font-weight: 800; }
.badge.success { color: #087354; background: var(--green-100); }
.badge.info { color: #2459b8; background: var(--blue-100); }
.channel-badge.store { color: #6542c2; background: var(--violet-100); }
.channel-badge.web { color: #12694f; background: var(--green-100); }
.quick-actions { padding: 8px; }
.quick-actions a { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 9px; transition: .15s; }
.quick-actions a:hover { background: #f6f8fc; }
.quick-actions a > div { flex: 1; }
.quick-actions strong, .quick-actions small { display: block; }
.quick-actions strong { font-size: 10px; }
.quick-actions small { margin-top: 3px; color: var(--ink-500); font-size: 8px; }
.quick-actions a > i { color: #a5afbd; font-size: 9px; }
.quick-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 9px; font-size: 11px; }
.quick-icon.primary { color: var(--blue-600); background: var(--blue-100); }
.quick-icon.green { color: var(--green-600); background: var(--green-100); }
.quick-icon.violet { color: var(--violet-600); background: var(--violet-100); }
.quick-icon.orange { color: var(--orange-600); background: var(--orange-100); }

/* Checkout */
.checkout-page { height: calc(100vh - var(--topbar-height)); padding: 15px; overflow: hidden; }
.checkout-toolbar { display: flex; gap: 11px; margin-bottom: 12px; }
.search-box { display: flex; align-items: center; flex: 1; min-height: 47px; padding: 0 14px; border: 1px solid #dce3ec; border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm); }
.search-box > i { color: var(--blue-600); }
.search-box input { flex: 1; height: 43px; border: 0; padding: 0 12px; outline: 0; color: var(--ink-900); font-size: 11px; }
.search-box kbd { padding: 3px 6px; border: 1px solid #dbe2eb; border-radius: 5px; color: var(--ink-500); background: #f6f8fb; font: 8px Inter, sans-serif; }
.checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 12px; height: calc(100% - 59px); }
.catalog-panel, .cart-panel { min-height: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.catalog-panel { display: flex; flex-direction: column; padding: 18px; }
.catalog-heading, .cart-heading { display: flex; align-items: center; justify-content: space-between; }
.catalog-heading h2, .cart-heading h2 { margin: 0; font-size: 16px; letter-spacing: -.025em; }
.catalog-heading > span { font-size: 9px; }
.category-pills { display: flex; gap: 6px; margin: 15px 0; overflow-x: auto; }
.category-pill { flex: 0 0 auto; min-height: 30px; padding: 0 12px; border: 1px solid #e1e6ed; border-radius: 17px; color: var(--ink-500); background: #fff; font-size: 9px; font-weight: 700; cursor: pointer; }
.category-pill.active { color: #fff; border-color: var(--blue-600); background: var(--blue-600); }
.product-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; overflow-y: auto; padding: 1px 3px 10px 1px; }
.product-card { position: relative; display: flex; flex-direction: column; min-height: 174px; overflow: hidden; border: 1px solid #e3e8ef; border-radius: 11px; background: #fff; cursor: pointer; transition: .18s ease; }
.product-card:hover { transform: translateY(-2px); border-color: #a9c2f3; box-shadow: 0 9px 22px rgba(29, 62, 111, .1); }
.product-image { display: grid; place-items: center; height: 83px; color: #fff; background: radial-gradient(circle at 70% 20%, rgba(255,255,255,.28), transparent 25%), linear-gradient(135deg, #233d65, #0e1c31); font-size: 22px; font-weight: 800; letter-spacing: -.08em; }
.product-body { padding: 10px; }
.product-body h3 { height: 28px; margin: 0; overflow: hidden; font-size: 10px; line-height: 1.4; }
.product-body small { display: block; margin: 4px 0 7px; color: var(--ink-500); font-size: 8px; }
.product-footer { display: flex; align-items: center; justify-content: space-between; }
.product-price { color: var(--ink-900); font-size: 10px; font-weight: 800; }
.stock-label { font-size: 7px; color: var(--green-600); }
.variant-label { position: absolute; top: 7px; right: 7px; padding: 3px 6px; border-radius: 8px; color: #fff; background: rgba(8,17,31,.74); font-size: 7px; font-weight: 700; }
.catalog-loading { grid-column: 1/-1; display: grid; place-items: center; min-height: 300px; color: var(--ink-500); font-size: 10px; }
.cart-panel { display: flex; flex-direction: column; overflow: hidden; }
.cart-heading { flex: 0 0 auto; padding: 16px 17px 12px; }
.cart-heading h2 span { display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; margin-left: 4px; border-radius: 10px; color: var(--blue-600); background: var(--blue-100); font-size: 8px; vertical-align: 2px; }
.customer-field { display: flex; align-items: center; min-height: 43px; margin: 0 16px 11px; border: 1px solid #e0e6ee; border-radius: 9px; overflow: hidden; }
.customer-field > span { display: grid; place-items: center; width: 40px; color: var(--ink-500); }
.customer-field input { flex: 1; min-width: 0; height: 40px; border: 0; outline: 0; font-size: 10px; }
.customer-field button { width: 37px; height: 40px; border: 0; color: var(--blue-600); background: var(--blue-100); cursor: pointer; }
.cart-lines { flex: 1; min-height: 120px; overflow-y: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.empty-cart { display: grid; place-items: center; align-content: center; height: 100%; padding: 30px; text-align: center; }
.empty-cart > span { display: grid; place-items: center; width: 55px; height: 55px; border-radius: 17px; color: #9cb0c7; background: #eef3f9; font-size: 18px; }
.empty-cart h3 { margin: 13px 0 4px; font-size: 12px; }
.empty-cart p { margin: 0; color: var(--ink-500); font-size: 9px; }
.cart-line { display: grid; grid-template-columns: 39px minmax(0, 1fr) auto; gap: 10px; padding: 11px 15px; border-bottom: 1px solid #edf0f4; }
.cart-thumb { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 9px; color: #fff; background: linear-gradient(135deg, #304f7b, #12243b); font-size: 9px; font-weight: 800; }
.cart-product { min-width: 0; }
.cart-product h4 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.cart-product p { margin: 3px 0 7px; color: var(--ink-500); font-size: 8px; }
.quantity-control { display: inline-flex; align-items: center; border: 1px solid #dfe5ec; border-radius: 7px; overflow: hidden; }
.quantity-control button { width: 25px; height: 23px; border: 0; color: var(--ink-700); background: #f7f9fc; cursor: pointer; }
.quantity-control span { min-width: 27px; text-align: center; font-size: 9px; font-weight: 700; }
.cart-line-total { text-align: right; }
.cart-line-total strong { display: block; font-size: 10px; white-space: nowrap; }
.cart-line-total button { margin-top: 13px; border: 0; color: #b4bdc9; background: transparent; cursor: pointer; }
.cart-summary { flex: 0 0 auto; padding: 12px 17px 8px; }
.cart-summary > div { display: flex; justify-content: space-between; margin: 7px 0; color: var(--ink-500); font-size: 9px; }
.cart-summary strong { color: var(--ink-700); }
.summary-action { border: 0; color: var(--blue-600); background: transparent; font-size: 9px; font-weight: 700; cursor: pointer; }
.cart-summary .cart-total { align-items: end; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #d9e0e9; color: var(--ink-900); font-size: 12px; font-weight: 700; }
.cart-summary .cart-total strong { color: var(--ink-900); font-size: 20px; letter-spacing: -.03em; }
.cart-actions { display: grid; grid-template-columns: 112px 1fr; gap: 8px; padding: 7px 16px 15px; }
.checkout-pay { justify-content: flex-start; }
.checkout-pay strong { margin-left: auto; }
.checkout-pay > i { margin-left: 2px; }

/* Modals */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(5, 14, 28, .57); backdrop-filter: blur(4px); }
.modal-card { position: relative; width: min(510px, 100%); max-height: 90vh; overflow-y: auto; padding: 27px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-lg); animation: modalIn .18s ease; }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.modal-card h2 { margin: 0; font-size: 20px; letter-spacing: -.035em; }
.modal-card > .muted { margin: 7px 0 20px; font-size: 10px; }
.modal-close { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #e2e7ee; border-radius: 9px; color: var(--ink-500); background: #fff; cursor: pointer; }
.variation-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.variation-option { padding: 13px; border: 1px solid #e0e6ee; border-radius: 10px; background: #fff; text-align: left; cursor: pointer; }
.variation-option:hover:not(:disabled) { border-color: var(--blue-600); background: #f7faff; }
.variation-option:disabled { opacity: .48; cursor: not-allowed; }
.variation-option strong, .variation-option small, .variation-option span { display: block; }
.variation-option strong { font-size: 10px; }
.variation-option small { margin: 4px 0 8px; color: var(--ink-500); font-size: 8px; }
.variation-option span { color: var(--blue-600); font-size: 10px; font-weight: 800; }
.payment-due { display: flex; align-items: center; justify-content: space-between; margin: 20px 0 15px; padding: 15px; border-radius: 11px; background: #f1f5fb; }
.payment-due span { color: var(--ink-500); font-size: 10px; }
.payment-due strong { font-size: 20px; }
.payment-methods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.payment-methods button { display: grid; place-items: center; gap: 7px; min-height: 78px; border: 1px solid #dfe5ed; border-radius: 10px; color: var(--ink-700); background: #fff; font-size: 9px; font-weight: 700; cursor: pointer; }
.payment-methods button i { font-size: 17px; color: var(--ink-500); }
.payment-methods button.selected { color: var(--blue-600); border-color: var(--blue-600); background: var(--blue-100); box-shadow: 0 0 0 2px rgba(36,107,253,.08); }
.payment-methods button.selected i { color: var(--blue-600); }
.cash-tender-panel { display: grid; gap: 9px; margin: 14px 0; padding: 14px; border: 1px solid #dce5f1; border-radius: 11px; background: #f7faff; }
.cash-tender-panel.hidden { display: none; }
.tendered-input-wrap { display: grid; grid-template-columns: 48px 1fr; align-items: center; overflow: hidden; border: 1px solid #dce3ed; border-radius: 9px; background: #fff; }
.tendered-input-wrap > span { color: var(--ink-500); text-align: center; font-size: 9px; font-weight: 800; }
.tendered-input-wrap .form-input { border: 0; border-left: 1px solid #e4e9f0; border-radius: 0; font-size: 15px; font-weight: 800; }
.quick-tender { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-tender button { padding: 7px 9px; border: 1px solid #dce3ed; border-radius: 7px; color: var(--blue-600); background: #fff; font-size: 8px; font-weight: 750; cursor: pointer; }
.quick-tender button:hover { border-color: var(--blue-600); background: var(--blue-100); }
.change-preview { display: flex; justify-content: space-between; align-items: center; padding-top: 9px; border-top: 1px dashed #cfd8e5; }
.change-preview span { color: var(--ink-500); font-size: 9px; }
.change-preview strong { color: var(--green-600); font-size: 15px; }
.held-sales-list { display: grid; gap: 8px; margin-top: 18px; }
.held-sale { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 13px; border: 1px solid #e0e6ed; border-radius: 10px; }
.held-sale strong, .held-sale small { display: block; }
.held-sale strong { font-size: 10px; }
.held-sale small { margin-top: 4px; color: var(--ink-500); font-size: 8px; }
.held-empty { padding: 35px; color: var(--ink-500); text-align: center; font-size: 10px; }
.success-modal-card { text-align: center; }
.success-check { display: grid; place-items: center; width: 55px; height: 55px; margin: 0 auto 18px; border-radius: 50%; color: #fff; background: var(--green-600); box-shadow: 0 0 0 9px var(--green-100); }
.success-total { display: block; margin: 18px 0; font-size: 26px; letter-spacing: -.04em; }
.success-modal-card { width: min(620px, 96vw); }
.success-change { display: flex; justify-content: space-between; align-items: center; margin: 0 0 16px; padding: 12px 14px; border-radius: 10px; color: #0f6646; background: var(--green-100); }
.success-change span { font-size: 9px; }
.success-change strong { font-size: 15px; }
.success-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

/* Placeholder and toast */
.placeholder-page { display: grid; place-items: center; min-height: calc(100vh - var(--topbar-height)); }
.placeholder-card { width: min(520px, 100%); padding: 45px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); text-align: center; }
.placeholder-icon { display: grid; place-items: center; width: 59px; height: 59px; margin: 0 auto 20px; border-radius: 17px; color: var(--blue-600); background: var(--blue-100); font-size: 19px; }
.placeholder-card h2 { margin: 8px 0; font-size: 24px; }
.placeholder-card > p:not(.eyebrow) { color: var(--ink-500); font-size: 11px; line-height: 1.7; }
.placeholder-card small { color: var(--ink-500); font-size: 9px; }
.placeholder-progress { height: 5px; margin: 25px 0 15px; overflow: hidden; border-radius: 4px; background: #e9eef4; }
.placeholder-progress span { display: block; width: 24%; height: 100%; border-radius: inherit; background: var(--blue-600); }
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 8px; width: min(350px, calc(100vw - 36px)); }
.toast { display: flex; align-items: flex-start; gap: 11px; padding: 13px 15px; border: 1px solid #e0e6ee; border-radius: 11px; background: #fff; box-shadow: var(--shadow-lg); animation: toastIn .2s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateX(12px); } }
.toast i { margin-top: 2px; }
.toast.success i { color: var(--green-600); }
.toast.error i { color: var(--red-600); }
.toast strong, .toast small { display: block; }
.toast strong { font-size: 10px; }
.toast small { margin-top: 3px; color: var(--ink-500); font-size: 8px; line-height: 1.5; }
.sidebar-overlay { display: none; }

/* Products & variations */
.module-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.module-header h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.04em; }
.module-header > div > p:last-child { margin: 0; color: var(--ink-500); font-size: 11px; }
.catalog-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 17px; }
.catalog-metrics article { display: flex; align-items: center; gap: 12px; min-height: 82px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.catalog-metrics small, .catalog-metrics strong { display: block; }
.catalog-metrics small { margin-bottom: 5px; color: var(--ink-500); font-size: 8px; font-weight: 600; }
.catalog-metrics strong { font-size: 19px; letter-spacing: -.035em; }
.products-toolbar { display: flex; align-items: center; gap: 9px; padding: 14px; border-bottom: 1px solid var(--line); }
.table-search { display: flex; align-items: center; flex: 1; max-width: 470px; min-height: 39px; padding: 0 12px; border: 1px solid #dfe5ed; border-radius: 9px; background: #fff; }
.table-search i { color: #8d9aab; font-size: 10px; }
.table-search input { flex: 1; height: 36px; min-width: 0; padding: 0 10px; border: 0; outline: 0; font-size: 10px; }
.filter-select { min-width: 145px; height: 39px; padding: 0 30px 0 11px; border: 1px solid #dfe5ed; border-radius: 9px; color: var(--ink-700); background: #fff; font-size: 9px; outline: 0; }
.product-table td { vertical-align: middle; }
.product-cell { display: flex; align-items: center; gap: 10px; min-width: 205px; }
.product-cell-image { display: grid; place-items: center; flex: 0 0 auto; width: 39px; height: 39px; border-radius: 9px; color: #fff; background: linear-gradient(135deg, #304f7b, #12243b); font-size: 9px; font-weight: 800; }
.product-cell strong, .product-cell small { display: block; }
.product-cell strong { font-size: 10px; }
.product-cell small { margin-top: 4px; color: var(--ink-500); font-size: 8px; }
.badge.neutral { color: var(--ink-700); background: #edf1f6; }
.badge.warning { color: #9a5c00; background: var(--orange-100); }
.badge.danger { color: #a52c39; background: var(--red-100); }
.variation-chips { display: flex; flex-wrap: wrap; gap: 4px; min-width: 150px; }
.variation-chip, .variation-more { display: inline-flex; align-items: center; min-height: 20px; padding: 0 6px; border-radius: 5px; color: #53637a; background: #edf1f6; font-size: 7px; font-weight: 700; }
.variation-more { color: var(--blue-600); background: var(--blue-100); }
.stock-value { display: block; font-size: 12px; }
.stock-value.low { color: var(--orange-600); }
.stock-caption { display: block; margin-top: 2px; color: var(--ink-500); font-size: 7px; }
.table-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line); color: var(--ink-500); font-size: 8px; }
.table-pagination { display: flex; align-items: center; gap: 8px; }
.pagination-button { display: grid; place-items: center; width: 27px; height: 27px; padding: 0; border: 1px solid #dfe5ed; border-radius: 7px; color: var(--ink-700); background: #fff; cursor: pointer; }
.pagination-button:disabled { opacity: .4; cursor: not-allowed; }
.table-actions { display: flex; align-items: center; gap: 5px; }
.row-action { display: grid; place-items: center; width: 29px; height: 29px; padding: 0; border: 1px solid #dfe5ed; border-radius: 7px; background: #fff; cursor: pointer; }
.row-action.view { color: var(--green-600); }
.row-action.edit { color: var(--blue-600); }
.row-action.delete { color: var(--red-600); }
.row-action:hover { background: #f4f7fb; }
.product-table th:last-child { position: sticky; right: 0; z-index: 3; min-width: 112px; background: #f8fafc; box-shadow: -8px 0 14px rgba(20, 42, 76, .06); }
.product-table td:last-child { position: sticky; right: 0; z-index: 2; min-width: 112px; background: #fff; box-shadow: -8px 0 14px rgba(20, 42, 76, .06); }
.table-loading { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 170px; color: var(--ink-500); font-size: 9px; }
.table-loading span { width: 18px; height: 18px; border: 2px solid #dce4ef; border-top-color: var(--blue-600); border-radius: 50%; animation: spin .8s linear infinite; }
.table-empty { display: grid; place-items: center; min-height: 190px; color: var(--ink-500); text-align: center; }
.table-empty i { margin-bottom: 10px; color: #9eacbe; font-size: 25px; }
.table-empty strong { color: var(--ink-700); font-size: 11px; }
.table-empty span { margin-top: 5px; font-size: 8px; }
.product-modal-card { width: min(940px, 96vw); }
.product-view-modal-card { width: min(880px, 96vw); padding: 0; overflow: hidden; }
.product-view-modal-card > .eyebrow { margin: 25px 28px 5px; }
.product-view-modal-card > h2 { margin: 0 28px 18px; font-size: 25px; }
.product-profile-hero { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: center; gap: 15px; margin: 0 28px 15px; padding: 18px; overflow: hidden; border-radius: 14px; color: #fff; background: radial-gradient(circle at 85% -60%, rgba(93, 151, 255, .82), transparent 48%), linear-gradient(120deg, #0b1d35, #153e76); }
.product-profile-image { display: grid; place-items: center; width: 62px; height: 62px; border: 1px solid rgba(255,255,255,.18); border-radius: 16px; color: #fff; background: rgba(255,255,255,.1); font-size: 17px; font-weight: 800; }
.product-profile-sku { display: inline-flex; padding: 4px 8px; border-radius: 6px; color: #bcd2f3; background: rgba(255,255,255,.08); font-size: 9px; font-weight: 800; letter-spacing: .05em; }
.product-profile-copy p { margin: 8px 0 0; color: #d1deef; font-size: 10px; }
.product-profile-badges { display: grid; justify-items: end; gap: 7px; }
.profile-woo-badge { font-size: 8px; color: #d6e3f5; }
.product-profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 28px 20px; }
.product-profile-stats article { display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.profile-stat-icon { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px; }
.profile-stat-icon.stock { color: var(--green-600); background: var(--green-100); }
.profile-stat-icon.price { color: var(--blue-600); background: var(--blue-100); }
.profile-stat-icon.options { color: var(--violet-600); background: var(--violet-100); }
.product-profile-stats small, .product-profile-stats strong { display: block; }
.product-profile-stats small { margin-bottom: 4px; color: var(--ink-500); font-size: 7px; }
.product-profile-stats strong { font-size: 11px; }
.product-profile-section { padding: 18px 28px 28px; border-top: 1px solid var(--line); background: #f7f9fc; }
.profile-section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 12px; }
.profile-section-heading .eyebrow { margin-bottom: 5px; }
.profile-section-heading h3 { margin: 0; font-size: 14px; }
.profile-section-heading > span { color: var(--ink-500); font-size: 8px; }
.product-variation-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.product-variation-detail-card { padding: 13px; border: 1px solid #dfe5ed; border-radius: 11px; background: #fff; }
.variation-detail-heading { display: flex; align-items: center; justify-content: space-between; }
.variation-detail-heading strong { font-size: 10px; }
.variation-detail-heading .status-dot:not(.online) { background: #c8d0db; }
.product-variation-detail-card > p { min-height: 26px; margin: 7px 0 10px; color: var(--ink-500); font-size: 8px; line-height: 1.55; }
.variation-detail-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 9px; border-top: 1px solid #edf0f4; }
.variation-detail-footer small, .variation-detail-footer strong { display: block; }
.variation-detail-footer small { margin-bottom: 3px; color: var(--ink-500); font-size: 7px; }
.variation-detail-footer strong { font-size: 9px; }
.variation-detail-footer .low { color: var(--orange-600); }
.profile-empty-state { grid-column: 1/-1; padding: 25px; color: var(--ink-500); text-align: center; font-size: 9px; }
.delete-confirm-card { width: min(430px, 96vw); padding: 32px; text-align: center; }
.delete-confirm-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 19px; border-radius: 17px; color: var(--red-600); background: var(--red-100); font-size: 19px; box-shadow: 0 0 0 8px rgba(220, 53, 69, .05); }
.delete-confirm-card > .muted { margin: 8px auto 18px; max-width: 330px; line-height: 1.6; }
.delete-confirm-note { display: flex; align-items: flex-start; gap: 9px; padding: 12px; border-radius: 9px; color: #6f541d; background: #fff7e8; text-align: left; font-size: 8px; line-height: 1.5; }
.delete-confirm-note i { margin-top: 2px; color: var(--orange-600); }
.delete-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 22px; }
.form-grid { display: grid; gap: 10px 14px; }
.form-grid.two-columns { grid-template-columns: repeat(2, 1fr); }
.variation-builder-heading { display: flex; align-items: center; justify-content: space-between; margin: 25px 0 9px; padding-top: 20px; border-top: 1px solid var(--line); }
.variation-builder-heading h3 { margin: 0; font-size: 14px; }
.variation-builder { display: grid; gap: 8px; }
.variation-builder-row { display: grid; grid-template-columns: 1.05fr 1.5fr .85fr .7fr .7fr 31px; gap: 8px; align-items: end; padding: 10px; border: 1px solid #e0e6ed; border-radius: 10px; background: #f9fbfd; }
.variation-builder-row label { display: block; margin: 0 0 5px; color: var(--ink-500); font-size: 7px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.variation-builder-row .form-input { height: 39px; font-size: 9px; }
.remove-variation { display: grid; place-items: center; width: 31px; height: 39px; border: 0; border-radius: 8px; color: var(--red-600); background: var(--red-100); cursor: pointer; }
.field-help { margin: 8px 0 0; color: var(--ink-500); font-size: 8px; }
.modal-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.field-with-action { display: grid; grid-template-columns: 1fr 42px; gap: 7px; }
.field-action-button { display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--blue-600); background: var(--blue-100); cursor: pointer; }
.field-action-button:hover { color: #fff; background: var(--blue-600); }
.product-rule-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 24px 22px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.product-rule-strip span { display: grid; gap: 3px; padding: 5px 10px; border-right: 1px solid var(--line); }
.product-rule-strip span:last-child { border-right: 0; }
.product-rule-strip small { color: var(--ink-500); font-size: 7px; text-transform: uppercase; letter-spacing: .04em; }
.product-rule-strip strong { color: var(--ink-900); font-size: 10px; }
.category-manager-card { width: min(650px, 96vw); max-height: 82vh; overflow: auto; }
.category-create-form { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; margin: 20px 0 14px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.category-maintenance-list { display: grid; gap: 7px; }
.category-maintenance-item { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f9fbfd; }
.category-maintenance-item > div:first-child { display: grid; gap: 3px; }
.category-maintenance-item small { color: var(--ink-500); font-size: 8px; }
.catalog-discount-badge { display: inline-flex; width: max-content; margin-top: 8px; padding: 3px 7px; border-radius: 999px; color: #0f7b51; background: #dff8ec; font-size: 7px; font-weight: 800; }
.line-discount-label { display: inline-block; margin: 4px 0 2px; color: #0f7b51; font-size: 7px; font-weight: 700; }
.line-tax-label { display: inline-block; margin: 1px 0 3px; color: #5c6f8a; font-size: 7px; font-weight: 700; }

@media (max-width: 1100px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .catalog-metrics { grid-template-columns: repeat(2, 1fr); }
    .checkout-layout { grid-template-columns: minmax(0, 1fr) 345px; }
    .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .business-date { display: none; }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close, .menu-button { display: inline-grid; }
    .sidebar-overlay { position: fixed; inset: 0; z-index: 25; background: rgba(5,14,28,.5); }
    .sidebar-overlay.visible { display: block; }
    .workspace { margin-left: 0; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .checkout-page { height: auto; overflow: visible; }
    .checkout-layout { grid-template-columns: 1fr; height: auto; }
    .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .catalog-panel { min-height: 520px; }
    .cart-panel { min-height: 600px; }
    .products-toolbar { flex-wrap: wrap; }
    .table-search { max-width: none; flex-basis: 100%; }
    .variation-builder-row { grid-template-columns: repeat(2, 1fr); }
    .remove-variation { width: 100%; }
    .login-shell { grid-template-columns: 1fr; }
    .login-brand-panel { display: none; }
    .mobile-brand { display: flex; }
}

@media (max-width: 600px) {
    .topbar { padding: 0 13px; }
    .page-icon, .user-menu > div, .topbar-actions form { display: none; }
    .user-menu { min-width: auto; }
    .notification-button { display: none; }
    .page-content { padding: 13px; }
    .hero-panel { display: block; padding: 24px; }
    .hero-panel .button { margin-top: 20px; }
    .metric-grid { grid-template-columns: 1fr; }
    .catalog-metrics { grid-template-columns: 1fr; }
    .module-header { display: block; }
    .module-header .button { margin-top: 15px; }
    .filter-select { flex: 1; min-width: 0; }
    .form-grid.two-columns, .variation-builder-row { grid-template-columns: 1fr; }
    .checkout-page { padding: 9px; }
    .checkout-toolbar { align-items: stretch; }
    .checkout-toolbar > .button { width: 45px; padding: 0; font-size: 0; }
    .checkout-toolbar > .button .button-count { font-size: 8px; }
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cart-actions { grid-template-columns: 90px 1fr; }
    .payment-methods { grid-template-columns: repeat(2, 1fr); }
    .variation-options { grid-template-columns: 1fr; }
    .login-form-panel { padding: 32px 22px; }
    .success-actions { grid-template-columns: 1fr; }
    .product-profile-hero { grid-template-columns: 52px 1fr; margin-inline: 16px; }
    .product-profile-image { width: 52px; height: 52px; }
    .product-profile-badges { grid-column: 1/-1; grid-template-columns: auto auto; justify-content: start; justify-items: start; }
    .product-profile-stats { grid-template-columns: 1fr; margin-inline: 16px; }
    .product-profile-section { padding-inline: 16px; }
    .product-variation-card-grid { grid-template-columns: 1fr; }
    .product-rule-strip { grid-template-columns: repeat(2, 1fr); margin-inline: 16px; }
    .product-rule-strip span:nth-child(2) { border-right: 0; }
    .category-create-form { grid-template-columns: 1fr; }
    .category-maintenance-item { grid-template-columns: 1fr auto; }
    .category-maintenance-item .table-actions { grid-column: 1/-1; justify-content: flex-end; }
    .delete-confirm-actions { grid-template-columns: 1fr; }
}

/* Business settings */
.settings-page { max-width: 1240px; margin: 0 auto; }
.settings-module-header { align-items: center; }
.settings-header-actions { display: flex; align-items: center; gap: 12px; }
.settings-save-state { display: inline-flex; align-items: center; gap: 7px; color: #13845b; font-size: 9px; font-weight: 700; }
.settings-save-state.dirty { color: #b66b00; }
.settings-save-state i { font-size: 8px; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 18px; }
.settings-card-column { display: grid; gap: 14px; }
.settings-card { padding: 22px; }
.settings-card-heading { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: start; gap: 14px; }
.settings-card-heading h3, .settings-summary-heading h3 { margin: 3px 0 5px; color: var(--ink-900); font-size: 15px; }
.settings-card-heading p:last-child { max-width: 580px; margin: 0; color: var(--ink-500); font-size: 9px; line-height: 1.55; }
.settings-card-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 12px; font-size: 15px; }
.settings-card-icon.tax { color: #2165e8; background: #e7efff; }
.settings-card-icon.discount { color: #7b4bdd; background: #f0eafe; }
.settings-card-icon.manual { color: #087b61; background: #def7ed; }
.settings-switch { position: relative; display: inline-block; width: 42px; height: 24px; cursor: pointer; }
.settings-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.settings-switch span { position: absolute; inset: 0; border-radius: 999px; background: #cbd5e1; transition: .18s ease; }
.settings-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(15, 23, 42, .22); transition: .18s ease; }
.settings-switch input:checked + span { background: var(--blue-600); }
.settings-switch input:checked + span::after { transform: translateX(18px); }
.settings-switch input:focus-visible + span { outline: 3px solid rgba(37, 99, 235, .2); }
.settings-fields { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); align-items: center; gap: 22px; margin: 20px 0 0 58px; padding-top: 18px; border-top: 1px solid var(--line); }
.settings-fields > div > small { display: block; margin-top: 7px; color: var(--ink-500); font-size: 8px; line-height: 1.45; }
.settings-rate-input { position: relative; }
.settings-rate-input .form-input { padding-right: 40px; font-weight: 700; }
.settings-rate-input > span { position: absolute; top: 50%; right: 14px; color: var(--ink-500); font-size: 10px; font-weight: 800; transform: translateY(-50%); }
.settings-rate-input input:disabled { color: #94a3b8; background: #f4f7fa; }
.settings-option-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #f8fafc; cursor: pointer; }
.settings-option-row > span:nth-child(2) { display: grid; gap: 3px; }
.settings-option-row strong { color: var(--ink-800); font-size: 9px; }
.settings-option-row small { color: var(--ink-500); font-size: 8px; line-height: 1.35; }
.settings-option-row input { width: 17px; height: 17px; accent-color: var(--blue-600); }
.settings-option-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; color: var(--blue-600); background: #e8f0ff; }
.settings-summary-card { position: sticky; top: 92px; overflow: hidden; }
.settings-summary-heading { display: flex; align-items: center; gap: 11px; padding: 19px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #f7faff, #fff); }
.settings-summary-heading > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--blue-500), var(--blue-700)); box-shadow: 0 7px 18px rgba(37, 99, 235, .22); }
.settings-summary-heading h3 { margin-bottom: 0; }
.settings-policy-list { display: grid; padding: 5px 19px; }
.settings-policy-list article { display: grid; grid-template-columns: 10px 1fr; gap: 11px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.settings-policy-list article:last-child { border-bottom: 0; }
.policy-dot { width: 8px; height: 8px; margin-top: 3px; border-radius: 50%; }
.policy-dot.tax { background: #2f6feb; box-shadow: 0 0 0 4px #e6eeff; }
.policy-dot.discount { background: #8b5de3; box-shadow: 0 0 0 4px #f0e9ff; }
.policy-dot.manual { background: #0c9b74; box-shadow: 0 0 0 4px #def7ed; }
.settings-policy-list article div { display: grid; gap: 3px; }
.settings-policy-list small { color: var(--ink-500); font-size: 7px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.settings-policy-list strong { color: var(--ink-900); font-size: 11px; }
.settings-policy-list p { margin: 0; color: var(--ink-500); font-size: 8px; line-height: 1.45; }
.settings-priority-note { display: grid; grid-template-columns: 28px 1fr; gap: 10px; margin: 8px 19px 18px; padding: 13px; border: 1px solid #d7e4fb; border-radius: 11px; color: #16489b; background: #f1f6ff; }
.settings-priority-note > i { margin-top: 2px; }
.settings-priority-note div { display: grid; gap: 4px; }
.settings-priority-note strong { font-size: 9px; }
.settings-priority-note p { margin: 0; color: #5e769b; font-size: 8px; line-height: 1.5; }
.settings-audit { display: grid; gap: 3px; padding: 16px 19px; border-top: 1px solid var(--line); background: #f9fbfd; }
.settings-audit small { color: var(--ink-500); font-size: 7px; font-weight: 700; text-transform: uppercase; }
.settings-audit strong { color: var(--ink-800); font-size: 9px; }
.settings-audit span { color: var(--ink-500); font-size: 8px; }

@media (max-width: 1050px) {
    .settings-layout { grid-template-columns: 1fr; }
    .settings-summary-card { position: static; }
}

@media (max-width: 680px) {
    .settings-header-actions { align-items: stretch; flex-direction: column; margin-top: 14px; }
    .settings-save-state { order: 2; }
    .settings-card { padding: 16px; }
    .settings-card-heading { grid-template-columns: 40px minmax(0, 1fr) auto; }
    .settings-card-icon { width: 40px; height: 40px; }
    .settings-fields { grid-template-columns: 1fr; margin-left: 0; }
}

/* Customers and loyalty */
.customers-page { display: grid; align-content: start; width: 100%; max-width: none; min-width: 0; margin: 0; overflow-x: hidden; }
.customer-page-header { min-width: 0; }
.customer-page-header > div { min-width: 0; }
.customer-directory-panel { display: flex; min-width: 0; flex-direction: column; overflow: hidden; }
.customer-toolbar { flex-wrap: nowrap; min-width: 0; }
.customer-toolbar .table-search { max-width: none; min-width: 260px; }
.customer-result-count { margin-left: auto; color: var(--ink-500); font-size: 9px; font-weight: 700; }
.customer-directory-table-wrap { width: 100%; max-width: 100%; min-width: 0; overflow: auto; scrollbar-gutter: stable; }
.customer-table { min-width: 890px; }
.customer-table th, .customer-table td { vertical-align: middle; }
.customer-table th:last-child { position: sticky; right: 0; z-index: 3; min-width: 155px; background: #f8fafc; box-shadow: -8px 0 14px rgba(20, 42, 76, .06); }
.customer-table td:last-child { position: sticky; right: 0; z-index: 2; min-width: 155px; background: #fff; box-shadow: -8px 0 14px rgba(20, 42, 76, .06); }
.customer-identity { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.customer-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 11px; color: #fff; background: linear-gradient(135deg, #246bfd, #164ebc); font-size: 10px; font-weight: 800; box-shadow: 0 6px 14px rgba(36, 107, 253, .2); }
.customer-contact { min-width: 180px; }
.customer-points strong { color: #8a5a08; font-size: 11px; }
.customer-points small { max-width: 145px; overflow: hidden; text-overflow: ellipsis; }
.row-action.loyalty { color: #9b6a08; background: #fffaf0; }
.row-action.activate { color: var(--green-600); background: var(--green-100); }
.customer-form-card { width: min(720px, 96vw); }
.customer-field-wide { grid-column: 1 / -1; }
.customer-policy-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.customer-toggle-card { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #f8fafc; cursor: pointer; }
.customer-toggle-card > span:nth-child(2) { display: grid; gap: 4px; }
.customer-toggle-card strong { color: var(--ink-800); font-size: 9px; }
.customer-toggle-card small { color: var(--ink-500); font-size: 8px; line-height: 1.4; }
.customer-toggle-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; }
.customer-toggle-icon.loyalty { color: #9b6800; background: #fff3cf; }
.customer-toggle-icon.active { color: var(--green-600); background: var(--green-100); }
.customer-view-card { width: min(720px, 96vw); padding: 0; overflow: hidden; }
.customer-view-card > .modal-close { z-index: 2; color: #fff; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.1); }
.customer-profile-hero { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 15px; padding: 28px; color: #fff; background: radial-gradient(circle at 88% -40%, rgba(91, 154, 255, .9), transparent 47%), linear-gradient(125deg, #0a1c34, #174d8f); }
.customer-profile-avatar { display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid rgba(255,255,255,.2); border-radius: 18px; color: #fff; background: rgba(255,255,255,.12); font-size: 18px; font-weight: 800; }
.customer-profile-hero .eyebrow { color: #8db7ff; }
.customer-profile-hero h2 { margin: 3px 0 6px; color: #fff; font-size: 22px; }
.customer-profile-hero div > span { color: #c9d8ed; font-size: 9px; font-weight: 700; }
.customer-profile-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 20px 28px 14px; }
.customer-profile-metrics article { display: flex; align-items: center; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.customer-profile-metrics .profile-stat-icon.points { color: #996500; background: #fff3cf; }
.customer-profile-metrics .profile-stat-icon.discount { color: var(--blue-600); background: var(--blue-100); }
.customer-profile-metrics .profile-stat-icon.member { color: var(--violet-600); background: var(--violet-100); }
.customer-profile-metrics small, .customer-profile-metrics strong { display: block; }
.customer-profile-metrics small { margin-bottom: 3px; color: var(--ink-500); font-size: 7px; }
.customer-profile-metrics strong { color: var(--ink-900); font-size: 10px; }
.customer-profile-details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 0 28px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--line); }
.customer-profile-details div { display: grid; gap: 4px; padding: 13px; background: #f9fbfd; }
.customer-profile-details small { color: var(--ink-500); font-size: 7px; text-transform: uppercase; letter-spacing: .04em; }
.customer-profile-details strong { color: var(--ink-800); font-size: 9px; overflow-wrap: anywhere; }
.customer-view-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 20px 28px 26px; }
.customer-ledger-card { width: min(1040px, 97vw); padding: 0; overflow: hidden; }
.customer-ledger-header { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto auto; align-items: center; gap: 13px; padding: 22px 26px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #fffdf7, #fff); }
.customer-ledger-header h2 { margin: 3px 0; font-size: 18px; }
.customer-ledger-header div > span { color: var(--ink-500); font-size: 8px; }
.ledger-balance { display: grid; justify-items: end; gap: 3px; padding-right: 15px; border-right: 1px solid var(--line); }
.ledger-balance small { color: var(--ink-500); font-size: 7px; text-transform: uppercase; }
.ledger-balance strong { color: #8a5a08; font-size: 15px; }
.customer-ledger-table-wrap { max-height: 55vh; overflow: auto; }
.customer-ledger-table td { vertical-align: top; }
.customer-ledger-table td:nth-child(2) { min-width: 220px; white-space: normal; }
.customer-ledger-table td:nth-child(3) { max-width: 210px; }
.customer-ledger-table td:nth-child(3) small { overflow: hidden; text-overflow: ellipsis; }
.points-delta { font-size: 11px; }
.points-delta.positive { color: var(--green-600); }
.points-delta.negative { color: var(--red-600); }
.loyalty-adjustment-card { width: min(520px, 96vw); }
.customer-textarea { min-height: 100px; padding: 13px 14px; resize: vertical; line-height: 1.5; }

@media (max-width: 850px) {
    .customer-toolbar { flex-wrap: wrap; }
    .customer-toolbar .table-search { flex-basis: 100%; min-width: 0; }
    .customer-policy-options { grid-template-columns: 1fr; }
    .customer-ledger-header { grid-template-columns: 42px 1fr; }
    .customer-ledger-header .ledger-balance { align-items: start; justify-items: start; padding: 0; border: 0; }
    .customer-ledger-header .button { justify-self: end; }
}

@media (max-width: 600px) {
    .customers-page { padding: 14px 12px; }
    .customer-page-header { display: flex; align-items: flex-start; }
    .customer-page-header .button { flex: 0 0 auto; margin-top: 0; padding-inline: 12px; font-size: 0; }
    .customer-page-header .button i { margin-right: 0; font-size: 11px; }
    .customer-toolbar .filter-select { width: 100%; flex: 1 1 100%; }
    .customer-result-count { width: 100%; margin-left: 0; }
    .customer-profile-hero { grid-template-columns: 52px 1fr; padding: 22px 18px; }
    .customer-profile-avatar { width: 52px; height: 52px; border-radius: 14px; font-size: 14px; }
    .customer-profile-hero > .badge { grid-column: 1 / -1; width: max-content; }
    .customer-profile-metrics { grid-template-columns: 1fr; padding-inline: 18px; }
    .customer-profile-details { grid-template-columns: 1fr; margin-inline: 18px; }
    .customer-view-actions { flex-direction: column; padding-inline: 18px; }
    .customer-ledger-header { padding: 18px; }
    .customer-ledger-header .button { grid-column: 1 / -1; width: 100%; }
}

/* Customer profile and loyalty modal polish */
#customerViewModal,
#loyaltyLedgerModal {
    padding: 28px;
}

.customer-view-card {
    width: min(900px, calc(100vw - 56px));
    max-height: min(92vh, 820px);
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 22px;
    box-shadow: 0 28px 80px rgba(5, 19, 42, .34);
}

.customer-view-card > .modal-close {
    top: 20px;
    right: 20px;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    transition: transform .16s ease, background .16s ease;
}

.customer-view-card > .modal-close:hover {
    background: rgba(255, 255, 255, .2);
    transform: translateY(-1px);
}

.customer-profile-hero {
    grid-template-columns: 78px minmax(0, 1fr) auto;
    gap: 20px;
    min-height: 176px;
    padding: 34px 78px 34px 34px;
    background:
        radial-gradient(circle at 88% -30%, rgba(89, 153, 255, .95), transparent 48%),
        linear-gradient(125deg, #081a31 0%, #123866 55%, #18569a 100%);
}

.customer-profile-avatar {
    width: 78px;
    height: 78px;
    border-radius: 22px;
    font-size: 21px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 14px 30px rgba(2, 11, 28, .22);
}

.customer-profile-hero h2 {
    margin: 5px 0 8px;
    font-size: clamp(23px, 2.4vw, 30px);
    line-height: 1.1;
}

.customer-profile-hero div > span {
    display: inline-flex;
    padding: 5px 9px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 7px;
    color: #d7e5f7;
    background: rgba(255,255,255,.07);
    font-size: 10px;
    letter-spacing: .05em;
}

.customer-profile-hero > .badge {
    align-self: end;
    min-width: 76px;
    justify-content: center;
    padding: 7px 11px;
}

.customer-profile-metrics {
    gap: 14px;
    padding: 24px 34px 18px;
}

.customer-profile-metrics article {
    min-height: 82px;
    gap: 13px;
    padding: 16px;
    border-radius: 14px;
    box-shadow: 0 7px 20px rgba(29, 50, 80, .055);
}

.customer-profile-metrics .profile-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 14px;
}

.customer-profile-metrics small {
    margin-bottom: 6px;
    font-size: 9px;
}

.customer-profile-metrics strong {
    font-size: 13px;
}

.customer-profile-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin: 8px 34px 12px;
}

.customer-profile-section-heading .eyebrow {
    margin-bottom: 5px;
}

.customer-profile-section-heading h3 {
    margin: 0;
    color: var(--ink-900);
    font-size: 15px;
}

.customer-profile-section-heading > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-500);
    font-size: 9px;
    font-weight: 700;
}

.customer-profile-details {
    gap: 12px;
    margin: 0 34px;
    overflow: visible;
    border: 0;
    background: transparent;
}

.customer-profile-details .customer-detail-item {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 68px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #f8fafc;
}

.customer-profile-details .customer-detail-item > div {
    display: grid;
    gap: 5px;
    padding: 0;
    background: transparent;
}

.customer-detail-icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    color: #245fca;
    background: #e8f0ff;
}

.customer-profile-details small {
    font-size: 8px;
    font-weight: 800;
}

.customer-profile-details strong {
    font-size: 11px;
    line-height: 1.35;
}

.customer-view-actions {
    gap: 10px;
    padding: 24px 34px 30px;
}

.customer-view-actions .button {
    min-height: 43px;
    padding-inline: 18px;
}

.customer-ledger-card {
    display: flex;
    flex-direction: column;
    width: min(1180px, calc(100vw - 56px));
    height: min(84vh, 760px);
    max-height: 760px;
    border: 1px solid rgba(255,255,255,.75);
    border-radius: 22px;
    box-shadow: 0 28px 80px rgba(5, 19, 42, .34);
}

.customer-ledger-card > .modal-close {
    top: 19px;
    right: 19px;
    z-index: 3;
    width: 38px;
    height: 38px;
    border-radius: 11px;
}

.customer-ledger-header {
    grid-template-columns: 54px minmax(0, 1fr) auto auto;
    gap: 16px;
    min-height: 118px;
    padding: 25px 78px 25px 30px;
    background: linear-gradient(135deg, #fffcf1 0%, #fff 58%, #f5f8ff 100%);
}

.customer-ledger-header .customer-toggle-icon {
    width: 54px;
    height: 54px;
    border-radius: 15px;
    font-size: 17px;
    box-shadow: 0 8px 18px rgba(155, 104, 0, .12);
}

.customer-ledger-header h2 {
    margin: 4px 0 5px;
    font-size: 23px;
}

.customer-ledger-header div > span {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .04em;
}

.ledger-balance {
    min-width: 145px;
    gap: 5px;
    padding: 8px 22px 8px 0;
}

.ledger-balance small {
    font-size: 8px;
}

.ledger-balance strong {
    font-size: 18px;
}

.customer-ledger-header .button {
    min-height: 42px;
    padding-inline: 17px;
}

.customer-ledger-table-wrap {
    flex: 1 1 auto;
    max-height: none;
    overflow: auto;
    background: #fff;
}

.customer-ledger-table {
    min-width: 920px;
}

.customer-ledger-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding-block: 15px;
    background: #f5f8fc;
    box-shadow: 0 1px 0 var(--line);
}

.customer-ledger-table td {
    padding-block: 15px;
}

.customer-ledger-card > .table-footer {
    flex: 0 0 auto;
    min-height: 62px;
    padding-inline: 28px;
    background: #fbfcfe;
}

@media (max-width: 850px) {
    #customerViewModal,
    #loyaltyLedgerModal {
        padding: 18px;
    }

    .customer-view-card,
    .customer-ledger-card {
        width: calc(100vw - 36px);
    }

    .customer-profile-hero {
        grid-template-columns: 64px minmax(0, 1fr);
        min-height: 0;
        padding: 28px 68px 28px 26px;
    }

    .customer-profile-avatar {
        width: 64px;
        height: 64px;
        border-radius: 18px;
        font-size: 17px;
    }

    .customer-profile-hero > .badge {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .customer-profile-metrics {
        grid-template-columns: 1fr;
        padding-inline: 24px;
    }

    .customer-profile-section-heading,
    .customer-profile-details {
        margin-inline: 24px;
    }

    .customer-view-actions {
        padding-inline: 24px;
    }

    .customer-ledger-card {
        height: min(90vh, 760px);
        max-height: 90vh;
    }

    .customer-ledger-header {
        grid-template-columns: 48px minmax(0, 1fr);
        padding: 23px 68px 23px 22px;
    }

    .customer-ledger-header .customer-toggle-icon {
        width: 48px;
        height: 48px;
    }

    .customer-ledger-header .ledger-balance {
        grid-column: 2;
        justify-items: start;
    }

    .customer-ledger-header .button {
        grid-column: 1 / -1;
        justify-self: stretch;
    }
}

@media (max-width: 560px) {
    #customerViewModal,
    #loyaltyLedgerModal {
        align-items: end;
        padding: 0;
    }

    .customer-view-card,
    .customer-ledger-card {
        width: 100vw;
        max-height: 94vh;
        border-radius: 22px 22px 0 0;
    }

    .customer-ledger-card {
        height: 94vh;
    }

    .customer-profile-hero {
        padding-inline: 20px 64px;
    }

    .customer-profile-hero h2 {
        font-size: 21px;
    }

    .customer-profile-metrics,
    .customer-view-actions {
        padding-inline: 18px;
    }

    .customer-profile-section-heading,
    .customer-profile-details {
        margin-inline: 18px;
    }

    .customer-profile-section-heading > span {
        display: none;
    }

    .customer-profile-details {
        grid-template-columns: 1fr;
    }

    .customer-view-actions {
        flex-direction: column;
    }

    .customer-view-actions .button {
        width: 100%;
    }

    .customer-ledger-header h2 {
        font-size: 19px;
    }
}

/* Keep customer dialogs inside the application workspace on desktop. */
@media (min-width: 901px) {
    #customerFormModal,
    #customerViewModal,
    #customerDeactivateModal,
    #loyaltyLedgerModal,
    #loyaltyAdjustmentModal {
        top: var(--topbar-height);
        left: var(--sidebar-width);
    }

    .customer-form-card,
    .customer-view-card,
    .customer-ledger-card,
    .loyalty-adjustment-card,
    #customerDeactivateModal .delete-confirm-card {
        max-height: calc(100vh - var(--topbar-height) - 36px);
    }

    .customer-ledger-card {
        height: min(78vh, 720px);
    }
}

/* Checkout customer and loyalty */
.checkout-customer-selector {
    position: relative;
    margin: 0 15px 12px;
}

.checkout-customer-trigger {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 12px;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--ink-700);
    background: #f8fafc;
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.checkout-customer-trigger:hover { border-color: #b8cdf3; background: #f4f8ff; }
.checkout-customer-trigger.selected { border-color: #b8cdf3; background: #f3f7ff; box-shadow: 0 5px 16px rgba(30, 91, 199, .07); }
.checkout-customer-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--blue-600); background: var(--blue-100); }
.checkout-customer-copy { display: grid; min-width: 0; gap: 2px; }
.checkout-customer-copy small { color: var(--ink-500); font-size: 7px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.checkout-customer-copy strong { overflow: hidden; color: var(--ink-900); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.checkout-customer-copy > span { overflow: hidden; color: var(--ink-500); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.checkout-customer-trigger > i { color: #94a3b8; font-size: 8px; }
.checkout-customer-clear { position: absolute; top: -7px; right: -7px; display: grid; place-items: center; width: 23px; height: 23px; border: 2px solid #fff; border-radius: 50%; color: #fff; background: #e14f5f; cursor: pointer; box-shadow: 0 5px 12px rgba(153, 36, 50, .2); }
.loyalty-summary-row { margin-inline: -5px !important; padding: 8px 7px; border-radius: 8px; color: #8a5a08 !important; background: #fff8e4; }
.loyalty-summary-row strong { color: #8a5a08 !important; }

.payment-customer-summary {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin: 18px 0 0;
    padding: 11px 13px;
    border: 1px solid #dce6f5;
    border-radius: 11px;
    background: #f7faff;
}

.payment-customer-summary > span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--blue-600); background: #e5edff; }
.payment-customer-summary div { display: grid; gap: 3px; }
.payment-customer-summary small { color: var(--ink-500); font-size: 7px; text-transform: uppercase; }
.payment-customer-summary strong { color: var(--ink-800); font-size: 10px; }
.payment-loyalty-preview { justify-items: end; padding-left: 14px; border-left: 1px solid #dce6f5; }
.payment-loyalty-preview strong { color: #8a5a08; }
.success-loyalty { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin: 3px auto 15px; padding: 9px 13px; border-radius: 999px; color: #8a5a08; background: #fff5d6; font-size: 9px; font-weight: 800; }

.checkout-customer-modal-card { width: min(720px, 96vw); padding: 30px; }
.customer-modal-search { position: relative; margin-bottom: 14px; }
.customer-modal-search > i { position: absolute; top: 50%; left: 15px; z-index: 1; color: var(--ink-500); transform: translateY(-50%); }
.customer-modal-search .form-input { padding-left: 42px; }
.checkout-customer-results { display: grid; gap: 8px; min-height: 230px; max-height: 46vh; margin-bottom: 14px; overflow-y: auto; }
.checkout-customer-result { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink-800); background: #fff; text-align: left; cursor: pointer; }
.checkout-customer-result:hover { border-color: #9dbbf0; background: #f7faff; }
.checkout-customer-result-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #2c72f5, #174eb2); font-size: 10px; font-weight: 800; }
.checkout-customer-result > span:nth-child(2) { display: grid; min-width: 0; gap: 5px; }
.checkout-customer-result > span:nth-child(2) strong { font-size: 10px; }
.checkout-customer-result > span:nth-child(2) small { overflow: hidden; color: var(--ink-500); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.checkout-customer-benefits { display: grid; justify-items: end; gap: 4px; }
.checkout-customer-benefits small { color: #177659; font-size: 8px; font-weight: 700; }
.checkout-customer-benefits strong { color: #986500; font-size: 9px; }
.checkout-customer-empty { display: grid; place-items: center; align-content: center; gap: 9px; min-height: 220px; color: var(--ink-500); text-align: center; }
.checkout-customer-empty i { color: #a8b7ca; font-size: 28px; }
.checkout-customer-empty strong { color: var(--ink-700); font-size: 11px; }
.checkout-customer-empty span { font-size: 8px; }



@media (max-width: 520px) {
    .checkout-customer-modal-card, .cashier-register-card, .register-operation-card, .register-close-card { width: 100vw; max-height: 94vh; border-radius: 20px 20px 0 0; }
    #customerSearchModal, #registerModal, #registerMovementModal, #registerCloseModal { align-items: end; padding: 0; }
    .checkout-customer-result { grid-template-columns: 38px minmax(0, 1fr); }
    .checkout-customer-benefits { grid-column: 2; grid-template-columns: auto auto; justify-content: start; justify-items: start; }
    .register-modal-heading { grid-template-columns: 48px minmax(0, 1fr); padding: 24px 60px 21px 20px; }
    .register-heading-icon { width: 48px; height: 48px; border-radius: 13px; }
    .register-metrics, .register-action-grid { padding-inline: 18px; }
    .register-expected-cash { margin-inline: 18px; }
    .register-page-main-card .register-modal-heading { padding: 24px 60px 21px 20px; }
    .register-page-main-card #registerPageOpenForm { padding: 22px 20px 24px; }
    .register-page-metrics, .register-page-actions { padding-inline: 18px; }
    .register-page-expected { margin-inline: 18px; }
    .register-history-header { padding-inline: 18px; }
    .register-history-filters { width: 100%; }
    .register-history-filters button { flex: 1; min-width: 0; }
    .register-history-footer { padding-inline: 18px; }
    .register-session-detail-card { width: 100vw; max-height: 94vh; border-radius: 20px 20px 0 0; overflow-y: auto; }
    #registerSessionDetailModal { align-items: end; padding: 0; }
    .register-session-detail-hero { grid-template-columns: 48px minmax(0, 1fr); padding: 23px 58px 20px 19px; }
    .register-session-detail-icon { width: 48px; height: 48px; border-radius: 13px; }
    .register-session-detail-status { grid-column: 2; justify-self: start; }
    .register-session-detail-times { margin-inline: 18px; }
    .register-session-detail-metrics { grid-template-columns: 1fr 1fr; padding-inline: 18px; }
    .register-session-reconciliation { grid-template-columns: 1fr; margin-inline: 18px; }
    .register-session-detail-card .modal-form-actions { padding-inline: 18px; }
}

/* =========================================================
   OTP NOTIFICATION SETTINGS
   ========================================================= */

.otp-settings-page {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: 20px 22px 28px;
}

.otp-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.otp-page-header h2 {
    margin: 3px 0 5px;
    color: var(--ink-900);
    font-size: 23px;
    line-height: 1.2;
    letter-spacing: -.035em;
}

.otp-page-header > div > p:last-child {
    margin: 0;
    color: var(--ink-500);
    font-size: 11px;
}

.otp-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.otp-summary-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 76px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.otp-summary-card small,
.otp-summary-card strong {
    display: block;
}

.otp-summary-card small {
    margin-bottom: 3px;
    color: var(--ink-500);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.otp-summary-card strong {
    overflow: hidden;
    color: var(--ink-900);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.otp-summary-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    font-size: 15px;
}

.otp-summary-icon.email {
    color: var(--blue-600);
    background: var(--blue-100);
}

.otp-summary-icon.sms {
    color: var(--green-600);
    background: #e4f8f0;
}

.otp-summary-icon.security {
    color: var(--violet-600);
    background: var(--violet-100);
}

.otp-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 16px;
    width: 100%;
}

.otp-settings-card {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.otp-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 72px;
    padding: 15px 17px;
    border-bottom: 1px solid var(--line);
    background: #fbfcfe;
}

.otp-card-title {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 11px;
}

.otp-card-title > div {
    min-width: 0;
}

.otp-card-title h3 {
    margin: 0 0 3px;
    color: var(--ink-900);
    font-size: 15px;
}

.otp-card-title p {
    overflow: hidden;
    margin: 0;
    color: var(--ink-500);
    font-size: 9px;
    line-height: 1.4;
    text-overflow: ellipsis;
}

.otp-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    color: var(--blue-600);
    background: var(--blue-100);
    font-size: 14px;
}

.otp-card-body {
    padding: 17px;
}

.otp-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px 14px;
}

.otp-form-grid .form-field {
    min-width: 0;
}

.otp-form-grid .form-field > label {
    display: block;
    margin-bottom: 6px;
    color: var(--ink-700);
    font-size: 9px;
    font-weight: 700;
}

.otp-form-grid input,
.otp-form-grid select,
.otp-test-controls input {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 8px 11px;
    border: 1px solid #d9e0ea;
    border-radius: 9px;
    color: var(--ink-900);
    background: #fff;
    outline: 0;
    font-size: 10px;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.otp-form-grid input:focus,
.otp-form-grid select:focus,
.otp-test-controls input:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(36, 107, 253, .1);
}

.password-field {
    position: relative;
    width: 100%;
}

.password-field input {
    width: 100%;
    padding-right: 40px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: var(--ink-500);
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
}

.password-toggle:hover {
    color: var(--blue-600);
    background: var(--blue-100);
}

.otp-checkbox-field {
    display: flex;
    align-items: end;
    min-width: 0;
}

.otp-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    width: 100%;
    min-height: 54px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
    cursor: pointer;
}

.otp-checkbox input {
    width: 16px;
    min-height: auto;
    margin-top: 2px;
    accent-color: var(--blue-600);
}

.otp-checkbox span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.otp-checkbox strong {
    color: var(--ink-700);
    font-size: 9px;
}

.otp-checkbox small {
    color: var(--ink-500);
    font-size: 7px;
    line-height: 1.35;
}

.otp-secret-status {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--ink-500);
    background: #f8fafc;
    font-size: 8px;
}

.otp-secret-status i {
    color: var(--blue-600);
}

.otp-test-panel {
    display: grid;
    grid-template-columns: minmax(135px, .65fr) minmax(220px, 1.35fr);
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #f8fafc;
}

.otp-test-panel > div:first-child {
    min-width: 0;
}

.otp-test-panel strong {
    display: block;
    margin-bottom: 3px;
    color: var(--ink-900);
    font-size: 9px;
}

.otp-test-panel small {
    display: block;
    color: var(--ink-500);
    font-size: 7px;
    line-height: 1.4;
}

.otp-test-controls {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
}

.otp-test-controls input {
    flex: 1 1 auto;
}

.otp-test-controls .button {
    flex: 0 0 auto;
    min-height: 38px;
    padding-inline: 13px;
    font-size: 9px;
    white-space: nowrap;
}

.otp-switch {
    position: relative;
    display: inline-flex;
    flex: 0 0 42px;
    width: 42px;
    height: 24px;
}

.otp-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.otp-switch-slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #cbd5e1;
    cursor: pointer;
    transition: background .18s ease;
}

.otp-switch-slider::before {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    content: "";
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .22);
    transition: transform .18s ease;
}

.otp-switch input:checked + .otp-switch-slider {
    background: var(--blue-600);
}

.otp-switch input:checked + .otp-switch-slider::before {
    transform: translateX(18px);
}

.otp-switch input:focus-visible + .otp-switch-slider {
    outline: 3px solid rgba(36, 107, 253, .18);
}

.otp-footer-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink-500);
    background: #fff;
    font-size: 8px;
}

@media (max-width: 1250px) {
    .otp-settings-grid {
        grid-template-columns: 1fr;
    }

    .otp-test-panel {
        grid-template-columns: minmax(170px, .6fr) minmax(260px, 1.4fr);
    }
}

@media (max-width: 800px) {
    .otp-settings-page {
        padding: 16px;
    }

    .otp-page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .otp-page-header .button {
        width: 100%;
    }

    .otp-summary-grid,
    .otp-form-grid,
    .otp-test-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .otp-settings-page {
        padding: 12px;
    }

    .otp-page-header h2 {
        font-size: 20px;
    }

    .otp-card-header {
        align-items: flex-start;
    }

    .otp-summary-grid {
        gap: 10px;
    }

    .otp-test-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .otp-test-controls .button {
        width: 100%;
    }
}
/* =========================================================
   CHECKOUT LOYALTY REDEMPTION
   ========================================================= */

.payment-modal-card {
    width: min(610px, 96vw);
    padding: 28px;
}

.loyalty-redemption-panel {
    margin: 16px 0;
    overflow: hidden;
    border: 1px solid #dce6f5;
    border-radius: 15px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(20, 42, 76, .05);
}

.loyalty-redemption-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 16px;
    border-bottom: 1px solid #e5ebf3;
    background:
        linear-gradient(
            135deg,
            #fffaf0 0%,
            #ffffff 60%,
            #f5f8ff 100%
        );
}

.loyalty-redemption-title {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
}

.loyalty-redemption-title > div {
    min-width: 0;
}

.loyalty-redemption-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: #966300;
    background: #fff1c7;
    box-shadow: 0 7px 16px rgba(151, 100, 0, .12);
}

.loyalty-redemption-title .eyebrow {
    margin-bottom: 4px;
    color: #a16b00;
    font-size: 7px;
}

.loyalty-redemption-title h3 {
    margin: 0 0 4px;
    color: var(--ink-900);
    font-size: 14px;
}

.loyalty-redemption-title p:last-child {
    margin: 0;
    color: var(--ink-500);
    font-size: 8px;
    line-height: 1.4;
}

.loyalty-balance-badge {
    display: grid;
    flex: 0 0 auto;
    justify-items: end;
    gap: 4px;
    padding: 9px 11px;
    border: 1px solid #f0dfb5;
    border-radius: 10px;
    color: #845900;
    background: #fff8e6;
}

.loyalty-balance-badge small {
    font-size: 7px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.loyalty-balance-badge strong {
    font-size: 10px;
}

.loyalty-redemption-body {
    padding: 15px;
}

.loyalty-rate-strip {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 13px;
    padding: 10px 11px;
    border: 1px solid #dce7f7;
    border-radius: 10px;
    color: #426286;
    background: #f5f8fd;
}

.loyalty-rate-strip > span {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    flex: 0 0 auto;
    border-radius: 8px;
    color: var(--blue-600);
    background: var(--blue-100);
}

.loyalty-rate-strip div {
    display: grid;
    gap: 2px;
}

.loyalty-rate-strip small {
    color: var(--ink-500);
    font-size: 7px;
}

.loyalty-rate-strip strong {
    color: var(--ink-800);
    font-size: 9px;
}

.loyalty-redemption-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
}

.loyalty-points-field {
    min-width: 0;
}

.loyalty-points-field > label {
    display: block;
    margin-bottom: 6px;
    color: var(--ink-700);
    font-size: 9px;
    font-weight: 700;
}

.loyalty-points-field > small {
    display: block;
    margin-top: 5px;
    color: var(--ink-500);
    font-size: 7px;
}

.loyalty-points-input {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    overflow: hidden;
    border: 1px solid #d5deea;
    border-radius: 10px;
    background: #ffffff;
    transition:
        border-color .18s ease,
        box-shadow .18s ease;
}

.loyalty-points-input:focus-within {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(36, 107, 253, .1);
}

.loyalty-points-input > span {
    display: grid;
    place-items: center;
    height: 42px;
    color: #986500;
    background: #fff7df;
}

.loyalty-points-input input {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 12px;
    border: 0;
    outline: 0;
    color: var(--ink-900);
    background: transparent;
    font-size: 13px;
    font-weight: 800;
}

.loyalty-max-button {
    min-height: 42px;
    padding-inline: 12px;
    white-space: nowrap;
}

.loyalty-redemption-preview {
    display: grid;
    grid-template-columns: 1fr 30px 1fr;
    align-items: center;
    gap: 8px;
    margin-top: 13px;
    padding: 12px;
    border: 1px solid #ecdcae;
    border-radius: 11px;
    background:
        linear-gradient(
            135deg,
            #fff9e9,
            #fffdf6
        );
}

.loyalty-redemption-preview > div {
    display: grid;
    gap: 4px;
}

.loyalty-redemption-preview small {
    color: #8b7650;
    font-size: 7px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.loyalty-redemption-preview strong {
    color: #7c5300;
    font-size: 13px;
}

.loyalty-redemption-arrow {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: #9b6b0b;
    background: #ffefbf;
    font-size: 8px;
}

.loyalty-payable-preview {
    text-align: right;
}

.loyalty-redemption-error {
    display: block;
    margin-top: 9px;
    padding: 9px 10px;
    border: 1px solid #f1cbd1;
    border-radius: 9px;
    color: #a82e3f;
    background: #fff3f5;
    font-size: 8px;
    line-height: 1.4;
}

.loyalty-otp-section {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #d5e2f6;
    border-radius: 12px;
    background:
        linear-gradient(
            135deg,
            #f5f8ff,
            #ffffff
        );
}

.loyalty-otp-header {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.loyalty-otp-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: var(--blue-600);
    background: var(--blue-100);
}

.loyalty-otp-header h4 {
    margin: 0 0 4px;
    color: var(--ink-900);
    font-size: 10px;
}

.loyalty-otp-header p {
    margin: 0;
    color: var(--ink-500);
    font-size: 8px;
    line-height: 1.45;
}

.loyalty-security-badge {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 0 8px;
    border-radius: 999px;
    color: #087354;
    background: var(--green-100);
    font-size: 7px;
    font-weight: 800;
}

.loyalty-otp-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.loyalty-otp-actions .button {
    min-height: 38px;
}

.loyalty-otp-verification {
    margin-top: 13px;
    padding-top: 13px;
    border-top: 1px solid #dfe7f2;
}

.loyalty-otp-verification-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
}

.loyalty-otp-verification-heading > div {
    display: grid;
    gap: 3px;
}

.loyalty-otp-verification-heading strong {
    color: var(--ink-800);
    font-size: 9px;
}

.loyalty-otp-verification-heading small {
    color: var(--ink-500);
    font-size: 7px;
}

.loyalty-otp-sent {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #087354;
    font-size: 7px;
    font-weight: 800;
}

.loyalty-otp-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.loyalty-otp-input-row input {
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 0 13px;
    border: 1px solid #d5deea;
    border-radius: 10px;
    outline: 0;
    color: var(--ink-900);
    background: #fff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .22em;
    text-align: center;
}

.loyalty-otp-input-row input:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(36, 107, 253, .1);
}

.loyalty-otp-input-row .button {
    min-width: 118px;
}

.loyalty-otp-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: var(--ink-500);
    font-size: 7px;
}

.loyalty-otp-verified {
    display: grid;
    grid-template-columns: 35px 1fr;
    align-items: center;
    gap: 10px;
    margin-top: 13px;
    padding: 11px;
    border: 1px solid #bce9d8;
    border-radius: 10px;
    color: #087354;
    background: #ecfbf5;
}

.loyalty-otp-verified > span {
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    color: #fff;
    background: var(--green-600);
}

.loyalty-otp-verified > div {
    display: grid;
    gap: 3px;
}

.loyalty-otp-verified strong {
    font-size: 9px;
}

.loyalty-otp-verified small {
    color: #3a806b;
    font-size: 7px;
}

@media (max-width: 600px) {
    .payment-modal-card {
        width: 100vw;
        max-height: 96vh;
        padding: 21px 16px;
        border-radius: 20px 20px 0 0;
    }

    #paymentModal {
        align-items: end;
        padding: 0;
    }

    .loyalty-redemption-header {
        align-items: flex-start;
    }

    .loyalty-balance-badge {
        padding: 7px 8px;
    }

    .loyalty-redemption-entry {
        grid-template-columns: 1fr;
    }

    .loyalty-max-button {
        width: 100%;
    }

    .loyalty-redemption-preview {
        grid-template-columns: 1fr;
    }

    .loyalty-redemption-arrow {
        display: none;
    }

    .loyalty-payable-preview {
        text-align: left;
    }

    .loyalty-otp-header {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .loyalty-security-badge {
        grid-column: 2;
        justify-self: start;
    }

    .loyalty-otp-actions .button {
        width: 100%;
    }

    .loyalty-otp-input-row {
        grid-template-columns: 1fr;
    }

    .loyalty-otp-input-row .button {
        width: 100%;
    }
}
.branch-switcher {
    position: relative;
    min-width: 250px;
}

.branch-switcher__button {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.branch-switcher__button:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.branch-switcher__button:focus-visible {
    outline: none;
    border-color: #2563eb;
    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.14);
}

.branch-switcher__button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.branch-switcher__icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #eff6ff;
    color: #2563eb;
}

.branch-switcher__details {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.branch-switcher__label {
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.branch-switcher__name {
    width: 100%;
    overflow: hidden;
    color: #0f172a;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.branch-switcher__chevron {
    flex: 0 0 auto;
    color: #94a3b8;
    font-size: 11px;
    transition: transform 0.2s ease;
}

.branch-switcher__chevron--open {
    transform: rotate(180deg);
}

.branch-switcher__menu {
    position: absolute;
    z-index: 1200;
    top: calc(100% + 8px);
    right: 0;
    width: min(360px, calc(100vw - 28px));
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.14);
}

.branch-switcher__menu-header {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 15px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.branch-switcher__menu-header strong {
    color: #0f172a;
    font-size: 14px;
}

.branch-switcher__menu-header span {
    color: #64748b;
    font-size: 12px;
}

.branch-switcher__list {
    max-height: 340px;
    overflow-y: auto;
    padding: 8px;
}

.branch-switcher__item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #0f172a;
    text-align: left;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.branch-switcher__item:hover:not(:disabled) {
    background: #f1f5f9;
}

.branch-switcher__item--active {
    background: #eff6ff;
    color: #1d4ed8;
    cursor: default;
}

.branch-switcher__item-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #f1f5f9;
    color: #64748b;
}

.branch-switcher__item--active
.branch-switcher__item-icon {
    background: #dbeafe;
    color: #2563eb;
}

.branch-switcher__item-content {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.branch-switcher__item-name {
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.branch-switcher__item-code {
    color: #64748b;
    font-size: 11px;
}

.branch-switcher__badge {
    width: fit-content;
    margin-top: 3px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.branch-switcher__item-status {
    flex: 0 0 auto;
    color: #94a3b8;
    font-size: 13px;
}

.branch-switcher__item--active
.branch-switcher__item-status {
    color: #2563eb;
}

.branch-switcher__loading,
.branch-switcher__empty {
    padding: 24px 16px;
    color: #64748b;
    font-size: 13px;
    text-align: center;
}

@media (max-width: 720px) {
    .branch-switcher {
        min-width: 0;
        width: 100%;
    }

    .branch-switcher__button {
        min-height: 44px;
    }

    .branch-switcher__label {
        display: none;
    }

    .branch-switcher__menu {
        position: fixed;
        top: 72px;
        right: 14px;
        left: 14px;
        width: auto;
    }
}

/* =========================================================
   TENANT PROFILE AND SUBSCRIPTION
   ========================================================= */

.tenant-profile-page {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 24px;
}

.tenant-profile-loading {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #64748b;
}

.tenant-profile-loading[hidden],
.tenant-profile-content[hidden],
.tenant-profile-error[hidden] {
    display: none !important;
}

.tenant-profile-error {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    border: 1px solid #fecaca;
    border-radius: 14px;
    background: #fef2f2;
    color: #b91c1c;
}

.tenant-profile-error > i {
    margin-top: 2px;
    font-size: 20px;
}

.tenant-profile-error strong {
    display: block;
    margin-bottom: 4px;
}

.tenant-profile-error p {
    margin: 0;
    font-size: 13px;
}

.tenant-profile-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tenant-profile-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background:
        linear-gradient(
            135deg,
            #eff6ff 0%,
            #ffffff 70%
        );
}

.tenant-profile-identity {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tenant-profile-logo {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #2563eb;
    color: #ffffff;
    font-size: 21px;
    box-shadow:
        0 10px 24px rgba(37, 99, 235, 0.22);
}

.tenant-profile-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tenant-profile-title-row h3 {
    margin: 0;
    color: #0f172a;
    font-size: 21px;
    font-weight: 800;
}

.tenant-profile-identity p {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 12px;
}

.tenant-profile-meta {
    display: flex;
    align-items: center;
    gap: 28px;
}

.tenant-profile-meta > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tenant-profile-meta small {
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.tenant-profile-meta strong {
    color: #334155;
    font-size: 12px;
}

.tenant-profile-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 2fr)
        minmax(300px, 1fr);
    gap: 20px;
    align-items: start;
}

.tenant-main-column,
.tenant-side-column {
    min-width: 0;
}

.tenant-form-section {
    padding: 20px;
    border-bottom: 1px solid #edf2f7;
}

.tenant-form-section:last-of-type {
    border-bottom: 0;
}

.tenant-form-section h4 {
    margin: 0 0 16px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
}

.tenant-form-section .form-field small {
    color: #94a3b8;
    font-size: 10px;
}

.tenant-form-section input[readonly] {
    background: #f8fafc;
    color: #64748b;
    cursor: not-allowed;
}

.tenant-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* Current subscription */

.subscription-current {
    padding: 20px;
}

.subscription-plan-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #edf2f7;
}

.subscription-plan-heading small {
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.subscription-plan-heading h3 {
    margin: 4px 0 0;
    color: #0f172a;
    font-size: 22px;
    font-weight: 800;
}

.subscription-period {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid #edf2f7;
}

.subscription-period > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.subscription-period small {
    color: #64748b;
    font-size: 11px;
}

.subscription-period strong {
    color: #334155;
    font-size: 11px;
    text-align: right;
}

.subscription-usage-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid #edf2f7;
}

.usage-item {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.usage-item__header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #64748b;
    font-size: 11px;
}

.usage-item__header strong {
    color: #334155;
}

.usage-progress {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.usage-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #2563eb;
    transition: width 0.3s ease;
}

.subscription-feature-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 18px;
}

.subscription-feature-list > div,
.subscription-plan-features > div {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #166534;
    font-size: 12px;
    font-weight: 600;
}

.subscription-feature--disabled {
    color: #94a3b8 !important;
}

/* Available plans */

.available-plans-card {
    overflow: visible;
}

.subscription-plans-grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding: 20px;
}

.subscription-plan-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    background: #ffffff;
    box-shadow:
        0 8px 24px rgba(15, 23, 42, 0.04);
}

.subscription-plan-card--current {
    border-color: #2563eb;
    box-shadow:
        0 10px 30px rgba(37, 99, 235, 0.12);
}

.subscription-current-label {
    position: absolute;
    top: -10px;
    right: 15px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.subscription-plan-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.subscription-plan-card__header small {
    color: #2563eb;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.subscription-plan-card__header h3 {
    margin: 4px 0 0;
    color: #0f172a;
    font-size: 20px;
    font-weight: 800;
}

.subscription-plan-card__header > i {
    color: #2563eb;
    font-size: 20px;
}

.subscription-plan-description {
    min-height: 42px;
    margin: 14px 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.6;
}

.subscription-plan-price {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.subscription-plan-price strong {
    color: #0f172a;
    font-size: 24px;
    font-weight: 850;
}

.subscription-plan-price span {
    color: #64748b;
    font-size: 11px;
}

.subscription-plan-annual {
    margin-top: 4px;
    color: #94a3b8;
    font-size: 10px;
}

.subscription-plan-limits {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 18px 0;
    padding: 16px 0;
    border-top: 1px solid #edf2f7;
    border-bottom: 1px solid #edf2f7;
    list-style: none;
}

.subscription-plan-limits li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-size: 11px;
}

.subscription-plan-limits i {
    width: 16px;
    color: #2563eb;
}

.subscription-plan-features {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 18px;
}

.subscription-plan-button {
    width: 100%;
    margin-top: auto;
}

.subscription-plans-empty {
    grid-column: 1 / -1;
    padding: 30px;
    color: #64748b;
    text-align: center;
}

.status-badge--trial {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-badge--pending_setup {
    background: #fef3c7;
    color: #92400e;
}

.status-badge--past_due {
    background: #ffedd5;
    color: #9a3412;
}

.status-badge--expired,
.status-badge--cancelled {
    background: #f1f5f9;
    color: #475569;
}

@media (max-width: 1100px) {
    .tenant-profile-grid {
        grid-template-columns: 1fr;
    }

    .subscription-plans-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .tenant-profile-page {
        padding: 16px;
    }

    .tenant-profile-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .tenant-profile-meta {
        width: 100%;
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .tenant-form-actions {
        flex-direction: column-reverse;
    }

    .tenant-form-actions button {
        width: 100%;
    }

    .subscription-plans-grid {
        grid-template-columns: 1fr;
    }
}
/* =========================================================
   USER MANAGEMENT
   ========================================================= */

.users-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
}

/* Ensure hidden UI states are respected */
.users-page [hidden] {
    display: none !important;
}

/* Allow dropdowns and modals to remain visible */
.users-page .content-card {
    overflow: visible;
}

/* =========================================================
   FILTERS
   ========================================================= */

.users-filter-card {
    padding: 16px;
    overflow: visible;
}

.users-filters {
    display: grid;
    grid-template-columns:
        minmax(320px, 1fr)
        minmax(165px, 180px)
        minmax(190px, 220px)
        auto;
    align-items: center;
    gap: 12px;
}

.users-search-field {
    position: relative;
    min-width: 0;
}

.users-search-field i {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 2;
    color: #94a3b8;
    font-size: 13px;
    pointer-events: none;
    transform: translateY(-50%);
}

.users-search-field input,
.users-filters select {
    width: 100%;
    height: 42px;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
    font-family: inherit;
    font-size: 12px;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.users-search-field input {
    padding: 0 14px 0 40px;
}

.users-search-field input::placeholder {
    color: #94a3b8;
}

.users-filters select {
    padding: 0 36px 0 13px;
    cursor: pointer;
}

.users-search-field input:hover,
.users-filters select:hover {
    border-color: #94a3b8;
}

.users-search-field input:focus,
.users-filters select:focus {
    border-color: #2563eb;
    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.12);
}

.users-filters .secondary-button {
    height: 42px;
    white-space: nowrap;
}

/* =========================================================
   LOADING, ERROR AND EMPTY STATES
   ========================================================= */

.users-loading,
.users-loading-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 140px;
    color: #64748b;
    font-size: 12px;
}

.users-loading-inline {
    min-height: 80px;
}

.users-loading[hidden],
.users-loading-inline[hidden] {
    display: none !important;
}

.users-error {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px;
    padding: 15px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 12px;
}

.users-error[hidden] {
    display: none !important;
}

.users-error i {
    flex: 0 0 auto;
    font-size: 15px;
}

.users-empty {
    padding: 50px 20px;
    text-align: center;
}

.users-empty[hidden] {
    display: none !important;
}

.users-empty > i {
    color: #cbd5e1;
    font-size: 34px;
}

.users-empty h3 {
    margin: 12px 0 5px;
    color: #334155;
    font-size: 16px;
}

.users-empty p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
}

/* =========================================================
   USERS TABLE
   ========================================================= */

.users-table-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
}

.users-table-wrapper[hidden] {
    display: none !important;
}
.users-table-wrapper {
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
}

.users-table {
    position: relative;
}

.users-actions-column {
    position: relative;
    width: 70px;
    overflow: visible;
    text-align: right !important;
}

.table-action-menu {
    position: relative;
    display: inline-flex;
    justify-content: flex-end;
    overflow: visible;
}

.table-action-dropdown {
    position: absolute;
    z-index: 1000;
    top: calc(100% + 6px);
    right: 0;
    width: 210px;
    padding: 7px;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #ffffff;
    box-shadow:
        0 18px 45px
        rgba(15, 23, 42, 0.2);
}

.table-action-dropdown[hidden] {
    display: none !important;
}

.table-action-dropdown button {
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #334155;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.table-action-dropdown button:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.table-action-dropdown button i {
    width: 16px;
    text-align: center;
}

.table-action-dropdown .danger-action {
    color: #b91c1c;
}

.table-action-dropdown .danger-action:hover {
    background: #fef2f2;
    color: #991b1b;
}
.users-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #edf2f7;
    text-align: left;
    vertical-align: middle;
}

.users-table th {
    background: #ffffff;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.users-table td {
    color: #475569;
    font-size: 12px;
}

.users-table tbody tr {
    transition: background-color 0.2s ease;
}

.users-table tbody tr:hover {
    background: #f8fafc;
}

.users-table tbody tr:last-child td {
    border-bottom: 0;
}

/* =========================================================
   USER IDENTITY
   ========================================================= */

.user-identity-cell {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 210px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
}

.user-identity-cell > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.user-identity-cell strong {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    color: #0f172a;
    font-size: 12px;
}

.user-identity-cell small {
    display: block;
    max-width: 240px;
    overflow: hidden;
    color: #64748b;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-current-label {
    display: inline-flex;
    align-items: center;
    margin-left: 3px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

/* =========================================================
   ROLE, BRANCH AND STATUS
   ========================================================= */

.user-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.user-branches-text {
    display: inline-block;
    max-width: 230px;
    overflow: hidden;
    color: #475569;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-status-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.user-lock-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #b45309;
    font-size: 9px;
    font-weight: 700;
}

.status-badge--inactive {
    background: #f1f5f9;
    color: #475569;
}

.status-badge--suspended {
    background: #ffedd5;
    color: #9a3412;
}

/* =========================================================
   TABLE ACTION MENU
   ========================================================= */

.users-actions-column {
    width: 70px;
    text-align: right !important;
}

.table-action-menu {
    position: relative;
    display: inline-flex;
    justify-content: flex-end;
}

.table-action-dropdown {
    position: fixed;
    z-index: 9999;
    width: 210px;
    max-height: min(320px, calc(100vh - 24px));
    overflow-y: auto;
    padding: 7px;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #ffffff;
    box-shadow:
        0 18px 45px
        rgba(15, 23, 42, 0.22);
}

.table-action-dropdown[hidden] {
    display: none !important;
}

.table-action-dropdown button {
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #334155;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.table-action-dropdown button:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.table-action-dropdown button i {
    width: 16px;
    color: #64748b;
    text-align: center;
}

.table-action-dropdown .danger-action {
    color: #b91c1c;
}

.table-action-dropdown .danger-action:hover {
    background: #fef2f2;
    color: #991b1b;
}

/* =========================================================
   PAGINATION
   ========================================================= */

.users-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid #edf2f7;
}

.users-pagination[hidden] {
    display: none !important;
}

.users-pagination span {
    color: #64748b;
    font-size: 11px;
}

.users-pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

/* =========================================================
   USER MODALS
   ========================================================= */

.users-form-dialog {
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.users-small-dialog {
    width: min(460px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.app-modal[hidden] {
    display: none !important;
}

/* =========================================================
   BRANCH ASSIGNMENT
   ========================================================= */

.user-branch-section {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.user-branch-section__header h4 {
    margin: 0;
    color: #0f172a;
    font-size: 14px;
}

.user-branch-section__header p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 11px;
}

.user-branch-options {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.user-branch-option {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 11px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.user-branch-option:hover {
    border-color: #93c5fd;
    background: #f8fbff;
}

.user-branch-option:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow:
        0 0 0 2px rgba(37, 99, 235, 0.08);
}

.user-branch-option input {
    flex: 0 0 auto;
}

.user-branch-option > span {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.user-branch-option strong {
    overflow: hidden;
    color: #334155;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-branch-option small {
    overflow: hidden;
    color: #94a3b8;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.users-branch-empty {
    grid-column: 1 / -1;
    padding: 20px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    text-align: center;
    font-size: 11px;
}

.users-modal-description {
    margin: 0 0 18px;
    color: #475569;
    font-size: 12px;
    line-height: 1.6;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {
    .users-filters {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(160px, 180px)
            minmax(180px, 200px);
    }

    .users-filters .secondary-button {
        grid-column: 1 / -1;
        justify-self: end;
    }
}

@media (max-width: 850px) {
    .users-filters {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .users-search-field {
        grid-column: 1 / -1;
    }

    .users-filters .secondary-button {
        grid-column: auto;
        justify-self: stretch;
    }
}

@media (max-width: 700px) {
    .users-page {
        padding: 16px;
    }

    .users-filter-card {
        padding: 14px;
    }

    .users-filters {
        grid-template-columns: 1fr;
    }

    .users-search-field {
        grid-column: auto;
    }

    .users-filters .secondary-button {
        width: 100%;
        grid-column: auto;
    }

    .user-branch-options {
        grid-template-columns: 1fr;
    }

    .users-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .users-pagination button {
        width: 100%;
    }

    .users-pagination span {
        order: -1;
        text-align: center;
    }
}
/* =========================================================
   Roles & Permissions - standard admin page
   ========================================================= */
/* Roles & Permissions */
.roles-page {
    display: grid;
    gap: 18px;
}

.roles-page [hidden] {
    display: none !important;
}

.roles-page-toolbar {
    align-items: flex-start;
}

.roles-toolbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.roles-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.roles-summary-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 112px;
    padding: 18px;
    background: var(--surface, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    box-shadow: 0 5px 18px rgba(15, 23, 42, 0.05);
}

.roles-summary-card__icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 12px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 18px;
}

.roles-summary-card div {
    display: grid;
    gap: 2px;
}

.roles-summary-card small {
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.roles-summary-card strong {
    color: #0f172a;
    font-size: 24px;
    line-height: 1.1;
}

.roles-summary-card span:last-child {
    color: #94a3b8;
    font-size: 12px;
}

.roles-directory-card {
    overflow: hidden;
    padding: 0;
}

.roles-directory-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.roles-directory-header h3 {
    margin: 0;
}

.roles-directory-header p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
}

.roles-directory-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.roles-search-field {
    position: relative;
    display: block;
}

.roles-search-field i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.roles-search-field input {
    width: 280px;
    min-height: 40px;
    padding: 9px 12px 9px 36px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
}

.roles-directory-controls select {
    min-height: 40px;
    padding: 8px 34px 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
}

.roles-table-wrapper {
    overflow-x: auto;
}

.roles-table {
    width: 100%;
    border-collapse: collapse;
}

.roles-table th {
    padding: 12px 16px;
    background: #f8fafc;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.roles-table td {
    padding: 13px 16px;
    border-top: 1px solid #e2e8f0;
    color: #0f172a;
    vertical-align: middle;
}

.roles-table tbody tr:hover {
    background: #fafcff;
}

.role-name-cell {
    display: flex;
    gap: 11px;
    align-items: center;
    min-width: 280px;
}

.role-icon {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 10px;
    background: #eef2ff;
    color: #4f46e5;
}

.role-name-cell div {
    display: grid;
    gap: 2px;
}

.role-name-cell strong {
    font-size: 14px;
}

.role-name-cell small {
    max-width: 380px;
    color: #64748b;
    font-size: 12px;
}

.role-code {
    display: inline-flex;
    padding: 4px 7px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: #f8fafc;
    color: #475569;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
}

.role-status-stack {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.role-built-in-label,
.role-custom-label {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.role-built-in-label {
    background: #ecfdf5;
    color: #047857;
}

.role-custom-label {
    background: #eff6ff;
    color: #1d4ed8;
}

.roles-actions-column {
    width: 160px;
    text-align: right;
}

.roles-row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.danger-icon-button {
    color: #dc2626;
}

.roles-loading,
.roles-error,
.roles-empty {
    padding: 28px 20px;
    text-align: center;
}

.roles-error {
    color: #b91c1c;
}

.roles-empty i {
    font-size: 26px;
    color: #94a3b8;
}

.role-form-dialog {
    width: min(980px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
}

.role-details-dialog {
    width: min(860px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
}

.roles-small-dialog {
    width: min(460px, calc(100vw - 32px));
}

.role-modal-subtitle {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 13px;
}

.form-field--full {
    grid-column: 1 / -1;
}

.role-permission-editor {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.role-permission-editor__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.role-permission-editor__header h4 {
    margin: 0;
}

.role-permission-editor__header p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
}

.role-permission-editor__actions {
    display: flex;
    gap: 12px;
}

.text-button {
    border: 0;
    background: transparent;
    color: #2563eb;
    font-weight: 700;
    cursor: pointer;
}

.role-permission-filter {
    margin: 16px 0;
}

.role-permission-filter input {
    width: 100%;
}

.role-permission-options,
.role-permissions-container {
    display: grid;
    gap: 16px;
    max-height: 430px;
    overflow: auto;
    padding-right: 4px;
}

.role-permission-group {
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    overflow: hidden;
}

.role-permission-group__title {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.role-permission-group__title span {
    color: #64748b;
    font-size: 12px;
}

.role-permission-checkboxes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.role-permission-checkbox {
    display: flex;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid #eef2f7;
    cursor: pointer;
}

.role-permission-checkbox:nth-child(odd) {
    border-right: 1px solid #eef2f7;
}

.role-permission-checkbox input {
    margin-top: 3px;
}

.role-permission-checkbox span {
    display: grid;
    gap: 2px;
}

.role-permission-checkbox strong {
    font-size: 13px;
}

.role-permission-checkbox small {
    color: #64748b;
    font-size: 12px;
}

.permission-group h4 {
    margin: 0 0 8px;
    color: #334155;
    font-size: 13px;
}

.permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.permission-item {
    display: flex;
    gap: 10px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.permission-item > span {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border-radius: 50%;
    background: #ecfdf5;
    color: #059669;
    font-size: 11px;
}

.permission-item div {
    display: grid;
    gap: 2px;
}

.permission-item strong {
    font-size: 13px;
}

.permission-item small {
    color: #64748b;
    font-size: 12px;
}

.role-action-message {
    margin: 0;
    color: #334155;
    line-height: 1.6;
}

.roles-state,
.roles-loading-inline {
    padding: 24px;
    color: #64748b;
    text-align: center;
}

@media (max-width: 900px) {
    .roles-summary-grid {
        grid-template-columns: 1fr;
    }

    .roles-directory-header {
        align-items: stretch;
        flex-direction: column;
    }

    .roles-directory-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .roles-search-field input {
        width: 100%;
    }

    .role-permission-checkboxes,
    .permission-grid {
        grid-template-columns: 1fr;
    }

    .role-permission-checkbox:nth-child(odd) {
        border-right: 0;
    }
}

@media (max-width: 640px) {
    .roles-page-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .roles-toolbar-actions {
        width: 100%;
    }

    .roles-toolbar-actions button {
        flex: 1;
    }
}
/* =========================================================
   MOBILE TOPBAR, BRANCH SWITCHER AND LOGOUT FIX
   Append to the end of app.css
   ========================================================= */

.topbar,
.topbar-actions,
.branch-switcher,
.user-menu,
.logout-form {
    min-width: 0;
}

.topbar {
    position: relative;
    overflow: visible;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    overflow: visible;
}

.branch-switcher {
    position: relative;
    flex: 0 1 250px;
    width: min(250px, 100%);
    max-width: 250px;
}

.branch-switcher__button {
    width: 100%;
    min-width: 0;
}

.branch-switcher__details {
    min-width: 0;
    overflow: hidden;
}

.branch-switcher__name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.branch-switcher__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    z-index: 1200;
    width: min(360px, calc(100vw - 24px));
    max-height: min(420px, calc(100vh - 110px));
    overflow-y: auto;
    border-radius: 14px;
}

.logout-form {
    position: relative;
    z-index: 20;
    display: inline-flex;
    margin: 0;
    flex: 0 0 auto;
}

.logout-button {
    position: relative;
    z-index: 21;
    flex: 0 0 auto;
    touch-action: manipulation;
    cursor: pointer;
}

.logout-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

@media (max-width: 900px) {
    .topbar {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
    }

    .page-heading {
        min-width: 0;
    }

    .page-heading > div {
        min-width: 0;
    }

    #pageTitle,
    #activeBranchHeading {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar-actions {
        min-width: 0;
        gap: 7px;
    }

    .business-date,
    .notification-button,
    .user-menu > div {
        display: none;
    }

    .user-menu {
        flex: 0 0 auto;
    }

    .branch-switcher {
        flex: 0 1 180px;
        width: 180px;
        max-width: 180px;
    }

    .branch-switcher__button {
        padding: 8px 10px;
    }

    .branch-switcher__label {
        display: none;
    }

    .branch-switcher__name {
        max-width: 100px;
        font-size: 12px;
    }

    .branch-switcher__icon {
        flex: 0 0 auto;
    }
}

@media (max-width: 640px) {
    .topbar {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "menu heading"
            "actions actions";
        gap: 8px 10px;
    }

    .menu-button {
        grid-area: menu;
    }

    .page-heading {
        grid-area: heading;
    }

    .topbar-actions {
        grid-area: actions;
        width: 100%;
        justify-content: space-between;
        padding-top: 8px;
        border-top: 1px solid var(--border-color, #e2e8f0);
    }

    .branch-switcher {
        flex: 1 1 auto;
        width: auto;
        max-width: none;
    }

    .branch-switcher__name {
        max-width: calc(100vw - 190px);
    }

    .branch-switcher__menu {
        position: fixed;
        top: auto;
        right: 12px;
        bottom: 12px;
        left: 12px;
        width: auto;
        max-height: 65vh;
    }

    .user-menu {
        display: none;
    }

    .logout-form,
    .logout-button {
        flex: 0 0 auto;
    }
}

@media (max-width: 390px) {
    .branch-switcher__chevron {
        display: none;
    }

    .branch-switcher__name {
        max-width: calc(100vw - 155px);
    }
}

.nav-link[hidden],
[data-access-group][hidden],
[data-permission][hidden],
[data-any-permission][hidden],
[data-all-permissions][hidden],
[data-role][hidden] {
    display: none !important;
}
.access-hidden {
    display: none !important;
}
/* =========================================================
   MOBILE TOPBAR LOGOUT VISIBILITY FIX
   ========================================================= */

.topbar-actions {
    min-width: 0;
}

.logout-form {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    margin: 0;
    position: relative;
    z-index: 1500;
}

.logout-button {
    display: inline-grid !important;
    place-items: center;
    visibility: visible !important;
    opacity: 1 !important;
    width: 42px;
    height: 42px;
    min-width: 42px;
    padding: 0;
    position: relative;
    z-index: 1501;
    cursor: pointer;
    touch-action: manipulation;
}

@media (max-width: 900px) {
    .topbar-actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        width: auto;
        max-width: 100%;
        overflow: visible;
    }

    .branch-switcher {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 180px;
    }

    .branch-switcher__button {
        width: 100%;
        min-width: 0;
    }

    .branch-switcher__details {
        min-width: 0;
        overflow: hidden;
    }

    .branch-switcher__name {
        display: block;
        max-width: 105px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .business-date,
    .notification-button,
    .user-menu {
        display: none !important;
    }

    .logout-form {
        display: inline-flex !important;
        flex: 0 0 42px;
    }
}

@media (max-width: 640px) {
    .topbar {
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr);
        grid-template-areas:
            "menu heading"
            "actions actions";
        gap: 8px 10px;
        padding: 10px 12px;
    }

    .menu-button {
        grid-area: menu;
    }

    .page-heading {
        grid-area: heading;
        min-width: 0;
    }

    .topbar-actions {
        grid-area: actions;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 42px;
        align-items: center;
        width: 100%;
        gap: 8px;
        padding-top: 8px;
        border-top: 1px solid #e2e8f0;
    }

    .branch-switcher {
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .branch-switcher__name {
        max-width: calc(100vw - 145px);
    }

    .logout-form {
        grid-column: 2;
        display: inline-flex !important;
        width: 42px;
    }

    .logout-button {
        display: inline-grid !important;
    }
}
/* Cash register payment summary and reconciliation alignment */

.register-payment-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.register-close-card {
    width: min(920px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.register-reconciliation-grid {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.register-reconciliation-row {
    display: grid;
    grid-template-columns:
        minmax(170px, 1.3fr)
        minmax(115px, 0.75fr)
        minmax(170px, 1fr)
        minmax(115px, 0.75fr);
    align-items: end;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--border-color, #dbe3ef);
    border-radius: 12px;
    background: var(--surface-muted, #f8fafc);
}

.register-reconciliation-row > div,
.register-reconciliation-row > label {
    min-width: 0;
    margin: 0;
}

.register-reconciliation-row > div:first-child {
    align-self: center;
}

.register-reconciliation-row strong,
.register-reconciliation-row small {
    display: block;
}

.register-reconciliation-row > div:first-child > strong {
    margin-bottom: 4px;
    color: var(--text-strong, #13213a);
    font-size: 0.95rem;
}

.register-reconciliation-row small {
    color: var(--text-muted, #64748b);
    font-size: 0.76rem;
    line-height: 1.35;
}

.register-reconciliation-row label small,
.register-reconciliation-row > div:not(:first-child) small {
    margin-bottom: 6px;
}

.register-reconciliation-row .form-input {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
}

.register-reconciliation-row > div:last-child {
    align-self: center;
    text-align: right;
}

.reconciliation-variance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid var(--border-color, #dbe3ef);
    border-radius: 10px;
}

.register-session-reconciliation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.register-session-reconciliation > div {
    padding: 14px;
    border: 1px solid var(--border-color, #dbe3ef);
    border-radius: 10px;
    background: var(--surface-muted, #f8fafc);
}

.register-session-reconciliation small,
.register-session-reconciliation strong {
    display: block;
}

.register-session-reconciliation strong {
    margin: 6px 0;
}

@media (max-width: 1100px) {
    .register-payment-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .register-reconciliation-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .register-reconciliation-row > div:last-child {
        text-align: left;
    }
}

@media (max-width: 640px) {
    .register-payment-metrics,
    .register-session-reconciliation,
    .register-reconciliation-row {
        grid-template-columns: 1fr;
    }
}
/* Register history payment-method columns */

.register-history-table-wrap,
.register-history-table-wrapper,
.register-history-table-container {
    overflow-x: auto;
}

.register-history-table {
    min-width: 1500px;
}

.register-history-table th,
.register-history-table td {
    white-space: nowrap;
}

.register-history-table th:first-child,
.register-history-table td:first-child {
    min-width: 290px;
}

.register-history-table th:last-child,
.register-history-table td:last-child {
    min-width: 96px;
    text-align: right;
}

/* =========================================================
   BRANCH SWITCHER VISIBILITY FIX
   ========================================================= */

.branch-switcher__menu[hidden] {
    display: none !important;
}

.branch-switcher__menu:not([hidden]) {
    display: block;
}

.branch-switcher {
    position: relative;
    z-index: 1300;
}

.branch-switcher__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    z-index: 1400;
    width: min(360px, calc(100vw - 24px));
    max-height: min(420px, calc(100vh - 110px));
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
}

.branch-switcher__list {
    max-height: 340px;
    overflow-y: auto;
    padding: 8px;
}

.topbar,
.topbar-actions {
    overflow: visible !important;
}
.branch-switcher {
    position: relative !important;
    z-index: 5000 !important;
}

.branch-switcher__button {
    position: relative;
    z-index: 5001;
    pointer-events: auto !important;
}

.branch-switcher__menu {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    z-index: 9999 !important;
    display: block;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.branch-switcher__menu[hidden] {
    display: none !important;
}

.topbar,
.topbar-actions,
.workspace,
.app-shell {
    overflow: visible !important;
}
.branch-switcher__menu[hidden] {
    display: none !important;
}

.branch-switcher__menu:not([hidden]) {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.branch-switcher__menu {
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow:
        0 20px 50px rgba(15, 23, 42, 0.24);
}

/* =========================================================
   BRANCH PRODUCTS PAGE
   Native Smart POS styling - no Bootstrap CSS required.
   ========================================================= */

.branch-products-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 24px 28px 32px;
    box-sizing: border-box;
    color: var(--ink-900, #0f172a);
}

/* Header */

.branch-products-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    margin-bottom: 18px;
}

.branch-products-header__content {
    min-width: 0;
}

.branch-products-eyebrow {
    margin: 0 0 5px;
    color: var(--blue-600, #246bfd);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.09em;
}

.branch-products-header h1 {
    margin: 0 0 7px;
    color: var(--ink-900, #0f172a);
    font-size: clamp(22px, 2vw, 28px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.04em;
}

.branch-products-subtitle {
    max-width: 720px;
    margin: 0;
    color: var(--ink-500, #64748b);
    font-size: 11px;
    line-height: 1.6;
}

.branch-context {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    min-height: 32px;
    margin-top: 12px;
    padding: 0 12px;
    border: 1px solid #d7e2f5;
    border-radius: 999px;
    background: #f2f6ff;
    color: #315b98;
    font-size: 9px;
    font-weight: 700;
}

.branch-context i {
    color: var(--blue-600, #246bfd);
}

.branch-context span {
    color: var(--ink-500, #64748b);
}

.branch-context strong {
    max-width: 280px;
    overflow: hidden;
    color: var(--ink-900, #0f172a);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Buttons */

.branch-products-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 15px;
    border: 1px solid transparent;
    border-radius: 9px;
    font: inherit;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        border-color 0.16s ease,
        background 0.16s ease;
}

.branch-products-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.branch-products-button:focus-visible {
    outline: 3px solid rgba(36, 107, 253, 0.16);
    outline-offset: 2px;
}

.branch-products-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.branch-products-button--primary {
    border-color: var(--blue-600, #246bfd);
    background: linear-gradient(135deg, #2f76ff, #135fe7);
    color: #fff;
    box-shadow: 0 8px 20px rgba(36, 107, 253, 0.22);
}

.branch-products-button--secondary {
    border-color: #dce3ec;
    background: #fff;
    color: var(--ink-700, #334155);
}

.branch-products-button--secondary:hover:not(:disabled) {
    border-color: #bac7d8;
    background: #f8fafc;
}

.branch-products-button--danger {
    border-color: #d94152;
    background: linear-gradient(135deg, #e34b5c, #bd2435);
    color: #fff;
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.2);
}

/* Alert */

.branch-products-alert {
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 10px;
    line-height: 1.5;
}

.branch-products-alert.is-hidden,
.branch-products-alert.d-none {
    display: none;
}

.branch-products-alert.alert-danger {
    border-color: #f2c7cd;
    background: #fff3f5;
    color: #9e2633;
}

.branch-products-alert.alert-success {
    border-color: #bce8d8;
    background: #effcf7;
    color: #087354;
}

.branch-products-alert.alert-warning {
    border-color: #f1d7a9;
    background: #fff8e8;
    color: #8a5708;
}

/* Summary cards */

.branch-products-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.branch-products-stat {
    position: relative;
    min-width: 0;
    min-height: 88px;
    overflow: hidden;
    padding: 17px 18px 16px 21px;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 12px;
    background: var(--surface, #fff);
    box-shadow: var(--shadow-sm, 0 6px 18px rgba(15, 23, 42, 0.06));
}

.branch-products-stat::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 4px 0 0 4px;
    content: "";
}

.branch-products-stat--blue::before {
    background: #246bfd;
}

.branch-products-stat--green::before {
    background: #16a36a;
}

.branch-products-stat--orange::before {
    background: #e88b11;
}

.branch-products-stat--violet::before {
    background: #7c4dff;
}

.branch-products-stat__label {
    margin-bottom: 7px;
    color: var(--ink-500, #64748b);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.branch-products-stat__value {
    color: var(--ink-900, #0f172a);
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
}

/* Main panel */

.branch-products-panel {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 12px;
    background: var(--surface, #fff);
    box-shadow: var(--shadow-sm, 0 6px 18px rgba(15, 23, 42, 0.06));
}

.branch-products-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) minmax(220px, 0.9fr) 150px;
    align-items: end;
    gap: 10px;
    padding: 14px;
    border-bottom: 1px solid var(--line, #e2e8f0);
}

.branch-products-field {
    min-width: 0;
}

.branch-products-field label,
.branch-products-form-field label {
    display: block;
    margin: 0 0 6px;
    color: var(--ink-500, #64748b);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.branch-products-field input,
.branch-products-field select,
.branch-products-form-field input {
    width: 100%;
    height: 40px;
    box-sizing: border-box;
    padding: 0 12px;
    border: 1px solid #dce3ec;
    border-radius: 9px;
    outline: none;
    background: #fff;
    color: var(--ink-900, #0f172a);
    font: inherit;
    font-size: 10px;
    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease;
}

.branch-products-field select {
    padding-right: 34px;
    cursor: pointer;
}

.branch-products-field input::placeholder,
.branch-products-form-field input::placeholder {
    color: #9aa7b8;
}

.branch-products-field input:focus,
.branch-products-field select:focus,
.branch-products-form-field input:focus {
    border-color: var(--blue-600, #246bfd);
    box-shadow: 0 0 0 3px rgba(36, 107, 253, 0.1);
}

.branch-products-form-field input[readonly] {
    background: #f5f7fa;
    color: var(--ink-500, #64748b);
}

.branch-products-input-wrap {
    position: relative;
}

.branch-products-input-wrap > i {
    position: absolute;
    top: 50%;
    left: 12px;
    z-index: 1;
    color: #8b98aa;
    font-size: 11px;
    transform: translateY(-50%);
    pointer-events: none;
}

.branch-products-input-wrap input {
    padding-left: 34px;
}

.branch-products-toolbar__action .branch-products-button {
    width: 100%;
}

/* Table */

.branch-products-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

.branch-products-table {
    width: 100%;
    min-width: 1050px;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 9px;
}

.branch-products-table th {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line, #e2e8f0);
    background: #f8fafc;
    color: var(--ink-500, #64748b);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.045em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.branch-products-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #edf0f5;
    color: var(--ink-700, #334155);
    vertical-align: middle;
    white-space: nowrap;
}

.branch-products-table tbody tr:last-child td {
    border-bottom: 0;
}

.branch-products-table tbody tr:hover {
    background: #fafcff;
}

.branch-products-table th:first-child,
.branch-products-table td:first-child {
    min-width: 190px;
}

.branch-products-table th:nth-child(2),
.branch-products-table td:nth-child(2) {
    min-width: 100px;
}

.branch-products-table th:nth-child(3),
.branch-products-table td:nth-child(3) {
    min-width: 110px;
}

.branch-products-table th:nth-child(4),
.branch-products-table td:nth-child(4) {
    min-width: 110px;
}

.branch-products-table th:nth-child(5),
.branch-products-table td:nth-child(5),
.branch-products-table th:nth-child(9),
.branch-products-table td:nth-child(9) {
    min-width: 80px;
}

.branch-products-table th:nth-child(6),
.branch-products-table td:nth-child(6),
.branch-products-table th:nth-child(7),
.branch-products-table td:nth-child(7),
.branch-products-table th:nth-child(8),
.branch-products-table td:nth-child(8) {
    min-width: 115px;
}

.branch-products-table th:last-child,
.branch-products-table td:last-child {
    position: sticky;
    right: 0;
    min-width: 132px;
    background: #fff;
    box-shadow: -8px 0 14px rgba(20, 42, 76, 0.06);
}

.branch-products-table th:last-child {
    z-index: 3;
    background: #f8fafc;
}

.branch-products-table td:last-child {
    z-index: 2;
}

.branch-products-table tbody tr:hover td:last-child {
    background: #fafcff;
}

.branch-products-table__actions {
    text-align: right;
}

.branch-products-table__message {
    padding: 44px 16px !important;
    text-align: center;
    color: var(--ink-500, #64748b) !important;
}

.branch-products-page .product-name {
    max-width: 240px;
}

.branch-products-page .product-name .fw-semibold {
    display: block;
    max-width: 220px;
    overflow: hidden;
    color: var(--ink-900, #0f172a);
    font-size: 10px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.branch-products-page .product-name small {
    display: block;
    margin-top: 4px;
    color: var(--ink-500, #64748b);
    font-size: 8px;
}

.branch-products-page .price-value {
    color: var(--ink-900, #0f172a);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.branch-products-page .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 800;
}

.branch-products-page .text-bg-success {
    background: #e7f9f1;
    color: #087354;
}

.branch-products-page .text-bg-secondary {
    background: #edf1f6;
    color: var(--ink-700, #334155);
}

.branch-products-page .stock-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #e7f9f1;
    color: #087354;
    font-size: 9px;
    font-weight: 800;
}

.branch-products-page .stock-value.low-stock {
    background: #fff4df;
    color: #9a5c00;
}

.branch-products-page .btn-group {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.branch-products-page .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 29px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: #fff;
    font: inherit;
    font-size: 8px;
    font-weight: 800;
    cursor: pointer;
}

.branch-products-page .btn-outline-primary {
    border-color: #c7d8f8;
    background: #f7faff;
    color: #246bfd;
}

.branch-products-page .btn-outline-danger {
    border-color: #f0c8ce;
    background: #fff9fa;
    color: #c73546;
}

/* Modal */

.branch-products-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
    background: rgba(5, 14, 28, 0.58);
    backdrop-filter: blur(4px);
}

.branch-products-modal.show {
    display: flex;
}

.branch-products-modal__dialog {
    width: min(520px, 100%);
    margin: auto;
    animation: branchProductsModalIn 0.18s ease;
}

.branch-products-modal__dialog--large {
    width: min(760px, 100%);
}

.branch-products-modal__content {
    display: flex;
    max-height: calc(100vh - 48px);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.branch-products-modal__header {
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line, #e2e8f0);
}

.branch-products-modal__eyebrow {
    margin: 0 0 4px;
    color: var(--ink-500, #64748b);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.branch-products-modal__header h2 {
    margin: 0;
    color: var(--ink-900, #0f172a);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.branch-products-modal__close {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    padding: 0;
    border: 1px solid #e2e7ee;
    border-radius: 9px;
    background: #fff;
    color: var(--ink-500, #64748b);
    cursor: pointer;
}

.branch-products-modal__close:hover {
    background: #f5f7fa;
    color: var(--ink-900, #0f172a);
}

.branch-products-modal__body {
    overflow-y: auto;
    padding: 20px;
}

.branch-products-modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--line, #e2e8f0);
    background: #f9fbfd;
}

/* Form */

.branch-products-form-field {
    margin-bottom: 16px;
}

.branch-products-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.branch-products-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 3px 0 18px;
    cursor: pointer;
}

.branch-products-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.branch-products-switch__track {
    position: relative;
    width: 42px;
    height: 24px;
    flex: 0 0 42px;
    border-radius: 999px;
    background: #cbd5e1;
    transition: background 0.18s ease;
}

.branch-products-switch__thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.22);
    transition: transform 0.18s ease;
}

.branch-products-switch input:checked + .branch-products-switch__track {
    background: #246bfd;
}

.branch-products-switch input:checked
+ .branch-products-switch__track
.branch-products-switch__thumb {
    transform: translateX(18px);
}

.branch-products-switch__label {
    color: var(--ink-700, #334155);
    font-size: 10px;
    font-weight: 800;
}

/* Assignment list */

.branch-products-list {
    display: grid;
    gap: 7px;
    margin-top: 14px;
}

.branch-products-list .list-group-item {
    width: 100%;
    padding: 13px;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 10px;
    background: #fff;
    color: var(--ink-900, #0f172a);
    text-align: left;
    cursor: pointer;
    transition:
        transform 0.16s ease,
        border-color 0.16s ease,
        background 0.16s ease;
}

.branch-products-list .list-group-item:hover {
    transform: translateY(-1px);
    border-color: #b8cdf5;
    background: #f7faff;
}

.branch-products-list .d-flex {
    display: flex;
}

.branch-products-list .justify-content-between {
    justify-content: space-between;
}

.branch-products-list .gap-3 {
    gap: 1rem;
}

.branch-products-list .text-nowrap {
    white-space: nowrap;
}

.branch-products-list .fw-semibold {
    font-size: 10px;
    font-weight: 800;
}

.branch-products-list small {
    display: block;
    margin-top: 5px;
    color: var(--ink-500, #64748b);
    font-size: 8px;
}

/* Remove confirmation */

.branch-products-confirmation {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border: 1px solid #f1ccd2;
    border-radius: 12px;
    background: #fff8f9;
}

.branch-products-confirmation__icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 10px;
    background: #ffe9ec;
    color: #c73546;
}

.branch-products-confirmation h3 {
    margin: 0 0 6px;
    color: var(--ink-900, #0f172a);
    font-size: 12px;
    font-weight: 800;
}

.branch-products-confirmation p {
    margin: 0;
    color: var(--ink-500, #64748b);
    font-size: 9px;
    line-height: 1.6;
}

body.branch-product-modal-open {
    overflow: hidden;
}

@keyframes branchProductsModalIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive */

@media (max-width: 1180px) {
    .branch-products-page {
        padding-right: 20px;
        padding-left: 20px;
    }

    .branch-products-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .branch-products-toolbar {
        grid-template-columns: minmax(0, 1fr) minmax(190px, 240px);
    }

    .branch-products-toolbar__action {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .branch-products-page {
        padding: 18px 14px 26px;
    }

    .branch-products-header {
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 14px;
    }

    .branch-products-header > .branch-products-button {
        width: 100%;
    }

    .branch-products-summary {
        grid-template-columns: 1fr;
    }

    .branch-products-toolbar {
        grid-template-columns: 1fr;
    }

    .branch-products-toolbar__action {
        grid-column: auto;
    }

    .branch-products-form-grid {
        grid-template-columns: 1fr;
    }

    .branch-context {
        width: 100%;
        box-sizing: border-box;
        border-radius: 10px;
    }

    .branch-context strong {
        max-width: calc(100% - 135px);
    }

    .branch-products-modal {
        padding: 12px;
    }

    .branch-products-modal__footer {
        flex-direction: column-reverse;
    }

    .branch-products-modal__footer .branch-products-button {
        width: 100%;
    }
}

/* =========================================================
   BRANCH PRODUCTS - ENHANCED ASSIGNMENT CATALOGUE
   Append after the existing Branch Products CSS.
   ========================================================= */

.branch-products-modal__dialog--catalogue {
    width: min(1040px, calc(100vw - 48px));
}

.branch-products-modal__subtitle {
    max-width: 620px;
    margin: 5px 0 0;
    color: var(--ink-500, #64748b);
    font-size: 9px;
    line-height: 1.5;
}

.branch-products-catalogue-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 240px);
    gap: 12px;
    margin-bottom: 12px;
}

.branch-products-catalogue-search {
    position: relative;
}

.branch-products-catalogue-search > i {
    position: absolute;
    top: 50%;
    left: 13px;
    color: #8492a6;
    font-size: 11px;
    transform: translateY(-50%);
    pointer-events: none;
}

.branch-products-catalogue-search input {
    width: 100%;
    height: 42px;
    box-sizing: border-box;
    padding: 0 40px 0 36px;
    border: 1px solid #dce3ec;
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: var(--ink-900, #0f172a);
    font: inherit;
    font-size: 10px;
    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease;
}

.branch-products-catalogue-search input:focus,
.branch-products-catalogue-filter:focus {
    border-color: var(--blue-600, #246bfd);
    box-shadow: 0 0 0 3px rgba(36, 107, 253, 0.1);
}

.branch-products-search-clear {
    position: absolute;
    top: 50%;
    right: 8px;
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #8794a7;
    cursor: pointer;
    transform: translateY(-50%);
}

.branch-products-search-clear:hover {
    background: #f0f4f8;
    color: var(--ink-900, #0f172a);
}

.branch-products-catalogue-filter {
    width: 100%;
    height: 42px;
    box-sizing: border-box;
    padding: 0 34px 0 12px;
    border: 1px solid #dce3ec;
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: var(--ink-900, #0f172a);
    font: inherit;
    font-size: 10px;
    cursor: pointer;
}

.branch-products-selection-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
    padding: 9px 12px;
    border: 1px solid #e3e9f1;
    border-radius: 9px;
    background: #f8fafc;
    color: var(--ink-500, #64748b);
    font-size: 9px;
    font-weight: 700;
}

.branch-products-select-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.branch-products-select-all input,
.branch-products-product-card__checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--blue-600, #246bfd);
    cursor: pointer;
}

.branch-products-catalogue-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-height: min(58vh, 560px);
    overflow-y: auto;
    padding: 2px 3px 4px 1px;
}

.branch-products-product-card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 11px;
    padding: 14px;
    border: 1px solid #dfe6ef;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition:
        transform 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        background 0.16s ease;
}

.branch-products-product-card:hover {
    transform: translateY(-1px);
    border-color: #b9cef5;
    background: #fafdff;
    box-shadow: 0 8px 18px rgba(36, 107, 253, 0.08);
}

.branch-products-product-card.is-selected {
    border-color: var(--blue-600, #246bfd);
    background: #f5f8ff;
    box-shadow: 0 0 0 2px rgba(36, 107, 253, 0.08);
}

.branch-products-product-card__checkbox {
    padding-top: 2px;
}

.branch-products-product-card__content {
    min-width: 0;
}

.branch-products-product-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.branch-products-product-card__name {
    min-width: 0;
    overflow: hidden;
    color: var(--ink-900, #0f172a);
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.branch-products-product-card__price {
    flex: 0 0 auto;
    color: var(--ink-900, #0f172a);
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.branch-products-product-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.branch-products-product-card__tag {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--ink-500, #64748b);
    font-size: 8px;
    font-weight: 700;
}

.branch-products-product-card__tag--sku {
    background: #eef4ff;
    color: #315b98;
}

.branch-products-product-card__details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #edf1f5;
}

.branch-products-product-card__detail {
    min-width: 0;
}

.branch-products-product-card__detail span {
    display: block;
    margin-bottom: 3px;
    color: var(--ink-500, #64748b);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.branch-products-product-card__detail strong {
    display: block;
    overflow: hidden;
    color: var(--ink-700, #334155);
    font-size: 9px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.branch-products-catalogue-empty {
    grid-column: 1 / -1;
    padding: 42px 16px;
    text-align: center;
    color: var(--ink-500, #64748b);
    font-size: 10px;
}

.branch-products-catalogue-empty i {
    display: block;
    margin-bottom: 10px;
    color: #9ca8b8;
    font-size: 24px;
}

@media (max-width: 850px) {
    .branch-products-modal__dialog--catalogue {
        width: min(720px, calc(100vw - 24px));
    }

    .branch-products-catalogue-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .branch-products-catalogue-toolbar {
        grid-template-columns: 1fr;
    }

    .branch-products-selection-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .branch-products-product-card__top {
        flex-direction: column;
    }

    .branch-products-product-card__details {
        grid-template-columns: 1fr;
    }
}
/* =========================================================
   SMART POS - SUPPLIERS PAGE
   Matched to Products & Customers UI
   ========================================================= */

.suppliers-page {
    width: 100%;
    min-width: 0;
    padding: 18px;
    box-sizing: border-box;
    color: #17223b;
    background: #f4f7fb;
}

.suppliers-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.suppliers-header__copy {
    min-width: 0;
}

.suppliers-eyebrow {
    margin: 0 0 6px;
    color: #246bfd;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.suppliers-header h1 {
    margin: 0 0 6px;
    color: #111a2e;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.suppliers-subtitle {
    margin: 0;
    color: #6f7f99;
    font-size: 12px;
    line-height: 1.55;
}

.suppliers-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.suppliers-button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.suppliers-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.suppliers-button--primary {
    border-color: #246bfd;
    background: #246bfd;
    color: #fff;
    box-shadow: 0 8px 18px rgba(36, 107, 253, 0.22);
}

.suppliers-button--secondary {
    border-color: #d9e2ef;
    background: #fff;
    color: #34425d;
}

.suppliers-alert {
    margin-bottom: 14px;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 12px;
}

.suppliers-alert.is-hidden {
    display: none;
}

.suppliers-alert.alert-success {
    border-color: #bce8d8;
    background: #effcf7;
    color: #087354;
}

.suppliers-alert.alert-danger {
    border-color: #f2c7cd;
    background: #fff3f5;
    color: #9e2633;
}

.suppliers-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.suppliers-stat {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 13px;
    padding: 16px;
    border: 1px solid #dfe6ef;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.suppliers-stat__icon {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border-radius: 10px;
    font-size: 16px;
}

.suppliers-stat__icon--blue {
    background: #e9f0ff;
    color: #246bfd;
}

.suppliers-stat__icon--green {
    background: #e4f9ee;
    color: #0ba56b;
}

.suppliers-stat__icon--orange {
    background: #fff1d9;
    color: #e08b00;
}

.suppliers-stat__icon--gray {
    background: #edf1f6;
    color: #60708a;
}

.suppliers-stat__content {
    min-width: 0;
}

.suppliers-stat__label {
    display: block;
    margin-bottom: 5px;
    color: #6f7f99;
    font-size: 11px;
    font-weight: 600;
}

.suppliers-stat strong {
    display: block;
    color: #111a2e;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
}

.suppliers-panel {
    overflow: hidden;
    border: 1px solid #dfe6ef;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.suppliers-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1.8fr) 170px 170px 130px;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border-bottom: 1px solid #dfe6ef;
}

.suppliers-input-wrap {
    position: relative;
}

.suppliers-input-wrap > i {
    position: absolute;
    top: 50%;
    left: 13px;
    color: #8a98ad;
    font-size: 12px;
    transform: translateY(-50%);
    pointer-events: none;
}

.suppliers-input-wrap input,
.suppliers-toolbar-select,
.suppliers-form-field input,
.suppliers-form-field select,
.suppliers-form-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d6dfeb;
    border-radius: 9px;
    outline: none;
    background: #fff;
    color: #17223b;
    font: inherit;
    font-size: 12px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.suppliers-input-wrap input,
.suppliers-toolbar-select,
.suppliers-form-field input,
.suppliers-form-field select {
    height: 40px;
    padding: 0 12px;
}

.suppliers-input-wrap input {
    padding-left: 38px;
}

.suppliers-toolbar-select {
    cursor: pointer;
}

.suppliers-input-wrap input:focus,
.suppliers-toolbar-select:focus,
.suppliers-form-field input:focus,
.suppliers-form-field select:focus,
.suppliers-form-field textarea:focus {
    border-color: #246bfd;
    box-shadow: 0 0 0 3px rgba(36, 107, 253, 0.10);
}

.suppliers-refresh {
    width: 100%;
}

.suppliers-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.suppliers-table {
    width: 100%;
    min-width: 1180px;
    border-collapse: collapse;
    font-size: 12px;
}

.suppliers-table th {
    padding: 12px 16px;
    border-bottom: 1px solid #dfe6ef;
    background: #f8fafc;
    color: #5d6d87;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.045em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.suppliers-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #e7edf5;
    color: #34425d;
    vertical-align: middle;
    white-space: nowrap;
}

.suppliers-table tbody tr:hover {
    background: #fbfcfe;
}

.suppliers-table__message {
    padding: 40px 16px !important;
    color: #7b8aa3 !important;
    text-align: center;
}

.suppliers-table__actions {
    text-align: right;
}

.suppliers-name {
    display: block;
    max-width: 220px;
    overflow: hidden;
    color: #111a2e;
    font-weight: 800;
    text-overflow: ellipsis;
}

.suppliers-town {
    display: block;
    margin-top: 4px;
    color: #7b8aa3;
    font-size: 11px;
}

.suppliers-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}

.suppliers-badge--active {
    background: #dcf8e9;
    color: #078353;
}

.suppliers-badge--hold {
    background: #fff0ce;
    color: #9b6500;
}

.suppliers-badge--inactive {
    background: #edf1f6;
    color: #58677f;
}

.suppliers-badge--blacklisted {
    background: #ffe5e8;
    color: #be2f41;
}

.suppliers-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.suppliers-action {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid #d6dfeb;
    border-radius: 8px;
    background: #fff;
    color: #34425d;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.suppliers-action--primary {
    border-color: #c6d8ff;
    color: #246bfd;
}

.suppliers-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-top: 1px solid #dfe6ef;
    color: #6f7f99;
    font-size: 11px;
}

.suppliers-pagination__controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.suppliers-page-button {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    border: 1px solid #d6dfeb;
    border-radius: 8px;
    background: #fff;
    color: #5f6f88;
    cursor: pointer;
}

.suppliers-page-button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.suppliers-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
    background: rgba(23, 34, 59, 0.62);
    backdrop-filter: blur(4px);
}

.suppliers-modal.show {
    display: flex;
}

.suppliers-modal__dialog {
    width: min(520px, 100%);
    margin: auto;
}

.suppliers-modal__dialog--large {
    width: min(920px, calc(100vw - 48px));
}

.suppliers-modal__content {
    display: flex;
    max-height: calc(100vh - 48px);
    flex-direction: column;
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.suppliers-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 26px 18px;
    border-bottom: 1px solid #e2e8f0;
}

.suppliers-modal__eyebrow {
    margin: 0 0 6px;
    color: #246bfd;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.suppliers-modal__header h2 {
    margin: 0;
    color: #111a2e;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.suppliers-modal__subtitle {
    margin: 6px 0 0;
    color: #71809a;
    font-size: 12px;
    line-height: 1.5;
}

.suppliers-modal__close {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    padding: 0;
    border: 1px solid #dce4ef;
    border-radius: 9px;
    background: #fff;
    color: #6a7890;
    cursor: pointer;
}

.suppliers-modal__body {
    overflow-y: auto;
    padding: 22px 26px 8px;
}

.suppliers-modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 26px 22px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.suppliers-form-section {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e6ebf2;
}

.suppliers-form-section--last {
    border-bottom: 0;
}

.suppliers-form-section__heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.suppliers-form-section__icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 9px;
    font-size: 13px;
}

.suppliers-form-section__icon--blue {
    background: #e9f0ff;
    color: #246bfd;
}

.suppliers-form-section__icon--green {
    background: #e4f9ee;
    color: #0ba56b;
}

.suppliers-form-section__icon--violet {
    background: #f0eafe;
    color: #7c4dff;
}

.suppliers-form-section__icon--orange {
    background: #fff1d9;
    color: #e08b00;
}

.suppliers-form-section__icon--gray {
    background: #edf1f6;
    color: #60708a;
}

.suppliers-form-section__heading h3 {
    margin: 0;
    color: #17223b;
    font-size: 13px;
    font-weight: 800;
}

.suppliers-form-section__heading p {
    margin: 3px 0 0;
    color: #7b8aa3;
    font-size: 11px;
}

.suppliers-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.suppliers-form-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.suppliers-form-field--wide {
    grid-column: span 2;
}

.suppliers-form-field label {
    display: block;
    margin: 0 0 7px;
    color: #43516b;
    font-size: 11px;
    font-weight: 700;
}

.suppliers-form-field textarea {
    min-height: 90px;
    padding: 11px 12px;
    resize: vertical;
}

.suppliers-field-suffix {
    position: relative;
}

.suppliers-field-suffix input {
    padding-right: 52px;
}

.suppliers-field-suffix span {
    position: absolute;
    top: 50%;
    right: 12px;
    color: #7b8aa3;
    font-size: 11px;
    transform: translateY(-50%);
    pointer-events: none;
}

.suppliers-status-card {
    margin-bottom: 16px;
    padding: 13px 14px;
    border: 1px solid #dfe6ef;
    border-radius: 10px;
    background: #f8fafc;
}

.suppliers-status-card span {
    display: block;
    margin-bottom: 4px;
    color: #7b8aa3;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.suppliers-status-card strong {
    color: #17223b;
    font-size: 13px;
}

body.suppliers-modal-open {
    overflow: hidden;
}

@media (max-width: 1100px) {
    .suppliers-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .suppliers-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .suppliers-refresh {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .suppliers-page {
        padding: 14px;
    }

    .suppliers-header {
        align-items: stretch;
        flex-direction: column;
    }

    .suppliers-header .suppliers-button {
        width: 100%;
    }

    .suppliers-summary,
    .suppliers-toolbar,
    .suppliers-form-grid,
    .suppliers-form-grid--two {
        grid-template-columns: 1fr;
    }

    .suppliers-form-field--wide {
        grid-column: auto;
    }

    .suppliers-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .suppliers-pagination__controls {
        justify-content: space-between;
    }

    .suppliers-modal {
        padding: 12px;
    }

    .suppliers-modal__dialog--large {
        width: 100%;
    }

    .suppliers-modal__footer {
        flex-direction: column-reverse;
    }

    .suppliers-modal__footer .suppliers-button {
        width: 100%;
    }
}


.row-action.woo-sync {
    color: #7f54b3;
    background: rgba(127, 84, 179, 0.1);
}

.row-action.woo-sync:hover {
    color: #ffffff;
    background: #7f54b3;
}

.row-action.woo-sync:disabled {
    cursor: wait;
    opacity: 0.65;
}

/* Smart POS mobile/responsive shell enhancements */

:root {
    --mobile-header-height: 64px;
    --mobile-gutter: 14px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
}

html {
    min-width: 320px;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body.app-body {
    min-width: 320px;
    overflow-x: hidden;
}

button,
a,
input,
select,
textarea {
    touch-action: manipulation;
}

.icon-button,
.nav-link,
.branch-switcher__button {
    -webkit-tap-highlight-color: transparent;
}

.app-shell,
.workspace,
.app-view {
    min-width: 0;
}

/* Prevent loaded SPA pages from forcing the whole shell wider. */
.app-view > * {
    min-width: 0;
    max-width: 100%;
}

.app-view img,
.app-view svg,
.app-view canvas,
.app-view video {
    max-width: 100%;
    height: auto;
}

.app-view table {
    max-width: 100%;
}

/* Tablet and below */
@media (max-width: 1024px) {
    body.sidebar-open {
        overflow: hidden;
        overscroll-behavior: contain;
    }

    .app-shell {
        display: block;
        min-height: 100dvh;
    }

    .workspace {
        width: 100%;
        min-height: 100dvh;
    }

    .sidebar {
        position: fixed;
        z-index: 1200;
        inset: 0 auto 0 0;
        width: min(86vw, 320px);
        max-width: 320px;
        height: 100dvh;
        padding-top: var(--safe-top);
        padding-bottom: var(--safe-bottom);
        transform: translate3d(-105%, 0, 0);
        transition: transform 220ms ease;
        box-shadow: 18px 0 45px rgb(15 23 42 / 0.22);
        will-change: transform;
    }

    .sidebar.is-open {
        transform: translate3d(0, 0, 0);
    }

    .sidebar-overlay {
        position: fixed;
        z-index: 1150;
        inset: 0;
        display: block;
        background: rgb(15 23 42 / 0.52);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 180ms ease, visibility 180ms ease;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.is-visible {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .sidebar-close,
    .menu-button {
        display: inline-grid;
        place-items: center;
        min-width: 44px;
        min-height: 44px;
    }

    .sidebar-brand {
        position: sticky;
        top: 0;
        z-index: 2;
    }

    .sidebar-nav {
        overscroll-behavior: contain;
        scrollbar-width: thin;
    }

    .nav-link {
        min-height: 46px;
    }

    .nav-link kbd {
        display: none;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 1000;
        min-height: calc(var(--mobile-header-height) + var(--safe-top));
        padding: calc(8px + var(--safe-top)) var(--mobile-gutter) 8px;
        gap: 10px;
    }

    .page-heading {
        flex: 1 1 auto;
        min-width: 0;
    }

    .page-heading > div {
        min-width: 0;
    }

    .page-heading h1,
    .page-heading small {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .page-heading h1 {
        font-size: clamp(1rem, 3vw, 1.25rem);
        line-height: 1.2;
    }

    .page-icon {
        flex: 0 0 auto;
    }

    .topbar-actions {
        flex: 0 0 auto;
        gap: 8px;
    }

    .business-date,
    .user-menu > div,
    .branch-switcher__label {
        display: none;
    }

    .user-menu {
        padding: 0;
        background: transparent;
        border: 0;
    }

    .avatar,
    .notification-button,
    .logout-button {
        min-width: 42px;
        width: 42px;
        height: 42px;
    }

    .branch-switcher__button {
        min-height: 42px;
        max-width: 190px;
        padding: 6px 9px;
    }

    .branch-switcher__details {
        min-width: 0;
    }

    .branch-switcher__name {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .branch-switcher__menu {
        position: fixed;
        z-index: 1300;
        top: calc(var(--mobile-header-height) + var(--safe-top) + 8px);
        right: calc(var(--mobile-gutter) + var(--safe-right));
        left: calc(var(--mobile-gutter) + var(--safe-left));
        width: auto;
        max-width: none;
        max-height: min(65dvh, 520px);
        overflow: auto;
    }

    .app-view {
        width: 100%;
        padding: 18px var(--mobile-gutter) calc(22px + var(--safe-bottom));
        overflow-x: hidden;
    }

    /* Generic responsive helpers for SPA fragments. */
    .app-view .table-responsive,
    .app-view .data-table-wrap,
    .app-view .table-container {
        width: 100%;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
    }

    .app-view .page-header,
    .app-view .content-header,
    .app-view .toolbar,
    .app-view .filter-bar,
    .app-view .action-bar {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* Phones */
@media (max-width: 720px) {
    :root {
        --mobile-gutter: 12px;
    }

    .topbar {
        min-height: calc(60px + var(--safe-top));
    }

    .page-icon,
    .logout-form {
        display: none;
    }

    .branch-switcher__icon,
    .branch-switcher__chevron {
        display: none;
    }

    .branch-switcher__button {
        max-width: 128px;
        padding-inline: 10px;
    }

    .topbar-actions {
        gap: 5px;
    }

    .avatar,
    .notification-button {
        width: 40px;
        min-width: 40px;
        height: 40px;
    }

    .app-view {
        padding-top: 14px;
    }

    .toast-region {
        right: calc(10px + var(--safe-right));
        bottom: calc(10px + var(--safe-bottom));
        left: calc(10px + var(--safe-left));
        width: auto;
    }
}

/* Very narrow phones */
@media (max-width: 430px) {
    .page-heading small {
        display: none;
    }

    .page-heading h1 {
        max-width: 34vw;
    }

    .branch-switcher__button {
        max-width: 105px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .sidebar-overlay {
        transition: none;
    }
}

/* =========================================================
   SmartPOS Collapsible Sidebar Sections
   ========================================================= */

.nav-section {
    margin-bottom: 6px;
}

/* Section toggle */

.nav-section-toggle {
    width: 100%;
    min-height: 42px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    padding: 9px 12px;

    border: 0;
    border-radius: 8px;

    background: transparent;
    color: inherit;

    font: inherit;

    cursor: pointer;

    transition:
        background-color 0.18s ease,
        color 0.18s ease;
}

.nav-section-toggle:hover {
    background: rgba(255, 255, 255, 0.055);
}

.nav-section-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Left side: icon + section title */

.nav-section-title {
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 10px;

    font-size: 0.72rem;
    font-weight: 700;

    letter-spacing: 0.075em;
    text-transform: uppercase;

    opacity: 0.78;
}

.nav-section-title > i {
    width: 18px;

    flex: 0 0 18px;

    text-align: center;

    font-size: 0.85rem;

    opacity: 0.8;
}

/* Chevron */

.nav-section-chevron {
    flex: 0 0 auto;

    font-size: 0.68rem;

    opacity: 0.6;

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}

.nav-section-toggle:hover .nav-section-chevron {
    opacity: 1;
}

.nav-section-toggle[aria-expanded="true"]
.nav-section-chevron {
    transform: rotate(180deg);
}

/* Section contents */

.nav-section-items {
    display: block;

    padding-top: 3px;
}

.nav-section-items[hidden] {
    display: none !important;
}

/* Slight indentation for links inside expandable groups */

.nav-section-items > .nav-link {
    margin-left: 4px;
    margin-right: 4px;
}

/* =========================================================
   Accounting/internal sub headings
   ========================================================= */

.nav-sub-label {
    margin:
        14px
        14px
        5px;

    padding: 0;

    font-size: 0.64rem;
    font-weight: 700;

    line-height: 1.2;

    letter-spacing: 0.085em;
    text-transform: uppercase;

    opacity: 0.42;

    pointer-events: none;
    user-select: none;
}

.nav-sub-label:first-of-type {
    margin-top: 10px;
}

/* Give nested sections a subtle visual hierarchy */

.nav-section-items .nav-sub-label + .nav-link {
    margin-top: 2px;
}

/* =========================================================
   Active section state
   ========================================================= */

.nav-section:has(.nav-link.active)
.nav-section-toggle {
    background: rgba(255, 255, 255, 0.04);
}

.nav-section:has(.nav-link.active)
.nav-section-title {
    opacity: 1;
}

/* =========================================================
   Empty permission-controlled groups
   ========================================================= */

/*
   Your permission JS can hide links.
   JS below also hides a section when no visible links remain.
*/

.nav-section.nav-section--empty {
    display: none;
}

/* =========================================================
   Optional separator between major groups
   ========================================================= */

.nav-section + .nav-section {
    margin-top: 3px;
}

/* =========================================================
   Sidebar compact/collapsed mode support
   Adapt these selectors if your collapsed-sidebar class differs.
   ========================================================= */

.sidebar.sidebar--collapsed .nav-section-title span,
.sidebar.sidebar--collapsed .nav-section-chevron,
.sidebar.sidebar--collapsed .nav-sub-label {
    display: none;
}

.sidebar.sidebar--collapsed .nav-section-toggle {
    justify-content: center;

    padding-left: 8px;
    padding-right: 8px;
}

.sidebar.sidebar--collapsed
.nav-section-title {
    justify-content: center;
}

.sidebar.sidebar--collapsed
.nav-section-title > i {
    margin: 0;
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 768px) {
    .nav-section-toggle {
        min-height: 46px;
    }

    .nav-section-title {
        font-size: 0.74rem;
    }

    .nav-sub-label {
        margin-left: 16px;
    }
}

/* =========================================================
   Reduced motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .nav-section-toggle,
    .nav-section-chevron {
        transition: none;
    }
}