:root {
    --bg: #f4f7f5;
    --surface: #ffffff;
    --surface-soft: #edf3ef;
    --ink: #18251e;
    --muted: #65736b;
    --line: #dce5df;
    --brand: #18764a;
    --brand-dark: #105b38;
    --brand-soft: #ddf3e7;
    --warning: #a35b00;
    --warning-soft: #fff1d8;
    --danger: #a52a2a;
    --danger-soft: #fde7e7;
    --shadow: 0 12px 36px rgba(30, 58, 42, .08);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
button, input { font: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 18px; background: #102a1d; color: #eef7f1; }
.brand { display: flex; align-items: center; gap: 12px; color: white; }
.brand:hover { color: white; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #46c985; font-size: 20px; font-weight: 800; color: #0b3520; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; }
.brand small { margin-top: 2px; color: #a9c2b3; font-size: 11px; letter-spacing: .04em; }
.project-card { margin: 28px 0 18px; padding: 14px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: rgba(255,255,255,.06); }
.project-card span, .project-card strong, .project-card a { display: block; }
.project-card span { color: #9bb5a5; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.project-card strong { margin: 5px 0 8px; }
.project-card a { color: #75dfa7; font-size: 12px; }
.main-nav { display: grid; gap: 5px; }
.main-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; color: #bed1c5; font-size: 14px; font-weight: 600; }
.main-nav a:hover, .main-nav a.is-active { background: rgba(255,255,255,.1); color: white; }
.nav-icon { width: 20px; text-align: center; color: #6fda9f; }
.sidebar-hint { margin-top: 28px; color: #a9c2b3; font-size: 13px; line-height: 1.5; }
.sidebar-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-footer span, .sidebar-footer a { display: block; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer span { color: #a9c2b3; font-size: 12px; }
.sidebar-footer a { margin-top: 6px; color: white; font-size: 13px; }

.main-content { min-width: 0; padding: 38px clamp(22px, 4vw, 60px) 70px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 28px; }
.page-header h1 { margin: 4px 0 7px; font-size: clamp(28px, 4vw, 42px); line-height: 1.05; letter-spacing: -.035em; }
.page-header p { max-width: 720px; margin: 0; color: var(--muted); line-height: 1.55; }
.eyebrow { color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.section-block { margin-top: 34px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 16px; }
.section-heading h2 { margin: 4px 0 0; font-size: 23px; }
.section-heading > p { max-width: 520px; margin: 0; color: var(--muted); font-size: 14px; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 15px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-weight: 700; font-size: 13px; }
.button-primary { background: var(--brand); color: white; }
.button-primary:hover { background: var(--brand-dark); color: white; }
.button-secondary { border-color: #a9cbb8; background: white; color: var(--brand-dark); }
.button-secondary:hover { border-color: var(--brand); background: var(--brand-soft); }
.button-ghost { border-color: var(--line); background: transparent; color: var(--muted); }
.button:disabled { cursor: not-allowed; opacity: .5; }

.messages { display: grid; gap: 10px; margin-bottom: 20px; }
.message { display: flex; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: white; font-size: 14px; }
.message-success { border-color: #9ad0b2; background: var(--brand-soft); }
.message-error { border-color: #efb2b2; background: var(--danger-soft); }

.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stat-card, .panel, .module-card, .integration-card, .toolbar { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 1px 0 rgba(24,37,30,.02); }
.stat-card { padding: 20px; }
.stat-card > span { display: block; margin-bottom: 9px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.stat-card > strong { display: block; margin-bottom: 12px; font-size: 31px; line-height: 1; }
.stat-card > a { font-size: 13px; font-weight: 700; }
.status-text { font-size: 20px !important; line-height: 1.2 !important; }
.status-success { color: var(--brand); }
.status-warning { color: var(--warning); }
.status-error { color: var(--danger); }
.status-muted { color: var(--muted); }

.flow-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.flow-step { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.72); }
.flow-step > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #e6ece8; color: var(--muted); font-weight: 800; }
.flow-step.is-ready > span { background: var(--brand); color: white; }
.flow-step strong, .flow-step small { display: block; }
.flow-step small { margin-top: 2px; color: var(--muted); }
.flow-step a { font-size: 13px; font-weight: 700; }

.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.compact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.module-card { display: flex; flex-direction: column; padding: 18px; }
.module-card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.module-card h2, .module-card h3 { margin: 0; }
.module-card h2 { margin-top: 16px; font-size: 20px; }
.module-card p { color: var(--muted); line-height: 1.48; font-size: 14px; }
.module-card > a { margin-top: auto; font-size: 13px; font-weight: 700; }
.module-card ul { margin: 0 0 20px; padding-left: 18px; color: #46544c; font-size: 13px; line-height: 1.55; }
.module-number { font-size: 13px; font-weight: 800; color: #99a69e; }
.badge { display: inline-flex; align-items: center; width: fit-content; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.badge-active { background: var(--brand-soft); color: var(--brand-dark); }
.badge-next { background: var(--warning-soft); color: var(--warning); }
.badge-planned { background: #e7ecff; color: #425aa8; }
.badge-later { background: #edf0ee; color: #68756d; }
.badge-error { background: var(--danger-soft); color: var(--danger); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 18px; color: var(--muted); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #999; }
.dot-active { background: var(--brand); }.dot-next { background: #e4982e; }.dot-planned { background: #6479cf; }.dot-later { background: #9ca7a0; }

.toolbar { margin-bottom: 14px; padding: 15px; }
.search-form label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 800; }
.search-form > div { display: flex; gap: 8px; }
input[type="search"], input[type="text"], input[type="password"], input[type="email"], input[type="number"] { width: 100%; max-width: 520px; padding: 10px 12px; border: 1px solid #bdcac2; border-radius: 8px; background: white; color: var(--ink); }
input:focus { outline: 3px solid rgba(24,118,74,.14); border-color: var(--brand); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; background: white; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: #f5f8f6; color: #55635b; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fbf9; }
td strong, td small { display: block; }
td small { margin-top: 3px; color: var(--muted); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 20px; padding: 18px; font-size: 13px; }
.empty-state { padding: 54px 24px; border: 1px dashed #bac8bf; border-radius: 14px; background: rgba(255,255,255,.6); text-align: center; }
.empty-state h2 { margin: 8px 0; }
.empty-state p { max-width: 560px; margin: 0 auto 18px; color: var(--muted); }
.empty-icon { font-size: 34px; color: var(--brand); }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.panel { padding: 20px; }
.panel h2, .panel h3 { margin-top: 0; }
.data-list { margin: 0; }
.data-list > div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.data-list > div:last-child { border-bottom: 0; }
.data-list dt { color: var(--muted); font-size: 12px; }
.data-list dd { margin: 0; font-weight: 700; }
.changelog-list { margin: 0; padding: 0; list-style: none; }
.changelog-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.changelog-list li:last-child { border-bottom: 0; }
.changelog-date { display: block; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.changelog-list p { margin: 4px 0 0; font-size: 13px; }
.image-links { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.image-links a { display: block; padding: 8px 10px; border-radius: 8px; background: var(--surface-soft); font-size: 13px; }
.back-link { margin-top: 0; font-size: 13px; }
.muted { color: var(--muted); }
.notice { margin-top: 18px; padding: 13px 15px; border-left: 4px solid var(--warning); border-radius: 8px; background: var(--warning-soft); color: #70430b; font-size: 13px; }
.check-list { padding-left: 20px; line-height: 1.8; }

.integration-card { padding: 22px; }
.integration-head { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.integration-head h2, .integration-head p { margin: 0; }
.integration-head p { margin-top: 3px; color: var(--muted); font-size: 13px; }
.integration-logo { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: #442586; color: white; font-size: 22px; font-weight: 800; }
.connection-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.connection-summary div { padding: 12px; border-radius: 9px; background: var(--surface-soft); }
.connection-summary dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.connection-summary dd { margin: 4px 0 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 700; }
.integration-columns { display: grid; grid-template-columns: 1.25fr .75fr; gap: 14px; margin-top: 18px; }
.inset-panel { box-shadow: none; }
.stack-form p { margin: 0 0 14px; }
.stack-form label { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 800; }
.stack-form .helptext { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.stack-form ul.errorlist { margin: 5px 0; padding: 8px 10px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); list-style: none; font-size: 12px; }
.security-note { margin-top: 18px; color: var(--muted); font-size: 11px; line-height: 1.5; }

.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.project-choice { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--ink); text-align: left; cursor: pointer; }
.project-choice:hover, .project-choice.is-current { border-color: #85b99d; box-shadow: var(--shadow); }
.project-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: var(--brand-soft); color: var(--brand-dark); font-weight: 800; }
.project-choice strong, .project-choice small { display: block; }
.project-choice small { margin-top: 4px; color: var(--muted); }

@media (max-width: 980px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; }
    .main-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }
    .sidebar-footer { margin-top: 18px; }
    .stats-grid, .module-grid, .compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .main-content { padding: 26px 16px 50px; }
    .page-header, .section-heading { display: block; }
    .page-header .button { margin-top: 14px; }
    .stats-grid, .module-grid, .compact-grid, .detail-grid, .integration-columns, .connection-summary, .project-grid { grid-template-columns: 1fr; }
    .search-form > div { flex-wrap: wrap; }
    .main-nav { grid-template-columns: 1fr; }
    .flow-step { grid-template-columns: 34px minmax(0, 1fr); }
    .flow-step > a { grid-column: 2; }
}
