:root {
    --primary: #087f8c;
    --primary-dark: #065f68;
    --accent: #16a3b2;
    --bg: #f1f8f9;
    --text: #173b40;
    --muted: #668287;
    --danger: #c0392b;
    --border: #d5e5e8;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Tahoma, "Noto Sans Thai", Arial, sans-serif;
    color: var(--text);
    background: linear-gradient(145deg, #e8f7f8 0%, #f8fbfc 55%, #eaf4f5 100%);
    min-height: 100vh;
}
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 12px 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand { font-weight: 700; color: var(--primary-dark); }
.container { width: min(1120px, 92%); margin: 32px auto; }
.card {
    background: rgba(255,255,255,.98);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 14px 35px rgba(25, 83, 91, .10);
    padding: 28px;
}
.narrow { max-width: 650px; margin-left: auto; margin-right: auto; }
h1 { margin: 0 0 8px; font-size: 28px; color: var(--primary-dark); }
h2 { margin-top: 0; color: var(--primary-dark); }
.subtitle { color: var(--muted); margin: 0 0 24px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field label { display: block; font-weight: 700; margin-bottom: 7px; font-size: 14px; }
.required::after { content: " *"; color: var(--danger); }
input, select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #b9d0d4;
    border-radius: 9px;
    background: #fff;
    font: inherit;
    color: var(--text);
}
input:focus, select:focus { outline: 3px solid rgba(22,163,178,.15); border-color: var(--accent); }
input[readonly] { background: #eef4f5; color: #45666b; }
.actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
.btn {
    border: 0;
    border-radius: 9px;
    padding: 11px 18px;
    min-height: 42px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    font-weight: 700;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #e5eff1; color: var(--text); }
.btn-small { padding: 8px 13px; min-height: 34px; font-size: 13px; }
.btn-danger { background: #b83c32; color: #fff; }
.alert { padding: 12px 14px; border-radius: 9px; margin-bottom: 18px; }
.alert-error { background: #fff0ee; color: #912c23; border: 1px solid #f0c4bf; }
.alert-success { background: #e9f8ef; color: #176c39; border: 1px solid #bde3ca; }
.review { display: grid; grid-template-columns: 220px 1fr; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.review dt, .review dd { margin: 0; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.review dt { background: #edf6f7; font-weight: 700; }
.review dd { background: #fff; word-break: break-word; }
.review dt:last-of-type, .review dd:last-of-type { border-bottom: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 1050px; background: #fff; }
th, td { padding: 10px 12px; border-bottom: 1px solid #e2ecee; text-align: left; white-space: nowrap; }
th { background: #daf0f2; color: #174f56; position: sticky; top: 0; }
tr:hover td { background: #f5fbfc; }
.toolbar { display: flex; gap: 12px; align-items: end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.toolbar .filters { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.count { color: var(--muted); margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
@media (max-width: 720px) {
    .grid { grid-template-columns: 1fr; }
    .card { padding: 20px; }
    .review { grid-template-columns: 1fr; }
    .review dt { border-bottom: 0; }
    .review dd { border-bottom: 1px solid var(--border); }
}
