:root {
    --bg: #edf2f1;
    --sidebar: #102421;
    --sidebar-2: #173631;
    --panel: #ffffff;
    --ink: #17211f;
    --muted: #66736f;
    --line: #d9e4e0;
    --soft: #f7faf9;
    --green: #128c7e;
    --green-dark: #0f5f55;
    --amber: #b7791f;
    --red: #b8322b;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
}

h1,
h2,
h3,
p {
    margin: 0;
}

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2));
    color: #fff;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--green);
    display: grid;
    place-items: center;
    font-weight: 800;
    letter-spacing: .5px;
}

.brand h1 {
    font-size: 18px;
    line-height: 1.15;
}

.brand p,
.sidebar-card small {
    color: #bdd4cf;
    font-size: 13px;
    margin-top: 3px;
}

nav {
    display: grid;
    gap: 6px;
}

nav a {
    min-height: 42px;
    display: flex;
    align-items: center;
    border-radius: 8px;
    padding: 0 12px;
    color: #e6f2ef;
    text-decoration: none;
    font-weight: 700;
}

nav a:hover {
    background: rgba(255, 255, 255, .09);
}

.sidebar-card {
    margin-top: auto;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 10px;
    padding: 14px;
    background: rgba(255, 255, 255, .06);
    display: grid;
    gap: 6px;
}

.sidebar-card span {
    color: #bdd4cf;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.sidebar-card strong {
    font-size: 16px;
}

.workspace {
    min-width: 0;
    padding: 26px;
}

.workspace-header {
    min-height: 110px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
    box-shadow: 0 10px 30px rgba(18, 38, 35, .06);
}

.workspace-header h2 {
    font-size: 28px;
    line-height: 1.2;
}

.workspace-header p,
.section-title p,
.action-card p {
    color: var(--muted);
    line-height: 1.45;
    margin-top: 5px;
}

.eyebrow,
.card-kicker {
    display: inline-block;
    color: var(--green-dark);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 5px;
}

.header-actions,
.section-title,
.file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.alert {
    background: #e7f6f1;
    border: 1px solid #b8ded3;
    color: #075e54;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 15px;
    font-weight: 700;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.metrics div,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 10px 26px rgba(18, 38, 35, .05);
}

.metrics div {
    min-height: 106px;
    padding: 16px;
    display: grid;
    align-content: center;
    gap: 5px;
}

.metrics span,
.metrics small {
    color: var(--muted);
    font-size: 13px;
}

.metrics b {
    font-size: 31px;
    line-height: 1;
}

.ops-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.panel {
    padding: 22px;
    margin-bottom: 16px;
}

.action-card {
    display: grid;
    align-content: start;
    gap: 12px;
}

.action-card h3 {
    font-size: 19px;
}

.copy-line {
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    color: #213936;
    overflow-wrap: anywhere;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.template-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 16px;
    align-items: end;
    margin-top: 16px;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 800;
    font-size: 13px;
}

label span {
    color: #263a36;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
    color: var(--ink);
    font-size: 15px;
}

input {
    min-height: 46px;
    padding: 10px 12px;
}

textarea {
    min-height: 118px;
    padding: 12px;
    resize: vertical;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.45;
}

input:focus,
textarea:focus {
    outline: 3px solid rgba(18, 140, 126, .14);
    border-color: var(--green);
    background: #fff;
}

button,
.button-link {
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    padding: 0 16px;
    background: var(--green);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(18, 140, 126, .16);
}

button:hover,
.button-link:hover {
    filter: brightness(.96);
}

.button-link.secondary {
    background: #31514c;
}

.wide,
.half,
.form-footer {
    grid-column: span 3;
}

.form-footer {
    display: flex;
    justify-content: flex-end;
}

.preview-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 14px;
}

.preview-box div {
    background: #eef7f4;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px;
}

.preview-box span {
    display: block;
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 6px;
}

.preview-box p {
    line-height: 1.5;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 14px;
    overflow: hidden;
    border-radius: 10px;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 12px;
    text-align: left;
    font-size: 13px;
    vertical-align: top;
}

th {
    background: #eef4f2;
    color: #31433f;
    font-weight: 800;
}

td {
    background: #fff;
}

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

    .sidebar {
        position: static;
        height: auto;
    }

    nav {
        grid-template-columns: repeat(3, 1fr);
    }

    .metrics,
    .ops-grid,
    .grid,
    .template-grid,
    .preview-box {
        grid-template-columns: 1fr 1fr;
    }

    .wide,
    .half,
    .form-footer {
        grid-column: span 2;
    }
}

@media (max-width: 720px) {
    .workspace {
        padding: 14px;
    }

    .workspace-header,
    .section-title,
    .header-actions,
    .file-row {
        align-items: stretch;
        flex-direction: column;
    }

    nav,
    .metrics,
    .ops-grid,
    .grid,
    .template-grid,
    .preview-box {
        grid-template-columns: 1fr;
    }

    .wide,
    .half,
    .form-footer {
        grid-column: span 1;
    }

    .form-footer,
    .header-actions {
        justify-content: stretch;
    }

    button,
    .button-link {
        width: 100%;
    }
}
