:root {
    --bg: #f4f6f5;
    --panel: #ffffff;
    --ink: #1f2528;
    --muted: #68747a;
    --line: #d9e0dd;
    --accent: #127d68;
    --accent-dark: #0d5f50;
    --amber: #a96416;
    --danger: #b42318;
    --shadow: 0 16px 42px rgba(30, 43, 48, .08);
}

* {
    box-sizing: border-box;
}

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

a {
    color: var(--accent-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    min-height: 38px;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    padding: 9px 14px;
    cursor: pointer;
}

button:hover {
    background: var(--accent-dark);
}

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

.sidebar {
    background: #20282b;
    color: #e9efed;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 8px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.brand strong {
    font-size: 21px;
}

.brand span {
    color: #aebbb8;
}

.sidebar nav {
    display: grid;
    gap: 4px;
}

.sidebar a {
    color: #dfe8e5;
    border-radius: 6px;
    padding: 10px 11px;
    text-decoration: none;
}

.sidebar a:hover,
.sidebar a.active {
    background: rgba(255, 255, 255, .1);
}

.logout {
    margin-top: auto;
}

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

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.topbar h1 {
    margin: 2px 0 0;
    font-size: 28px;
    line-height: 1.15;
}

.eyebrow {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.status-dot {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 6px;
    background: #e8f2ef;
    color: var(--accent-dark);
    font-weight: 700;
    padding: 5px 9px;
}

.panel,
.metric {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.panel {
    padding: 18px;
    margin-bottom: 18px;
}

.panel h1 {
    margin: 0 0 14px;
    font-size: 18px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric {
    min-height: 96px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

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

.metric strong {
    font-size: 24px;
}

.split {
    display: grid;
    grid-template-columns: minmax(300px, .9fr) minmax(420px, 1.5fr);
    gap: 18px;
    align-items: start;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-title h1 {
    margin: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    max-width: 100%;
    border-radius: 6px;
    background: #edf1f0;
    color: #344144;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    overflow-wrap: anywhere;
}

.alert {
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    background: #eef5f3;
}

.alert.success {
    border-color: #b9d8cf;
    color: var(--accent-dark);
}

.alert.warning {
    border-color: #efcf9f;
    background: #fff7ea;
    color: var(--amber);
}

.alert.error {
    border-color: #e6b8b5;
    background: #fff0ef;
    color: var(--danger);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

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

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 10px 8px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

.form-grid,
.dense-form {
    display: grid;
    gap: 12px;
}

.form-grid {
    grid-template-columns: 1fr;
}

.dense-form {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
}

label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    background: #fff;
    padding: 8px 10px;
}

textarea {
    min-height: 88px;
    resize: vertical;
}

.span-2 {
    grid-column: span 2;
}

.check {
    grid-template-columns: 18px 1fr;
    align-items: center;
    color: var(--ink);
}

.check input {
    width: 16px;
    min-height: 16px;
}

.dense-form button {
    align-self: end;
}

.facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.facts div {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px;
    background: #fbfcfc;
}

.facts dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.empty {
    min-height: 88px;
    display: grid;
    place-items: center;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: 8px;
}

.inline-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.code-block {
    overflow: auto;
    border-radius: 6px;
    background: #20282b;
    color: #eef5f3;
    padding: 14px;
}

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

.login-panel {
    width: min(420px, 100%);
    display: grid;
    gap: 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.login-panel h1 {
    margin: 0;
    font-size: 24px;
}

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

@media (max-width: 1050px) {
    .metric-grid,
    .facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .split,
    .dense-form {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }
}

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

    .sidebar {
        position: static;
    }

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

    .content {
        padding: 16px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .metric-grid,
    .facts {
        grid-template-columns: 1fr;
    }
}


.customer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: fit-content;
    max-width: 100%;
    margin-bottom: 18px;
    border-radius: 8px;
    background: #ff6a21;
    color: #fff;
    padding: 10px 14px;
    font-weight: 700;
}

.customer-bar a {
    color: #fff;
    font-weight: 500;
    text-decoration: underline;
}

.customer-search-form,
.article-form {
    display: grid;
    gap: 12px;
}

.customer-search-form {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    align-items: end;
}

.customer-search-form button {
    grid-column: 2;
}

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

.article-panel {
    margin-top: 18px;
}

.article-form {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.article-form .span-2 {
    grid-column: span 2;
}

.article-form button {
    align-self: end;
}

.icon-action {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    border-radius: 6px;
    background: #edf1f0;
    padding: 5px 8px;
    font-weight: 700;
}
