:root {
    --ns-plum: #642536;
    --ns-gold: #E5AD38;
    --ns-charcoal: #302A29;
    --ns-cream: #E8D5C0;
    --ns-camel: #C58D66;
    --ns-bg: #faf6f1;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", "Noto Kufi Arabic", Tahoma, sans-serif;
    background: var(--ns-bg);
    color: var(--ns-charcoal);
    line-height: 1.7;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 22px;
    background: var(--ns-plum);
    color: #fff;
}

.brand { display: grid; }
.brand span { font-size: 0.85em; opacity: 0.85; }

#topnav { display: flex; gap: 6px; flex-wrap: wrap; }
#topnav a, #topnav button {
    font: inherit;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 999px;
    padding: 6px 14px;
    text-decoration: none;
    cursor: pointer;
}
#topnav a.is-on, #topnav a:hover, #topnav button:hover { background: rgba(255,255,255,0.15); }

main { max-width: 980px; margin: 0 auto; padding: 24px 16px 60px; }

.footer { text-align: center; color: #8a7a6e; font-size: 0.85em; padding: 20px; }

.card {
    background: #fff;
    border: 1px solid var(--ns-cream);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 18px;
}

h1, h2, h3 { color: var(--ns-plum); line-height: 1.4; }

.muted { color: #7a6a5e; font-size: 0.92em; }

form.stack, .stack { display: grid; gap: 14px; }

label.field { display: grid; gap: 6px; font-weight: 600; }

input, textarea, select {
    font: inherit;
    font-weight: 400;
    padding: 10px 12px;
    border: 1px solid var(--ns-cream);
    border-radius: 10px;
    background: #fff;
    color: var(--ns-charcoal);
    width: 100%;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--ns-gold); border-color: var(--ns-camel); }

.btn {
    font: inherit;
    font-weight: 700;
    padding: 10px 22px;
    border-radius: 10px;
    border: none;
    background: var(--ns-plum);
    color: #fff;
    cursor: pointer;
    width: fit-content;
}
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: #fff; color: var(--ns-plum); border: 1.5px solid var(--ns-plum); }
.btn.small { padding: 6px 14px; font-size: 0.9em; }

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

.error { color: var(--ns-plum); font-weight: 700; }
.ok-msg { color: #2e5c2e; font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    font: inherit;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--ns-camel);
    background: #fff;
    color: var(--ns-plum);
    cursor: pointer;
}
.chip.is-on { background: var(--ns-plum); border-color: var(--ns-plum); color: #fff; }

.badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85em;
    white-space: nowrap;
}
.badge.l1 { background: var(--ns-cream); }
.badge.l2 { background: var(--ns-gold); }
.badge.l3 { background: var(--ns-plum); color: #fff; }
.badge.ok { background: #dcead9; color: #2e5c2e; }
.badge.warn { background: var(--ns-gold); }
.badge.pending { background: var(--ns-cream); }

.classify { padding: 10px 14px; border-radius: 10px; background: var(--ns-cream); font-weight: 600; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 2px solid var(--ns-cream); padding-bottom: 10px; margin-bottom: 18px; }
.tab {
    font: inherit;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 999px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--ns-charcoal);
}
.tab.is-on { background: var(--ns-plum); color: #fff; }

table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: right; padding: 10px 8px; border-bottom: 1px solid var(--ns-cream); vertical-align: top; }
table.list th { color: var(--ns-plum); }

.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 8px; }
.steps li { display: flex; gap: 10px; align-items: baseline; }
.steps li::before {
    counter-increment: step;
    content: counter(step, arabic-indic);
    background: var(--ns-cream);
    color: var(--ns-plum);
    font-weight: 700;
    border-radius: 50%;
    min-width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.callout {
    border-radius: 12px;
    padding: 14px 16px;
    background: var(--ns-cream);
    margin-bottom: 14px;
}
.callout.info { background: #e9e4f0; }
.callout.warn { background: #f6e8c9; }

.two-col { display: grid; gap: 14px; }
@media (min-width: 720px) { .two-col { grid-template-columns: 1fr 1fr; } }
