/* etisalat Design Workflow: dark UI for the PO page and Manage. */
:root {
  color-scheme: dark;
  --bg: #0D0A14;
  --bg-2: #120E1B;
  --surface: #181322;
  --surface-2: #201A2D;
  --surface-3: #2A2339;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #F4F2F8;
  --subtle: #B3AEC0;
  --muted: #827C92;
  --brand: #E00800;
  --brand-hi: #FF3B2F;
  --brand-soft: rgba(224, 8, 0, .14);
  --ok: #3FCB7E;  --ok-soft: rgba(63, 203, 126, .13);
  --warn: #F2B544; --warn-soft: rgba(242, 181, 68, .13);
  --bad: #FF6B5E;  --bad-soft: rgba(255, 107, 94, .13);
  --info: #6CB6FF; --info-soft: rgba(108, 182, 255, .13);
  --violet: #A98BFF; --violet-soft: rgba(169, 139, 255, .14);
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35), 0 1px 0 rgba(255, 255, 255, .03) inset;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--brand-soft); }
:focus-visible { outline: 2px solid var(--brand-hi); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; height: 80px; padding: 0 24px;
  background: rgba(13, 10, 20, .82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 10px; color: var(--text); font-weight: 600; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--brand); font-size: 21px; font-weight: 800; letter-spacing: -.5px; }
.brand span { color: var(--subtle); font-size: 14px; }
.topbar .grow { flex: 1; }
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); padding: 4px; border-radius: 999px; }
.tabs button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; color: var(--subtle); cursor: pointer; font-size: 14px; font-weight: 500; }
.tabs button[aria-selected="true"] { background: var(--surface-3); color: var(--text); }
.tabs button:hover { color: var(--text); }

/* Buttons and fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #F20D04; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--subtle); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.ok { background: var(--ok-soft); border-color: rgba(63, 203, 126, .35); color: var(--ok); }
.btn.danger { background: transparent; border-color: rgba(255, 107, 94, .35); color: var(--bad); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.input, .textarea, .select { width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; color: var(--text); transition: border-color .15s, background .15s; }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: rgba(255, 59, 47, .7); background: #150F1F; box-shadow: 0 0 0 3px var(--brand-soft); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input[type="date"] { color-scheme: dark; }
.label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.req { color: var(--brand-hi); margin-left: 3px; }
.hint { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.field { margin-bottom: 22px; }
.field.invalid .input, .field.invalid .textarea, .field.invalid .chips { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); border-radius: 10px; }
.field .err { display: none; color: var(--bad); font-size: 13px; margin-top: 6px; }
.field.invalid .err { display: block; }

/* Chips (single / multi choice) and score */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--subtle); cursor: pointer; font-size: 14px; transition: all .15s; }
.chip span:hover { border-color: rgba(255, 255, 255, .28); color: var(--text); }
.chip input:checked + span { background: var(--brand-soft); border-color: rgba(255, 59, 47, .7); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--brand-hi); outline-offset: 2px; }
.score { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.score .chip span { width: 100%; flex-direction: column; align-items: flex-start; border-radius: 12px; padding: 10px 12px; gap: 2px; }
.score .chip b { font-size: 18px; color: var(--text); }
.score .chip small { font-size: 12px; }

/* Cards, pills, avatars */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--subtle); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.violet { background: var(--violet-soft); color: var(--violet); }
.pill.brand { background: var(--brand-soft); color: var(--brand-hi); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-size: 11px; font-weight: 700; color: #fff; background: #4B3F68; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 36px; height: 36px; font-size: 13px; }
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.kbd { font-size: 12px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 0 5px; }

/* Toast */
#toasts { position: fixed; bottom: 22px; right: 22px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--surface-3); border: 1px solid var(--line-2); border-left: 3px solid var(--info); padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 380px; font-size: 14px; animation: up .2s ease; }
.toast.ok { border-left-color: var(--ok); } .toast.bad { border-left-color: var(--bad); }
@keyframes up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: #3A3249 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #3A3249; border-radius: 10px; border: 2px solid var(--bg); }

/* Narrow windows: let the top bar wrap instead of running off the edge */
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; row-gap: 8px; }
  .topbar .grow { display: none; }
  .brand span { display: none; }
  .tools { flex-wrap: wrap; }
  .search input { width: 150px; }
}

/* The etisalat logo, the same size and place on every page: top left, 24px in, in an 80px band. */
.app-brand { display: inline-flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; text-decoration: none !important; color: inherit; }
.app-brand img { height: 20px; width: auto; display: block; }
.app-brand span { font-size: 11px; font-weight: 600; letter-spacing: .04em; color: rgba(255,255,255,.55); white-space: nowrap; }
