/* Shared tokens and controls for admin + committee pages.
   --brand / --accent / --stage are injected from settings (theme_style_tag). */
:root {
  --brand: #0f7a4a;
  --accent: #d4a63a;
  --stage: #07140f;
  --ink: #14201b;
  --ink-2: #4b5a53;
  --ink-3: #7d8b85;
  --line: #e3e8e5;
  --line-2: #eef2f0;
  --paper: #ffffff;
  --canvas: #f5f7f6;
  --ok: #138a52;
  --warn: #b7791f;
  --warn-bg: #fdf6e7;
  --danger: #c0392b;
  --danger-bg: #fdeeec;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .05), 0 6px 24px -8px rgba(16, 24, 20, .12);
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --brand-soft: color-mix(in srgb, var(--brand) 10%, white);
  --brand-deep: color-mix(in srgb, var(--brand) 75%, black);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.3; margin: 0; font-weight: 700; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  background: var(--brand); color: #fff;
  transition: background .15s, box-shadow .15s, transform .05s;
  white-space: nowrap; text-decoration: none !important;
}
.btn:hover { background: var(--brand-deep); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--line-2); }
.btn-danger { background: var(--paper); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, white); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 8px; }
.btn svg { width: 16px; height: 16px; flex: none; }

/* Forms */
label { display: block; font-weight: 600; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.input, input[type=text], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink); font: inherit; font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 10px 12px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
input[type=color] {
  width: 44px; height: 42px; padding: 3px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--paper); cursor: pointer;
}
input[type=file] { font: inherit; font-size: 13px; }
.field { margin-bottom: 14px; }
.field-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.field-row > .field { flex: 1 1 160px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); cursor: pointer; margin: 0; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* Cards and notices */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.notice { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 12px; border: 1px solid; }
.notice-ok { background: color-mix(in srgb, var(--ok) 8%, white); border-color: color-mix(in srgb, var(--ok) 25%, white); color: #0c5a36; }
.notice-error { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 25%, white); color: #8e2a20; }
.notice-warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 30%, white); color: #7a5213; }
.notice ul { margin: 6px 0 0; padding-inline-start: 18px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--line-2); color: var(--ink-2);
}
.badge-ok { background: color-mix(in srgb, var(--ok) 12%, white); color: var(--ok); }
.badge-wait { background: var(--warn-bg); color: var(--warn); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center; overflow: hidden;
  background: var(--c, var(--brand)); color: #fff; font-weight: 700; font-size: 15px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Toast */
.toast {
  position: fixed; inset-inline: 0; bottom: 24px; margin: auto; width: max-content; max-width: calc(100% - 32px);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 100;
  opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }
