:root {
    --ink: #0f4c4a;
    --gold: #b08d3f;
    --paper: #fbf9f3;
    --text: #1b1b18;
    --muted: #6e7169;
    --rule: #e2ddd0;
    --surface: #ffffff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--text);
    font: 15px/1.55 ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.masthead {
    background: var(--ink);
    color: var(--paper);
    padding: 18px 0;
}
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand strong { display: block; letter-spacing: 0.06em; text-transform: uppercase; font-size: 14px; }
.brand em { font-style: normal; font-size: 12.5px; opacity: 0.72; }
.brand .mark {
    width: 28px; height: 28px; flex: none;
    background: var(--gold);
    clip-path: polygon(50% 0, 61% 33%, 95% 33%, 68% 55%, 79% 90%, 50% 68%, 21% 90%, 32% 55%, 5% 33%, 39% 33%);
}

button, .primary, .ghost {
    font: inherit;
    border-radius: 8px;
    cursor: pointer;
    padding: 10px 16px;
    border: 1px solid transparent;
    transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
.ghost { background: transparent; color: var(--paper); border-color: rgba(251, 249, 243, .38); }
.ghost:hover { background: rgba(251, 249, 243, .12); }
.primary {
    background: var(--ink);
    color: var(--paper);
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
}
.primary:hover { background: #0c3d3c; }
.primary:active { transform: scale(.985); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

main { padding-bottom: 64px; }

.flash { padding: 12px 16px; border-radius: 8px; margin-top: 20px; font-size: 14px; }
.flash.ok { background: #e8f1ec; border: 1px solid #bcd8cb; color: #11402f; }
.flash.error { background: #fbeceb; border: 1px solid #e8c3bf; color: #7a2620; }

.actions {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 20px; margin: 28px 0 20px;
}
.actions h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.01em; }
.actions p { margin: 0; color: var(--muted); font-size: 14px; }
.buttons { display: flex; gap: 10px; flex-wrap: wrap; }

.summary {
    display: flex; flex-wrap: wrap; gap: 28px;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-left: 3px solid var(--gold);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 28px;
}
.summary span {
    display: block; font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
}
.summary strong { font-size: 18px; }

fieldset {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 10px;
    padding: 20px 22px 24px;
    margin: 0 0 20px;
}
legend {
    font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
    color: var(--ink); font-weight: 700; padding: 0 8px;
}

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.grid.two { grid-template-columns: 1fr 1fr; margin-top: 10px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

label { display: block; font-size: 12.5px; color: var(--muted); }
label.full { display: block; margin-top: 14px; }
input[type=text], input[type=date], select, textarea {
    width: 100%; margin-top: 5px; padding: 9px 11px;
    border: 1px solid var(--rule); border-radius: 7px;
    font: inherit; font-size: 14px; color: var(--text); background: #fff;
}
input[type=file] { margin-top: 8px; font-size: 12.5px; }
textarea { resize: vertical; line-height: 1.5; }
input:hover, textarea:hover, select:hover { border-color: #c9c3b2; }

.assets .thumb {
    display: flex; align-items: center; justify-content: center;
    height: 92px; margin-top: 6px;
    background: var(--paper); border: 1px dashed var(--rule); border-radius: 8px;
}
.assets .thumb img { max-height: 76px; max-width: 90%; }

.hint { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; }
.hint code { background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; padding: 1px 5px; font-size: 12px; }

table.courses { width: 100%; border-collapse: collapse; margin-top: 6px; }
table.courses th {
    text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
    color: var(--muted); font-weight: 600; padding: 0 6px 6px;
}
table.courses th.n, table.courses td.n { text-align: right; }
table.courses td { padding: 3px 6px; }
table.courses td.n input { text-align: right; }
table.courses input { margin-top: 0; }
table.courses th:nth-child(4), table.courses td:nth-child(4),
table.courses th:nth-child(5), table.courses td:nth-child(5),
table.courses th:nth-child(6), table.courses td:nth-child(6) { width: 84px; }

.save { margin-top: 8px; }
.inline { margin: 0; }

@media (max-width: 760px) {
    .grid, .grid.two, .grid.three { grid-template-columns: 1fr; }
    .masthead .wrap { flex-direction: column; align-items: flex-start; }
    table.courses, table.courses tbody, table.courses tr, table.courses td { display: block; width: 100%; }
    table.courses thead { display: none; }
    table.courses tr { border-bottom: 1px solid var(--rule); padding-bottom: 10px; margin-bottom: 10px; }
    table.courses td.n input { text-align: left; }
}
