:root {
    --ecm-bg: #f4f0e8;
    --ecm-surface: #ffffff;
    --ecm-surface-alt: #f9f6ef;
    --ecm-border: #ddd2c3;
    --ecm-text: #2e241c;
    --ecm-muted: #6a5a4c;
    --ecm-primary: #244c5a;
    --ecm-primary-strong: #17343f;
    --ecm-success: #2f6e49;
    --ecm-error: #a53f2b;
    --ecm-warning: #926a1f;
    --ecm-radius: 18px;
    --ecm-shadow: 0 18px 44px rgba(56, 42, 26, 0.12);
    --ecm-font-title: "Segoe UI Semibold", "Trebuchet MS", sans-serif;
    --ecm-font-body: "Segoe UI", "Tahoma", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at top left, rgba(36, 76, 90, 0.12), transparent 28%),
        linear-gradient(180deg, #fbf8f2 0%, var(--ecm-bg) 100%);
    color: var(--ecm-text);
    font-family: var(--ecm-font-body);
}

body {
    line-height: 1.5;
}

a {
    color: var(--ecm-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code,
pre {
    font-family: Consolas, "Courier New", monospace;
}

.ecm-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.ecm-shell-simple {
    display: block;
    width: min(860px, calc(100% - 24px));
    min-height: auto;
    margin: 32px auto;
}

.ecm-sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 28px 22px;
    background: rgba(20, 40, 48, 0.96);
    color: #f5efe5;
}

.ecm-sidebar-brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 28px;
}

.ecm-sidebar-brand strong {
    font-size: 1.35rem;
}

.ecm-sidebar-brand small {
    color: rgba(245, 239, 229, 0.72);
}

.ecm-sidebar-section-title {
    margin: 22px 0 10px;
    color: rgba(245, 239, 229, 0.58);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ecm-sidebar-nav {
    display: grid;
    gap: 10px;
}

.ecm-sidebar-nav-secondary {
    margin-bottom: auto;
}

.ecm-sidebar-nav a {
    padding: 12px 14px;
    border-radius: 12px;
    color: #f5efe5;
    background: rgba(255, 255, 255, 0.05);
}

.ecm-sidebar-nav a.is-active,
.ecm-sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.16);
    text-decoration: none;
}

.ecm-sidebar-footer {
    display: grid;
    gap: 10px;
    padding-top: 20px;
}

.ecm-main {
    padding: 30px;
}

.ecm-page-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.ecm-page-header h1 {
    margin: 8px 0 0;
    font-family: var(--ecm-font-title);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.ecm-page-meta {
    color: var(--ecm-muted);
    text-align: right;
}

.ecm-page-meta strong {
    color: var(--ecm-text);
}

.ecm-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-bottom: 22px;
}

.ecm-grid-3,
.ecm-card-grid,
.ecm-step-grid,
.ecm-kpi-grid {
    display: grid;
    gap: 18px;
    margin-bottom: 22px;
}

.ecm-grid-3,
.ecm-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ecm-step-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ecm-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ecm-panel,
.ecm-auth-card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(221, 210, 195, 0.9);
    border-radius: var(--ecm-radius);
    box-shadow: var(--ecm-shadow);
    padding: 24px;
}

.ecm-panel > :first-child,
.ecm-auth-card > :first-child,
.ecm-card > :first-child,
.ecm-link-card > :first-child,
.ecm-kpi > :first-child,
.ecm-step > :first-child {
    margin-top: 0;
}

.ecm-panel > :last-child,
.ecm-auth-card > :last-child,
.ecm-card > :last-child,
.ecm-link-card > :last-child,
.ecm-kpi > :last-child,
.ecm-step > :last-child {
    margin-bottom: 0;
}

.ecm-hero-panel {
    background:
        linear-gradient(135deg, rgba(36, 76, 90, 0.96), rgba(23, 52, 63, 0.94)),
        #17343f;
    color: #f7f1e8;
}

.ecm-hero-panel .ecm-badge {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.ecm-hero-panel p,
.ecm-hero-panel li,
.ecm-hero-panel a {
    color: rgba(247, 241, 232, 0.92);
}

.ecm-kpi,
.ecm-card,
.ecm-step,
.ecm-link-card {
    padding: 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(221, 210, 195, 0.95);
}

.ecm-kpi strong {
    display: block;
    margin-bottom: 6px;
    font-size: 1.55rem;
    line-height: 1.1;
}

.ecm-kpi span,
.ecm-step strong {
    display: block;
    margin-bottom: 8px;
    color: var(--ecm-text);
}

.ecm-link-card {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: transform 120ms ease, box-shadow 120ms ease;
}

.ecm-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(56, 42, 26, 0.08);
    text-decoration: none;
}

