/* Orii Content UI — shared styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #F8FAFC;
  --surface:   #ffffff;
  --border:    rgba(15,23,42,0.08);
  --text:      #0F172A;
  --muted:     #475569;
  --accent:    #4F46E5;
  --accent-fg: #ffffff;
  --danger:    #DC2626;
  --success:   #16A34A;
  --warn:      #D97706;
  --radius:    8px;
  --shadow:    0 1px 3px rgba(15,23,42,.08);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* ── Layout ──────────────────────────────────────── */
.app       { display: flex; min-height: 100vh; }
.sidebar   { width: 220px; background: var(--surface); border-right: 1px solid var(--border); padding: 24px 16px; flex-shrink: 0; }
.main      { flex: 1; padding: 32px 40px; max-width: 900px; }
.page      { max-width: 640px; margin: 80px auto; padding: 0 16px; }

/* ── Nav ─────────────────────────────────────────── */
.brand { font-weight: 700; letter-spacing: -.3px; font-size: 16px; margin-bottom: 28px; }
.nav a { display: block; padding: 6px 8px; border-radius: var(--radius); color: var(--muted); text-decoration: none; font-size: 13px; margin-bottom: 2px; }
.nav a:hover, .nav a.active { background: var(--bg); color: var(--text); }
.nav-section { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 16px 8px 6px; }

/* ── Cards ───────────────────────────────────────── */
.card      { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card-row  { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-body { flex: 1; }

/* ── Typography ──────────────────────────────────── */
h1 { font-size: 22px; font-weight: 700; margin-bottom: 20px; }
h2 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
h3 { font-size: 14px; font-weight: 600; }
p  { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ── Badges ──────────────────────────────────────── */
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: .3px; }
.badge-draft           { background: #f0f0ee; color: #555; }
.badge-awaiting        { background: #fef3c7; color: var(--warn); }
.badge-approved        { background: #d1fae5; color: var(--success); }
.badge-rejected        { background: #fee2e2; color: var(--danger); }
.badge-scheduled       { background: #dbeafe; color: #1d4ed8; }
.badge-published       { background: #e0e7ff; color: #4338ca; }

/* ── Buttons ─────────────────────────────────────── */
button, .btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius); font-size: 13px; font-weight: 500; cursor: pointer; border: none; transition: opacity .15s; }
button:hover, .btn:hover { opacity: .85; }
button:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary   { background: var(--accent); color: var(--accent-fg); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-ghost     { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-sm        { padding: 4px 10px; font-size: 12px; }
.btn-group     { display: flex; gap: 8px; }

/* ── Forms ───────────────────────────────────────── */
.form-group  { margin-bottom: 16px; }
label        { display: block; font-weight: 500; font-size: 13px; margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; font-family: inherit; background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 200px; resize: vertical; }

/* ── Misc ────────────────────────────────────────── */
.empty    { text-align: center; color: var(--muted); padding: 48px 0; font-size: 13px; }
.loader   { text-align: center; color: var(--muted); padding: 40px; font-size: 13px; }
.error    { background: #fee2e2; color: var(--danger); padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }
.success  { background: #d1fae5; color: var(--success); padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }
.divider  { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.char-count { font-size: 11px; color: var(--muted); text-align: right; margin-top: 4px; }
.char-count.over { color: var(--danger); }
.copy-btn   { font-size: 11px; padding: 3px 8px; }
.post-body  { white-space: pre-wrap; font-size: 13px; line-height: 1.6; }

/* ── Login page ──────────────────────────────────── */
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 40px; box-shadow: var(--shadow); }
.login-brand { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.login-sub   { color: var(--muted); font-size: 13px; margin-bottom: 28px; }

/* ── Tab nav ─────────────────────────────────────── */
.tabs      { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab       { padding: 8px 16px; font-size: 13px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; border-top: none; border-left: none; border-right: none; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }

/* ── Topic priority dot ──────────────────────────── */
.prio-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; margin-top: 4px; }
.prio-high { background: #16a34a; }
.prio-mid  { background: #d97706; }
.prio-low  { background: #9ca3af; }

/* ── Filters ─────────────────────────────────────── */
.filter-bar { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-btn { padding: 5px 12px; font-size: 12px; border-radius: 20px; background: var(--bg); border: 1px solid var(--border); cursor: pointer; color: var(--muted); }
.filter-btn.active { background: var(--accent); color: #fff; border-color: transparent; }

/* ── Posts table ─────────────────────────────────── */
.posts-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.posts-table th { text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
.posts-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.post-row { cursor: pointer; }
.post-row:hover td { background: var(--bg); }
.post-expand-row td { background: #fafaf8; padding: 0; border-bottom: 1px solid var(--border); }
.post-expand-body { padding: 16px 20px; }
.post-title-cell { display: block; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-awaitingapproval { background: #fef3c7; color: var(--warn); }
