:root {
  --navy: #0f2a3f;
  --navy-light: #14415f;
  --teal: #0f9e75;
  --teal-dark: #0c7e5e;
  --bg: #f5f7f6;
  --card: #ffffff;
  --border: #e1e5e3;
  --text: #16211d;
  --text-muted: #5c6b65;
  --amber: #c98a1d;
  --red: #c0392b;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- Login ---------- */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 2px 12px rgba(15, 42, 63, 0.06);
}

.login-card h1 {
  font-size: 20px;
  margin: 0 0 4px;
  color: var(--navy);
}

.login-card p.sub {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 14px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--navy);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}

.field textarea {
  resize: vertical;
  min-height: 90px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.15s ease;
}

.btn:hover { opacity: 0.9; }

.btn-primary {
  background: var(--teal);
  color: #fff;
  width: 100%;
}

.btn-approve {
  background: var(--teal);
  color: #fff;
}

.btn-reject {
  background: #fff;
  color: var(--red);
  border-color: var(--red);
}

.btn-secondary {
  background: #fff;
  color: var(--navy);
  border-color: var(--border);
}

.error-msg {
  color: var(--red);
  font-size: 13px;
  margin-top: 10px;
  min-height: 16px;
}

/* ---------- App shell ---------- */
#app-screen {
  min-height: 100vh;
}

header.topbar {
  background: var(--navy);
  color: #fff;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header.topbar .brand {
  display: flex;
  flex-direction: column;
}

header.topbar .brand strong {
  font-size: 16px;
}

header.topbar .brand span {
  font-size: 12px;
  color: #a9c3ba;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}

.topbar-right .who {
  color: #cfe3dc;
}

main.content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  border: 1px solid var(--border);
  background: #fff;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-muted);
}

.filter-btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.draft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.draft-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.draft-card:hover {
  box-shadow: 0 4px 14px rgba(15, 42, 63, 0.08);
  border-color: #c9d5d0;
}

.tag-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 5px;
}

.tag-blog { background: #e6f1fb; color: #185fa5; }
.tag-linkedin { background: #e6f1fb; color: #0c447c; }
.tag-email { background: #eaf3de; color: #3b6d11; }
.tag-press { background: #fbeaf0; color: #993556; }

.status-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 5px;
}

.status-pending { background: #f1efe8; color: #5f5e5a; }
.status-approved { background: #e1f5ee; color: #0f6e56; }
.status-rejected { background: #faece7; color: #993c1d; }

.draft-card h3 {
  font-size: 15px;
  margin: 0 0 6px;
  color: var(--navy);
}

.draft-card p.meta {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 20px;
  font-size: 14px;
}

/* ---------- Modal / Drawer ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 42, 63, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  z-index: 50;
}

.overlay.center {
  align-items: center;
  justify-content: center;
}

.drawer {
  background: #fff;
  width: 100%;
  max-width: 520px;
  height: 100%;
  overflow-y: auto;
  padding: 28px;
}

.modal-box {
  background: #fff;
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius);
  padding: 28px;
  max-height: 88vh;
  overflow-y: auto;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  line-height: 1;
  padding: 4px;
}

.drawer h2 {
  font-size: 18px;
  margin: 0 0 4px;
  color: var(--navy);
}

.detail-block {
  margin-bottom: 16px;
}

.detail-block h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 4px;
}

.detail-block p {
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
  white-space: pre-wrap;
}

.decision-row {
  display: flex;
  gap: 10px;
  margin: 20px 0 14px;
}

.decided-note {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 8px;
}

.top-actions {
  display: flex;
  gap: 10px;
}