.ecm-stack {
    display: grid;
    gap: 14px;
}

.ecm-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.ecm-pill-list li {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(36, 76, 90, 0.08);
    color: var(--ecm-primary);
    font-size: 0.92rem;
}

.ecm-note {
    padding: 16px 18px;
    border-left: 4px solid var(--ecm-primary);
    border-radius: 14px;
    background: rgba(36, 76, 90, 0.08);
    color: var(--ecm-text);
}

.ecm-subtle {
    color: var(--ecm-muted);
}

.ecm-auth {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 20px;
}

.ecm-auth-card {
    width: min(520px, 100%);
}

.ecm-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(36, 76, 90, 0.1);
    color: var(--ecm-primary);
    font-size: 0.88rem;
    font-weight: 600;
}

.ecm-badge-warning {
    background: rgba(146, 106, 31, 0.12);
    color: var(--ecm-warning);
}

.ecm-alert {
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 14px;
}

.ecm-alert-success {
    background: rgba(47, 110, 73, 0.12);
    color: var(--ecm-success);
}

.ecm-alert-error {
    background: rgba(165, 63, 43, 0.12);
    color: var(--ecm-error);
}

.ecm-form-grid {
    display: grid;
    gap: 16px;
}

.ecm-form-grid label {
    display: grid;
    gap: 8px;
    font-weight: 600;
}

.ecm-form-grid input,
.ecm-form-grid select,
.ecm-form-grid button,
.ecm-form-grid textarea {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--ecm-border);
    font: inherit;
}

.ecm-form-grid textarea {
    resize: vertical;
    min-height: 110px;
}

.ecm-form-grid button {
    background: var(--ecm-primary);
    color: #fff;
    border-color: transparent;
    cursor: pointer;
}

.ecm-form-grid button:hover {
    background: var(--ecm-primary-strong);
}

.ecm-form-columns {
    display: grid;
    gap: 16px;
}

.ecm-form-columns-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ecm-form-columns-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ecm-form-columns-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ecm-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ecm-button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--ecm-border);
    border-radius: 12px;
    background: var(--ecm-surface-alt);
    color: var(--ecm-text);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.ecm-button-secondary:hover {
    background: #efe8dd;
    text-decoration: none;
}

.ecm-list {
    margin: 0;
    padding-left: 18px;
}

.ecm-table-wrap {
    overflow-x: auto;
}

.ecm-table {
    width: 100%;
    border-collapse: collapse;
}

.ecm-table th,
.ecm-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--ecm-border);
    text-align: left;
    vertical-align: top;
}

.ecm-table-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ecm-inline-form {
    margin: 0;
}

.ecm-inline-form button {
    min-height: 44px;
}

.ecm-status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(36, 76, 90, 0.1);
    color: var(--ecm-primary);
    font-size: 0.82rem;
    font-weight: 700;
}

.ecm-status-chip.is-success {
    background: rgba(47, 110, 73, 0.12);
    color: var(--ecm-success);
}

.ecm-status-chip.is-muted {
    background: rgba(106, 90, 76, 0.12);
    color: var(--ecm-muted);
}

.ecm-status-chip.is-warning {
    background: rgba(146, 106, 31, 0.14);
    color: var(--ecm-warning);
}

.ecm-table-status-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.ecm-placeholder-card {
    padding: 18px;
    border: 1px dashed var(--ecm-border);
    border-radius: 16px;
    background: var(--ecm-surface-alt);
}

.ecm-code-block {
    overflow-x: auto;
    padding: 16px;
    border-radius: 16px;
    background: #201a17;
    color: #f9efe2;
}

@media (max-width: 980px) {
    .ecm-shell {
        grid-template-columns: 1fr;
    }

    .ecm-sidebar {
        gap: 20px;
    }

    .ecm-main {
        padding: 22px;
    }

    .ecm-page-header,
    .ecm-grid {
        grid-template-columns: 1fr;
        display: grid;
    }

    .ecm-grid-3,
    .ecm-card-grid,
    .ecm-step-grid,
    .ecm-kpi-grid {
        grid-template-columns: 1fr;
    }

    .ecm-form-columns-2,
    .ecm-form-columns-3,
    .ecm-form-columns-4 {
        grid-template-columns: 1fr;
    }

    .ecm-page-meta {
        text-align: left;
    }
}
