:root {
  --ink: #171a2b;
  --muted: #687087;
  --line: #e6e8f0;
  --paper: #ffffff;
  --canvas: #f5f6fa;
  --navy: #11152b;
  --purple: #6c5ce7;
  --purple-dark: #5747d7;
  --pink: #f238d3;
  --blue: #4083ff;
  --aqua: #24c8b1;
  --aqua-soft: #dcf8f3;
  --purple-soft: #eeebff;
  --warning-soft: #fff3d6;
  --shadow: 0 20px 60px rgba(17, 21, 43, .12);
}

* { box-sizing: border-box; }
html { min-height: 100%; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); }
body { margin: 0; min-height: 100vh; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; }
[hidden] { display: none !important; }

.brand-lockup { display: flex; align-items: center; gap: 11px; color: inherit; }
.brand-lockup > .brand-name { display: flex; align-items: baseline; font-size: 1.27rem; letter-spacing: -.03em; }
.brand-lockup strong { font-weight: 800; }
.brand-lockup .brand-ia { color: transparent; background: linear-gradient(110deg, var(--pink), var(--purple), var(--blue), var(--aqua)); background-clip: text; -webkit-background-clip: text; }
.brand-lockup em { margin-left: 5px; color: #94a1be; font-style: normal; font-weight: 650; }
.brand-symbol { position: relative; display: block; flex: 0 0 40px; width: 40px; height: 40px; overflow: hidden; }
.brand-symbol img { position: absolute; top: -5px; left: -7px; width: auto; max-width: none; height: 50px; }
.brand-lockup--large .brand-symbol { flex-basis: 52px; width: 52px; height: 52px; }
.brand-lockup--large .brand-symbol img { top: -6px; left: -8px; height: 64px; }
.brand-lockup--large > .brand-name { font-size: 1.6rem; }
.eyebrow { display: block; margin-bottom: 9px; color: var(--purple); font-size: .74rem; line-height: 1.3; font-weight: 850; letter-spacing: .13em; }
.muted { color: var(--muted); }

.auth-body { overflow-x: hidden; color: #fff; background: var(--navy); }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(460px, .9fr); min-height: 100vh; }
.auth-brand { position: relative; display: flex; flex-direction: column; padding: clamp(38px, 5vw, 76px); overflow: hidden; isolation: isolate; }
.auth-brand::before, .auth-brand::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(1px); }
.auth-brand::before { width: 620px; height: 620px; left: -300px; bottom: -310px; background: radial-gradient(circle at 65% 35%, rgba(36, 200, 177, .22), transparent 60%); border: 1px solid rgba(36, 200, 177, .12); }
.auth-brand::after { width: 480px; height: 480px; right: -240px; top: -190px; background: radial-gradient(circle at 35% 65%, rgba(108, 92, 231, .4), transparent 60%); }
.auth-message { max-width: 650px; margin: auto 0; }
.auth-message .eyebrow { color: var(--aqua); }
.auth-message h1 { max-width: 620px; margin: 0 0 22px; font-size: clamp(2.7rem, 5vw, 5.2rem); line-height: .99; letter-spacing: -.062em; }
.auth-message p { max-width: 600px; color: #bdc3d7; font-size: clamp(1rem, 1.3vw, 1.25rem); line-height: 1.65; }
.auth-rule { display: flex; gap: 10px; align-items: center; color: #aab1c7; font-size: .9rem; }
.auth-rule span { color: var(--aqua); }
.auth-card-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 28px 78px; color: var(--ink); background: var(--canvas); }
.auth-card { width: min(100%, 470px); padding: clamp(28px, 4vw, 48px); border: 1px solid rgba(230, 232, 240, .9); border-radius: 26px; background: var(--paper); box-shadow: var(--shadow); }
.auth-card h1, .auth-card h2 { margin: 0 0 8px; font-size: clamp(1.75rem, 3vw, 2.2rem); letter-spacing: -.045em; }
.auth-card .muted { margin: 0 0 30px; line-height: 1.6; }
.auth-card form { display: grid; gap: 10px; }
.auth-card label { margin-top: 8px; font-size: .88rem; font-weight: 750; }
.auth-card input { width: 100%; height: 52px; padding: 0 15px; border: 1px solid #d7dbe6; border-radius: 12px; outline: none; background: #fbfbfd; transition: .2s; }
.auth-card input:focus { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(108, 92, 231, .11); background: #fff; }
.password-field { position: relative; }
.password-field input { padding-right: 84px; }
.toggle-password { position: absolute; inset: 0 8px 0 auto; border: 0; color: var(--purple); background: transparent; font-size: .78rem; font-weight: 800; }
.link-button { border: 0; padding: 0; color: var(--purple); background: transparent; font-weight: 750; }
.forgot-link { justify-self: end; margin: 1px 0 8px; font-size: .86rem; }
.primary-button, .secondary-button { min-height: 46px; padding: 0 18px; border-radius: 11px; font-weight: 800; transition: transform .18s, box-shadow .18s, background .18s; }
.primary-button { border: 0; color: #fff; background: linear-gradient(135deg, var(--purple), #7c66f0); box-shadow: 0 10px 24px rgba(108, 92, 231, .23); }
.primary-button:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 13px 28px rgba(108, 92, 231, .3); }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.button-link { display: grid; place-items: center; text-decoration: none; }
.compact { min-height: 38px; padding: 0 13px; font-size: .84rem; }
.form-message { min-height: 20px; color: #bd2c4a; font-size: .83rem; line-height: 1.45; }
.form-message.success { color: #12806e; }
.auth-footer { position: fixed; right: 0; bottom: 0; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 9px; width: 45%; min-height: 54px; margin: 0; padding: 8px 14px; border-top: 1px solid var(--line); color: #697087; background: #fff; box-shadow: 0 -8px 26px rgba(17, 21, 43, .06); font-size: .74rem; }
.developer-brand { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); text-decoration: none; }
.developer-mark { position: relative; display: block; width: 22px; height: 22px; overflow: hidden; }
.developer-mark img { position: absolute; top: -3px; left: -4px; width: auto; max-width: none; height: 28px; }
.developer-word { display: inline-flex; align-items: baseline; letter-spacing: -.035em; }
.developer-word strong { font-weight: 850; }
.developer-word .brand-ia { color: transparent; background: linear-gradient(110deg, var(--pink), var(--purple), var(--blue), var(--aqua)); background-clip: text; -webkit-background-clip: text; }
.developer-word em { margin-left: 3px; color: #7d879f; font-style: normal; font-weight: 650; }
.footer-separator { color: #b2b7c5; }
.legal-link { color: #626a80; font-weight: 700; text-decoration: none; }
.legal-link:hover { color: var(--purple); }
.mobile-brand { display: none; margin-bottom: 36px; }
.simple-auth { display: grid; place-items: center; }
.simple-auth .auth-card-wrap { width: 100%; min-height: 100vh; }
.simple-auth .brand-lockup { margin-bottom: 36px; }

.app-body { background: var(--canvas); }
.app-shell { display: grid; grid-template-columns: 258px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; z-index: 20; display: flex; flex-direction: column; height: 100vh; color: #e9ebf6; background: var(--navy); box-shadow: 8px 0 30px rgba(17, 21, 43, .08); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 25px 22px 20px; }
.main-nav { flex: 1; padding: 8px 13px; overflow-y: auto; }
.nav-label { display: block; padding: 21px 12px 8px; color: #737b97; font-size: .64rem; font-weight: 850; letter-spacing: .14em; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 43px; margin: 3px 0; padding: 0 12px; border: 0; border-radius: 10px; color: #aeb5cc; background: transparent; font-size: .9rem; font-weight: 680; text-align: left; transition: .18s; }
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(108, 92, 231, .28), rgba(108, 92, 231, .1)); box-shadow: inset 3px 0 var(--aqua); }
.nav-icon { display: grid; place-items: center; width: 22px; color: var(--aqua); font-size: 1rem; }
.main-area { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; padding-bottom: 54px; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 18px; min-height: 76px; padding: 12px clamp(18px, 3vw, 38px); border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); }
.company-context { display: flex; flex-direction: column; }
.company-context span { color: var(--muted); font-size: .7rem; }
.company-context strong { font-size: .9rem; }
.topbar-actions { display: flex; align-items: center; gap: 15px; margin-left: auto; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip > span:last-child { display: flex; flex-direction: column; }
.user-chip strong { font-size: .83rem; }
.user-chip small { color: var(--muted); font-size: .7rem; }
.avatar { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 11px; color: #fff; background: linear-gradient(135deg, var(--purple), var(--aqua)); font-weight: 850; }
.menu-button { display: none; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; font-size: 1.1rem; }
.content { flex: 1; width: min(100%, 1480px); margin: 0 auto; padding: clamp(24px, 3.5vw, 46px); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading h1 { margin: 0; font-size: clamp(2rem, 3vw, 2.8rem); letter-spacing: -.055em; }
.page-heading p { margin: 8px 0 0; color: var(--muted); }
.page-heading .primary-button { min-width: 150px; }
.notice-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 15px; margin-bottom: 22px; padding: 17px 19px; border: 1px solid #d7d1ff; border-radius: 15px; background: linear-gradient(95deg, var(--purple-soft), #f7f6ff); }
.notice-card p { margin: 4px 0 0; color: #62677b; font-size: .86rem; }
.notice-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: #fff; background: var(--purple); font-weight: 900; }
.status-chip { display: inline-flex; width: fit-content; align-items: center; min-height: 27px; padding: 0 10px; border-radius: 999px; color: #646a7d; background: #eef0f5; font-size: .69rem; font-weight: 850; }
.status-progress { color: #5b48ce; background: #ddd7ff; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.metric-card, .panel { border: 1px solid var(--line); background: var(--paper); box-shadow: 0 9px 30px rgba(17, 21, 43, .045); }
.metric-card { position: relative; min-height: 142px; padding: 20px; border-radius: 16px; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; right: -24px; bottom: -28px; width: 88px; height: 88px; border-radius: 50%; background: var(--purple-soft); }
.metric-card:nth-child(2)::after, .metric-card:nth-child(4)::after { background: var(--aqua-soft); }
.metric-card span { color: var(--muted); font-size: .78rem; font-weight: 700; }
.metric-card strong { display: block; margin: 8px 0 2px; font-size: 2.1rem; letter-spacing: -.055em; }
.metric-card small { color: #9aa0b0; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); gap: 18px; }
.panel { padding: 24px; border-radius: 17px; }
.panel h2 { margin: 0; font-size: 1.18rem; letter-spacing: -.025em; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; }
.panel-head > span { color: var(--purple); font-size: 1.35rem; font-weight: 900; }
.progress-track { height: 8px; margin: 20px 0; border-radius: 999px; background: #ebeaf1; overflow: hidden; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--purple), var(--aqua)); transition: width .4s; }
.check-list { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.check-list li { display: flex; align-items: center; gap: 10px; color: #73798a; font-size: .85rem; }
.check-list li span { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 7px; background: #f0f1f5; font-weight: 900; }
.check-list li.done { color: var(--ink); }
.check-list li.done span { color: #087663; background: var(--aqua-soft); }
.principle-panel { color: #fff; background: linear-gradient(145deg, #181d3b, var(--navy)); overflow: hidden; }
.principle-panel .eyebrow { color: var(--aqua); }
.principle-panel h2 { max-width: 390px; font-size: 1.5rem; }
.principle-panel > p { color: #aeb5cc; font-size: .83rem; line-height: 1.6; }
.principle-flow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 30px 0; }
.principle-flow div { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 14px 7px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; background: rgba(255, 255, 255, .045); }
.principle-flow strong { font-size: .86rem; }
.principle-flow span { margin-top: 3px; color: var(--aqua); font-size: .68rem; }
.principle-flow b { color: var(--purple); }
.placeholder-page { display: grid; place-items: center; }
.empty-module { max-width: 540px; padding: 50px 28px; text-align: center; }
.module-icon { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 24px; border-radius: 23px; color: var(--purple); background: var(--purple-soft); font-size: 2rem; }
.empty-module h1 { margin: 0; font-size: 2.25rem; letter-spacing: -.05em; }
.empty-module p { margin: 12px 0 22px; color: var(--muted); line-height: 1.65; }
.app-footer { position: fixed; right: 0; bottom: 0; left: 258px; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 8px 24px; border-top: 1px solid var(--line); color: #697087; background: #fff; box-shadow: 0 -8px 26px rgba(17, 21, 43, .06); font-size: .74rem; text-align: center; }
.sidebar-backdrop { display: none; }
.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: 360px; padding: 14px 17px; border-radius: 12px; color: #fff; background: #242940; box-shadow: var(--shadow); opacity: 0; transform: translateY(15px); pointer-events: none; transition: .22s; }
.toast.show { opacity: 1; transform: translateY(0); }
.mobile-only { display: none; }

.management-heading { align-items: center; }
.management-toolbar { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 17px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.search-field, .filter-field { display: grid; gap: 6px; }
.search-field { flex: 1; }
.filter-field { width: min(280px, 32vw); }
.search-field span, .filter-field span { color: var(--muted); font-size: .72rem; font-weight: 750; }
.search-field input, .filter-field select, .dialog-fields input, .dialog-fields select { width: 100%; height: 43px; padding: 0 12px; border: 1px solid #d7dbe6; border-radius: 10px; outline: none; color: var(--ink); background: #fff; }
.search-field input:focus, .filter-field select:focus, .dialog-fields input:focus, .dialog-fields select:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(108, 92, 231, .1); }
.record-count { margin-left: auto; padding-bottom: 11px; color: var(--muted); font-size: .78rem; white-space: nowrap; }
.table-card { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 9px 30px rgba(17, 21, 43, .045); }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.data-table th { padding: 14px 16px; color: #777e91; background: #f8f9fc; font-size: .7rem; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: 15px 16px; border-top: 1px solid #eef0f5; vertical-align: middle; }
.data-table tr:hover td { background: #fbfbfe; }
.data-table .primary-cell { min-width: 180px; }
.data-table .primary-cell strong, .data-table .primary-cell small { display: block; }
.data-table .primary-cell small { margin-top: 3px; color: var(--muted); }
.table-action { min-height: 33px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--purple); background: #fff; font-size: .74rem; font-weight: 800; }
.table-empty { padding: 40px 20px; color: var(--muted); text-align: center; }
.status-active { color: #087663; background: var(--aqua-soft); }
.status-blocked { color: #9a5b00; background: var(--warning-soft); }
.status-inactive { color: #7a4250; background: #f8e4e9; }
.role-chip { display: inline-flex; padding: 5px 9px; border-radius: 999px; color: #5747d7; background: var(--purple-soft); font-size: .7rem; font-weight: 800; }

.entity-dialog, .credential-dialog { width: min(620px, calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 0; border: 0; border-radius: 20px; background: transparent; box-shadow: var(--shadow); }
.entity-dialog::backdrop, .credential-dialog::backdrop { background: rgba(9, 12, 28, .58); backdrop-filter: blur(3px); }
.dialog-shell { margin: 0; padding: 0; border-radius: 20px; background: #fff; overflow: hidden; }
.dialog-shell > header { display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 24px 17px; border-bottom: 1px solid var(--line); }
.dialog-shell > header h2 { margin: 0; font-size: 1.35rem; }
.dialog-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; padding: 22px 24px 10px; }
.dialog-field { display: grid; gap: 7px; }
.dialog-field.full { grid-column: 1 / -1; }
.dialog-field label { font-size: .78rem; font-weight: 750; }
.dialog-field small { color: var(--muted); font-size: .68rem; }
.dialog-shell > .form-message { padding: 4px 24px; }
.dialog-shell > footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 22px; }
.credential-shell { padding-bottom: 2px; }
.credential-shell > p { padding: 0 24px; color: var(--muted); line-height: 1.55; }
.temporary-password { display: flex; align-items: center; gap: 10px; margin: 18px 24px; padding: 13px; border: 1px dashed #bcb3f8; border-radius: 12px; background: var(--purple-soft); }
.temporary-password code { flex: 1; font-size: 1rem; font-weight: 800; word-break: break-all; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.settings-card { display: grid; grid-template-columns: auto 1fr; gap: 17px; min-height: 210px; padding: 23px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: 0 9px 30px rgba(17, 21, 43, .045); }
.settings-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; color: var(--purple); background: var(--purple-soft); font-size: 1.15rem; font-weight: 900; }
.settings-card h2 { margin: 12px 0 7px; font-size: 1.15rem; }
.settings-card p { margin: 0 0 10px; color: var(--muted); font-size: .86rem; line-height: 1.6; }
.settings-card small { color: #8b92a5; line-height: 1.45; }
.settings-links { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.settings-links a { padding: 8px 11px; border-radius: 9px; color: var(--purple); background: var(--purple-soft); font-size: .76rem; font-weight: 800; text-decoration: none; }
.deletion-card { grid-column: 1 / -1; }
.deletion-card label { display: block; margin: 14px 0 6px; font-size: .78rem; font-weight: 750; }
.deletion-card textarea, .deletion-card select { width: 100%; padding: 11px 12px; border: 1px solid #d7dbe6; border-radius: 10px; outline: none; color: var(--ink); background: #fff; font: inherit; }
.deletion-card textarea { min-height: 88px; resize: vertical; }
.deletion-card textarea:focus, .deletion-card select:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(108, 92, 231, .1); }
.deletion-card button { margin-top: 10px; }
.deletion-card #deletionMessage { display: block; margin-top: 8px; }
.legal-acceptance { display: grid; gap: 12px; padding: 6px 24px 12px; }
.legal-acceptance label { display: flex; align-items: flex-start; gap: 9px; color: #555d72; font-size: .86rem; line-height: 1.5; }
.legal-acceptance input { margin-top: 4px; accent-color: var(--purple); }
.legal-acceptance a { color: var(--purple); font-weight: 750; }

.brand-heading { align-items: center; }
.brand-company-picker { display: grid; grid-template-columns: auto minmax(220px, 380px); align-items: center; gap: 14px; margin-bottom: 18px; padding: 16px 18px; border: 1px solid #d7d1ff; border-radius: 14px; background: var(--purple-soft); }
.brand-company-picker > span { color: #4d456f; font-size: .82rem; font-weight: 800; }
.brand-company-picker select, .brand-fields input, .brand-fields textarea, .asset-upload select, .asset-upload input { width: 100%; border: 1px solid #d7dbe6; border-radius: 10px; outline: none; color: var(--ink); background: #fff; font: inherit; }
.brand-company-picker select, .brand-fields input, .asset-upload select, .asset-upload input[type="file"] { min-height: 44px; padding: 0 12px; }
.brand-company-picker select:focus, .brand-fields input:focus, .brand-fields textarea:focus, .asset-upload select:focus, .asset-upload input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(108, 92, 231, .1); }
.brand-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 20px 22px; border-radius: 17px; color: #fff; background: linear-gradient(135deg, #171b38, var(--navy)); box-shadow: 0 15px 35px rgba(17, 21, 43, .14); }
.brand-summary .eyebrow { color: var(--aqua); }
.brand-summary strong, .brand-summary small { display: block; }
.brand-summary strong { font-size: 1.25rem; }
.brand-summary small { margin-top: 5px; color: #aeb5cc; }
.brand-palette-preview { display: flex; min-width: 210px; height: 54px; overflow: hidden; border: 3px solid rgba(255,255,255,.12); border-radius: 15px; }
.brand-palette-preview span { flex: 1; background: var(--purple); }
.brand-palette-preview span:nth-child(2) { background: var(--aqua); }
.brand-palette-preview span:nth-child(3) { background: var(--pink); }
.brand-palette-preview span:nth-child(4) { background: var(--navy); }
.brand-form { display: grid; gap: 18px; }
.brand-card { padding: 24px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: 0 9px 30px rgba(17, 21, 43, .045); }
.brand-card > header { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 20px; }
.brand-card h2 { margin: 0; font-size: 1.18rem; }
.brand-card header p { margin: 5px 0 0; color: var(--muted); font-size: .84rem; }
.brand-step { display: grid; flex: 0 0 38px; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: var(--purple); background: var(--purple-soft); font-size: .75rem; font-weight: 900; }
.brand-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.brand-fields label, .color-grid label, .asset-upload label { display: grid; gap: 7px; }
.brand-fields label > span, .color-grid label > span, .asset-upload label > span { color: #4e5569; font-size: .78rem; font-weight: 800; }
.brand-fields label.full { grid-column: 1 / -1; }
.brand-fields textarea { min-height: 96px; padding: 11px 12px; resize: vertical; }
.font-fields { margin-top: 18px; }
.color-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.color-grid label { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfe; }
.color-grid input[type="color"] { width: 100%; height: 52px; padding: 3px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; }
.color-grid code { color: var(--muted); font-size: .72rem; text-align: center; }
.asset-card { margin-top: 18px; }
.asset-upload { display: grid; grid-template-columns: minmax(190px, .65fr) minmax(260px, 1.35fr) auto; align-items: end; gap: 13px; padding: 16px; border-radius: 14px; background: #f7f8fc; }
.asset-upload input[type="file"] { padding: 8px; }
.file-picker small { color: var(--muted); font-size: .68rem; }
.asset-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 13px; margin-top: 18px; }
.asset-item { position: relative; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.asset-preview { display: grid; place-items: center; height: 110px; margin-bottom: 10px; overflow: hidden; border-radius: 9px; background: linear-gradient(135deg, #f1f2f8, #fafaff); }
.asset-preview img { width: 100%; height: 100%; object-fit: contain; }
.asset-preview span { color: var(--purple); font-size: 1.7rem; font-weight: 900; }
.asset-item strong, .asset-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-item strong { font-size: .76rem; }
.asset-item small { margin-top: 4px; color: var(--muted); font-size: .67rem; }
.asset-item footer { display: flex; justify-content: space-between; gap: 7px; margin-top: 10px; }
.asset-link, .asset-delete { padding: 6px 8px; border: 0; border-radius: 7px; color: var(--purple); background: var(--purple-soft); font-size: .68rem; font-weight: 800; text-decoration: none; }
.asset-delete { color: #a83b54; background: #f9e7ec; }
.brand-empty { padding: 34px 18px; border: 1px dashed #cdd1df; border-radius: 15px; color: var(--muted); background: #fff; text-align: center; }
.compact-empty { margin-top: 17px; padding: 22px; }
.brand-message { margin: 14px 2px 0; }
.brand-readonly #saveBrandKit, .brand-readonly .asset-upload, .brand-readonly .asset-delete { display: none; }
.brand-readonly .brand-fields input, .brand-readonly .brand-fields textarea, .brand-readonly .color-grid input { pointer-events: none; opacity: .75; }

.legal-body { min-height: 100vh; padding: 34px 20px 90px; background: var(--canvas); }
.legal-shell { width: min(860px, 100%); margin: 0 auto; }
.legal-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.legal-header a { color: var(--purple); font-weight: 800; text-decoration: none; }
.legal-document { padding: clamp(24px, 5vw, 52px); border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 14px 42px rgba(17, 21, 43, .07); }
.legal-document h1 { margin: 0 0 8px; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.05em; }
.legal-document .legal-meta { margin: 0 0 30px; color: var(--muted); }
.legal-document h2 { margin: 30px 0 9px; font-size: 1.12rem; }
.legal-document p, .legal-document li { color: #555d72; line-height: 1.72; }
.legal-document ul { padding-left: 22px; }
.legal-footer { position: fixed; right: 0; bottom: 0; left: 0; z-index: 30; display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 54px; padding: 8px 16px; border-top: 1px solid var(--line); color: #697087; background: #fff; box-shadow: 0 -8px 26px rgba(17, 21, 43, .06); font-size: .74rem; }
.simple-auth .auth-footer { width: 100%; }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .color-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-upload { grid-template-columns: 1fr 1fr; }
  .asset-upload button { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-card-wrap { min-height: 100vh; }
  .mobile-brand { display: flex; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: min(290px, 86vw); transition: transform .22s; }
  .menu-open .sidebar { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 15; display: block; background: rgba(10, 13, 29, .48); opacity: 0; pointer-events: none; transition: opacity .22s; }
  .menu-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
  .menu-button, .mobile-only { display: block; }
  .topbar { min-height: 68px; }
  .app-footer { left: 0; }
  .auth-footer { width: 100%; }
}

@media (max-width: 620px) {
  .auth-card-wrap { padding: 18px; }
  .auth-card { padding: 28px 22px; border-radius: 20px; }
  .topbar { gap: 10px; padding: 10px 14px; }
  .company-context { display: none; }
  .user-chip > span:last-child { display: none; }
  .content { padding: 24px 16px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading .primary-button { width: 100%; }
  .notice-card { grid-template-columns: auto 1fr; }
  .notice-card .status-chip { grid-column: 2; }
  .metric-grid { gap: 11px; }
  .metric-card { min-height: 126px; padding: 16px; }
  .metric-card strong { font-size: 1.8rem; }
  .metric-card small { font-size: .69rem; }
  .panel { padding: 20px 17px; }
  .principle-flow { align-items: stretch; flex-direction: column; }
  .principle-flow b { transform: rotate(90deg); align-self: center; }
  .app-footer { padding-inline: 16px; }
  .settings-grid { grid-template-columns: 1fr; }
  .deletion-card { grid-column: auto; }
  .legal-header { align-items: flex-start; flex-direction: column; }
  .brand-heading { align-items: stretch; }
  .brand-company-picker { grid-template-columns: 1fr; }
  .brand-summary { align-items: flex-start; flex-direction: column; }
  .brand-palette-preview { width: 100%; min-width: 0; }
  .brand-card { padding: 19px 16px; }
  .brand-fields, .color-grid, .asset-upload { grid-template-columns: 1fr; }
  .brand-fields label.full, .asset-upload button { grid-column: auto; }
  .management-toolbar { align-items: stretch; flex-direction: column; }
  .search-field, .filter-field { width: 100%; }
  .record-count { margin-left: 0; padding: 0; }
  .dialog-fields { grid-template-columns: 1fr; padding-inline: 18px; }
  .dialog-field.full { grid-column: auto; }
  .dialog-shell > header, .dialog-shell > footer { padding-inline: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
