:root {
    --ink: #172925;
    --muted: #61716d;
    --line: #dce5e1;
    --canvas: #f4f7f5;
    --surface: #ffffff;
    --brand: #123d35;
    --brand-2: #1f6558;
    --lime: #d9ec6f;
    --orange: #f3a55b;
    --blue: #7cb8c9;
    --shadow: 0 18px 48px rgba(18, 61, 53, .09);
    --radius: 20px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at 8% 0%, rgba(217,236,111,.14), transparent 24rem), var(--canvas); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
a { color: inherit; }
.page-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { min-height: 78px; padding: 14px clamp(20px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; gap: 24px; background: rgba(255,255,255,.9); border-bottom: 1px solid rgba(220,229,225,.9); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.brand small { margin-top: 4px; color: var(--muted); font-size: .7rem; letter-spacing: .04em; }
.brand-mark { display: inline-grid; place-items: center; width: 46px; height: 46px; color: var(--lime); background: var(--brand); border-radius: 14px 14px 14px 5px; font-size: .85rem; font-weight: 900; letter-spacing: .07em; box-shadow: 0 9px 22px rgba(18,61,53,.18); }
.brand-mark-large { width: 58px; height: 58px; margin-bottom: 28px; background: var(--lime); color: var(--brand); }
.top-actions { display: flex; align-items: center; gap: 20px; }
.top-actions > a { color: var(--muted); font-size: .9rem; font-weight: 700; text-decoration: none; }
.top-actions form { margin: 0; }
.user-pill { display: flex; align-items: center; gap: 9px; color: #365049; font-size: .86rem; font-weight: 700; }
.user-pill > span { display: grid; place-items: center; width: 34px; height: 34px; color: var(--brand); background: #e7efe9; border-radius: 50%; }
.main { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 46px 0 70px; flex: 1; }
.main-auth { width: 100%; max-width: none; padding: 0; display: grid; }
.footer { padding: 24px clamp(20px, 5vw, 72px); display: flex; justify-content: space-between; gap: 16px; color: #7a8985; border-top: 1px solid var(--line); font-size: .78rem; }
.eyebrow { margin: 0 0 9px; color: var(--brand-2); font-size: .72rem; font-weight: 900; letter-spacing: .13em; }
.muted { color: var(--muted); }
h1, h2, p { text-wrap: pretty; }
h1, h2 { margin-top: 0; letter-spacing: -.035em; }
.button { min-height: 42px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; font-weight: 800; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--brand); box-shadow: 0 10px 24px rgba(18,61,53,.17); }
.button-primary:hover { background: #0b3029; }
.button-secondary { color: var(--brand); background: #fff; border-color: var(--line); }
.button-ghost { color: var(--brand); background: #edf3f0; }
.button-small { min-height: 36px; padding: 7px 12px; font-size: .8rem; }
.button-wide { width: 100%; min-height: 50px; justify-content: space-between; padding-inline: 19px; }
.alert { margin-bottom: 20px; padding: 13px 15px; border: 1px solid; border-radius: 12px; font-size: .9rem; }
.alert-error { color: #862e2e; background: #fff0f0; border-color: #f4c5c5; }
.alert-success { color: #17603f; background: #eef9f2; border-color: #bde4ca; }
.alert-warning { color: #745212; background: #fff9e8; border-color: #efdb9d; }
.auth-panel { min-height: calc(100vh - 70px); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); background: #fff; }
.auth-intro { padding: clamp(48px, 8vw, 120px); display: flex; flex-direction: column; justify-content: center; color: #fff; background: radial-gradient(circle at 82% 18%, rgba(217,236,111,.18), transparent 18rem), linear-gradient(145deg, #103a32, #1a5146); position: relative; overflow: hidden; }
.auth-intro::after { content: ""; position: absolute; right: -90px; bottom: -170px; width: 440px; height: 440px; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; box-shadow: 0 0 0 60px rgba(255,255,255,.025), 0 0 0 120px rgba(255,255,255,.018); }
.auth-intro .eyebrow { color: var(--lime); }
.auth-intro h1 { max-width: 650px; margin-bottom: 22px; font-size: clamp(2.7rem, 5.5vw, 5rem); line-height: .98; position: relative; z-index: 1; }
.auth-intro > p:not(.eyebrow) { max-width: 500px; margin: 0 0 42px; color: #cbdcd7; font-size: 1.05rem; line-height: 1.65; }
.auth-feature { display: flex; align-items: center; gap: 10px; margin: 7px 0; color: #e2ede9; font-size: .9rem; position: relative; z-index: 1; }
.auth-feature span { display: grid; place-items: center; width: 23px; height: 23px; color: var(--brand); background: var(--lime); border-radius: 50%; font-size: .72rem; font-weight: 900; }
.auth-card { width: min(430px, calc(100% - 48px)); margin: auto; padding: 36px 0; }
.auth-card h2 { margin-bottom: 8px; font-size: 2rem; }
.auth-card > .muted { margin: 0 0 28px; line-height: 1.55; }
.stack-form { display: grid; gap: 18px; }
.stack-form label { display: grid; gap: 8px; color: #314741; font-size: .84rem; font-weight: 800; }
.stack-form input { width: 100%; height: 49px; padding: 0 14px; color: var(--ink); background: #fbfcfb; border: 1px solid #cad7d2; border-radius: 11px; outline: none; }
.stack-form input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(31,101,88,.11); }
.hero { margin-bottom: 36px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.hero h1 { margin-bottom: 8px; font-size: clamp(2.1rem, 5vw, 3.4rem); }
.hero p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 1rem; }
.hero-status { padding: 9px 13px; display: flex; align-items: center; gap: 8px; color: #396058; background: #eaf2ed; border-radius: 999px; font-size: .75rem; font-weight: 800; }
.hero-status span { width: 7px; height: 7px; background: #45a575; border-radius: 50%; box-shadow: 0 0 0 4px rgba(69,165,117,.12); }
.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.module-card { min-height: 285px; padding: 28px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); position: relative; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.module-card::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 5px; background: var(--brand); }
.module-accent-1::before { background: var(--orange); }
.module-accent-2::before { background: var(--blue); }
.module-accent-3::before { background: var(--lime); }
.module-card:hover { transform: translateY(-3px); box-shadow: 0 23px 55px rgba(18,61,53,.13); }
.module-icon { width: 52px; height: 52px; margin-bottom: 22px; display: grid; place-items: center; color: var(--brand); background: #eaf1ed; border-radius: 15px; font-size: 1.45rem; font-weight: 900; }
.module-copy { flex: 1; }
.module-copy h2 { margin: 9px 0 10px; font-size: 1.45rem; }
.module-copy p { margin: 0 0 24px; color: var(--muted); line-height: 1.55; }
.role-badge { display: inline-block; padding: 5px 8px; border-radius: 6px; font-size: .64rem; font-weight: 900; letter-spacing: .055em; text-transform: uppercase; }
.role-admin { color: #744d08; background: #fff0c4; }
.role-editor { color: #195e53; background: #dcefe9; }
.role-visor { color: #476279; background: #e4eff7; }
.module-card form { margin: 0; }
.module-link { width: 100%; padding: 15px 0 0; display: flex; justify-content: space-between; color: var(--brand); background: none; border: 0; border-top: 1px solid var(--line); cursor: pointer; font-weight: 900; text-align: left; }
.module-link span { transition: transform .15s ease; }
.module-link:hover span { transform: translateX(4px); }
.coming-soon { margin-top: 26px; padding: 24px 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: rgba(255,255,255,.58); border: 1px dashed #bfcfc9; border-radius: 17px; }
.coming-soon > div { display: flex; align-items: center; gap: 15px; }
.coming-soon strong { display: block; margin-bottom: 4px; }
.coming-soon p { margin: 0; color: var(--muted); font-size: .86rem; }
.coming-soon a { color: var(--brand-2); font-size: .85rem; font-weight: 900; text-decoration: none; white-space: nowrap; }
.plus-icon { display: grid; place-items: center; width: 42px; height: 42px; color: var(--brand); background: #e7efeb; border-radius: 13px; font-size: 1.5rem; }
.empty-state { padding: 64px 24px; text-align: center; background: #fff; border: 1px dashed #bdccc7; border-radius: var(--radius); }
.empty-state h2 { margin: 15px 0 6px; }
.empty-state p { margin: 0; color: var(--muted); }
.empty-icon { color: var(--brand-2); font-size: 2.4rem; }
.section-heading { margin-bottom: 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; }
.section-heading h1 { margin-bottom: 8px; font-size: clamp(2rem, 4vw, 3rem); }
.section-heading p:not(.eyebrow) { margin: 0; color: var(--muted); }
.legend { margin-bottom: 22px; padding: 14px 18px; display: flex; flex-wrap: wrap; gap: 24px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 13px; font-size: .76rem; }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend strong { color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-admin { background: #d79e24; }.dot-editor { background: #3a9a80; }.dot-visor { background: #65a1c3; }
.permission-list { display: grid; gap: 16px; }
.permission-user { background: #fff; border: 1px solid var(--line); border-radius: 17px; overflow: hidden; box-shadow: 0 8px 25px rgba(18,61,53,.045); }
.permission-user > header { padding: 18px 20px; display: flex; align-items: center; gap: 12px; background: #fbfcfb; border-bottom: 1px solid var(--line); }
.permission-user h2 { margin: 0 0 2px; font-size: 1rem; letter-spacing: -.01em; }
.permission-user header p { margin: 0; color: var(--muted); font-size: .75rem; }
.permission-user.is-disabled { opacity: .68; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; color: var(--brand); background: #e2ede7; border-radius: 11px; font-weight: 900; }
.status-off { margin-left: auto; padding: 5px 8px; color: #7f3939; background: #fbe8e8; border-radius: 6px; font-size: .65rem; font-weight: 900; text-transform: uppercase; }
.permission-modules { padding: 5px 20px; }
.permission-row { min-height: 65px; display: grid; grid-template-columns: minmax(180px, 1fr) 170px 115px 78px; align-items: center; gap: 16px; border-bottom: 1px solid #edf1ef; }
.permission-row:last-child { border-bottom: 0; }
.permission-row > strong { font-size: .86rem; }
.permission-row select { width: 100%; height: 38px; padding: 0 10px; color: var(--ink); background: #fff; border: 1px solid #cdd9d4; border-radius: 9px; }
.toggle { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .75rem; font-weight: 700; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle span { width: 35px; height: 20px; padding: 3px; display: block; background: #cbd5d1; border-radius: 999px; transition: background .15s ease; }
.toggle span::after { content: ""; width: 14px; height: 14px; display: block; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s ease; }
.toggle input:checked + span { background: var(--brand-2); }
.toggle input:checked + span::after { transform: translateX(15px); }
.launch-card { width: min(530px, 100%); margin: 90px auto; padding: 50px 35px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.launch-card h1 { margin-bottom: 10px; }
.launch-card > p:not(.eyebrow) { color: var(--muted); }
.spinner { width: 50px; height: 50px; margin: 0 auto 24px; border: 4px solid #e0e9e5; border-top-color: var(--brand-2); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
    .auth-panel { grid-template-columns: 1fr; }
    .auth-intro { min-height: 42vh; padding: 48px 30px; }
    .auth-intro h1 { font-size: clamp(2.4rem, 11vw, 4rem); }
    .auth-intro > p:not(.eyebrow) { margin-bottom: 20px; }
    .auth-feature { display: none; }
    .auth-card { padding: 54px 0 70px; }
    .module-grid { grid-template-columns: 1fr; }
    .permission-row { padding: 14px 0; grid-template-columns: 1fr 1fr; }
    .permission-row > strong { grid-column: 1 / -1; }
    .permission-row .button { justify-self: end; }
}

@media (max-width: 600px) {
    .topbar { padding: 12px 16px; }
    .brand small, .user-pill, .top-actions > a { display: none; }
    .top-actions { gap: 8px; }
    .main { width: min(100% - 28px, 1180px); padding-top: 32px; }
    .main-auth { width: 100%; padding: 0; }
    .hero, .section-heading, .coming-soon { align-items: flex-start; flex-direction: column; }
    .hero-status { align-self: flex-start; }
    .module-card { min-height: 260px; padding: 23px; }
    .coming-soon a { white-space: normal; }
    .legend { gap: 12px; }
    .legend span { width: 100%; }
    .permission-user > header { align-items: flex-start; }
    .permission-modules { padding-inline: 15px; }
    .permission-row { grid-template-columns: 1fr; gap: 10px; }
    .permission-row > strong { grid-column: auto; }
    .permission-row .button { justify-self: stretch; }
    .footer { flex-direction: column; }
}

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