/* GRAND Approval – Design-System */
:root {
  --bg: #0a0a0b;
  --surface: #131315;
  --surface-2: #1a1a1d;
  --surface-3: #232327;
  --border: #2b2b31;
  --border-soft: #202024;
  --text: #f4f4f5;
  --text-dim: #a1a1aa;
  --text-faint: #6b6b74;
  --accent: #e8552d;
  --accent-soft: color-mix(in oklab, var(--accent) 18%, transparent);

  --draft: #71717a;
  --review: #3b82f6;
  --changes: #f59e0b;
  --approved: #10b981;
  --scheduled: #a855f7;
  --published: #ec4899;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --shadow: 0 10px 40px -12px rgba(0,0,0,.7);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.45;
  overscroll-behavior-y: none;
}
img, video { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  padding: 9px 15px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; font-weight: 550; font-size: 13.5px;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .08s var(--ease);
  white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-3); border-color: #3a3a42; }
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: color-mix(in oklab, var(--accent) 85%, #fff); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-ok { background: var(--approved); border-color: var(--approved); color: #05231a; }
.btn-warn { background: var(--changes); border-color: var(--changes); color: #2a1a00; }
.btn-danger { color: #f87171; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
.btn-icon { padding: 8px; width: 34px; height: 34px; }

input[type=text], input[type=password], input[type=search], input[type=datetime-local],
input[type=date], input[type=number], textarea, select {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 10px 12px; outline: none;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); background: var(--surface-3); }
textarea { resize: vertical; min-height: 76px; line-height: 1.5; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; font-weight: 550; letter-spacing: .01em; }

.card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-lg); }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.tiny { font-size: 11.5px; }
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; }
.spacer { flex: 1; }
.wrap { flex-wrap: wrap; }
.hidden { display: none !important; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 650; letter-spacing: .02em; text-transform: uppercase;
  border: 1px solid transparent; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.badge.draft     { color: var(--draft);     background: color-mix(in oklab, var(--draft) 15%, transparent); }
.badge.review    { color: var(--review);    background: color-mix(in oklab, var(--review) 15%, transparent); }
.badge.changes   { color: var(--changes);   background: color-mix(in oklab, var(--changes) 16%, transparent); }
.badge.approved  { color: var(--approved);  background: color-mix(in oklab, var(--approved) 15%, transparent); }
.badge.scheduled { color: var(--scheduled); background: color-mix(in oklab, var(--scheduled) 16%, transparent); }
.badge.published { color: var(--published); background: color-mix(in oklab, var(--published) 15%, transparent); }

.avatar {
  border-radius: 99px; background: linear-gradient(135deg, #3f3f46, #18181b);
  display: grid; place-items: center; font-weight: 700; flex: none; overflow: hidden;
  font-size: 12px; letter-spacing: .02em; color: #e4e4e7;
}

dialog {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: var(--r-lg); padding: 0; max-width: min(560px, calc(100vw - 32px));
  width: 100%; box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0,0,0,.66); backdrop-filter: blur(3px); }
dialog .dlg-head { padding: 18px 20px 0; font-weight: 650; font-size: 16px; }
dialog .dlg-body { padding: 16px 20px; }
dialog .dlg-foot { padding: 14px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; }

#toasts { position: fixed; bottom: 18px; left: 50%; translate: -50% 0; z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: var(--surface-3); border: 1px solid var(--border); padding: 10px 16px;
  border-radius: 99px; box-shadow: var(--shadow); font-size: 13px; font-weight: 550;
  animation: toastIn .25s var(--ease);
}
.toast.err { border-color: #7f1d1d; color: #fca5a5; }
.toast.ok { border-color: color-mix(in oklab, var(--approved) 50%, var(--border)); }
@keyframes toastIn { from { opacity: 0; translate: 0 12px; } }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: sk 1.4s infinite; border-radius: var(--r-sm); }
@keyframes sk { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
