:root {
    color-scheme: light;
    --ink: #17202a;
    --muted: #667085;
    --line: #d9e0e8;
    --panel: #ffffff;
    --page: #f5f7fa;
    --accent: #0f766e;
    --accent-dark: #115e59;
    --danger: #b42318;
    --warning: #b54708;
    --success: #027a48;
}

* {
    box-sizing: border-box;
}

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

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

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

.brand {
    color: var(--ink);
    display: block;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
}

.subtitle {
    color: var(--muted);
    display: block;
    font-size: 13px;
    margin-top: 2px;
}

nav {
    align-items: center;
    display: flex;
    gap: 14px;
}

.user-label {
    color: var(--muted);
    font-size: 13px;
}

.page {
    margin: 0 auto;
    max-width: 1100px;
    padding: 28px 16px 56px;
}

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

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

.toolbar h1,
.detail-header h1 {
    font-size: 28px;
    line-height: 1.15;
    margin: 0;
}

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

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

.button.secondary {
    background: #ffffff;
    color: var(--accent-dark);
}

.button.danger,
button.danger {
    background: var(--danger);
    border-color: var(--danger);
}

.notice {
    background: #ecfdf3;
    border: 1px solid #abefc6;
    border-radius: 6px;
    color: var(--success);
    margin-bottom: 16px;
    padding: 12px 14px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

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

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

th {
    background: #f9fafb;
    color: #344054;
    font-size: 13px;
}

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

.empty {
    color: var(--muted);
    padding: 28px;
    text-align: center;
}

.badge {
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 9px;
}

.badge.new,
.badge.scheduled {
    background: #eff8ff;
    color: #175cd3;
}

.badge.in-progress {
    background: #fff8e6;
    color: var(--warning);
}

.badge.completed {
    background: #ecfdf3;
    color: var(--success);
}

.badge.cancelled {
    background: #fef3f2;
    color: var(--danger);
}

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

.field.full {
    grid-column: 1 / -1;
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

input,
select,
textarea {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font: inherit;
    min-height: 42px;
    padding: 9px 10px;
    width: 100%;
}

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

.error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 5px;
}

.error-box {
    background: #fef3f2;
    border: 1px solid #fecdca;
    border-radius: 6px;
    color: var(--danger);
    margin: 14px 0;
    padding: 11px 12px;
}

.actions {
    align-items: center;
    display: flex;
    gap: 10px;
    padding: 0 22px 22px;
}

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

.detail-grid {
    display: grid;
    gap: 0;
    grid-template-columns: 220px 1fr;
}

.detail-grid div {
    border-bottom: 1px solid var(--line);
    padding: 13px 16px;
}

.detail-grid div:nth-child(odd) {
    background: #f9fafb;
    color: #344054;
    font-weight: 700;
}

.status-form {
    align-items: center;
    display: flex;
    gap: 10px;
}

.login-wrap {
    display: grid;
    min-height: 60vh;
    place-items: center;
}

.login-panel {
    max-width: 430px;
    padding: 24px;
    width: 100%;
}

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

.login-panel .field {
    margin-top: 16px;
}

.login-panel button {
    margin-top: 18px;
    width: 100%;
}

.check-row {
    align-items: center;
    display: flex;
    font-weight: 400;
    gap: 8px;
    margin-top: 14px;
}

.check-row input {
    min-height: auto;
    width: auto;
}

.user-admin {
    margin-bottom: 22px;
    padding: 20px;
}

.user-admin h2 {
    font-size: 20px;
    margin: 0 0 16px;
}

.user-row {
    align-items: end;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 12px;
    grid-template-columns: 1.2fr 1fr 1.2fr 150px 90px 90px;
    padding: 16px 0;
}

.user-row:first-of-type {
    border-top: 0;
}

@media (max-width: 760px) {
    .topbar,
    .toolbar,
    .detail-header {
        align-items: stretch;
        flex-direction: column;
    }

    nav,
    .toolbar-actions,
    .status-form,
    .actions {
        align-items: stretch;
        flex-direction: column;
    }

    .form-grid,
    .detail-grid,
    .user-row {
        grid-template-columns: 1fr;
    }

    .detail-grid div:nth-child(odd) {
        border-bottom: 0;
        padding-bottom: 4px;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead {
        display: none;
    }

    tr {
        border-bottom: 1px solid var(--line);
        padding: 12px;
    }

    td {
        border-bottom: 0;
        padding: 6px 0;
    }
}
