/* CMO-2 styles. Brand tokens drive the colour shift between
   Surf (light blue), zkCross (dark grayscale) and Personal. */

:root {
  --bg: #f7f9fb;
  --surface: #ffffff;
  --surface-alt: #f1f4f8;
  --border: #e3e8ee;
  --text: #16202d;
  --text-muted: #5b6877;
  --text-soft: #8794a3;

  --accent-blue: #469bff;
  --accent-blue-hover: #2f86ec;
  --accent-blue-tint: rgba(70, 155, 255, 0.12);
  --accent-blue-border: rgba(70, 155, 255, 0.25);

  --brand-zkcross: #272727;
  --brand-surf: #469bff;
  --brand-shivam: #6b46ff;

  --good: #1faa5a;
  --warn: #e0a800;
  --bad: #d83a3a;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand-mark {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-weight: 900;
  letter-spacing: 0.5px;
}
.logo-mark { color: var(--text); font-size: 20px; }
.logo-tag {
  background: var(--accent-blue);
  color: white;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.screen-tabs { display: flex; gap: 4px; flex: 1; }
.screen-tabs a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}
.screen-tabs a:hover { background: var(--surface-alt); color: var(--text); }
.screen-tabs a.active { background: var(--accent-blue-tint); color: var(--accent-blue); }
.user-block { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-muted); }
.user-block button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 12px;
}
.user-block button.ghost:hover { background: var(--surface-alt); color: var(--text); }

.brand-row, .platform-row {
  display: flex;
  gap: 8px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.platform-row { padding-top: 0; padding-bottom: 12px; }

.brand-pill, .platform-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.15s;
}
.brand-pill:hover, .platform-pill:hover { border-color: var(--text-muted); color: var(--text); }
.brand-pill.active { background: var(--text); color: white; border-color: var(--text); }
.brand-pill.brand-zkcross.active { background: var(--brand-zkcross); border-color: var(--brand-zkcross); }
.brand-pill.brand-surf.active    { background: var(--brand-surf);    border-color: var(--brand-surf); }
.brand-pill.brand-shivam.active  { background: var(--brand-shivam);  border-color: var(--brand-shivam); }
.platform-pill.active { background: var(--accent-blue); color: white; border-color: var(--accent-blue); }

body.screen-graphics .platform-row,
body.screen-docs .platform-row,
body.screen-docs .brand-row { display: none; }

.screen { max-width: 1280px; margin: 0 auto; padding: 24px; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 24px 0 12px; }
.section-title h2 { margin: 0; font-size: 18px; font-weight: 900; letter-spacing: -0.01em; }
.section-title .meta { font-size: 13px; color: var(--text-muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.ref-id { font-size: 11px; color: var(--text-soft); font-weight: 700; letter-spacing: 0.04em; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tag-brand-zkcross { background: var(--brand-zkcross); color: white; }
.tag-brand-surf    { background: var(--brand-surf);    color: white; }
.tag-brand-shivam  { background: var(--brand-shivam);  color: white; }
.tag-platform { background: var(--accent-blue-tint); color: var(--accent-blue); }
.tag-status   { background: var(--surface-alt); color: var(--text-muted); }
.tag-status-pending_approval { background: #fff4d3; color: #8a6d00; }
.tag-status-approved  { background: #d4f1de; color: #0f7036; }
.tag-status-scheduled { background: #d3e9ff; color: #1657a8; }
.tag-status-published { background: #e0d8ff; color: #4a2eaa; }
.tag-status-rejected, .tag-status-cancelled { background: #ffd9d9; color: #8a1c1c; }

.card-body { white-space: pre-wrap; font-size: 14px; color: var(--text); margin: 8px 0; line-height: 1.55; }
.card-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.card-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); margin-top: 8px; flex-wrap: wrap; }

.btn { border: none; padding: 7px 14px; border-radius: var(--radius-sm); font-weight: 700; font-size: 13px; transition: all 0.15s; }
.btn-primary { background: var(--accent-blue); color: white; }
.btn-primary:hover { background: var(--accent-blue-hover); }
.btn-secondary { background: var(--surface-alt); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
.btn-danger:hover { background: var(--bad); color: white; }
.btn-graphic {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--accent-blue-tint);
  border: 1px solid var(--accent-blue-border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--accent-blue);
  font-weight: 700;
  text-decoration: none;
}
.btn-graphic:hover { background: var(--accent-blue); color: white; }

input[type=text], input[type=datetime-local], input[type=number], textarea, select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 0 2px var(--accent-blue-tint); }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
label { display: block; font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.form-row { margin-bottom: 12px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 16px; }
.cal-day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-height: 220px; padding: 10px; }
.cal-day-head { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; display: flex; justify-content: space-between; }
.cal-day-head strong { color: var(--text); font-size: 14px; }
.cal-post { background: var(--surface-alt); border-radius: var(--radius-sm); padding: 6px 8px; margin-bottom: 6px; font-size: 11px; border-left: 3px solid var(--accent-blue); }
.cal-post.brand-zkcross { border-left-color: var(--brand-zkcross); }
.cal-post.brand-surf    { border-left-color: var(--brand-surf); }
.cal-post.brand-shivam  { border-left-color: var(--brand-shivam); }
.cal-post .time { font-weight: 700; color: var(--text); }
.cal-post .preview { color: var(--text-muted); margin-top: 2px; }

.table { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--border); }
.table th { background: var(--surface-alt); font-weight: 700; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--surface-alt); }
.engagement-input { width: 64px; padding: 4px 6px; font-size: 12px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: white; padding: 10px 18px; border-radius: var(--radius); font-size: 13px; z-index: 100; box-shadow: var(--shadow-md); transition: opacity 0.2s, transform 0.2s; }
.toast.hidden { opacity: 0; pointer-events: none; transform: translate(-50%, 12px); }
.toast.error { background: var(--bad); }

.empty { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty h3 { margin: 0 0 6px; font-size: 16px; color: var(--text); }
.empty p { margin: 0; font-size: 14px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(16, 24, 40, 0.5); display: flex; align-items: center; justify-content: center; z-index: 200; }
.modal-backdrop.hidden { display: none; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 24px; width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-md); }
.modal h3 { margin: 0 0 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.muted { color: var(--text-muted); font-size: 13px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.markdown { line-height: 1.65; font-size: 15px; }
.markdown h1, .markdown h2, .markdown h3 { font-weight: 900; margin-top: 24px; margin-bottom: 8px; }
.markdown code { background: var(--surface-alt); padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.markdown pre { background: var(--surface-alt); padding: 12px; border-radius: var(--radius-sm); overflow-x: auto; }
.markdown a { color: var(--accent-blue); text-decoration: underline; }
