:root {
    --ink: #1c2530;
    --muted: #6b7684;
    --line: #e2e6ea;
    --bg: #f4f6f8;
    --card: #ffffff;
    --brand: #14532d;
    --brand-accent: #1fae6f;
    --danger: #c0392b;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Cairo', 'Tahoma', 'Segoe UI', sans-serif;
    line-height: 1.7;
}

.page {
    max-width: 860px;
    margin: 0 auto;
    padding: 24px 16px 64px;
}

.brand-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 4px 22px;
}

.brand-bar .brand {
    font-size: 22px;
    font-weight: 800;
    color: var(--ink);
}

.brand-bar .brand span {
    color: var(--brand-accent);
}

.brand-bar .subtitle {
    color: var(--muted);
    font-size: 14px;
}

.title-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px 24px;
    margin-bottom: 20px;
}

.title-card h1 {
    margin: 0 0 8px;
    font-size: 24px;
}

.title-card p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
}

.notice {
    background: #fff8e6;
    border: 1px solid #f0dca0;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 14px;
    color: #6b4f00;
    margin-bottom: 20px;
}

.section {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    margin-bottom: 18px;
    overflow: hidden;
}

.section-header {
    background: var(--ink);
    color: #fff;
    padding: 14px 20px;
    font-weight: 700;
    font-size: 16px;
}

.section-body {
    padding: 20px;
}

.field {
    margin-bottom: 16px;
}

.field label.main {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 14.5px;
}

.field .hint {
    color: var(--muted);
    font-size: 12.5px;
    margin-top: 4px;
}

.row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.row .field {
    flex: 1 1 220px;
}

input[type=text],
input[type=number],
input[type=date],
input[type=tel],
input[type=file],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfd6dd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14.5px;
    background: #fff;
    color: var(--ink);
}

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

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px rgba(31, 174, 111, 0.15);
}

.rank-grid {
    display: grid;
    grid-template-columns: 1fr 90px;
    gap: 8px 14px;
    align-items: center;
}

.rank-grid .goal-name { font-size: 14.5px; }

.rank-grid input {
    text-align: center;
}

.radio-list, .checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-list label, .checkbox-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14.5px;
    font-weight: 400;
    cursor: pointer;
}

.table-wrap {
    overflow-x: auto;
    margin-bottom: 4px;
}

table.grid {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

table.grid th, table.grid td {
    border: 1px solid var(--line);
    padding: 8px;
    text-align: center;
    font-size: 13.5px;
}

table.grid th {
    background: #eef1f4;
    font-weight: 700;
}

table.grid td:first-child, table.grid th:first-child {
    text-align: right;
    white-space: nowrap;
}

table.grid select, table.grid input {
    padding: 6px 8px;
    font-size: 13px;
    min-width: 90px;
}

.inline-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 700;
}

.actions {
    text-align: center;
    margin-top: 26px;
}

button.submit {
    background: var(--brand-accent);
    color: #fff;
    border: none;
    padding: 14px 42px;
    font-size: 17px;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
}

button.submit:hover { background: #17925c; }

.required { color: var(--danger); }

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 560px) {
    .two-col { grid-template-columns: 1fr; }
}

footer.note {
    text-align: center;
    color: var(--muted);
    font-size: 12.5px;
    margin-top: 30px;
}

/* admin */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
.admin-table th, .admin-table td {
    border: 1px solid var(--line);
    padding: 10px;
    font-size: 13.5px;
    text-align: right;
}
.admin-table th { background: #eef1f4; }
.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 10px;
}
.btn {
    display: inline-block;
    background: var(--ink);
    color: #fff;
    padding: 9px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
}
.btn.alt { background: var(--brand-accent); }
.login-box {
    max-width: 380px;
    margin: 80px auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 28px;
}
.error-box {
    background: #fdecea;
    border: 1px solid #f5b4ac;
    color: var(--danger);
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 14px;
}
