:root {
    --admin-blue: #2563eb;
    --admin-cyan: #06b6d4;
    --admin-purple: #7c3aed;
    --admin-navy: #0f172a;
    --admin-sidebar: #0f172a;
    --admin-bg: #f1f5f9;
    --admin-text: #24344d;
    --admin-muted: #718096;
    --admin-line: #e2e8f0;
    --admin-green: #1fa875;
}
* { box-sizing: border-box; }
body { color: var(--admin-text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.btn-primary { --bs-btn-bg: var(--admin-blue); --bs-btn-border-color: var(--admin-blue); --bs-btn-hover-bg: #1157c9; --bs-btn-hover-border-color: #1157c9; }

.admin-guest-body { display: grid; min-height: 100vh; padding: 1.25rem; place-items: center; background: #f4f7fb; }
.admin-login-shell { display: block; width: min(445px, 100%); overflow: hidden; border: 1px solid #dce6f2; border-radius: 20px; background: white; box-shadow: 0 20px 54px rgba(15,23,42,.11); }
.login-form-panel { display: block; padding: 2rem 2.15rem 1.5rem; background: white; }
.login-box { width: 100%; }
.admin-login-logo { display: block; width: 210px; max-width: 68%; margin: 0 auto 1.3rem; text-decoration: none; }
.admin-login-logo img { display: block; width: 100%; height: auto; }
.admin-access-badge { display: flex; width: max-content; max-width: 100%; margin: 0 auto 1rem; padding: .37rem .68rem; align-items: center; gap: .38rem; color: #155e75; border: 1px solid #bae6fd; border-radius: 999px; background: #f0f9ff; font-size: .64rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.admin-access-badge > span { display: inline-grid; width: 17px; height: 17px; place-items: center; color: #047857; border-radius: 50%; background: #d1fae5; font-size: .62rem; }
.login-box h2 { margin-bottom: .28rem; color: var(--admin-navy); font-size: 1.65rem; font-weight: 700; letter-spacing: -.035em; text-align: center; }
.login-subtitle { margin-bottom: 1.3rem; color: var(--admin-muted); font-size: .81rem; text-align: center; }
.admin-login-form .form-label { margin-bottom: .38rem; color: #334155; font-size: .76rem; font-weight: 600; }
.login-input-wrap, .password-wrap { position: relative; }
.login-field-icon { position: absolute; z-index: 2; top: 50%; left: .82rem; display: inline-grid; width: 20px; height: 20px; color: #7890af; place-items: center; transform: translateY(-50%); pointer-events: none; }
.admin-login-form .form-control { min-height: 46px; padding: .68rem 2.75rem .68rem 2.75rem; color: var(--admin-navy); border: 1px solid #d6e1ee; border-radius: 11px; background: white; font-size: .84rem; box-shadow: inset 0 1px 2px rgba(15,23,42,.025); }
.admin-login-form .form-control:-webkit-autofill,
.admin-login-form .form-control:-webkit-autofill:hover,
.admin-login-form .form-control:-webkit-autofill:focus { -webkit-text-fill-color: var(--admin-navy); -webkit-box-shadow: 0 0 0 1000px white inset; transition: background-color 9999s ease-out; }
.admin-login-form .form-control:focus { border-color: #7eb0f5; background: white; box-shadow: 0 0 0 4px rgba(37,99,235,.08); }
.password-toggle { position: absolute; z-index: 3; top: 50%; right: .55rem; display: inline-grid; width: 34px; height: 34px; padding: 0; color: #5f7696; border: 0; border-radius: 8px; background: transparent; place-items: center; transform: translateY(-50%); transition: color .18s ease, background-color .18s ease; }
.password-toggle:hover, .password-toggle:focus-visible { color: var(--admin-blue); background: #eef5ff; outline: 0; }
.password-eye-closed { display: none; }
.password-toggle.is-visible .password-eye-open { display: none; }
.password-toggle.is-visible .password-eye-closed { display: block; }
.login-submit { min-height: 46px; margin-top: 1.15rem; border-radius: 10px; box-shadow: 0 9px 20px rgba(37,99,235,.17); font-size: .82rem; font-weight: 700; }
.login-submit span { margin-left: .35rem; font-size: 1.05rem; }
.back-to-site { color: var(--admin-blue); font-size: .75rem; font-weight: 600; text-decoration: none; }
.login-meta { display: flex; margin-top: 1rem; padding-top: .9rem; align-items: center; justify-content: space-between; gap: 1rem; color: #8b98aa; border-top: 1px solid #edf2f7; font-size: .64rem; }
.login-meta span { text-align: right; }

.admin-body { min-height: 100vh; background: var(--admin-bg); }
.admin-sidebar { position: fixed; z-index: 1040; top: 0; bottom: 0; left: 0; display: flex; width: 274px; color: #a7b4c7; flex-direction: column; background: var(--admin-sidebar); transition: transform .25s ease; }
.sidebar-brand { display: flex; height: 82px; padding: 0 1.35rem; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand > a { display: flex; align-items: center; gap: .75rem; color: white; text-decoration: none; }
.admin-brand-mark { display: inline-grid; width: 42px; height: 42px; overflow: hidden; place-items: center; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; background: rgba(255,255,255,.06); box-shadow: 0 9px 18px rgba(0,0,0,.2); }
.admin-brand-mark img { width: 58px; max-width: none; height: 58px; object-fit: contain; }
.brand-copy { display: flex; flex-direction: column; }
.brand-copy strong { font-size: .95rem; letter-spacing: -.02em; }
.brand-copy small { margin-top: .12rem; color: #718099; font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; }
.sidebar-close { color: #a7b4c7; border: 0; background: transparent; font-size: 1.6rem; }
.sidebar-nav { overflow-y: auto; padding: 1.6rem 1rem; flex: 1; }
.nav-section-label { display: block; padding: 0 .7rem; margin-bottom: .55rem; color: #53637b; font-size: .62rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.sidebar-link { display: flex; min-height: 45px; margin-bottom: .28rem; padding: 0 .75rem; align-items: center; gap: .75rem; color: #9aa9bd; border-radius: 9px; font-size: .79rem; font-weight: 500; text-decoration: none; }
.sidebar-link:hover { color: white; background: rgba(255,255,255,.06); }
.sidebar-link.active { color: white; background: linear-gradient(90deg, rgba(31,117,238,.25), rgba(31,117,238,.08)); box-shadow: inset 3px 0 #3b8df6; }
.sidebar-link.disabled { opacity: .58; pointer-events: none; }
.nav-glyph { display: inline-grid; width: 25px; height: 25px; place-items: center; color: #6f91bd; font-size: 1rem; }
.sidebar-link.active .nav-glyph { color: #74b3ff; }
.soon-badge { margin-left: auto; padding: .15rem .36rem; color: #7690b0; border-radius: 5px; background: rgba(255,255,255,.07); font-size: .53rem; text-transform: uppercase; }
.sidebar-footer { padding: 1rem; border-top: 1px solid rgba(255,255,255,.07); }
.system-status { display: flex; padding: .8rem; align-items: center; gap: .65rem; border-radius: 9px; background: rgba(255,255,255,.035); }
.system-status > span { width: 8px; height: 8px; border-radius: 50%; background: #42d69c; box-shadow: 0 0 0 4px rgba(66,214,156,.1); }
.system-status div { display: flex; flex-direction: column; }
.system-status strong { color: #b4c1d1; font-size: .65rem; }
.system-status small { color: #607089; font-size: .57rem; }

.admin-main { min-height: 100vh; margin-left: 274px; }
.admin-header { position: sticky; z-index: 1020; top: 0; display: flex; min-height: 82px; padding: 0 2rem; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--admin-line); background: rgba(255,255,255,.94); backdrop-filter: blur(13px); }
.header-breadcrumb { display: block; margin-bottom: .2rem; color: #8b98aa; font-size: .63rem; }
.admin-header h1 { margin: 0; color: var(--admin-navy); font-size: 1.18rem; font-weight: 700; }
.sidebar-toggle { width: 39px; height: 39px; color: var(--admin-navy); border: 1px solid var(--admin-line); border-radius: 9px; background: white; }
.environment-pill { display: inline-flex; padding: .42rem .65rem; align-items: center; gap: .45rem; color: #58708e; border: 1px solid var(--admin-line); border-radius: 20px; background: #f8fafc; font-size: .63rem; font-weight: 600; }
.environment-pill span { width: 6px; height: 6px; border-radius: 50%; background: var(--admin-green); }
.profile-button { display: flex; padding: .3rem .5rem .3rem .35rem; align-items: center; gap: .65rem; color: var(--admin-text); border: 1px solid transparent; border-radius: 10px; background: transparent; }
.profile-button:hover { border-color: var(--admin-line); background: #f8fafc; }
.profile-avatar { display: inline-grid; width: 36px; height: 36px; place-items: center; color: white; border-radius: 10px; background: linear-gradient(145deg, #1d75ed, #094fb9); font-size: .78rem; font-weight: 600; }
.profile-copy { flex-direction: column; align-items: flex-start; }
.profile-copy strong { max-width: 150px; overflow: hidden; color: var(--admin-navy); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy small { color: #8b98aa; font-size: .58rem; }
.profile-menu { width: 240px; border-color: var(--admin-line); border-radius: 11px; font-size: .76rem; }
.profile-menu .dropdown-item { font-size: .76rem; }

.admin-content { padding: 2rem; }
.dashboard-welcome { margin-bottom: 1.8rem; }
.dashboard-kicker, .panel-label { margin-bottom: .45rem; color: var(--admin-blue); font-size: .61rem; }
.dashboard-welcome h2 { margin: 0 0 .4rem; color: var(--admin-navy); font-size: 1.85rem; font-weight: 700; letter-spacing: -.04em; }
.dashboard-welcome p { margin: 0; color: var(--admin-muted); font-size: .8rem; }
.role-stack { display: flex; align-items: center; gap: .5rem; }
.role-stack span { color: var(--admin-muted); font-size: .65rem; }
.role-stack strong { padding: .4rem .6rem; color: #0b6b50; border: 1px solid #bfe8d8; border-radius: 7px; background: #eaf8f3; font-size: .63rem; }
.summary-card, .admin-panel { border: 1px solid var(--admin-line); border-radius: 13px; background: white; box-shadow: 0 6px 18px rgba(16,36,69,.035); }
.summary-card { padding: 1.2rem; }
.summary-top { display: flex; margin-bottom: 1.1rem; align-items: flex-start; justify-content: space-between; }
.summary-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 9px; font-size: .9rem; font-weight: 600; }
.tone-primary { color: #155ecb; background: #e9f2ff; }.tone-success { color: #18805d; background: #e8f8f2; }.tone-info { color: #087892; background: #e7f8fb; }.tone-warning { color: #a36512; background: #fff5e1; }
.summary-change { color: var(--admin-green); font-size: .61rem; font-weight: 600; }
.summary-value, .summary-label { display: block; }
.summary-value { color: var(--admin-navy); font-size: 1.55rem; line-height: 1; letter-spacing: -.03em; }
.summary-label { margin-top: .35rem; color: var(--admin-muted); font-size: .68rem; }
.summary-spark { height: 3px; margin-top: 1.1rem; border-radius: 6px; background: #edf1f6; }
.summary-spark i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #2563eb, #06b6d4); }
.admin-panel { padding: 1.35rem; }
.panel-heading { margin-bottom: 1.2rem; }
.panel-heading h3 { margin: 0; color: var(--admin-navy); font-size: .98rem; font-weight: 600; }
.dummy-label { padding: .3rem .5rem; color: #8794a6; border-radius: 6px; background: #f1f4f8; font-size: .56rem; font-weight: 600; text-transform: uppercase; }
.chart-wrap { display: flex; height: 260px; padding-top: 1rem; align-items: flex-end; gap: clamp(.55rem, 2vw, 1.35rem); border-bottom: 1px solid var(--admin-line); background-image: linear-gradient(#eef2f6 1px, transparent 1px); background-size: 100% 25%; }
.chart-column { position: relative; display: flex; height: 100%; align-items: center; flex: 1; flex-direction: column; justify-content: flex-end; }
.chart-column i { width: min(38px, 72%); min-height: 20px; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, #4a93f1, #1764d7); opacity: .88; transition: opacity .2s; }
.chart-column:hover i { opacity: 1; }
.chart-column small { position: absolute; bottom: -1.6rem; color: #8b98aa; font-size: .6rem; }
.chart-value { margin-bottom: .35rem; color: #6f7f93; font-size: .54rem; opacity: 0; }
.chart-column:hover .chart-value { opacity: 1; }
.activity-panel { padding-bottom: 2.8rem; }
.status-list { display: grid; gap: .95rem; }
.status-list > div { display: flex; align-items: flex-start; gap: .75rem; }
.status-check, .status-wait { display: inline-grid; width: 27px; height: 27px; flex: 0 0 auto; place-items: center; color: #17815e; border-radius: 8px; background: #e8f8f2; font-size: .7rem; font-weight: 700; }
.status-wait { color: #96601a; background: #fff4df; }
.status-list p, .status-list strong, .status-list small { display: block; margin: 0; }
.status-list strong { color: #33445d; font-size: .69rem; }
.status-list small { margin-top: .18rem; color: #8895a7; font-size: .6rem; }
.activity-table { min-width: 720px; font-size: .69rem; }
.activity-table thead th { padding: .75rem; color: #8794a6; border-bottom-color: var(--admin-line); background: #f8fafc; font-size: .58rem; letter-spacing: .05em; text-transform: uppercase; }
.activity-table tbody td { padding: .85rem .75rem; color: #596a80; border-bottom-color: #edf1f5; }
.activity-table tbody tr:last-child td { border-bottom: 0; }
.activity-table strong { color: var(--admin-navy); }
.table-status { display: inline-block; padding: .3rem .48rem; border-radius: 6px; font-size: .56rem; font-weight: 600; }
.table-status.confirmed { color: #137455; background: #e6f7f0; }.table-status.review { color: #9b6417; background: #fff3dd; }.table-status.pending { color: #4f68a1; background: #edf2ff; }
.admin-overlay { display: none; }

/* Phase 12: markup and commercial rules */
.commercial-page { display: grid; max-width: 1480px; margin: 0 auto; gap: 1.15rem; }
.commercial-hero { display: flex; min-height: 145px; padding: 1.65rem 1.8rem; align-items: center; justify-content: space-between; gap: 1.5rem; overflow: hidden; border: 1px solid #d7e3f2; border-radius: 18px; background: radial-gradient(circle at 92% 10%, rgba(37,99,235,.14), transparent 30%), linear-gradient(135deg,#fff,#f5f9ff); box-shadow: 0 10px 32px rgba(15,43,78,.05); }
.commercial-eyebrow { display: block; margin-bottom: .35rem; color: #1967df; font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.commercial-hero h2 { margin: 0; color: #0d2142; font-size: clamp(1.55rem,2vw,2.05rem); font-weight: 720; letter-spacing: -.035em; }
.commercial-hero p { max-width: 720px; margin: .5rem 0 0; color: #6c7d94; font-size: .79rem; line-height: 1.55; }
.commercial-add-button { display: inline-flex; min-width: 138px; min-height: 43px; align-items: center; justify-content: center; gap: .5rem; border-radius: 10px; font-size: .75rem; font-weight: 650; box-shadow: 0 10px 20px rgba(37,99,235,.18); }
.commercial-add-button span { font-size: 1rem; }
.commercial-alert { margin: 0; border-radius: 12px; font-size: .78rem; }
.commercial-migration-card { display: flex; padding: 1.4rem; align-items: flex-start; gap: 1rem; border: 1px solid #f2d190; border-radius: 14px; background: #fffaf0; }
.migration-icon { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; color: #a86300; border-radius: 10px; background: #ffefc8; font-weight: 800; }
.commercial-migration-card h3 { margin: 0 0 .35rem; color: #5e441a; font-size: .95rem; }
.commercial-migration-card p { margin: 0 0 .55rem; color: #80673d; font-size: .74rem; }
.commercial-migration-card code { color: #1453a6; font-size: .7rem; }
.commercial-summary-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: .8rem; }
.commercial-summary-card { position: relative; display: flex; min-height: 88px; padding: 1rem 1.1rem; overflow: hidden; flex-direction: column; justify-content: center; border: 1px solid #dfe7f1; border-radius: 13px; background: white; box-shadow: 0 5px 16px rgba(15,43,78,.035); }
.commercial-summary-card::after { position: absolute; right: -17px; bottom: -24px; width: 70px; height: 70px; content: ""; border-radius: 50%; background: currentColor; opacity: .06; }
.commercial-summary-card span { color: #73839a; font-size: .66rem; }
.commercial-summary-card strong { margin-top: .3rem; color: #10264a; font-size: 1.35rem; letter-spacing: -.03em; }
.commercial-summary-card.tone-blue { color: #2563eb; }.commercial-summary-card.tone-violet { color: #7c3aed; }.commercial-summary-card.tone-cyan { color: #0891b2; }.commercial-summary-card.tone-green { color: #15966d; }.commercial-summary-card.tone-amber { color: #c47b10; }
.commercial-simulator { overflow: hidden; border: 1px solid #dce5f0; border-radius: 15px; background: #fff; box-shadow: 0 8px 28px rgba(15,43,78,.04); }
.commercial-simulator-heading { display: flex; padding: 1rem 1.15rem; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid #e5ebf3; background: linear-gradient(90deg,#f7faff,#fff); }
.commercial-simulator-heading h3 { margin: 0; color: #112a4c; font-size: .95rem; }
.commercial-simulator-heading p { margin: .25rem 0 0; color: #78899e; font-size: .65rem; }
.simulation-state { display: inline-flex; min-height: 28px; padding: 0 .65rem; align-items: center; border-radius: 999px; font-size: .58rem; font-weight: 750; white-space: nowrap; }
.simulation-state.is-clear { color: #087b59; background: #e7f8f0; }.simulation-state.has-conflict { color: #9b6200; background: #fff2d2; }
.commercial-simulator-form { display: grid; padding: .9rem 1rem; align-items: end; grid-template-columns: minmax(180px,1.4fr) repeat(8,minmax(82px,.65fr)) auto; gap: .45rem; }
.commercial-simulator-form label { display: flex; min-width: 0; flex-direction: column; gap: .25rem; }
.commercial-simulator-form label > span { color: #64758c; font-size: .55rem; font-weight: 700; }
.commercial-simulator-form input,.commercial-simulator-form select { width: 100%; min-width: 0; height: 36px; padding: 0 .55rem; color: #263b59; border: 1px solid #d7e1ed; border-radius: 8px; outline: 0; background: #fbfdff; font-size: .62rem; }
.commercial-simulator-form input:focus,.commercial-simulator-form select:focus { border-color: #86aff3; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.commercial-simulator-form .btn { min-height: 36px; font-size: .62rem; white-space: nowrap; }
.simulation-message { margin: 0 1rem 1rem; padding: .7rem .8rem; border-radius: 9px; font-size: .65rem; }.simulation-message.is-error { color: #a02b2b; border: 1px solid #f2c8c8; background: #fff3f3; }
.commercial-simulator-result { padding: 0 1rem 1rem; }
.simulation-price-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); border: 1px solid #dfe7f1; border-radius: 11px; background: #f9fbfe; }
.simulation-price-grid article { padding: .7rem .8rem; border-right: 1px solid #e1e8f1; }.simulation-price-grid article:last-child { border-right: 0; }
.simulation-price-grid small,.simulation-price-grid strong,.simulation-price-grid span { display: block; }.simulation-price-grid small { color: #76879c; font-size: .54rem; }.simulation-price-grid strong { margin: .16rem 0; color: #153052; font-size: .9rem; }.simulation-price-grid span { color: #8796a8; font-size: .54rem; }
.simulation-price-grid article.is-selling { background: #ecf4ff; }.simulation-price-grid article.is-selling strong { color: #155dcc; }
.simulation-resolution { display: grid; margin-top: .7rem; padding: .75rem .85rem; align-items: center; grid-template-columns: minmax(190px,.7fr) minmax(320px,1.3fr); gap: 1rem; border: 1px solid #dfe7f1; border-radius: 10px; }
.simulation-resolution small,.simulation-resolution strong,.simulation-resolution span { display: block; }.simulation-resolution small { color: #7d8da1; font-size: .54rem; }.simulation-resolution strong { margin: .18rem 0; color: #173151; font-size: .75rem; }.simulation-resolution span { color: #71839a; font-size: .58rem; }
.simulation-candidates { display: flex; flex-wrap: wrap; gap: .32rem; }.simulation-candidates > small { width: 100%; }.simulation-candidates > span { display: inline-flex; padding: .3rem .45rem; align-items: center; gap: .35rem; border-radius: 7px; background: #f0f4f9; }.simulation-candidates > span.is-winner { color: #155dcc; background: #e8f1ff; }.simulation-candidates b { font-size: .51rem; font-weight: 700; }
.priority-panel { display: grid; padding: 1.1rem 1.25rem; align-items: center; grid-template-columns: minmax(230px,.7fr) minmax(550px,1.3fr); gap: 1rem; border: 1px solid #dfe7f1; border-radius: 14px; background: white; }
.priority-copy h3 { margin: 0; color: #122847; font-size: 1rem; }
.priority-copy p { margin: .3rem 0 0; color: #7b8a9e; font-size: .68rem; }
.priority-flow { display: grid; grid-template-columns: repeat(4,1fr); }
.priority-flow div { position: relative; display: flex; min-height: 52px; padding: .55rem .7rem; align-items: center; gap: .6rem; border: 1px solid #e1e8f2; background: #f8fbff; }
.priority-flow div:first-child { border-radius: 10px 0 0 10px; }.priority-flow div:last-child { border-radius: 0 10px 10px 0; }
.priority-flow div:not(:last-child)::after { position: absolute; z-index: 2; top: 50%; right: -5px; width: 9px; height: 9px; content: ""; transform: translateY(-50%) rotate(45deg); border-top: 1px solid #c8d5e5; border-right: 1px solid #c8d5e5; background: #f8fbff; }
.priority-flow span { display: grid; width: 26px; height: 26px; flex: 0 0 26px; place-items: center; color: #1766d9; border-radius: 8px; background: #e6f0ff; font-size: .64rem; font-weight: 800; }
.priority-flow strong { color: #40536f; font-size: .67rem; font-weight: 650; }
.rule-builder,.rule-list-panel { border: 1px solid #dce5f0; border-radius: 15px; background: white; box-shadow: 0 8px 28px rgba(15,43,78,.045); }
.rule-builder { overflow: hidden; scroll-margin-top: 95px; }
.rule-builder-heading { display: flex; padding: 1.15rem 1.3rem; align-items: center; justify-content: space-between; border-bottom: 1px solid #e3eaf3; background: linear-gradient(90deg,#f7faff,#fff); }
.rule-builder-heading h3 { margin: 0; color: #10264a; font-size: 1rem; }
.builder-section { padding: 1.2rem 1.3rem; border-bottom: 1px solid #edf1f6; }
.builder-section:last-child { border-bottom: 0; }
.builder-section-title { display: flex; margin-bottom: .95rem; align-items: center; gap: .65rem; }
.builder-section-title > span { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; color: #1d66d5; border-radius: 8px; background: #eaf2ff; font-size: .67rem; font-weight: 800; }
.builder-section-title div { display: flex; flex-direction: column; }
.builder-section-title strong { color: #1a2e4c; font-size: .75rem; }
.builder-section-title small { margin-top: .12rem; color: #8795a8; font-size: .61rem; }
.rule-builder .form-label { margin-bottom: .35rem; color: #53647c; font-size: .63rem; font-weight: 650; }
.rule-builder .form-control,.rule-builder .form-select { min-height: 41px; color: #213653; border-color: #d8e2ee; border-radius: 9px; background-color: #fbfdff; font-size: .72rem; }
.rule-builder .form-control:focus,.rule-builder .form-select:focus { border-color: #85b4f5; background: white; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.commercial-input-unit { position: relative; }
.commercial-input-unit input { padding-right: 2.2rem; }
.commercial-input-unit span { position: absolute; top: 50%; right: .85rem; color: #7590b0; transform: translateY(-50%); font-size: .7rem; font-weight: 700; }
.rule-price-preview { display: flex; min-height: 41px; padding: .42rem .7rem; align-items: center; justify-content: space-between; gap: .5rem; border: 1px solid #bfe7d8; border-radius: 9px; background: #effbf6; }
.rule-price-preview small { color: #628173; font-size: .58rem; }.rule-price-preview strong { color: #087953; font-size: .8rem; }
.rule-save-button { min-height: 41px; border-radius: 9px; font-size: .72rem; font-weight: 650; }
.rule-target { display: none; }
.rule-filter-bar { padding: .85rem; border-bottom: 1px solid #e4ebf3; }
.rule-filter-bar form { display: grid; grid-template-columns: minmax(260px,1fr) 150px 150px 130px auto auto; gap: .55rem; }
.rule-filter-bar input,.rule-filter-bar select { width: 100%; min-height: 39px; padding: .55rem .7rem; color: #31445f; border: 1px solid #d8e2ee; border-radius: 9px; outline: 0; background: #fbfdff; font-size: .68rem; }
.rule-search-field { position: relative; }.rule-search-field span { position: absolute; top: 50%; left: .7rem; color: #7790ad; transform: translateY(-50%); }.rule-search-field input { padding-left: 1.8rem; }
.rule-filter-bar .btn { display: inline-grid; min-height: 39px; place-items: center; font-size: .68rem; }
.rule-table-wrap { overflow-x: auto; }
.rule-table { width: 100%; min-width: 1180px; border-collapse: collapse; }
.rule-table th { padding: .72rem .8rem; color: #8190a4; border-bottom: 1px solid #e5ebf2; background: #f8fafc; font-size: .55rem; font-weight: 700; letter-spacing: .06em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.rule-table td { padding: .8rem; color: #53647b; border-bottom: 1px solid #edf1f6; font-size: .66rem; vertical-align: middle; }
.rule-table tr:last-child td { border-bottom: 0; }
.rule-table td > strong,.rule-table td > small { display: block; }.rule-table td > strong { color: #172b48; font-size: .7rem; }.rule-table td > small { margin-top: .2rem; color: #8090a5; font-size: .57rem; }
.scope-pill,.status-pill,.all-condition { display: inline-flex; padding: .28rem .45rem; align-items: center; border-radius: 7px; font-size: .56rem; font-weight: 700; white-space: nowrap; }
.scope-pill { margin-bottom: .28rem; color: #245aa4; background: #edf4ff; }.scope-agent { color: #6a3ab1; background: #f2ebff; }.scope-plan { color: #9a5b08; background: #fff4dc; }
.condition-tags { display: flex; max-width: 260px; flex-wrap: wrap; gap: .25rem; }.condition-tags span,.all-condition { padding: .2rem .35rem; color: #61738b; border-radius: 5px; background: #f1f5f9; font-size: .54rem; }
.markup-value { color: #086e50!important; font-size: .82rem!important; }
.status-pill.active { color: #087853; background: #e8f8f1; }.status-pill.inactive { color: #6d7786; background: #edf0f4; }
.rule-actions { display: flex; gap: .35rem; }.rule-actions form { margin: 0; }.rule-actions .btn { font-size: .58rem; white-space: nowrap; }
.empty-rules { display: grid; padding: 2.3rem; place-items: center; text-align: center; }.empty-rules > span { display: grid; width: 42px; height: 42px; margin-bottom: .65rem; place-items: center; color: #2a6bd0; border-radius: 11px; background: #eaf2ff; font-size: 1rem; font-weight: 800; }.empty-rules strong { color: #24364f; font-size: .76rem; }.empty-rules p { margin: .25rem 0 0; color: #8492a5; font-size: .63rem; }

@media (max-width: 1199.98px) {
    .commercial-summary-grid { grid-template-columns: repeat(3,1fr); }
    .commercial-simulator-form { grid-template-columns: repeat(5,minmax(120px,1fr)); }
    .commercial-simulator-form label:first-of-type { grid-column: span 2; }
    .commercial-simulator-form .btn { min-height: 36px; }
    .priority-panel { grid-template-columns: 1fr; }
    .rule-filter-bar form { grid-template-columns: 1fr repeat(3,140px) auto auto; }
}
@media (max-width: 767.98px) {
    .commercial-hero { min-height: auto; padding: 1.2rem; align-items: flex-start; flex-direction: column; }
    .commercial-summary-grid { grid-template-columns: repeat(2,1fr); }
    .commercial-simulator-heading { align-items: flex-start; flex-direction: column; }
    .commercial-simulator-form { grid-template-columns: 1fr 1fr; }
    .commercial-simulator-form label:first-of-type { grid-column: 1/-1; }
    .simulation-price-grid { overflow-x: auto; grid-template-columns: repeat(5,minmax(130px,1fr)); }
    .simulation-resolution { grid-template-columns: 1fr; }
    .priority-flow { overflow-x: auto; grid-template-columns: repeat(4,minmax(145px,1fr)); }
    .rule-filter-bar form { grid-template-columns: 1fr 1fr; }
    .rule-search-field { grid-column: 1/-1; }
}

@media (max-width: 1199.98px) {
    .admin-login-shell { width: min(445px, 100%); }
}
@media (max-width: 991.98px) {
    .admin-login-shell { width: min(445px, 100%); border-radius: 20px; }
    .login-form-panel { padding: 2rem 2.15rem 1.5rem; }
    .admin-sidebar { transform: translateX(-100%); }
    .admin-main { margin-left: 0; }
    .sidebar-open .admin-sidebar { transform: translateX(0); }
    .admin-overlay { position: fixed; z-index: 1035; inset: 0; background: rgba(5,15,31,.48); }
    .sidebar-open .admin-overlay { display: block; }
}
@media (max-width: 767.98px) {
    .admin-header { min-height: 70px; padding: 0 1rem; }
    .admin-content { padding: 1.2rem 1rem; }
    .dashboard-welcome h2 { font-size: 1.5rem; }
    .role-stack { flex-wrap: wrap; }
}
@media (max-width: 575.98px) {
    .admin-guest-body { padding: .85rem; }
    .admin-login-shell { border-radius: 16px; }
    .login-form-panel { padding: 1.75rem 1.25rem; }
    .login-box h2 { font-size: 1.55rem; }
    .login-meta { align-items: flex-start; flex-direction: column; }
    .login-meta span { text-align: left; }
    .admin-sidebar { width: min(286px, 86vw); }
    .profile-button { padding: .2rem; }
}
