:root {
    --dl-primary: #0E5A2F;
    --dl-forest: #084028;
    --dl-gold: #D4A017;
    --dl-soft-gold: #F2C14E;
    --dl-charcoal: #1C1C1C;
    --dl-sage: #A9C5A2;
    --dl-soft-sage: #DCEAD9;
    --dl-ivory: #FAF7F2;
    --dl-sand: #EFE6D6;
    --dl-stone: #C8C2B6;
    --dl-wood: #7A5230;
    --dl-success: #28A745;
    --dl-warning: #F0B429;
    --dl-error: #D94135;
    --dl-info: #2D7DD2;
    --dl-white: #FFFFFF;
    --dl-muted: #66736C;
    --dl-line: #DFE7E1;
    --dl-surface: #F4F7F4;
    --dl-shadow: 0 20px 60px rgba(8, 64, 40, .10);
    --dl-shadow-soft: 0 8px 30px rgba(28, 28, 28, .06);
    --f7-theme-color: var(--dl-primary);
    --f7-font-family: "Inter", "Segoe UI", Arial, sans-serif;
    color-scheme: light;
}

@font-face {
    font-family: "Framework7 Icons";
    font-style: normal;
    font-weight: 400;
    font-display: block;
    src: url("/assets/fonts/framework7-icons.woff2?v=5.0.5") format("woff2");
}

.f7-icons, .framework7-icons {
    display: inline-block;
    font-family: "Framework7 Icons";
    font-size: 28px;
    font-style: normal;
    font-weight: 400;
    font-feature-settings: "liga";
    letter-spacing: normal;
    line-height: 1;
    text-align: center;
    text-rendering: optimizeLegibility;
    text-transform: none;
    white-space: nowrap;
    word-wrap: normal;
    -webkit-font-feature-settings: "liga";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; background: var(--dl-ivory); }
