:root {
    --bg: #f4f2ee;
    --panel: #ffffff;
    --text: #251f1b;
    --muted: #6f6860;
    --line: #ded8cf;
    --primary: #7d1f2f;
    --primary-hover: #5f1724;
    --danger: #a51d2d;
    --focus: #d9a441;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

a {
    color: var(--primary);
}

code {
    background: #f0ebe4;
    border-radius: 4px;
    padding: 1px 5px;
}

pre {
    margin: 0;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #2b2520;
    color: #fff8ed;
    padding: 16px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    padding: 22px clamp(16px, 4vw, 42px);
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.admin-header h1,
.panel h2,
.login-box h1 {
    margin: 0;
    line-height: 1.2;
}

.admin-header p,
.panel-header p {
    margin: 4px 0 0;
    color: var(--muted);
}

.admin-header nav {
    display: flex;
    gap: 14px;
    white-space: nowrap;
}

.admin-layout {
    display: grid;
    gap: 18px;
    width: min(1180px, calc(100% - 32px));
    margin: 22px auto 48px;
}

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

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

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

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

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

th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

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

input,
select,
textarea {
    width: 100%;
    min-height: 40px;
    border: 1px solid #cfc6ba;
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font: inherit;
    padding: 8px 10px;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--focus);
    outline-offset: 1px;
}

.grid-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

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

.weekly-form {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.weekly-form label {
    grid-template-columns: 110px 1fr;
    align-items: center;
}

.inline-form {
    display: flex;
    max-width: 460px;
}

.checkbox-line {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    min-height: 40px;
}

.checkbox-line input {
    width: auto;
    min-height: 0;
}

.form-actions {
    display: flex;
    align-items: end;
    gap: 10px;
}

button,
.button-primary {
    min-height: 40px;
    border: 0;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 8px 14px;
}

button:hover,
.button-primary:hover {
    background: var(--primary-hover);
}

button:disabled {
    cursor: not-allowed;
    opacity: .5;
}

.button-link {
    min-height: 0;
    padding: 0;
    background: transparent;
    color: var(--danger);
}

.button-link:hover {
    background: transparent;
    text-decoration: underline;
}

.actions {
    white-space: nowrap;
}

.notice {
    border-radius: 8px;
    padding: 12px 14px;
}

.notice-error {
    border: 1px solid #e2a7ad;
    background: #fff0f2;
    color: #6e1824;
}

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

.login-box {
    display: grid;
    gap: 14px;
    width: min(420px, 100%);
}

.login-box .panel {
    display: grid;
    gap: 14px;
}

@media (max-width: 820px) {
    .admin-header,
    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .grid-form .wide {
        grid-column: auto;
    }

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