:root {
    --red: #C62828;
    --red-dark: #8E1414;
    --magenta: #AD1457;
    --yellow: #F9A825;
    --yellow-soft: #FFF3CD;
    --ivory: #FFF8F0;
    --ivory-dark: #F4E5D6;
    --canvas: #F6F3EF;
    --white: #FFFFFF;
    --ink: #1A1A1A;
    --muted: #716A64;
    --border: #E8DED4;
    --green: #2E7D32;
    --blue: #1565C0;
    --shadow-sm: 0 5px 22px rgba(45, 30, 24, .08);
    --shadow-md: 0 16px 42px rgba(45, 30, 24, .14);
    --sidebar: 285px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; font-family: Inter, system-ui, sans-serif; color: var(--ink); background: var(--canvas); }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
.me-1 { margin-right: .25rem; }
.me-2 { margin-right: .5rem; }

.login-body {
    display: grid;
    place-items: center;
    padding: 32px;
    background:
        radial-gradient(circle at 12% 12%, rgba(249, 168, 37, .23), transparent 30%),
        radial-gradient(circle at 88% 88%, rgba(173, 20, 87, .16), transparent 34%),
        #F8F3EC;
}
.login-shell { width: min(1120px, 100%); min-height: 680px; display: grid; grid-template-columns: 1.08fr .92fr; overflow: hidden; border-radius: 32px; background: #fff; box-shadow: 0 30px 90px rgba(79, 45, 32, .18); }
.login-brand-panel { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 72px; color: #fff; background: linear-gradient(145deg, var(--red-dark), var(--red) 48%, var(--magenta)); overflow: hidden; }
.login-brand-panel::before, .login-brand-panel::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,.07); }
.login-brand-panel::before { width: 360px; height: 360px; right: -160px; top: -100px; }
.login-brand-panel::after { width: 260px; height: 260px; left: -120px; bottom: -110px; }
.brand-mark { position: relative; z-index: 1; width: 74px; height: 74px; display: grid; place-items: center; margin-bottom: 30px; border-radius: 22px; color: var(--red); background: var(--yellow); font-size: 31px; box-shadow: 0 18px 38px rgba(0,0,0,.2); }
.eyebrow { margin: 0 0 11px; color: var(--yellow); font-size: 12px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.login-brand-panel h1 { position: relative; z-index: 1; margin: 0; max-width: 580px; font-size: clamp(37px, 5vw, 58px); line-height: 1.02; letter-spacing: -.045em; }
.login-brand-panel h1 span { color: var(--yellow); }
.login-brand-panel > p:not(.eyebrow) { position: relative; z-index: 1; max-width: 530px; margin: 24px 0 32px; color: rgba(255,255,255,.82); font-size: 16px; line-height: 1.7; }
.login-features { position: relative; z-index: 1; display: grid; gap: 13px; }
.login-features div { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.9); font-size: 14px; font-weight: 700; }
.login-features i { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--yellow); background: rgba(255,255,255,.11); }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: 68px; }
.login-card-head h2 { margin: 0; font-size: 36px; letter-spacing: -.035em; }
.login-card-head > p:last-child { margin: 12px 0 30px; color: var(--muted); line-height: 1.6; }
.login-form { display: grid; gap: 10px; }
.login-form label, .form-label { color: var(--ink); font-size: 13px; font-weight: 800; }
.input-icon { position: relative; margin-bottom: 12px; }
.input-icon > i { position: absolute; top: 50%; left: 16px; color: var(--red); transform: translateY(-50%); }
.input-icon input { width: 100%; height: 54px; padding: 0 48px; border: 2px solid var(--border); border-radius: 14px; outline: none; transition: .2s; }
.input-icon input:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(198, 40, 40, .09); }
.password-toggle { position: absolute; top: 50%; right: 10px; width: 38px; height: 38px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; transform: translateY(-50%); }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 20px; border: 0; border-radius: 13px; color: #fff; background: linear-gradient(135deg, var(--red), var(--magenta)); font-weight: 800; text-decoration: none; box-shadow: 0 10px 24px rgba(198, 40, 40, .22); transition: .2s; }
.primary-button:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 15px 30px rgba(198, 40, 40, .28); }
.primary-button:disabled { opacity: .65; transform: none; cursor: wait; }
.login-button { width: 100%; margin-top: 10px; min-height: 55px; }
.login-help { margin: 28px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; text-align: center; }
.alert-error { display: flex; gap: 10px; align-items: center; margin-bottom: 22px; padding: 13px 15px; border-radius: 12px; color: #8F1111; background: #FFEBEE; font-size: 13px; font-weight: 700; }

.portal-body { padding: 84px 0 0 var(--sidebar); }
.topbar { position: fixed; z-index: 1020; top: 0; left: 0; right: 0; height: 70px; display: flex; align-items: center; padding: 0 25px; color: #fff; background: linear-gradient(115deg, var(--red-dark), var(--red), var(--magenta)); box-shadow: var(--shadow-sm); }
.menu-button { display: none; width: 42px; height: 42px; margin-right: 12px; border: 0; border-radius: 12px; color: #fff; background: rgba(255,255,255,.14); }
.topbar-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 20px; font-weight: 800; text-decoration: none; }
.topbar-brand strong { color: var(--yellow); }
.brand-symbol { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--red); background: var(--yellow); }
.topbar-context { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.socket-indicator { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 20px; color: rgba(255,255,255,.78); background: rgba(255,255,255,.1); font-size: 11px; font-weight: 700; }
.socket-indicator i { color: #FFCA28; font-size: 7px; }
.socket-indicator.online i { color: #69F0AE; }
.socket-indicator.offline i { color: #FF8A80; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip > i { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--red); background: var(--yellow); }
.user-chip div { display: grid; gap: 2px; }
.user-chip strong { font-size: 12px; }
.user-chip span { color: rgba(255,255,255,.72); font-size: 10px; }
.portal-sidebar { position: fixed; z-index: 1010; top: 70px; bottom: 0; left: 0; width: var(--sidebar); display: flex; flex-direction: column; padding: 24px 18px; background: #fff; border-right: 1px solid var(--border); }
.sidebar-merchant { display: flex; align-items: center; gap: 13px; padding: 0 6px 22px; border-bottom: 1px solid var(--border); }
.merchant-avatar { width: 52px; height: 52px; flex: 0 0 52px; display: grid; place-items: center; overflow: hidden; border-radius: 16px; color: #fff; background: linear-gradient(135deg, var(--red), var(--magenta)); font-size: 21px; }
.merchant-avatar.has-logo { padding: 6px; border: 1px solid rgba(127, 0, 178, 0.12); background: #FFFFFF; box-shadow: inset 0 0 0 1px rgba(255,255,255,.45), 0 6px 18px rgba(60, 28, 98, 0.10); }
.merchant-avatar img { width: 100%; height: 100%; object-fit: cover; }
.merchant-avatar.has-logo img { display: block; width: 100%; height: 100%; object-fit: contain; background: #FFFFFF; }
.sidebar-merchant div:last-child { min-width: 0; display: grid; gap: 5px; }
.sidebar-merchant span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.sidebar-merchant strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-nav { display: grid; gap: 7px; margin-top: 22px; }
.sidebar-nav a, .sidebar-nav button, .logout-link { display: flex; align-items: center; gap: 13px; width:100%; min-height: 47px; padding: 0 15px; border:0; border-radius: 13px; color: var(--muted); background:transparent; font-size: 13px; font-weight: 750; text-align:left; text-decoration: none; transition: .2s; }
.sidebar-nav a i, .sidebar-nav button i, .logout-link i { width: 19px; text-align: center; }
.sidebar-nav a:hover, .sidebar-nav button:hover, .sidebar-nav a.active { color: var(--red); background: var(--ivory); }
.sidebar-nav a.active { box-shadow: inset 3px 0 0 var(--red); }
.sidebar-nav .sidebar-action { margin-top: 8px; color: #fff; background: linear-gradient(135deg, var(--red), var(--magenta)); }
.sidebar-nav .sidebar-action:hover { color: #fff; background: linear-gradient(135deg, var(--red-dark), var(--magenta)); }
.sidebar-nav .sidebar-customer-link { color:#0D47A1; background:#E3F2FD; }
.sidebar-nav .sidebar-customer-link:hover { color:#fff; background:#1565C0; }
.sidebar-role { margin-top: auto; padding: 16px; border-radius: 15px; background: var(--ivory); }
.sidebar-role > span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.sidebar-role strong { display: flex; align-items: center; gap: 7px; margin: 8px 0; color: var(--red); font-size: 12px; }
.sidebar-role small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.logout-link { margin-top: 12px; color: var(--red); }
.sidebar-overlay { position: fixed; z-index: 1005; inset: 70px 0 0; display: none; background: rgba(0,0,0,.4); backdrop-filter: blur(2px); }
.portal-main { width: 100%; min-height: calc(100vh - 84px); padding: 0 28px 36px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 25px; }
.page-heading h1 { margin: 0; font-size: 28px; letter-spacing: -.035em; }
.page-heading p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.page-eyebrow { margin-bottom: 7px; color: var(--red); font-size: 10px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; margin-bottom: 26px; }
.stat-card { position: relative; padding: 21px; overflow: hidden; border: 1px solid rgba(232,222,212,.7); border-radius: 19px; background: #fff; box-shadow: var(--shadow-sm); }
.stat-card::after { content: ''; position: absolute; right: -22px; bottom: -35px; width: 105px; height: 105px; border-radius: 50%; background: var(--ivory); }
.stat-icon { position: relative; z-index: 1; width: 43px; height: 43px; display: grid; place-items: center; margin-bottom: 17px; border-radius: 13px; color: var(--red); background: var(--ivory); }
.stat-card span { position: relative; z-index: 1; display: block; color: var(--muted); font-size: 11px; font-weight: 750; }
.stat-card strong { position: relative; z-index: 1; display: block; margin-top: 6px; font-size: 27px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, .75fr); gap: 22px; }
.panel { border: 1px solid rgba(232,222,212,.75); border-radius: 21px; background: #fff; box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.panel-head h2 { margin: 0; font-size: 17px; }
.panel-link { color: var(--red); font-size: 12px; font-weight: 800; text-decoration: none; }
.store-list { display: grid; gap: 12px; padding: 18px; }
.store-row { display: grid; grid-template-columns: 45px minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 13px; border-radius: 15px; background: var(--ivory); }
.store-row-icon { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(135deg, var(--red), var(--magenta)); }
.store-row-main { min-width: 0; }
.store-row-main strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.store-row-main span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.status-pill { display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; border-radius: 20px; color: var(--green); background: #E8F5E9; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.status-pill.inactive, .status-pill.cancelled { color: #8F1111; background: #FFEBEE; }
.status-pill.pending { color: #B06000; background: #FFF3E0; }
.status-pill.assigned, .status-pill.delivering { color: var(--blue); background: #E3F2FD; }
.status-pill.delivered { color: var(--green); background: #E8F5E9; }
.quick-card { display: flex; flex-direction: column; justify-content: center; min-height: 260px; padding: 28px; color: #fff; background: linear-gradient(145deg, var(--red-dark), var(--red), var(--magenta)); }
.quick-card .quick-icon { width: 55px; height: 55px; display: grid; place-items: center; margin-bottom: 20px; border-radius: 17px; color: var(--red); background: var(--yellow); font-size: 23px; }
.quick-card h2 { margin: 0; font-size: 24px; }
.quick-card p { margin: 12px 0 22px; color: rgba(255,255,255,.78); font-size: 13px; line-height: 1.6; }
.quick-card .primary-button { color: var(--red-dark); background: var(--yellow); box-shadow: none; }
.table-panel { overflow: hidden; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; min-width: 850px; border-collapse: collapse; }
.data-table th { padding: 14px 17px; color: var(--muted); background: var(--ivory); font-size: 10px; font-weight: 900; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 15px 17px; border-bottom: 1px solid #F0E8E0; color: var(--muted); font-size: 12px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table strong { color: var(--ink); }
.empty-panel { padding: 50px 22px; color: var(--muted); text-align: center; }
.empty-panel i { display: block; margin-bottom: 14px; color: var(--border); font-size: 45px; }
.filter-bar { display: flex; gap: 10px; align-items: center; }
.select-control, .text-control { width: 100%; height: 46px; padding: 0 13px; border: 2px solid var(--border); border-radius: 12px; color: var(--ink); background: #fff; outline: none; }
.select-control:focus, .text-control:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(198,40,40,.08); }
.live-toast { position: fixed; z-index: 1100; top: 82px; right: 24px; max-width: 360px; padding: 13px 16px; border-radius: 12px; color: #fff; background: #252525; box-shadow: var(--shadow-md); font-size: 12px; font-weight: 700; opacity: 0; pointer-events: none; transform: translateY(-12px); transition: .25s; }
.live-toast.show { opacity: 1; transform: none; }

.order-layout { display: grid; grid-template-columns: minmax(330px, .85fr) minmax(0, 1.15fr); gap: 22px; align-items: start; }
.order-layout.single { grid-template-columns: 1fr; }
.order-form-panel { position: sticky; top: 88px; overflow: hidden; }
.order-form-body { padding: 22px; }
.form-group { margin-bottom: 17px; }
.form-label { display: block; margin-bottom: 7px; }
.location-input-group { display: flex; gap: 8px; }
.location-input-group .text-control { flex: 1; min-width: 0; }
.location-action-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:stretch; }
.attached-location-group { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:0; }
.attached-location-group .text-control { position:relative; z-index:1; height:54px; border-radius:14px 0 0 14px; }
.attached-location-group .text-control:focus { z-index:3; }
.attached-location-button { position:relative; z-index:2; display:inline-flex; align-items:center; justify-content:center; gap:8px; height:54px; padding:0 17px; border:2px solid var(--border); color:var(--red); background:#fff; font-size:12px; font-weight:850; white-space:nowrap; }
.attached-location-button:hover { color:#fff; border-color:var(--red); background:var(--red); }
.attached-location-button:disabled { opacity:.65; cursor:wait; }
.paste-location-button { border-left:0; border-radius:0 14px 14px 0; }
.calculate-location-button { min-width:175px; height:54px; border-radius:14px; }
.secondary-button { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 15px; border: 2px solid var(--border); border-radius: 12px; color: var(--red); background: #fff; font-weight: 800; }
.secondary-button:disabled { opacity: .6; cursor: wait; }
.coordinate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.coordinate-input { direction: ltr !important; unicode-bidi: bidi-override !important; text-align: left !important; }
.map-message { min-height: 19px; margin-top: 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.map-message.error { color: var(--red); }
.map-message.success { color: var(--green); }
.store-form-help { display: block; margin-top: 9px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.quote-card { display: none; margin: 20px 0; padding: 20px; border: 2px solid #F6D47C; border-radius: 17px; background: #FFF9E8; }
.quote-card.show { display: block; }
.quote-label { color: #8B6513; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.quote-price { margin: 7px 0; color: var(--red-dark); font-size: 38px; font-weight: 900; letter-spacing: -.04em; }
.quote-meta { display: flex; flex-wrap: wrap; gap: 8px 15px; color: var(--muted); font-size: 11px; }
.request-button { width: 100%; min-height: 68px; font-size: 18px; }
.request-button[hidden] { display: none; }
.permission-notice { padding: 25px; border-radius: 17px; color: #734D00; background: #FFF8E1; line-height: 1.6; }
.permission-notice i { margin-right: 8px; color: var(--yellow); }
.success-order { padding: 23px; border-radius: 17px; color: #1B5E20; background: #E8F5E9; text-align: center; }
.success-order i { display: block; margin-bottom: 12px; font-size: 43px; }
.success-order strong { display: block; margin: 8px 0; font-size: 20px; }

.live-room-badge { display:inline-flex; align-items:center; gap:8px; padding:9px 13px; border-radius:20px; color:var(--green); background:#E8F5E9; font-size:11px; font-weight:850; white-space:nowrap; }
.live-room-badge i { font-size:10px; }
.dashboard-heading-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
.copy-customer-link { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:40px; padding:9px 14px; border:0; border-radius:12px; color:#fff; background:linear-gradient(135deg,#1565C0,#0D47A1); font-size:11px; font-weight:850; box-shadow:0 7px 18px rgba(21,101,192,.2); }
.copy-customer-link:disabled, .sidebar-customer-link:disabled { opacity:.65; cursor:wait; }
.dashboard-service-panel { margin-bottom:22px; overflow:hidden; }
.service-panel-head { align-items:flex-start; }
.origin-meta { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.origin-meta span { display:inline-flex; align-items:center; gap:7px; padding:8px 10px; border-radius:11px; color:var(--muted); background:var(--ivory); font-size:10px; font-weight:700; }
.origin-meta i { color:var(--red); }
.dashboard-quote { margin-bottom:18px; text-align:center; }
.dashboard-quote > .store-form-help { text-align:center; }
.quote-summary-grid { display:grid; grid-template-columns:1fr; gap:12px; width:min(100%,620px); margin:0 auto; }
.quote-summary-grid > div { padding:18px; border-radius:15px; background:#fff; }
.quote-summary-grid .quote-metric-label { display:block; color:var(--muted); font-size:11px; font-weight:850; letter-spacing:.04em; text-transform:uppercase; }
.quote-distance-value, .quote-price-value { display:inline-flex; align-items:baseline; justify-content:center; gap:8px; margin-top:8px; color:var(--ink); line-height:1; }
.quote-distance-value > span { font-size:46px; font-weight:900; letter-spacing:-.04em; }
.quote-distance-value > small { color:var(--muted); font-size:16px; font-weight:850; }
.quote-summary-grid .quote-total { color:#fff; background:linear-gradient(135deg,var(--red),var(--magenta)); }
.quote-summary-grid .quote-total .quote-metric-label { color:rgba(255,255,255,.78); }
.quote-price-value { color:#fff; }
.quote-price-value > small { font-size:22px; font-weight:850; }
.quote-price-value > span { font-size:56px; font-weight:950; letter-spacing:-.05em; }
.dashboard-order-result { display:flex; align-items:center; gap:13px; margin-top:15px; padding:14px 16px; border-radius:13px; color:#1B5E20; background:#E8F5E9; }
.dashboard-order-result[hidden] { display:none; }
.dashboard-order-result i { font-size:25px; }
.dashboard-order-result div { display:grid; gap:3px; }
.dashboard-order-result span { font-size:11px; }
.dashboard-order-result strong { font-size:16px; }
.dashboard-permission { margin-bottom:22px; }
.active-summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:15px; margin:0 0 25px; }
.active-summary-card { display:flex; align-items:center; justify-content:space-between; gap:15px; padding:18px 20px; border:1px solid var(--border); border-radius:17px; background:#fff; box-shadow:var(--shadow-sm); }
.active-summary-card > div { display:flex; align-items:center; gap:11px; color:var(--muted); font-size:11px; font-weight:800; text-transform:uppercase; }
.active-summary-card i { width:39px; height:39px; display:grid; place-items:center; border-radius:12px; font-size:15px; }
.active-summary-card strong { font-size:27px; }
.active-summary-card.created i { color:#6A1B9A; background:#F3E5F5; }
.active-summary-card.pending i { color:#B06000; background:#FFF3E0; }
.active-summary-card.assigned i { color:var(--blue); background:#E3F2FD; }
.active-summary-card.delivering i { color:var(--green); background:#E8F5E9; }
.active-orders-section { margin-top:4px; }
.publish-customer-order { width:100%; min-height:48px; margin-top:12px; }
.section-heading-row { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom:16px; }
.section-heading-row h2 { margin:0; font-size:21px; }
.section-heading-row > span { color:var(--muted); font-size:11px; font-weight:750; }
.active-orders-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:17px; }
.active-empty { grid-column:1/-1; border:1px solid var(--border); border-radius:18px; background:#fff; box-shadow:var(--shadow-sm); }
.active-order-card { position:relative; overflow:hidden; padding:19px; border:1px solid var(--border); border-top:4px solid #E0A13A; border-radius:18px; background:#fff; box-shadow:var(--shadow-sm); transition:.2s; }
.active-order-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-md); }
.active-order-card.status-assigned { border-top-color:var(--blue); }
.active-order-card.status-delivering { border-top-color:var(--green); }
.active-order-top { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.active-order-top > div { display:grid; gap:4px; }
.active-order-top > div span { color:var(--muted); font-size:9px; font-weight:850; text-transform:uppercase; }
.active-order-top > div strong { font-size:16px; }
.active-order-store { display:flex; align-items:center; gap:9px; margin:16px 0 13px; padding:10px 12px; border-radius:12px; color:var(--red); background:var(--ivory); font-size:12px; }
.active-order-details { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.active-order-details div { min-width:0; padding:10px; border-radius:11px; background:#FAF9F7; }
.active-order-details span { display:block; color:var(--muted); font-size:8px; font-weight:850; text-transform:uppercase; }
.active-order-details strong { display:block; margin-top:5px; overflow:hidden; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.active-map-link { display:flex; align-items:center; justify-content:center; gap:8px; margin-top:13px; min-height:39px; border:1px solid var(--border); border-radius:11px; color:var(--red); font-size:10px; font-weight:850; text-decoration:none; }
.active-map-link:hover { color:#fff; border-color:var(--red); background:var(--red); }
.orders-filter-panel { margin-bottom:20px; padding:20px; }
.orders-filter-form { display:grid; gap:15px; }
.orders-filter-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:13px; }
.filter-field { min-width:0; }
.filter-field label { display:block; margin-bottom:7px; color:var(--muted); font-size:10px; font-weight:850; text-transform:uppercase; }
.orders-filter-actions { display:flex; justify-content:flex-end; gap:10px; }
.orders-filter-actions .secondary-button { text-decoration:none; }
.orders-table-head > div { display:grid; gap:5px; }
.orders-table-head > div span, .orders-table-head > strong { color:var(--muted); font-size:10px; }
.orders-pagination { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:17px 20px; border-top:1px solid var(--border); }
.pagination-button, .pagination-pages a { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-width:36px; height:36px; padding:0 11px; border:1px solid var(--border); border-radius:10px; color:var(--muted); background:#fff; font-size:10px; font-weight:800; text-decoration:none; }
.pagination-button:hover, .pagination-pages a:hover, .pagination-pages a.active { color:#fff; border-color:var(--red); background:var(--red); }
.pagination-button.disabled { opacity:.4; pointer-events:none; }
.pagination-pages { display:flex; align-items:center; gap:6px; }
.pagination-pages span { color:var(--muted); font-size:11px; }
.merchant-confirm-modal { position:fixed; inset:0; z-index:1200; display:grid; padding:18px; place-items:center; }
.merchant-confirm-modal[hidden] { display:none!important; }
.merchant-confirm-backdrop { position:absolute; inset:0; background:rgba(28,18,15,.64); backdrop-filter:blur(3px); }
.merchant-confirm-card { position:relative; z-index:1; width:min(410px,100%); padding:27px; border-radius:22px; background:#fff; box-shadow:0 24px 70px rgba(0,0,0,.3); text-align:center; }
.merchant-confirm-icon { display:grid; width:70px; height:70px; margin:0 auto 15px; place-items:center; border-radius:22px; color:#fff; background:linear-gradient(135deg,var(--red),var(--magenta)); font-size:27px; }
.merchant-confirm-icon.success { background:linear-gradient(135deg,#08783f,#14975a); }
.merchant-confirm-card h2 { margin:0 0 8px; font-size:21px; }
.merchant-confirm-card p { margin:0 0 15px; color:var(--muted); font-size:12px; line-height:1.55; }
.merchant-confirm-card .primary-button, .merchant-modal-cancel { width:100%; min-height:50px; margin-top:9px; }
.merchant-confirm-card button[hidden] { display:none!important; }
.merchant-modal-cancel { display:flex; align-items:center; justify-content:center; border:0; border-radius:12px; color:var(--ink); background:#f2eeeb; font-weight:850; }
.merchant-confirm-message { min-height:18px; color:var(--muted); font-size:10px; font-weight:750; }
.merchant-confirm-message.working { color:var(--blue); }
.merchant-confirm-message.error { padding:10px; border-radius:11px; color:#9b1c1c; background:#ffebee; }
body.merchant-modal-open { overflow:hidden; }

@media (max-width: 1050px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .content-grid, .order-layout { grid-template-columns: 1fr; }
    .order-form-panel { position: static; }
    .orders-filter-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 820px) {
    :root { --sidebar: 280px; }
    .portal-body { padding-left: 0; }
    .menu-button { display: block; }
    .portal-sidebar { z-index: 1040; transform: translateX(-100%); transition: transform .25s; }
    .portal-sidebar.open { transform: none; }
    .sidebar-overlay.show { display: block; }
    .portal-main { padding: 0 16px 28px; }
    .socket-indicator span, .user-chip div { display: none; }
    .page-heading { align-items: stretch; flex-direction: column; }
    .dashboard-heading-actions { justify-content:flex-start; }
    .quote-summary-grid { grid-template-columns:1fr; }
}
@media (max-width: 650px) {
    .login-body { padding: 0; }
    .login-shell { min-height: 100vh; grid-template-columns: 1fr; border-radius: 0; }
    .login-brand-panel { min-height: 310px; padding: 38px 30px; }
    .login-brand-panel h1 { font-size: 38px; }
    .brand-mark { width: 56px; height: 56px; margin-bottom: 20px; border-radius: 17px; font-size: 24px; }
    .login-brand-panel > p:not(.eyebrow), .login-features { display: none; }
    .login-card { padding: 40px 28px 50px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 11px; }
    .stat-card { padding: 16px; }
    .stat-card strong { font-size: 23px; }
    .topbar { padding: 0 14px; }
    .topbar-brand > span:last-child { display: none; }
    .coordinate-grid { grid-template-columns: 1fr; }
    .location-action-row { grid-template-columns:1fr; }
    .attached-location-group { grid-template-columns:minmax(0,1fr) auto; }
    .attached-location-button { padding:0 13px; }
    .calculate-location-button { width:100%; }
    .service-panel-head, .section-heading-row { align-items:flex-start; flex-direction:column; }
    .origin-meta { justify-content:flex-start; }
    .active-summary-grid { grid-template-columns:1fr; }
    .active-summary-card { padding:14px 16px; }
    .quote-summary-grid, .orders-filter-grid { grid-template-columns:1fr; }
    .orders-filter-actions { flex-direction:column-reverse; }
    .orders-filter-actions > * { width:100%; }
    .orders-pagination { align-items:stretch; }
    .pagination-button span { display:none; }
    .pagination-pages { overflow-x:auto; }
}

/* ========================================================================
 * OKDelivery — Portal de comercios / Tema violeta y azul
 * Paleta: #7f00b2 · #8e22bb · #ab49cc · #1e91ed · #4ca1f5
 * Tipografía: Inter para interfaz y Montserrat para títulos y métricas.
 * Esta sección reemplaza únicamente la presentación visual.
 * ======================================================================== */

:root {
    --okd-purple-deep: #7f00b2;
    --okd-purple: #8e22bb;
    --okd-violet: #ab49cc;
    --okd-blue: #1e91ed;
    --okd-sky: #4ca1f5;
    --okd-ink: #17152a;
    --okd-muted: #706b82;
    --okd-line: rgba(127, 0, 178, .13);
    --okd-surface: rgba(255, 255, 255, .95);
    --okd-soft-purple: rgba(171, 73, 204, .11);
    --okd-soft-blue: rgba(76, 161, 245, .13);
    --okd-gradient: linear-gradient(135deg, #7f00b2 0%, #8e22bb 28%, #ab49cc 52%, #1e91ed 79%, #4ca1f5 100%);
    --okd-gradient-horizontal: linear-gradient(90deg, #7f00b2 0%, #ab49cc 48%, #1e91ed 100%);
    --okd-gradient-purple: linear-gradient(135deg, #7f00b2 0%, #8e22bb 48%, #ab49cc 100%);
    --okd-shadow-sm: 0 9px 26px rgba(80, 31, 127, .10);
    --okd-shadow-md: 0 20px 48px rgba(72, 29, 120, .16);
    --okd-shadow-lg: 0 32px 78px rgba(47, 18, 88, .25);

    /* Alias para que toda la estructura existente adopte la nueva paleta. */
    --red: #7f00b2;
    --red-dark: #6b0097;
    --magenta: #ab49cc;
    --yellow: #4ca1f5;
    --yellow-soft: rgba(76, 161, 245, .14);
    --ivory: #f8f5ff;
    --ivory-dark: #eee8fa;
    --canvas: #f5f5fb;
    --white: #ffffff;
    --ink: #17152a;
    --muted: #706b82;
    --border: rgba(127, 0, 178, .13);
    --green: #16844b;
    --blue: #1e91ed;
    --shadow-sm: var(--okd-shadow-sm);
    --shadow-md: var(--okd-shadow-md);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--okd-violet) rgba(127, 0, 178, .07);
}

*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: rgba(127, 0, 178, .06); }
*::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: var(--okd-gradient);
    background-clip: padding-box;
}

html { background: #f5f5fb; }
body,
button,
input,
select,
textarea { font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

h1,
h2,
h3,
.topbar-brand,
.login-brand-panel h1,
.login-card-head h2,
.page-heading h1,
.stat-card strong,
.active-summary-card strong,
.quote-distance-value,
.quote-price-value,
.active-order-top strong {
    font-family: "Montserrat", "Inter", sans-serif;
}

body.portal-body {
    color: var(--okd-ink);
    background:
        radial-gradient(circle at 7% 4%, rgba(171, 73, 204, .15), transparent 27rem),
        radial-gradient(circle at 96% 13%, rgba(30, 145, 237, .14), transparent 27rem),
        linear-gradient(180deg, #fbfaff 0%, #f4f7ff 52%, #f8f6fc 100%);
    background-attachment: fixed;
}

body.portal-body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .34;
    background-image:
        linear-gradient(rgba(127, 0, 178, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 145, 237, .025) 1px, transparent 1px);
    background-size: 30px 30px;
}

/* Acceso */
.login-body {
    color: var(--okd-ink);
    background:
        radial-gradient(circle at 12% 8%, rgba(255, 255, 255, .18), transparent 23rem),
        radial-gradient(circle at 88% 88%, rgba(76, 161, 245, .27), transparent 29rem),
        var(--okd-gradient);
    background-attachment: fixed;
}

.login-body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 34px 34px;
}

.login-shell {
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, .44);
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--okd-shadow-lg);
    backdrop-filter: blur(22px) saturate(1.1);
}

.login-brand-panel {
    background:
        radial-gradient(circle at 84% 14%, rgba(255,255,255,.13), transparent 16rem),
        linear-gradient(145deg, rgba(96, 0, 145, .98), rgba(127, 0, 178, .97) 38%, rgba(171, 73, 204, .95) 67%, rgba(30, 145, 237, .92));
}

.login-brand-panel::before,
.login-brand-panel::after { background: rgba(255, 255, 255, .08); }

.brand-mark {
    border: 1px solid rgba(255, 255, 255, .46);
    color: #fff;
    background: rgba(255, 255, 255, .17);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.30), 0 20px 42px rgba(44, 12, 80, .24);
    backdrop-filter: blur(16px);
}

.eyebrow,
.login-brand-panel h1 span { color: #fff; }
.login-brand-panel h1 { text-shadow: 0 13px 34px rgba(45, 12, 78, .22); }
.login-brand-panel h1 span { position: relative; display: inline-block; }
.login-brand-panel h1 span::after {
    content: "";
    position: absolute;
    right: 2px;
    bottom: -7px;
    left: 2px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255,255,255,.84);
}

.login-features i {
    color: #fff;
    background: rgba(255,255,255,.14);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}

.login-card {
    border-left: 1px solid rgba(127, 0, 178, .09);
    background: rgba(255,255,255,.92);
}

.login-card-head .eyebrow,
.page-eyebrow { color: var(--okd-purple); }
.login-card-head h2 { color: var(--okd-ink); }
.login-card-head > p:last-child,
.login-help { color: var(--okd-muted); }

.input-icon {
    border: 1px solid var(--okd-line);
    border-radius: 15px;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(40, 25, 62, .03);
}
.input-icon > i { color: var(--okd-purple); }
.input-icon input { border: 0; background: transparent; color: var(--okd-ink); }
.input-icon:focus-within {
    border-color: var(--okd-violet);
    box-shadow: 0 0 0 4px rgba(171, 73, 204, .12);
}
.input-icon input:focus { box-shadow: none; }
.password-toggle { color: var(--okd-purple); }

.alert-error {
    border: 1px solid rgba(127, 0, 178, .13);
    color: #7a1d91;
    background: linear-gradient(135deg, rgba(171,73,204,.11), rgba(76,161,245,.09));
}
.alert-error i { color: var(--okd-purple); }

/* Barra superior */
.topbar {
    border-bottom: 0;
    background: var(--okd-gradient);
    box-shadow: 0 15px 36px rgba(72, 22, 132, .25);
}
.topbar::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 1px;
    background: rgba(255,255,255,.35);
}

.menu-button,
.brand-symbol,
.user-chip > i {
    border: 1px solid rgba(255,255,255,.33);
    color: #fff;
    background: rgba(255,255,255,.16);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.24), 0 8px 18px rgba(43, 17, 88, .20);
    backdrop-filter: blur(10px);
}
.topbar-brand strong { color: #fff; }
.socket-indicator {
    border: 1px solid rgba(255,255,255,.28);
    color: #fff;
    background: rgba(255,255,255,.14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.20);
    backdrop-filter: blur(10px);
}
.socket-indicator i { color: #f59e0b; filter: drop-shadow(0 0 7px currentColor); }
.socket-indicator.online i { color: #22c55e; }
.socket-indicator.offline i { color: #ef4444; }
.user-chip span { color: rgba(255,255,255,.78); }

/* Navegación lateral */
.portal-sidebar {
    border-right: 1px solid var(--okd-line);
    background: rgba(255,255,255,.92);
    box-shadow: 12px 0 35px rgba(67, 30, 100, .07);
    backdrop-filter: blur(20px) saturate(1.1);
}
.sidebar-merchant { border-color: var(--okd-line); }
.merchant-avatar {
    border: 1px solid rgba(127, 0, 178, .13);
    background: var(--okd-gradient);
    box-shadow: 0 12px 24px rgba(91, 30, 150, .21);
}
.sidebar-merchant span,
.sidebar-role > span,
.sidebar-role small { color: var(--okd-muted); }
.sidebar-merchant strong { color: var(--okd-ink); }

.sidebar-nav a,
.sidebar-nav button,
.logout-link { color: #7c778d; }
.sidebar-nav a:hover,
.sidebar-nav button:hover,
.sidebar-nav a.active {
    color: var(--okd-purple);
    background: linear-gradient(135deg, var(--okd-soft-purple), var(--okd-soft-blue));
}
.sidebar-nav a.active { box-shadow: inset 4px 0 0 var(--okd-purple); }
.sidebar-nav .sidebar-action {
    color: #fff;
    background: var(--okd-gradient-horizontal);
    box-shadow: 0 11px 22px rgba(98, 29, 158, .20);
}
.sidebar-nav .sidebar-action:hover {
    color: #fff;
    background: var(--okd-gradient);
}
.sidebar-nav .sidebar-customer-link {
    color: var(--okd-blue);
    background: var(--okd-soft-blue);
}
.sidebar-nav .sidebar-customer-link:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--okd-blue), var(--okd-sky));
}
.sidebar-role {
    border: 1px solid var(--okd-line);
    background: linear-gradient(135deg, rgba(171,73,204,.08), rgba(76,161,245,.10));
}
.sidebar-role strong { color: var(--okd-purple); }
.logout-link { color: var(--okd-purple-deep); }
.logout-link:hover {
    color: #fff;
    background: var(--okd-gradient-horizontal);
}
.sidebar-overlay { background: rgba(22, 13, 38, .54); backdrop-filter: blur(5px); }

/* Encabezados y superficies */
.page-heading { position: relative; }
.page-heading::before {
    content: "";
    position: absolute;
    top: 3px;
    left: -15px;
    width: 5px;
    height: 50px;
    border-radius: 999px;
    background: var(--okd-gradient);
    box-shadow: 0 7px 18px rgba(127,0,178,.26);
}
.page-heading h1 { color: var(--okd-ink); letter-spacing: -.045em; }
.page-heading p,
.section-heading-row > span { color: var(--okd-muted); }

.panel,
.stat-card,
.active-summary-card,
.active-order-card,
.active-empty,
.merchant-confirm-card,
.login-card,
.orders-filter-panel {
    border: 1px solid var(--okd-line);
    background: var(--okd-surface);
    box-shadow: var(--okd-shadow-sm);
    backdrop-filter: blur(18px);
}

.panel,
.merchant-confirm-card { border-radius: 23px; }
.panel-head { border-color: rgba(127,0,178,.09); }
.panel-head h2,
.section-heading-row h2 { color: var(--okd-ink); }
.panel-link { color: var(--okd-purple); }

.stat-card {
    border-radius: 21px;
    transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--okd-shadow-md); }
.stat-card::after { background: linear-gradient(135deg, var(--okd-soft-purple), var(--okd-soft-blue)); }
.stat-icon {
    color: var(--okd-purple);
    background: linear-gradient(135deg, var(--okd-soft-purple), var(--okd-soft-blue));
}
.stat-card span { color: var(--okd-muted); }
.stat-card strong { color: var(--okd-ink); }

.quick-card {
    border: 0;
    background: var(--okd-gradient);
    box-shadow: 0 22px 48px rgba(84, 26, 145, .27);
}
.quick-card::before,
.quick-card::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.10);
}
.quick-card::before { width: 180px; height: 180px; top: -95px; right: -35px; }
.quick-card::after { width: 96px; height: 96px; bottom: -48px; left: -30px; }
.quick-card > * { position: relative; z-index: 1; }
.quick-card .quick-icon {
    border: 1px solid rgba(255,255,255,.38);
    color: #fff;
    background: rgba(255,255,255,.16);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.28);
}

.store-row,
.active-order-details div,
.order-form-body,
.quote-card,
.filter-bar {
    background: linear-gradient(135deg, rgba(171,73,204,.055), rgba(76,161,245,.07));
}
.store-row-icon { background: var(--okd-gradient-purple); }
.store-row-main span { color: var(--okd-muted); }

/* Formularios */
.select-control,
.text-control,
.coordinate-input,
.attached-location-group,
.location-input-group {
    border-color: var(--okd-line);
    color: var(--okd-ink);
    background: #fff;
}
.select-control:focus,
.text-control:focus,
.coordinate-input:focus,
.attached-location-group:focus-within,
.location-input-group:focus-within {
    border-color: var(--okd-violet);
    box-shadow: 0 0 0 4px rgba(171,73,204,.12);
}
.form-label,
.filter-field label { color: var(--okd-ink); }
.map-message,
.store-form-help,
.quote-meta { color: var(--okd-muted); }

.primary-button,
.login-button,
.request-button,
.calculate-location-button,
.publish-customer-order,
.merchant-confirm-card .primary-button {
    border: 0;
    color: #fff;
    background: var(--okd-gradient-horizontal);
    box-shadow: 0 13px 27px rgba(91, 30, 151, .23);
}
.primary-button:hover,
.login-button:hover,
.request-button:hover,
.calculate-location-button:hover,
.publish-customer-order:hover {
    color: #fff;
    transform: translateY(-2px);
    filter: saturate(1.08);
    box-shadow: 0 17px 32px rgba(72, 36, 145, .29);
}
.secondary-button,
.attached-location-button {
    border: 1px solid var(--okd-line);
    color: var(--okd-purple-deep);
    background: linear-gradient(135deg, var(--okd-soft-purple), var(--okd-soft-blue));
    box-shadow: none;
}
.secondary-button:hover,
.attached-location-button:hover {
    color: #fff;
    border-color: transparent;
    background: var(--okd-gradient-horizontal);
}

.copy-customer-link,
.live-room-badge {
    border: 1px solid var(--okd-line);
    color: var(--okd-purple);
    background: linear-gradient(135deg, rgba(171,73,204,.10), rgba(76,161,245,.12));
    box-shadow: var(--okd-shadow-sm);
}
.live-room-badge i { color: var(--okd-blue); }
.copy-customer-link:hover { color: #fff; background: var(--okd-gradient-horizontal); }
.origin-meta span {
    border-color: var(--okd-line);
    color: var(--okd-muted);
    background: linear-gradient(135deg, rgba(171,73,204,.06), rgba(76,161,245,.08));
}
.origin-meta i { color: var(--okd-purple); }

/* Cotización */
.quote-card {
    border: 1px solid var(--okd-line);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}
.quote-summary-grid > div {
    border: 1px solid var(--okd-line);
    background: rgba(255,255,255,.84);
}
.quote-summary-grid .quote-total {
    border: 0;
    color: #fff;
    background: var(--okd-gradient);
    box-shadow: 0 18px 38px rgba(88, 30, 148, .25);
}
.quote-metric-label,
.quote-distance-value > small { color: var(--okd-muted); }
.quote-distance-value { color: var(--okd-ink); }

.dashboard-order-result,
.success-order {
    border: 1px solid rgba(30,145,237,.18);
    color: #1567a5;
    background: rgba(76,161,245,.12);
}
.dashboard-order-result i,
.success-order i { color: var(--okd-blue); }

/* Resúmenes y órdenes activas */
.active-summary-card { border-radius: 19px; }
.active-summary-card > div { color: var(--okd-muted); }
.active-summary-card i {
    color: var(--okd-purple);
    background: linear-gradient(135deg, var(--okd-soft-purple), var(--okd-soft-blue));
}
.active-summary-card.created i { color: var(--okd-purple-deep); background: var(--okd-soft-purple); }
.active-summary-card.pending i { color: var(--okd-violet); background: rgba(171,73,204,.12); }
.active-summary-card.assigned i { color: var(--okd-blue); background: var(--okd-soft-blue); }
.active-summary-card.delivering i { color: var(--okd-sky); background: rgba(76,161,245,.14); }

.active-order-card {
    border-top: 0;
    border-radius: 21px;
}
.active-order-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--okd-gradient);
}
.active-order-card:hover { box-shadow: var(--okd-shadow-md); }
.active-order-store {
    color: var(--okd-purple);
    background: linear-gradient(135deg, var(--okd-soft-purple), var(--okd-soft-blue));
}
.active-order-top > div span,
.active-order-details span { color: var(--okd-muted); }
.active-order-details strong { color: var(--okd-ink); }
.active-map-link {
    border-color: var(--okd-line);
    color: var(--okd-blue);
    background: rgba(76,161,245,.07);
}
.active-map-link:hover {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--okd-blue), var(--okd-sky));
}

/* Estados */
.status-pill {
    border: 1px solid rgba(127,0,178,.10);
    color: var(--okd-purple-deep);
    background: var(--okd-soft-purple);
}
.status-pill.pending { color: #7d2698; background: rgba(171,73,204,.13); }
.status-pill.assigned { color: #7750a8; background: rgba(142,34,187,.11); }
.status-pill.delivering { color: #0879ca; background: rgba(30,145,237,.13); }
.status-pill.delivered { color: #176fb4; background: rgba(76,161,245,.14); }
.status-pill.inactive,
.status-pill.cancelled { color: #777181; background: rgba(111,105,123,.11); }

/* Tabla y filtros */
.table-panel { overflow: hidden; }
.data-table th {
    color: var(--okd-muted);
    background: linear-gradient(135deg, rgba(171,73,204,.07), rgba(76,161,245,.08));
}
.data-table td,
.data-table tr:last-child td { border-color: rgba(127,0,178,.08); }
.orders-filter-panel { border-radius: 21px; }
.filter-field label { color: var(--okd-muted); }
.pagination-button,
.pagination-pages a {
    border-color: var(--okd-line);
    color: var(--okd-purple);
    background: #fff;
}
.pagination-button:hover,
.pagination-pages a:hover,
.pagination-pages a.active {
    color: #fff;
    border-color: transparent;
    background: var(--okd-gradient-horizontal);
}
.orders-pagination { border-color: rgba(127,0,178,.09); }
.empty-panel i { color: var(--okd-violet); }

/* Toast y modal */
.live-toast {
    border: 1px solid rgba(255,255,255,.26);
    color: #fff;
    background: linear-gradient(135deg, rgba(127,0,178,.96), rgba(30,145,237,.96));
    box-shadow: var(--okd-shadow-lg);
}
.merchant-confirm-backdrop {
    background: rgba(21,13,37,.60);
    backdrop-filter: blur(7px);
}
.merchant-confirm-card { box-shadow: var(--okd-shadow-lg); }
.merchant-confirm-icon {
    background: var(--okd-gradient);
    box-shadow: 0 14px 30px rgba(93,28,151,.24);
}
.merchant-confirm-icon.success {
    background: linear-gradient(135deg, var(--okd-blue), var(--okd-sky));
}
.merchant-modal-cancel {
    border: 1px solid var(--okd-line);
    color: var(--okd-purple-deep);
    background: linear-gradient(135deg, var(--okd-soft-purple), var(--okd-soft-blue));
}
.merchant-confirm-message.working { color: var(--okd-blue); }
.merchant-confirm-message.error {
    color: #7a1d91;
    background: linear-gradient(135deg, rgba(171,73,204,.11), rgba(76,161,245,.09));
}

@media (max-width: 820px) {
    .page-heading::before { left: -9px; width: 4px; }
    .topbar { box-shadow: 0 11px 27px rgba(72,22,132,.23); }
    .portal-sidebar { background: rgba(255,255,255,.97); }
}

@media (max-width: 650px) {
    .login-shell { border: 0; }
    .login-card { border-left: 0; }
    .login-brand-panel { min-height: 300px; }
    .panel,
    .stat-card,
    .active-summary-card,
    .active-order-card,
    .orders-filter-panel { border-radius: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Corrección de contexto para los elementos decorativos del acceso rápido. */
.quick-card { position: relative; overflow: hidden; }

/* =====================================================================
 * Optimización de rendimiento
 * Conserva la paleta violeta/azul, pero evita filtros y repintados caros.
 * ===================================================================== */
body.portal-body,
.login-body {
    background-attachment: scroll !important;
}

body.portal-body::before,
.login-body::before {
    display: none !important;
    content: none !important;
}

.topbar,
.menu-button,
.brand-symbol,
.user-chip > i,
.socket-indicator,
.portal-sidebar,
.sidebar-overlay,
.login-shell,
.brand-mark,
.panel,
.stat-card,
.active-summary-card,
.active-order-card,
.active-empty,
.merchant-confirm-card,
.login-card,
.orders-filter-panel,
.merchant-confirm-backdrop {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

.portal-sidebar,
.panel,
.stat-card,
.active-summary-card,
.active-order-card,
.active-empty,
.merchant-confirm-card,
.login-card,
.orders-filter-panel {
    background-color: #ffffff !important;
}

.portal-sidebar {
    contain: layout paint style;
    box-shadow: 8px 0 24px rgba(67, 30, 100, .055) !important;
}

.topbar {
    contain: layout paint style;
    box-shadow: 0 8px 22px rgba(72, 22, 132, .17) !important;
}

.panel,
.stat-card,
.active-summary-card,
.active-order-card,
.active-empty,
.orders-filter-panel {
    box-shadow: 0 5px 16px rgba(62, 32, 91, .065) !important;
}

.active-orders-grid,
.table-wrap,
.store-list {
    contain: layout style;
}

.active-order-card,
.store-row {
    content-visibility: auto;
    contain-intrinsic-size: auto 220px;
}

.stat-card:hover,
.active-order-card:hover,
.primary-button:hover,
.login-button:hover,
.request-button:hover,
.calculate-location-button:hover,
.publish-customer-order:hover {
    filter: none !important;
}

@media (max-width: 820px) {
    .portal-sidebar {
        will-change: transform;
    }

    .portal-sidebar:not(.open) {
        visibility: hidden;
    }

    .portal-sidebar.open {
        visibility: visible;
    }
}

@media (min-width: 821px) {
    .portal-sidebar {
        will-change: auto;
    }
}

/* OKDELIVERY_MERCHANT_PWA_STYLES_BEGIN */
.merchant-pwa-install-button,
.merchant-pwa-login-install { display:inline-flex; min-height:38px; padding:0 14px; align-items:center; justify-content:center; gap:8px; border:0; border-radius:12px; color:#fff; background:linear-gradient(135deg,#7f00b2,#1e91ed); box-shadow:0 10px 24px rgba(83,45,145,.2); font-family:inherit; font-size:11px; font-weight:900; cursor:pointer; }
.merchant-pwa-install-button[hidden], .merchant-pwa-login-install[hidden] { display:none!important; }
.merchant-pwa-install-button:disabled, .merchant-pwa-login-install:disabled { opacity:.65; cursor:wait; }
.merchant-pwa-login-install { width:100%; min-height:48px; margin-top:14px; font-size:12px; }
.merchant-pwa-modal { position:fixed; inset:0; z-index:5000; display:grid; padding:18px; place-items:center; }
.merchant-pwa-modal[hidden] { display:none!important; }
.merchant-pwa-backdrop { position:absolute; inset:0; background:rgba(24,14,32,.68); backdrop-filter:blur(5px); }
.merchant-pwa-dialog { position:relative; z-index:1; width:min(100%,430px); max-height:calc(100dvh - 36px); overflow:auto; padding:28px 24px 24px; border:1px solid rgba(127,0,178,.14); border-radius:24px; background:#fff; box-shadow:0 26px 80px rgba(23,12,31,.3); text-align:center; }
.merchant-pwa-dialog-icon { display:grid; width:72px; height:72px; margin:0 auto 15px; place-items:center; border-radius:22px; color:#fff; background:linear-gradient(135deg,#7f00b2,#1e91ed); font-size:27px; }
.merchant-pwa-dialog-icon.permission { background:linear-gradient(135deg,#8e22bb,#4ca1f5); }
.merchant-pwa-eyebrow { display:block; color:#7f00b2; font-size:10px; font-weight:900; letter-spacing:.07em; text-transform:uppercase; }
.merchant-pwa-dialog h2 { margin:8px 0 9px; color:#24152e; font-size:23px; font-weight:900; line-height:1.15; }
.merchant-pwa-dialog>p { margin:0; color:#74697b; font-size:12px; line-height:1.65; }
.merchant-pwa-permission-list, .merchant-pwa-step-list { display:grid; gap:10px; margin-top:19px; text-align:left; }
.merchant-pwa-permission-list>div, .merchant-pwa-step-list>div { display:flex; min-height:62px; padding:12px 13px; align-items:center; gap:12px; border:1px solid rgba(127,0,178,.1); border-radius:15px; background:linear-gradient(135deg,rgba(127,0,178,.045),rgba(30,145,237,.055)); }
.merchant-pwa-permission-list i, .merchant-pwa-step-list b { display:grid; width:38px; height:38px; flex:0 0 38px; place-items:center; border-radius:12px; color:#fff; background:linear-gradient(135deg,#7f00b2,#1e91ed); font-size:15px; }
.merchant-pwa-permission-list span, .merchant-pwa-step-list span { display:grid; gap:3px; color:#33243b; font-size:12px; line-height:1.4; }
.merchant-pwa-permission-list strong, .merchant-pwa-step-list strong { color:#24152e; font-size:12px; font-weight:900; }
.merchant-pwa-permission-list small { color:#74697b; font-size:10px; }
.merchant-pwa-primary, .merchant-pwa-secondary { display:inline-flex; width:100%; min-height:48px; margin-top:11px; padding:0 16px; align-items:center; justify-content:center; gap:8px; border:0; border-radius:13px; font-family:inherit; font-size:12px; font-weight:900; cursor:pointer; }
.merchant-pwa-primary { color:#fff; background:linear-gradient(135deg,#7f00b2,#1e91ed); box-shadow:0 12px 25px rgba(83,45,145,.2); }
.merchant-pwa-secondary { color:#392a42; background:#f1edf4; }
.merchant-pwa-primary:disabled, .merchant-pwa-secondary:disabled { opacity:.65; cursor:wait; }
.merchant-pwa-message { min-height:18px; margin-top:15px; color:#74697b; font-size:11px; font-weight:800; line-height:1.5; }
.merchant-pwa-message.working { color:#176da8; }
.merchant-pwa-message.success { color:#08783f; }
.merchant-pwa-message.warning { padding:10px; border-radius:11px; color:#9a5b00; background:#fff7e5; }
body.merchant-pwa-modal-open { overflow:hidden; }
@media (max-width:820px) { .merchant-pwa-install-button { width:38px; min-width:38px; padding:0; } .merchant-pwa-install-button span { display:none; } }
@media (max-width:480px) { .merchant-pwa-dialog { padding:25px 18px 20px; border-radius:21px; } }
/* OKDELIVERY_MERCHANT_PWA_STYLES_END */
