:root {
    color-scheme: light;
    font-family: Arial, Helvetica, sans-serif;
    --bg: #f4f6fa;
    --panel: #ffffff;
    --line: #dfe5ee;
    --text: #172033;
    --muted: #657085;
    --brand: #213f70;
    --brand-2: #bd7440;
    --danger: #b3263a;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--text);
    margin: 0;
}

a {
    color: inherit;
}

.sidebar {
    background: #172033;
    bottom: 0;
    color: #fff;
    left: 0;
    padding: 22px 18px;
    position: fixed;
    top: 0;
    width: 250px;
}

.brand {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
}

.brand-mark {
    align-items: center;
    background: var(--brand-2);
    border-radius: 8px;
    display: inline-flex;
    font-size: 22px;
    font-weight: 800;
    height: 46px;
    justify-content: center;
    width: 46px;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: rgba(255, 255, 255, .66);
    font-size: 12px;
    margin-top: 2px;
}

.nav {
    display: grid;
    gap: 8px;
}

.nav a {
    border-radius: 7px;
    color: rgba(255, 255, 255, .82);
    font-weight: 700;
    padding: 11px 12px;
    text-decoration: none;
}

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

.app-shell {
    margin-left: 250px;
    min-height: 100vh;
    padding: 32px;
}

.app-shell-full {
    display: grid;
    margin-left: 0;
    place-items: center;
}

.page-heading {
    margin-bottom: 22px;
}

.row-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.eyebrow {
    color: var(--brand-2);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    margin: 0 0 8px;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    color: var(--brand);
    font-size: 34px;
    line-height: 1.15;
    margin-bottom: 8px;
}

h2 {
    font-size: 20px;
    margin-bottom: 6px;
}

p {
    color: var(--muted);
    line-height: 1.55;
}

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

.stat-card,
.panel,
.welcome {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(23, 32, 51, .06);
}

.stat-card {
    padding: 18px;
}

.stat-card small {
    color: var(--muted);
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-card strong {
    color: var(--brand);
    display: block;
    font-size: 30px;
}

.panel,
.welcome {
    padding: 22px;
}

.panel-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 18px;
}

.quick-actions,
.form-actions,
.actions {
    align-items: center;
    display: flex;
    gap: 10px;
}

.quick-actions {
    flex-wrap: wrap;
}

.button,
button {
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    justify-content: center;
    padding: 10px 14px;
    text-decoration: none;
}

.button-light {
    background: #fff;
    color: var(--brand);
}

.actions {
    justify-content: flex-end;
}

.actions a,
.actions button {
    background: #fff;
    border: 1px solid var(--line);
    color: var(--brand);
    font-size: 13px;
    padding: 7px 10px;
    text-decoration: none;
}

.actions form {
    margin: 0;
}

.actions button {
    color: var(--danger);
}

.table-wrap {
    overflow-x: auto;
    padding: 0;
}

table {
    border-collapse: collapse;
    min-width: 760px;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 14px 16px;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #edf1f7;
    color: var(--brand);
    font-size: 13px;
}

.right {
    text-align: right;
}

.badge {
    background: #eef2f7;
    border-radius: 999px;
    color: #42506a;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 9px;
}

.swatch {
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 5px;
    display: inline-block;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
    width: 28px;
}

.thumb {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    height: 44px;
    margin-right: 8px;
    object-fit: contain;
    padding: 4px;
    vertical-align: middle;
    width: 44px;
}

.image-preview {
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 12px;
    padding: 12px;
}

.image-preview img {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 7px;
    height: 86px;
    object-fit: contain;
    padding: 6px;
    width: 86px;
}

.image-preview span {
    color: var(--muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}

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

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

input,
select,
textarea {
    border: 1px solid #cfd7e4;
    border-radius: 7px;
    color: var(--text);
    font: inherit;
    font-weight: 400;
    padding: 10px 11px;
    width: 100%;
}

textarea {
    resize: vertical;
}

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

.check-row {
    align-items: center;
    display: flex;
}

.check-row input {
    width: auto;
}

.alert {
    border-radius: 8px;
    font-weight: 700;
    margin-bottom: 18px;
    padding: 12px 14px;
}

.alert-success {
    background: #e7f7ee;
    color: #176a3a;
}

.alert-danger {
    background: #fde8ec;
    color: var(--danger);
}

.detail-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(280px, .8fr) minmax(360px, 1fr);
    margin-bottom: 22px;
}

.meta-list {
    display: grid;
    gap: 12px;
    margin: 14px 0 0;
}

.meta-list dt {
    color: var(--brand-2);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.meta-list dd {
    color: var(--text);
    line-height: 1.45;
    margin: 0;
}

.compact-form,
.table-edit-form {
    display: grid;
    gap: 10px;
}

.inline-fields {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.table-edit-form {
    min-width: 320px;
}

.delete-row-form {
    margin-top: 10px;
}

.delete-row-form button {
    background: #fff;
    border-color: #f0c7cf;
    color: var(--danger);
    width: 100%;
}

.assignment-panel {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.assignment-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.assignment-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    padding: 14px;
}

@media (max-width: 900px) {
    .sidebar {
        position: static;
        width: auto;
    }

    .app-shell {
        margin-left: 0;
        padding: 20px;
    }

    .stats-grid,
    .detail-grid,
    .assignment-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

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

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