body { margin: 0; color: var(--dl-charcoal); font-family: var(--f7-font-family); background: var(--dl-white); -webkit-font-smoothing: antialiased; }
body > #app.framework7-root { height: 100vh; overflow-x: hidden !important; overflow-y: auto !important; -webkit-overflow-scrolling: touch; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.muted { color: var(--dl-muted); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--dl-primary); font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow.light { color: var(--dl-soft-gold); }
.status-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--dl-gold); box-shadow: 0 0 0 5px rgba(212,160,23,.14); }
.button { --f7-button-height: 46px; --f7-button-border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 20px; font-weight: 750; letter-spacing: .01em; text-transform: none; }
.button.button-large { --f7-button-height: 54px; padding: 0 26px; }
.button.button-fill { background: var(--dl-primary); color: white; box-shadow: 0 10px 24px rgba(14,90,47,.18); }
.button.button-fill:hover { background: var(--dl-forest); }
.button.button-outline { border: 1px solid rgba(14,90,47,.28); color: var(--dl-primary); background: rgba(255,255,255,.65); }
.button[disabled] { opacity: .5; pointer-events: none; }
.dl-toast { position: fixed; z-index: 9999; right: 20px; bottom: 20px; max-width: min(360px, calc(100% - 40px)); padding: 13px 17px; border-radius: 12px; color: white; background: var(--dl-forest); box-shadow: var(--dl-shadow); opacity: 0; transform: translateY(12px); transition: opacity .2s, transform .2s; font-size: 12px; }
.dl-toast.show { opacity: 1; transform: translateY(0); }
.icon-button { width: 42px; height: 42px; padding: 0; border: 1px solid var(--dl-line); background: var(--dl-white); color: var(--dl-forest); border-radius: 12px; display: inline-grid; place-items: center; cursor: pointer; }
.icon-button:hover { border-color: var(--dl-sage); background: var(--dl-soft-sage); }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.brand-emblem { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; position: relative; overflow: hidden; border-radius: 16px 16px 16px 5px; color: white; background: linear-gradient(145deg, var(--dl-primary), var(--dl-forest)); box-shadow: 0 8px 20px rgba(8,64,40,.2); }
.brand-emblem::after { content: ""; position: absolute; width: 28px; height: 28px; right: -10px; bottom: -9px; border: 2px solid var(--dl-gold); border-radius: 50%; }
.brand-emblem span { position: relative; z-index: 1; font-family: Georgia, serif; font-size: 17px; font-weight: 800; letter-spacing: -.04em; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.05; }
.brand-copy strong { color: var(--dl-forest); font-family: Georgia, "Times New Roman", serif; font-size: 20px; letter-spacing: .03em; }
.brand-copy small { margin-top: 5px; color: var(--dl-gold); font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.brand-logo-image { max-width: 190px; max-height: 54px; width: auto; height: auto; object-fit: contain; }
.brand-compact .brand-emblem { width: 38px; height: 38px; border-radius: 13px 13px 13px 4px; }
.brand-compact .brand-copy strong { font-size: 17px; }

/* Public experience */
.public-page { background: var(--dl-white); }
.public-header { height: 86px; position: sticky; z-index: 20; top: 0; display: flex; align-items: center; border-bottom: 1px solid rgba(223,231,225,.8); background: rgba(255,255,255,.88); backdrop-filter: blur(18px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.public-header nav { display: flex; align-items: center; gap: 30px; color: #3E4D45; font-size: 14px; font-weight: 650; }
.public-header nav > a:not(.button):hover { color: var(--dl-primary); }
.hero { min-height: 700px; display: flex; align-items: center; position: relative; overflow: hidden; background: radial-gradient(circle at 90% 15%, rgba(212,160,23,.12), transparent 28%), linear-gradient(160deg, var(--dl-ivory) 0%, #fff 50%, #F0F6F1 100%); }
.hero::before { content: ""; position: absolute; left: -10%; bottom: -52%; width: 620px; height: 620px; border: 1px solid rgba(14,90,47,.08); border-radius: 50%; }
.hero-grid { padding: 82px 0 92px; display: grid; grid-template-columns: 1.04fr .96fr; gap: 74px; align-items: center; }
.hero-copy h1 { max-width: 720px; margin: 20px 0 22px; font-family: Georgia, "Times New Roman", serif; color: var(--dl-forest); font-size: clamp(50px, 6vw, 79px); font-weight: 500; line-height: .99; letter-spacing: -.045em; }
.hero-lead { max-width: 620px; margin: 0; color: #56645D; font-size: 18px; line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 28px; color: #5D6B64; font-size: 12px; font-weight: 700; }
.trust-row span { display: flex; align-items: center; gap: 6px; }
.trust-row .icon { color: var(--dl-primary); font-size: 17px; }
.hero-visual { min-height: 500px; display: grid; place-items: center; position: relative; }
.visual-orbit { position: absolute; border-radius: 50%; border: 1px solid rgba(14,90,47,.16); }
.orbit-one { width: 490px; height: 490px; }
.orbit-two { width: 380px; height: 380px; border-color: rgba(212,160,23,.22); }
.hero-console { width: min(430px, 92%); position: relative; z-index: 2; overflow: hidden; padding: 22px; border: 1px solid rgba(255,255,255,.9); border-radius: 30px; color: white; background: linear-gradient(150deg, #0E5A2F 0%, #084028 74%); box-shadow: 0 32px 80px rgba(8,64,40,.28); transform: rotate(1.5deg); }
.hero-console::after { content: ""; position: absolute; right: -90px; top: -90px; width: 230px; height: 230px; border-radius: 50%; background: rgba(212,160,23,.16); }
.console-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.12); }
.console-head span { font-family: Georgia, serif; font-weight: 800; letter-spacing: .06em; }
.console-head small { color: var(--dl-sage); }
.console-welcome { padding: 30px 4px 26px; }
.console-welcome span { color: var(--dl-soft-gold); font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.console-welcome strong { display: block; margin-top: 10px; font-family: Georgia, serif; font-size: 34px; line-height: 1.15; font-weight: 500; }
.console-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.console-grid > div { min-height: 92px; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; padding: 15px; border: 1px solid rgba(255,255,255,.11); border-radius: 16px; background: rgba(255,255,255,.07); }
.console-grid .icon { color: var(--dl-soft-gold); font-size: 22px; }
.console-grid span { font-size: 11px; font-weight: 700; }
.section { padding: 106px 0; }
.section-ivory { background: var(--dl-ivory); }
.section-heading { max-width: 740px; margin-bottom: 45px; }
.section-heading h2, .foundation-grid h2 { margin: 14px 0; color: var(--dl-forest); font-family: Georgia, serif; font-size: clamp(35px, 4vw, 52px); font-weight: 500; line-height: 1.12; letter-spacing: -.03em; }
.section-heading p, .section-copy { color: var(--dl-muted); font-size: 17px; line-height: 1.7; }
.role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.role-card { min-height: 240px; padding: 30px; border: 1px solid #E3E8E3; border-radius: 22px; background: white; box-shadow: var(--dl-shadow-soft); transition: transform .25s, box-shadow .25s; }
.role-card:hover { transform: translateY(-4px); box-shadow: var(--dl-shadow); }
.role-number { color: var(--dl-gold); font-size: 12px; font-weight: 850; letter-spacing: .15em; }
.role-card h3 { margin: 48px 0 12px; color: var(--dl-forest); font-family: Georgia, serif; font-size: 25px; font-weight: 600; }
.role-card p { margin: 0; color: var(--dl-muted); line-height: 1.65; }
.foundation-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 80px; align-items: start; }
.foundation-list { border-top: 1px solid var(--dl-line); }
.foundation-item { display: grid; grid-template-columns: 52px 1fr; gap: 18px; padding: 25px 0; border-bottom: 1px solid var(--dl-line); }
.foundation-item > .icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: var(--dl-primary); background: var(--dl-soft-sage); }
.foundation-item h3 { margin: 0 0 7px; color: var(--dl-forest); font-size: 17px; }
.foundation-item p { margin: 0; color: var(--dl-muted); line-height: 1.6; }
.public-footer { padding: 35px 0; border-top: 1px solid var(--dl-line); background: var(--dl-ivory); }
.public-footer .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.public-footer p { color: var(--dl-muted); font-size: 12px; }

/* Authentication */
.auth-page { min-height: 100vh; background: var(--dl-ivory); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, .95fr) 1.05fr; }
.auth-story { min-height: 100vh; position: relative; overflow: hidden; padding: 42px clamp(40px, 6vw, 90px); color: white; background: linear-gradient(145deg, #0E5A2F, #063521); }
.auth-story::after { content: ""; position: absolute; left: -170px; bottom: -250px; width: 650px; height: 650px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; box-shadow: 0 0 0 90px rgba(255,255,255,.025), 0 0 0 180px rgba(255,255,255,.02); }
.auth-story .brand-copy strong { color: white; }
.auth-back { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 8px; color: rgba(255,255,255,.75); font-size: 13px; }
.auth-back .icon { font-size: 17px; }
.auth-story-content { max-width: 610px; position: relative; z-index: 2; margin-top: clamp(100px, 17vh, 185px); }
.auth-story-content > .brand { display: flex; width: max-content; margin-bottom: 58px; }
.auth-story h1 { margin: 17px 0 20px; font-family: Georgia, serif; font-size: clamp(42px, 5vw, 66px); line-height: 1.04; font-weight: 500; letter-spacing: -.04em; }
.auth-story-content > p { max-width: 520px; color: rgba(255,255,255,.7); font-size: 17px; line-height: 1.7; }
.auth-points { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 35px; color: rgba(255,255,255,.8); font-size: 12px; font-weight: 700; }
.auth-points span { display: flex; align-items: center; gap: 7px; }
.auth-points .icon { color: var(--dl-soft-gold); }
.auth-glow { position: absolute; right: -90px; top: 12%; width: 250px; height: 250px; border-radius: 50%; filter: blur(10px); background: rgba(212,160,23,.12); }
.auth-form-wrap { display: grid; place-items: center; padding: 50px; background: var(--dl-ivory); }
.auth-form-card { width: min(480px, 100%); }
.mobile-auth-brand { display: none; }
.auth-form-card h2 { margin: 12px 0 10px; color: var(--dl-forest); font-family: Georgia, serif; font-size: 38px; font-weight: 550; letter-spacing: -.025em; }
.auth-form-card > p { margin: 0 0 28px; line-height: 1.6; }
.auth-help { display: flex; align-items: flex-start; gap: 10px; margin-top: 22px; padding: 15px; border-radius: 12px; color: #617068; background: rgba(169,197,162,.2); font-size: 12px; line-height: 1.5; }
.auth-help .icon { flex: 0 0 auto; color: var(--dl-primary); font-size: 18px; }

/* Forms */
.stack-form { display: flex; flex-direction: column; gap: 18px; }
.stack-form.compact { gap: 15px; }
.field { display: flex; flex-direction: column; gap: 8px; color: #35433B; font-size: 13px; font-weight: 700; }
.field input, .field textarea, .field select { width: 100%; min-height: 48px; padding: 12px 14px; outline: none; border: 1px solid #CDD8D0; border-radius: 12px; color: var(--dl-charcoal); background: white; transition: border-color .2s, box-shadow .2s; }
.field textarea { resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--dl-primary); box-shadow: 0 0 0 4px rgba(14,90,47,.10); }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--dl-error); }
.input-wrap { display: flex; align-items: center; position: relative; }
.input-wrap > .icon { position: absolute; z-index: 1; left: 14px; color: #829087; font-size: 18px; }
.input-wrap input { padding-left: 43px; padding-right: 45px; }
.password-toggle { position: absolute; right: 8px; width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: #718078; cursor: pointer; }
.password-toggle .icon { font-size: 18px; }
.field-error { min-height: 0; color: var(--dl-error); font-size: 11px; font-weight: 650; }
.field-error:empty { display: none; }
.field-hint { color: #7B8781; font-size: 11px; font-weight: 500; }
.form-alert { padding: 12px 14px; border-radius: 10px; color: var(--dl-primary); background: var(--dl-soft-sage); font-size: 13px; line-height: 1.45; }
.form-alert.error { color: #9C2C23; background: #FDEBE8; }
.form-alert[hidden] { display: none; }
.submit-button.is-loading { pointer-events: none; opacity: .72; }
.submit-button.is-loading::before { content: ""; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.45); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
.field-grid { display: grid; gap: 15px; }
.field-grid.two { grid-template-columns: repeat(2, 1fr); }
.field-grid.three { grid-template-columns: repeat(3, 1fr); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Dashboard layout */
.dashboard-page { min-height: 100vh; background: var(--dl-surface); }
.app-layout { min-height: 100vh; }
.app-sidebar { width: 270px; min-height: 100vh; position: fixed; z-index: 40; left: 0; top: 0; display: flex; flex-direction: column; padding: 25px 18px 18px; color: #DCE7E0; background: linear-gradient(180deg, #0A482D, #063923 72%, #052F1D); box-shadow: 8px 0 30px rgba(8,64,40,.10); }
.sidebar-brand { padding: 0 8px 22px; border-bottom: 1px solid rgba(255,255,255,.09); }
.app-sidebar .brand-copy strong { color: white; }
.app-sidebar .brand-emblem { background: rgba(255,255,255,.12); box-shadow: none; }
.role-pill { display: flex; align-items: center; gap: 10px; margin: 20px 8px 13px; color: var(--dl-soft-gold); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; scrollbar-width: thin; }
.nav-item { min-height: 46px; display: grid; grid-template-columns: 27px 1fr auto; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 11px; color: rgba(255,255,255,.73); font-size: 13px; font-weight: 650; transition: background .2s, color .2s; }
.nav-item .icon { font-size: 19px; }
.nav-item small { padding: 3px 6px; border-radius: 6px; color: var(--dl-sage); background: rgba(255,255,255,.07); font-size: 8px; letter-spacing: .07em; text-transform: uppercase; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,.10); }
.nav-item.active { box-shadow: inset 3px 0 var(--dl-gold); }
.nav-item.is-disabled { opacity: .72; cursor: default; }
.sidebar-footer { margin-top: auto; display: flex; justify-content: space-between; padding: 16px 8px 0; border-top: 1px solid rgba(255,255,255,.09); color: rgba(255,255,255,.43); font-size: 9px; }
.app-main { min-height: 100vh; margin-left: 270px; }
.app-topbar { height: 76px; position: sticky; z-index: 30; top: 0; display: flex; align-items: center; gap: 14px; padding: 0 30px; border-bottom: 1px solid var(--dl-line); background: rgba(255,255,255,.9); backdrop-filter: blur(15px); }
.sidebar-toggle { display: none; }
.topbar-title { display: flex; flex-direction: column; }
.topbar-title span { color: var(--dl-muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .1em; }
.topbar-title strong { margin-top: 2px; color: var(--dl-forest); font-size: 16px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border: 1px solid var(--dl-line); border-radius: 14px; background: white; }
.user-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: white; background: linear-gradient(145deg, var(--dl-primary), var(--dl-forest)); font-weight: 800; }
.user-details { display: flex; flex-direction: column; min-width: 110px; }
.user-details strong { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.user-details small { margin-top: 2px; color: var(--dl-muted); font-size: 9px; }
.app-content { width: min(1400px, 100%); margin: 0 auto; padding: 30px; }
.welcome-panel { min-height: 175px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; position: relative; overflow: hidden; padding: 34px; border-radius: 24px; color: white; background: linear-gradient(120deg, #0E5A2F, #084028 72%); box-shadow: var(--dl-shadow); }
.welcome-panel::after { content: ""; position: absolute; right: -80px; top: -120px; width: 340px; height: 340px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 0 0 60px rgba(255,255,255,.025), 0 0 0 120px rgba(255,255,255,.02); }
.welcome-panel > div { position: relative; z-index: 1; }
.welcome-panel .eyebrow { color: var(--dl-soft-gold); }
.welcome-panel h1 { margin: 8px 0 5px; font-family: Georgia, serif; font-size: 36px; font-weight: 500; }
.welcome-panel p { max-width: 720px; margin: 0; color: rgba(255,255,255,.7); line-height: 1.55; }
.release-chip { min-width: 145px; padding: 15px 18px; border: 1px solid rgba(255,255,255,.13); border-radius: 16px; background: rgba(255,255,255,.08); }
.release-chip span { display: block; color: rgba(255,255,255,.6); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.release-chip strong { display: block; margin-top: 5px; color: var(--dl-soft-gold); font-size: 19px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.metric-card { min-height: 135px; display: flex; align-items: center; gap: 16px; padding: 20px; border: 1px solid var(--dl-line); border-radius: 18px; background: white; box-shadow: var(--dl-shadow-soft); }
.metric-icon { width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 15px; color: var(--dl-primary); background: var(--dl-soft-sage); }
.metric-icon .icon { font-size: 21px; }
.metric-card > div { display: flex; flex-direction: column; min-width: 0; }
.metric-card small { color: var(--dl-muted); font-size: 10px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.metric-card strong { margin: 4px 0 2px; color: var(--dl-forest); font-size: 26px; }
.metric-card span:not(.metric-icon) { overflow: hidden; color: #829087; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; margin-top: 18px; }
.dl-panel { padding: 24px; border: 1px solid var(--dl-line); border-radius: 20px; background: white; box-shadow: var(--dl-shadow-soft); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.panel-heading h2 { margin: 6px 0 0; color: var(--dl-forest); font-family: Georgia, serif; font-size: 24px; font-weight: 550; }
.panel-heading p { margin: 7px 0 0; color: var(--dl-muted); font-size: 12px; line-height: 1.5; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-height: 24px; padding: 4px 9px; border-radius: 8px; color: var(--dl-primary); background: var(--dl-soft-sage); font-size: 9px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.badge.success { color: #167335; background: #E6F6EA; }
.badge.warning { color: #8B6206; background: #FFF3D2; }
.milestone-list { display: flex; flex-direction: column; }
.milestone { min-height: 78px; display: grid; grid-template-columns: 34px 1fr auto; gap: 13px; align-items: start; padding: 14px 0; border-top: 1px solid var(--dl-line); }
.milestone-check { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--dl-primary); }
.milestone-check .icon { font-size: 15px; }
.milestone strong { color: #314139; font-size: 13px; }
.milestone p { margin: 5px 0 0; color: var(--dl-muted); font-size: 11px; line-height: 1.5; }
.milestone > small { color: var(--dl-stone); font-size: 10px; font-weight: 800; }
.module-list { display: flex; flex-direction: column; gap: 5px; }
.module-row { display: grid; grid-template-columns: 35px 1fr 20px; align-items: center; gap: 10px; padding: 10px; border-radius: 11px; }
.module-row:hover { background: var(--dl-surface); }
.module-row > .icon:first-child { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--dl-primary); background: var(--dl-soft-sage); font-size: 16px; }
.module-row span { display: flex; flex-direction: column; }
.module-row strong { color: #35443C; font-size: 12px; }
.module-row small { margin-top: 2px; color: #8A968F; font-size: 9px; }
.module-row .arrow { color: #A6B1AA; font-size: 14px; }
.module-row.is-disabled { opacity: .7; cursor: default; }
.info-banner { display: flex; align-items: center; gap: 15px; margin-top: 18px; padding: 18px 22px; border: 1px solid #D7E5D8; border-radius: 16px; background: #EEF6EF; }
.info-banner > .icon { color: var(--dl-primary); font-size: 25px; }
.info-banner strong { color: var(--dl-forest); font-size: 13px; }
.info-banner p { margin: 4px 0 0; color: var(--dl-muted); font-size: 11px; }
.mobile-nav { display: none; }
.sidebar-backdrop { display: none; }

/* Admin pages */
.page-heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 4px 0 24px; }
.page-heading-row h1 { margin: 7px 0 6px; color: var(--dl-forest); font-family: Georgia, serif; font-size: 38px; font-weight: 550; letter-spacing: -.025em; }
.page-heading-row p { margin: 0; color: var(--dl-muted); }
.settings-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 18px; }
.form-panel .submit-button { align-self: flex-start; }
.palette-stack { display: flex; flex-direction: column; gap: 12px; }
.palette-row { display: flex; align-items: center; gap: 12px; }
.palette-row > span { width: 42px; height: 42px; flex: 0 0 auto; border: 1px solid rgba(0,0,0,.06); border-radius: 12px; }
.palette-row > div { display: flex; flex-direction: column; }
.palette-row strong { color: #35443C; font-size: 12px; }
.palette-row small { margin-top: 3px; color: var(--dl-muted); font-size: 9px; line-height: 1.4; }
.panel-note { display: flex; align-items: flex-start; gap: 8px; margin: 20px 0 0; padding-top: 17px; border-top: 1px solid var(--dl-line); color: var(--dl-muted); font-size: 10px; line-height: 1.5; }
.panel-note .icon { flex: 0 0 auto; color: var(--dl-primary); font-size: 16px; }
.maintenance-panel { margin-top: 18px; }
.rule-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.rule-summary { padding: 17px; border: 1px solid var(--dl-line); border-radius: 14px; background: var(--dl-surface); }
.rule-summary > span { display: block; color: var(--dl-muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.rule-summary strong { display: block; margin: 6px 0 4px; color: var(--dl-forest); font-size: 17px; }
.rule-summary small { color: #75827B; font-size: 10px; line-height: 1.4; }
.maintenance-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px; padding-top: 22px; border-top: 1px solid var(--dl-line); }
.maintenance-layout h3 { margin: 0 0 17px; color: #35443C; font-size: 14px; }
.rules-history { max-height: 385px; overflow-y: auto; }
.history-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--dl-line); }
.history-row > div { display: flex; flex-direction: column; }
.history-row strong { color: #35443C; font-size: 11px; }
.history-row span:not(.badge), .history-row small { margin-top: 4px; color: var(--dl-muted); font-size: 9px; }
.history-row > div:last-child { align-items: flex-end; }
.rule-guardrail { display: flex; align-items: flex-start; gap: 10px; margin-top: 22px; padding: 14px 16px; border-radius: 12px; background: #FFF7E2; color: #72530B; }
.rule-guardrail .icon { flex: 0 0 auto; font-size: 18px; }
.rule-guardrail p { margin: 0; font-size: 10px; line-height: 1.55; }
.system-hero { min-height: 116px; display: flex; align-items: center; justify-content: space-between; padding: 24px; border-radius: 20px; color: white; background: linear-gradient(120deg, var(--dl-primary), var(--dl-forest)); box-shadow: var(--dl-shadow); }
.system-hero > div { display: flex; align-items: center; gap: 15px; }
.system-mark { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.14); border-radius: 17px; color: var(--dl-soft-gold); background: rgba(255,255,255,.08); }
.system-mark .icon { font-size: 25px; }
.system-hero small, .system-hero span:not(.system-mark):not(.badge) { display: block; color: rgba(255,255,255,.62); font-size: 10px; }
.system-hero strong { display: block; margin: 4px 0; font-family: Georgia, serif; font-size: 25px; font-weight: 550; }
.status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.status-card { display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--dl-line); border-radius: 17px; background: white; box-shadow: var(--dl-shadow-soft); }
.status-icon { width: 38px; height: 38px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 11px; color: var(--dl-primary); background: var(--dl-soft-sage); }
.status-card small { color: var(--dl-muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.status-card strong { margin: 5px 0 4px; color: var(--dl-forest); font-size: 18px; }
.status-card > span:last-child { color: #839087; font-size: 9px; }
.system-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.check-list { display: flex; flex-direction: column; }
.check-list > div { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-top: 1px solid var(--dl-line); }
.check-list span { display: flex; align-items: center; gap: 9px; color: #45534C; font-size: 12px; }
.check-list .icon { color: var(--dl-primary); font-size: 17px; }
.check-list strong { color: var(--dl-muted); font-size: 10px; }
.migration-list { margin: 0 0 18px; padding: 0; list-style: none; }
.migration-list li { display: flex; align-items: center; gap: 9px; padding: 11px 0; border-top: 1px solid var(--dl-line); color: #45534C; font-size: 11px; }
.migration-list .icon { color: var(--dl-gold); font-size: 17px; }
.empty-state { display: grid; place-items: center; min-height: 150px; color: #87938D; text-align: center; }
.empty-state.compact { min-height: 90px; }
.empty-state .icon { color: var(--dl-sage); font-size: 28px; }
.empty-state p { margin: 8px 0; font-size: 11px; }

/* Organization and account management */
.management-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.management-stats article { min-height: 96px; display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--dl-line); border-radius: 17px; background: white; box-shadow: var(--dl-shadow-soft); }
.management-stats .status-icon { margin: 0; flex: 0 0 auto; }
.management-stats article > div { display: flex; flex-direction: column; }
.management-stats small { color: var(--dl-muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.management-stats strong { margin-top: 4px; color: var(--dl-forest); font-family: Georgia, serif; font-size: 26px; }
.management-layout, .account-editor-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; align-items: start; }
.management-form-panel { min-width: 0; }
.account-editor-grid { grid-template-columns: 1.2fr .8fr; }
.account-side-stack { display: flex; flex-direction: column; gap: 18px; }
.member-fields { display: flex; flex-direction: column; gap: 15px; padding: 16px; border: 1px solid #D8E5DA; border-radius: 14px; background: #F3F8F3; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.check-field { min-height: 48px; display: flex; align-items: center; gap: 9px; padding: 12px 14px; border: 1px solid #CDD8D0; border-radius: 12px; color: #35433B; background: white; font-size: 12px; font-weight: 700; }
.check-field input { width: 17px; height: 17px; accent-color: var(--dl-primary); }
.directory-panel { margin-top: 18px; }
.directory-heading { align-items: flex-end; }
.filter-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.filter-bar input, .filter-bar select { min-height: 42px; padding: 9px 11px; outline: 0; border: 1px solid #CDD8D0; border-radius: 10px; color: var(--dl-charcoal); background: white; font-size: 11px; }
.filter-bar input { width: min(230px, 100%); }
.filter-bar .button { --f7-button-height: 42px; padding: 0 14px; font-size: 11px; }
.directory-section { padding-top: 19px; border-top: 1px solid var(--dl-line); }
.directory-section + .directory-section { margin-top: 24px; }
.directory-section > h3 { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; color: #35443C; font-size: 14px; }
.directory-section > h3 span { min-width: 25px; padding: 4px 7px; border-radius: 8px; color: var(--dl-primary); background: var(--dl-soft-sage); font-size: 9px; text-align: center; }
.directory-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--dl-line); border-radius: 14px; }
.directory-table { width: 100%; min-width: 820px; border-collapse: collapse; background: white; }
.directory-table th { padding: 11px 13px; border-bottom: 1px solid var(--dl-line); color: #718078; background: var(--dl-surface); font-size: 9px; font-weight: 850; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
.directory-table td { padding: 12px 13px; border-bottom: 1px solid #E9EEEA; color: #526159; font-size: 10px; line-height: 1.45; vertical-align: middle; }
.directory-table tbody tr:last-child td { border-bottom: 0; }
.directory-table td > strong, .directory-table td > small { display: block; }
.directory-table td > strong { color: #35443C; font-size: 11px; }
.directory-table td > small { margin-top: 3px; color: #859189; font-size: 9px; }
.record-identity { min-width: 190px; display: flex; align-items: center; gap: 10px; }
.record-identity > span, .record-identity > img { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; color: var(--dl-primary); background: var(--dl-soft-sage); object-fit: cover; font-weight: 850; }
.record-identity .icon { font-size: 17px; }
.record-identity > div { min-width: 0; display: flex; flex-direction: column; }
.record-identity strong { overflow: hidden; color: #35443C; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.record-identity small { margin-top: 3px; color: #859189; font-size: 9px; }
.table-action { min-height: 34px; display: inline-flex; align-items: center; gap: 5px; padding: 6px 9px; border: 1px solid #CEDAD1; border-radius: 9px; color: var(--dl-primary); background: white; cursor: pointer; font-size: 9px; font-weight: 800; }
.table-action:hover { background: var(--dl-soft-sage); }
.table-action .icon { font-size: 14px; }
.scope-copy { display: block; max-width: 240px; line-height: 1.55; }
.governance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; align-items: start; }
.permission-list { display: flex; flex-direction: column; }
.permission-list > div { display: grid; grid-template-columns: 135px 1fr; gap: 14px; padding: 12px 0; border-top: 1px solid var(--dl-line); }
.permission-list strong { color: #35443C; font-size: 11px; }
.permission-list span { color: var(--dl-muted); font-size: 9px; line-height: 1.55; }
.audit-list { max-height: 430px; overflow-y: auto; }
.audit-list > div { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; border-top: 1px solid var(--dl-line); }
.audit-mark { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; color: var(--dl-primary); background: var(--dl-soft-sage); }
.audit-mark .icon { font-size: 15px; }
.audit-list p { display: flex; flex-direction: column; margin: 0; }
.audit-list strong { color: #35443C; font-size: 10px; }
.audit-list small { margin-top: 4px; color: var(--dl-muted); font-size: 9px; }

/* Installer and error states */
.install { min-height: 100vh; display: grid; place-items: center; padding: 34px; background: radial-gradient(circle at 10% 10%, rgba(212,160,23,.15), transparent 28%), var(--dl-ivory); }
.install-shell { width: min(1020px, 100%); display: grid; grid-template-columns: .72fr 1.28fr; overflow: hidden; border: 1px solid var(--dl-line); border-radius: 28px; background: white; box-shadow: var(--dl-shadow); }
.install-aside { position: relative; overflow: hidden; padding: 38px; color: white; background: linear-gradient(145deg, var(--dl-primary), var(--dl-forest)); }
.install-aside .brand-copy strong { color: white; }
.install-aside h1 { margin: 90px 0 15px; font-family: Georgia, serif; font-size: 38px; font-weight: 500; line-height: 1.1; }
.install-aside p { color: rgba(255,255,255,.68); line-height: 1.65; }
.install-aside::after { content: ""; position: absolute; width: 340px; height: 340px; right: -180px; bottom: -150px; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; box-shadow: 0 0 0 60px rgba(255,255,255,.025); }
.install-main { padding: 38px; }
.install-main h2 { margin: 6px 0; color: var(--dl-forest); font-family: Georgia, serif; font-size: 30px; font-weight: 550; }
.install-main > p { margin: 0 0 22px; color: var(--dl-muted); }
.preflight { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px; }
.preflight span { padding: 9px; border-radius: 9px; color: var(--dl-primary); background: var(--dl-soft-sage); font-size: 9px; font-weight: 750; text-align: center; }
.preflight span.fail { color: #9C2C23; background: #FDEBE8; }
.notice { margin-bottom: 17px; padding: 13px 15px; border-radius: 11px; color: var(--dl-primary); background: var(--dl-soft-sage); font-size: 12px; line-height: 1.55; }
.notice.error { color: #9C2C23; background: #FDEBE8; }
.notice.success { color: #146D31; background: #E6F6EA; }
.installer-section { margin: 22px 0 12px; padding-top: 18px; border-top: 1px solid var(--dl-line); color: var(--dl-primary); font-size: 11px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 30px; background: var(--dl-ivory); }
.error-card { width: min(500px, 100%); padding: 48px; border: 1px solid var(--dl-line); border-radius: 24px; background: white; box-shadow: var(--dl-shadow); text-align: center; }
.error-code { color: var(--dl-gold); font-size: 13px; font-weight: 900; letter-spacing: .15em; }
.error-card h1 { margin: 10px 0; color: var(--dl-forest); font-family: Georgia, serif; font-size: 36px; font-weight: 550; }
.error-card p { margin: 0 0 23px; color: var(--dl-muted); line-height: 1.6; }
.error-card pre { overflow: auto; padding: 10px; background: var(--dl-surface); font-size: 10px; text-align: left; }

@media (max-width: 1100px) {
    .hero-grid { gap: 32px; }
    .hero-copy h1 { font-size: 56px; }
    .app-sidebar { width: 240px; }
    .app-main { margin-left: 240px; }
    .metric-grid, .status-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid, .settings-grid, .system-layout, .management-layout, .account-editor-grid, .governance-grid { grid-template-columns: 1fr; }
    .palette-stack { display: grid; grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 821px) and (max-height: 760px) {
    .auth-story-content { margin-top: 64px; }
    .auth-story-content > .brand { margin-bottom: 34px; }
    .auth-story h1 { margin: 14px 0 16px; font-size: 50px; }
    .auth-points { margin-top: 24px; }
}

@media (max-width: 820px) {
    .container { width: min(100% - 28px, 680px); }
    .public-header { height: 72px; }
    .public-header nav > a:not(.button) { display: none; }
    .hero { min-height: auto; }
    .hero-grid { grid-template-columns: 1fr; padding: 65px 0 75px; }
    .hero-copy h1 { font-size: clamp(44px, 12vw, 62px); }
    .hero-visual { min-height: 450px; }
    .role-grid { grid-template-columns: repeat(2, 1fr); }
    .foundation-grid { grid-template-columns: 1fr; gap: 35px; }
    .auth-shell { display: block; }
    .auth-story { display: none; }
    .auth-form-wrap { min-height: 100vh; padding: 35px 24px; }
    .mobile-auth-brand { display: block; margin-bottom: 55px; }
    .app-sidebar { width: 280px; transform: translateX(-102%); transition: transform .25s ease; }
    body.sidebar-open .app-sidebar { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; z-index: 35; inset: 0; display: block; pointer-events: none; opacity: 0; background: rgba(3,28,17,.48); transition: opacity .25s; }
    body.sidebar-open .sidebar-backdrop { pointer-events: auto; opacity: 1; }
    .app-main { margin-left: 0; padding-bottom: 72px; }
    .app-topbar { height: 68px; padding: 0 18px; }
    .sidebar-toggle { display: inline-grid; }
    .user-details { display: none; }
    .user-chip { min-width: 44px; padding: 4px; }
    .app-content { padding: 20px; }
    .mobile-nav { height: calc(64px + env(safe-area-inset-bottom)); position: fixed; z-index: 32; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 8px env(safe-area-inset-bottom); border-top: 1px solid var(--dl-line); background: rgba(255,255,255,.96); backdrop-filter: blur(14px); }
    .mobile-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #829087; font-size: 8px; font-weight: 700; }
    .mobile-nav a.active { color: var(--dl-primary); }
    .mobile-nav .icon { font-size: 20px; }
    .mobile-nav a.is-disabled { opacity: .6; }
    .maintenance-layout { grid-template-columns: 1fr; }
    .management-stats { grid-template-columns: repeat(2, 1fr); }
    .directory-heading { align-items: flex-start; flex-direction: column; }
    .filter-bar { width: 100%; justify-content: flex-start; }
    .directory-table { min-width: 0; }
    .directory-table thead { display: none; }
    .directory-table tbody, .directory-table tr, .directory-table td { display: block; width: 100%; }
    .directory-table tr { padding: 10px 13px; border-bottom: 1px solid var(--dl-line); }
    .directory-table tbody tr:last-child { border-bottom: 0; }
    .directory-table td { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; border: 0; text-align: right; }
    .directory-table td[data-label]::before { content: attr(data-label); flex: 0 0 95px; color: #7A8780; font-size: 8px; font-weight: 850; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
    .directory-table td:first-child { justify-content: flex-start; text-align: left; }
    .directory-table td:first-child::before { display: none; }
    .directory-table td:last-child { justify-content: flex-end; }
    .record-identity { min-width: 0; }
    .scope-copy { max-width: 220px; }
    .field-grid.three { grid-template-columns: 1fr; }
    .install-shell { grid-template-columns: 1fr; }
    .install-aside { display: none; }
}

@media (max-width: 560px) {
    .container { width: calc(100% - 24px); }
    .brand-emblem { width: 40px; height: 40px; }
    .brand-copy strong { font-size: 17px; }
    .header-inner .brand-copy small { display: none; }
    .public-header .button { min-width: auto; padding: 0 15px; }
    .hero-grid { padding: 50px 0 65px; }
    .hero-copy h1 { margin-top: 16px; font-size: 45px; }
    .hero-lead { font-size: 16px; }
    .hero-actions { flex-direction: column; }
    .hero-actions .button { width: 100%; }
    .trust-row { display: grid; grid-template-columns: 1fr 1fr; }
    .hero-visual { min-height: 390px; }
    .visual-orbit.orbit-one { width: 370px; height: 370px; }
    .visual-orbit.orbit-two { width: 290px; height: 290px; }
    .hero-console { padding: 16px; border-radius: 22px; }
    .console-welcome { padding: 22px 2px; }
    .console-welcome strong { font-size: 27px; }
    .console-grid > div { min-height: 76px; padding: 11px; }
    .section { padding: 72px 0; }
    .role-grid { grid-template-columns: 1fr; }
    .role-card { min-height: 205px; }
    .role-card h3 { margin-top: 34px; }
    .public-footer .container { flex-direction: column; align-items: flex-start; }
    .auth-form-wrap { padding: 24px 20px; }
    .auth-form-card h2 { font-size: 33px; }
    .field-grid.two { grid-template-columns: 1fr; }
    .app-topbar { padding: 0 12px; }
    .topbar-title span { display: none; }
    .topbar-actions { gap: 6px; }
    .topbar-actions > .icon-button[data-pwa-install] { display: none !important; }
    .app-content { padding: 14px; }
    .welcome-panel { min-height: 190px; align-items: flex-start; flex-direction: column; padding: 24px; }
    .welcome-panel h1 { font-size: 30px; }
    .release-chip { min-width: 135px; padding: 10px 13px; }
    .metric-grid, .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .metric-card { min-height: 125px; flex-direction: column; align-items: flex-start; padding: 15px; }
    .metric-icon { width: 38px; height: 38px; }
    .metric-card strong { font-size: 22px; }
    .dashboard-grid { grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
    .dl-panel { padding: 18px; border-radius: 17px; }
    .info-banner { align-items: flex-start; }
    .page-heading-row { align-items: flex-start; flex-direction: column; }
    .page-heading-row h1 { font-size: 32px; }
    .settings-grid { gap: 12px; }
    .palette-stack { grid-template-columns: 1fr; }
    .rule-summary-grid { grid-template-columns: 1fr; }
    .management-stats { gap: 9px; }
    .management-stats article { min-height: 88px; padding: 13px; }
    .management-stats .status-icon { width: 34px; height: 34px; }
    .management-stats strong { font-size: 22px; }
    .filter-bar { align-items: stretch; flex-direction: column; }
    .filter-bar input, .filter-bar select, .filter-bar .button { width: 100%; }
    .form-actions { flex-direction: column; }
    .form-actions .button { width: 100%; }
    .permission-list > div { grid-template-columns: 1fr; gap: 5px; }
    .maintenance-panel { margin-top: 12px; }
    .system-hero { align-items: flex-start; flex-direction: column; gap: 18px; }
    .system-layout { gap: 12px; }
    .install { padding: 0; }
    .install-shell { min-height: 100vh; border: 0; border-radius: 0; }
    .install-main { padding: 28px 20px; }
    .preflight { grid-template-columns: 1fr 1fr; }
}

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