/* Dahab ERP — tokens and page styles */
:root {
    --ink: #251f21;
    --ink-2: #585254;
    --ink-3: #8b8486;
    --hairline: #eae9ea;
    --page: #ffffff;
    --sand: #f4efec;
    --teal: #73a89a;
    --teal-deep: #3f6f63;
    --teal-wash: rgba(115, 168, 154, 0.12);
    --red: #ed313e;
    --ochre: #d8b76a;
    --ochre-wash: #fbf4e2;
    --ochre-ink: #7a5f1f;
    --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--sand);
    color: var(--ink);
    font-family: "Noto Sans Arabic", "Segoe UI", Tahoma, -apple-system, Arial, sans-serif;
    font-size: 14px;
    line-height: 24px;
}
bdi { font-variant-numeric: tabular-nums; }
a { color: inherit; }

.shell { max-width: 1040px; margin: 0 auto; padding: 24px 16px 64px; }
.card { background: var(--page); border-radius: 16px; padding: 20px 16px 28px; }
@media (min-width: 768px) { .shell { padding: 32px 24px 72px; } .card { padding: 32px 36px 40px; } }

h1 { font-size: 24px; line-height: 1.3; margin: 0 0 6px; font-weight: 700; }
@media (min-width: 768px) { h1 { font-size: 30px; } }
.sub { color: var(--ink-2); margin: 0 0 4px; font-size: 13px; }
.intro { color: var(--ink-2); margin: 12px 0 0; max-width: 62ch; }
h2 { font-size: 19px; margin: 28px 0 4px; }
h3 { font-size: 15px; margin: 0; }
p { margin: 8px 0; }

.nav { display: flex; flex-wrap: wrap; gap: 18px; border-bottom: 1px solid var(--hairline); margin-top: 18px; }
.nav a { padding: 10px 0; color: var(--ink-2); text-decoration: none; font-size: 14px; }
.nav a.on { color: var(--ink); box-shadow: inset 0 -1px 0 var(--ink); }
@media (max-width: 600px) { .nav a { min-height: 44px; display: inline-flex; align-items: center; } }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0 0; }
.stat { border: 1px solid var(--hairline); border-radius: var(--radius); padding: 12px; }
.stat .label { font-size: 12px; color: var(--ink-2); line-height: 18px; }
.stat .value { font-size: 18px; font-weight: 600; margin-top: 4px; }
.stat .note { font-size: 12px; color: var(--ink-2); margin-top: 4px; line-height: 18px; }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 14px; } .stat .value { font-size: 20px; } }

.panel { border: 1px solid var(--hairline); border-radius: var(--radius); padding: 16px; margin-top: 18px; }
.panel .hint { font-size: 13px; color: var(--ink-2); margin: 4px 0 12px; }
@media (min-width: 768px) { .panel { padding: 20px; } }

.form { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
@media (min-width: 600px) { .form { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 12px; color: var(--ink-2); }
input, select, textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #cfcbcc;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-family: inherit;
    font-size: 15px;
}
select { text-align: right; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; grid-column: 1 / -1; margin-top: 4px; }
button {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 8px;
    border: 1px solid var(--ink);
    background: var(--ink);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
button.ghost { background: #fff; color: var(--ink); border-color: #cfcbcc; }
button:disabled { opacity: 0.5; cursor: default; }
.linkbtn { border: 0; background: none; padding: 0; min-height: 0; color: var(--ink-2); font-weight: 400; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; min-height: 44px; }
.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--teal); }

.tablewrap { margin-top: 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data caption { text-align: right; font-size: 12px; color: var(--ink-2); padding-bottom: 6px; }
table.data th, table.data td { padding: 9px 8px; border-bottom: 1px solid var(--hairline); text-align: right; white-space: nowrap; }
table.data th { font-size: 12px; color: var(--ink-2); font-weight: 600; }
table.data th:first-child, table.data td:first-child { white-space: normal; }
.scroll { overflow-x: auto; }

.cards { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rcard { border: 1px solid var(--hairline); border-radius: var(--radius); padding: 12px; }
.rcard .t { font-weight: 600; font-size: 14px; }
.rcard dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 8px 0 0; }
.rcard dt { font-size: 11px; color: var(--ink-2); }
.rcard dd { margin: 2px 0 0; font-size: 14px; }
.only-wide { display: none; }
.only-narrow { display: block; }
@media (min-width: 720px) { .only-wide { display: block; } .only-narrow { display: none; } }

.money { white-space: nowrap; }
.money b { font-weight: 600; }
.cur { font-size: 11px; color: var(--ink-2); }
.badge { display: inline-block; font-size: 12px; line-height: 20px; padding: 1px 8px; border-radius: 999px; border: 1px solid #cfcbcc; color: var(--ink-2); white-space: nowrap; }
.badge.ok { border-color: var(--teal); color: var(--teal-deep); background: var(--teal-wash); }
.badge.wait { border-color: var(--ochre); color: var(--ochre-ink); background: var(--ochre-wash); }

.msg { font-size: 13px; margin: 12px 0 0; }
.msg.ok { color: var(--teal-deep); }
.msg.err { color: var(--red); }
.note { font-size: 13px; color: var(--ink-2); margin: 12px 0 0; line-height: 21px; }

.bars { display: flex; align-items: flex-end; gap: 16px; height: 160px; margin: 18px 0 6px; padding: 0 4px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.bar .fill { width: 100%; max-width: 72px; background: var(--ink-2); border-radius: 4px 4px 0 0; }
.bar .v { font-size: 12px; color: var(--ink-2); }
.bar .l { font-size: 12px; color: var(--ink-2); }

.callout { border: 1px solid var(--hairline); background: var(--sand); border-radius: var(--radius); padding: 14px 16px; margin-top: 18px; }
.callout h4 { margin: 0 0 6px; font-size: 14px; }
.callout ul { margin: 0; padding-inline-start: 18px; font-size: 13px; line-height: 22px; }

.lines { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.line { border: 1px solid var(--hairline); border-radius: var(--radius); padding: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.line .field:first-child { grid-column: 1 / -1; }
.line .lt { display: flex; flex-direction: column; gap: 6px; }
.line .lt span { font-size: 12px; color: var(--ink-2); }
@media (min-width: 720px) { .line { grid-template-columns: 2fr 1fr 1fr 1fr; align-items: end; } .line .field:first-child { grid-column: auto; } }

.totals { margin: 16px 0 0; }
.totals div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid var(--hairline); font-size: 14px; }
.totals div span:first-child { color: var(--ink-2); }
.totals .grand { font-weight: 600; font-size: 15px; }
.totals .grand span:first-child { color: var(--ink); }

.login { max-width: 420px; margin: 8vh auto; background: #fff; border-radius: 16px; padding: 28px 22px; }
.login h1 { font-size: 22px; }
.footer { color: var(--ink-3); font-size: 12px; margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12px; color: var(--ink-2); }
