:root {
  --bg: #0f1420;
  --panel: #161d2e;
  --panel-2: #1c2438;
  --border: #2a3450;
  --text: #e7ebf5;
  --text-dim: #9aa5c0;
  --accent: #5b7cfa;
  --accent-2: #22c1a4;
  --danger: #e5566b;
  --warn: #e0a530;

  --status-in-development: #7c6fd8;
  --status-for-review: #e0a530;
  --status-approved: #22c1a4;
  --status-posted: #4d8de8;
  --status-na: #6b7280;
  --status-not-approved: #e5566b;

  --headline-1: #5b7cfa;
  --headline-2: #22c1a4;
  --headline-3: #e0a530;
  --headline-4: #c77dff;
  --headline-5: #ef6ea8;
  --headline-6: #4dd0e1;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--border);
}
.topbar-brand a { font-weight: 700; font-size: 16px; color: var(--text); }
.topbar-nav a { margin-left: 18px; color: var(--text-dim); }

.page { max-width: 1100px; margin: 0 auto; padding: 28px 24px 60px; }

h1 { font-size: 22px; margin: 0 0 18px; }
h2 { font-size: 16px; color: var(--text); margin: 0 0 12px; }
h3 { font-size: 13px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 8px; }

.card h2 {
  border-left: 3px solid var(--headline-1); padding-left: 10px; margin-left: -1px;
}
.card h2:nth-of-type(6n+1) { border-left-color: var(--headline-1); color: var(--headline-1); }
.card h2:nth-of-type(6n+2) { border-left-color: var(--headline-2); color: var(--headline-2); }
.card h2:nth-of-type(6n+3) { border-left-color: var(--headline-3); color: var(--headline-3); }
.card h2:nth-of-type(6n+4) { border-left-color: var(--headline-4); color: var(--headline-4); }
.card h2:nth-of-type(6n+5) { border-left-color: var(--headline-5); color: var(--headline-5); }
.card h2:nth-of-type(6n+6) { border-left-color: var(--headline-6); color: var(--headline-6); }

.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 18px 20px; margin-bottom: 18px;
}

.login-wrap { display: flex; justify-content: center; align-items: center; min-height: 80vh; }
.login-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 32px; width: 320px; display: flex; flex-direction: column; gap: 10px;
}
.login-card h1 { font-size: 18px; margin-bottom: 8px; }

label { display: block; font-size: 12px; color: var(--text-dim); margin: 10px 0 4px; }
input[type=text], input[type=password], input[type=email], input[type=date], input[type=datetime-local],
input[type=number], input[type=url], textarea, select {
  width: 100%; background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); padding: 8px 10px; font-family: inherit; font-size: 13px;
}
textarea { resize: vertical; }
button, .btn {
  background: var(--accent); color: white; border: none; border-radius: 6px;
  padding: 9px 16px; font-size: 13px; cursor: pointer; font-weight: 600;
}
button:hover, .btn:hover { opacity: .9; }
button.secondary, .btn.secondary { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
button.danger { background: var(--danger); }
button.small, .btn.small { padding: 5px 10px; font-size: 12px; }

.field-error { color: var(--danger); font-size: 13px; margin-bottom: 8px; }

.division-section { margin-bottom: 32px; }
.division-heading {
  font-size: 15px; text-transform: uppercase; letter-spacing: .05em;
  border-left: 3px solid var(--headline-1); padding-left: 10px; margin-bottom: 14px;
}
.division-section:nth-of-type(6n+1) .division-heading { color: var(--headline-1); border-left-color: var(--headline-1); }
.division-section:nth-of-type(6n+2) .division-heading { color: var(--headline-2); border-left-color: var(--headline-2); }
.division-section:nth-of-type(6n+3) .division-heading { color: var(--headline-3); border-left-color: var(--headline-3); }
.division-section:nth-of-type(6n+4) .division-heading { color: var(--headline-4); border-left-color: var(--headline-4); }
.division-section:nth-of-type(6n+5) .division-heading { color: var(--headline-5); border-left-color: var(--headline-5); }
.division-section:nth-of-type(6n+6) .division-heading { color: var(--headline-6); border-left-color: var(--headline-6); }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.project-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px;
  display: block;
}
.project-card .brand { color: var(--text-dim); font-size: 12px; margin-bottom: 6px; }
.project-card h2 { margin-bottom: 4px; }
.project-card-thumb {
  width: 100%; height: 120px; object-fit: cover; border-radius: 6px; margin-bottom: 12px; display: block;
}

.tabs { display: flex; align-items: stretch; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs > a, .tab-dropdown > a {
  padding: 8px 14px; color: var(--text-dim); border-bottom: 2px solid transparent; font-size: 13px;
  line-height: 1.3; display: flex; align-items: center;
}
.tabs > a.active, .tab-dropdown > a.active { color: var(--text); border-bottom-color: var(--accent); }

table { width: 100%; border-collapse: collapse; }
table th, table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
table th { color: var(--text-dim); font-weight: 600; }

/* Content Pillars: hover dropdown on the tab bar */
.tab-dropdown { position: relative; display: flex; }
.tab-dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 20;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px; min-width: 220px; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.tab-dropdown:hover .tab-dropdown-menu,
.tab-dropdown:focus-within .tab-dropdown-menu { display: block; }
.tab-dropdown-menu a {
  display: block; padding: 7px 10px; border-radius: 5px; font-size: 13px;
  color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tab-dropdown-menu a:hover { background: var(--panel); text-decoration: none; }
.tab-dropdown-menu a.active { color: var(--accent); font-weight: 600; }

/* Single-pillar detail page */
.pillar-cap {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent);
  color: white; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex: 0 0 auto;
}
.pillar-cap-lg { width: 48px; height: 48px; font-size: 18px; }
.pillar-detail-head { display: flex; gap: 16px; align-items: center; margin-bottom: 4px; }
.pillar-name-input {
  font-size: 20px; font-weight: 700; background: transparent; border: none;
  border-bottom: 2px solid var(--accent); border-radius: 0; padding: 4px 2px;
}
.pillar-detail-footer {
  display: flex; justify-content: space-between; align-items: center; margin-top: 20px;
}
.pillar-nav { display: flex; gap: 8px; }

.repeat-row { display: flex; gap: 8px; margin-bottom: 6px; align-items: center; position: relative; }

.slack-autocomplete {
  position: absolute; top: 100%; left: 0; z-index: 30; margin-top: 2px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px;
  min-width: 260px; max-width: 360px; box-shadow: 0 8px 24px rgba(0,0,0,.4);
  overflow: hidden;
}
.slack-autocomplete-item {
  padding: 7px 10px; font-size: 12.5px; cursor: pointer; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.slack-autocomplete-item:hover { background: var(--panel); }
.repeat-row input { flex: 1; }
.link-icon {
  width: 22px; height: 22px; flex: 0 0 22px; display: flex; align-items: center; justify-content: center;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 5px;
}
.link-icon img { width: 13px; height: 13px; }
.link-icon[href=""], .open-link[href=""] { pointer-events: none; opacity: .4; }
.open-link { flex: 0 0 auto; white-space: nowrap; }

.status-badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
  color: white;
}
.status-in-development { background: var(--status-in-development); }
.status-for-review { background: var(--status-for-review); }
.status-approved { background: var(--status-approved); }
.status-posted { background: var(--status-posted); }
.status-na { background: var(--status-na); }
.status-not-approved { background: var(--status-not-approved); }

.platform-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.platform-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.platform-card h3 { display: flex; justify-content: space-between; align-items: center; }
.enabled-pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--status-na); }
.enabled-pill.on { background: var(--accent-2); color: #05261f; }

.flash-stack { margin-bottom: 16px; }
.flash { background: var(--panel-2); border: 1px solid var(--accent-2); color: var(--text); padding: 8px 12px; border-radius: 6px; margin-bottom: 8px; font-size: 13px; }

.hint { color: var(--text-dim); font-size: 12px; margin-top: 4px; }

/* Profile popup (in-app card, no navigation to Slack unless the Slack row is clicked) */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.modal-overlay[hidden] { display: none; }
.modal-card {
  position: relative; width: 360px; max-width: calc(100vw - 32px);
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 22px;
}
.modal-close {
  position: absolute; top: 14px; right: 14px; background: transparent; border: none;
  color: var(--text-dim); font-size: 15px; padding: 4px; cursor: pointer;
}
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.profile-avatar {
  width: 56px; height: 56px; border-radius: 50%; background: var(--panel);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  font-size: 22px; font-weight: 700; color: var(--text-dim); flex: 0 0 auto;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-size: 18px; font-weight: 700; }
.profile-title { color: var(--text-dim); font-size: 13px; margin-top: 2px; }
.profile-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 0; border-top: 1px solid var(--border); font-size: 13px;
}
.profile-row span:first-child { color: var(--text-dim); }

/* Content queue */
.queue-section { margin-bottom: 26px; }
.queue-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; border: none; padding: 0; }
.queue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.queue-card {
  position: relative; background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px; color: var(--text);
}
.queue-card:hover { border-color: var(--accent); }
.queue-card-link { display: block; color: inherit; text-decoration: none; padding-right: 50px; }
.queue-card-link:hover { text-decoration: none; }
.queue-card-title { font-weight: 600; margin-bottom: 4px; word-break: break-word; }
.queue-card-delete { position: absolute; top: 10px; right: 10px; margin: 0; }

/* Composer */
.composer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.composer-panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px;
}
.composer-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.composer-panel-head h3 { margin: 0; }
.skip-toggle-label {
  display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-dim);
  width: auto; white-space: nowrap; margin: 0;
}
.skip-toggle-label input { width: auto; }
.platform-name { display: flex; align-items: center; gap: 8px; }
.platform-icon { display: inline-flex; width: 18px; height: 18px; flex: 0 0 auto; }
.platform-icon svg { width: 100%; height: 100%; }
.status-select {
  font-size: 12px; font-weight: 700; color: white; border: none; border-radius: 999px;
  padding: 4px 10px; cursor: pointer;
}
.status-select.status-in-development { background: var(--status-in-development); }
.status-select.status-for-review { background: var(--status-for-review); }
.status-select.status-approved { background: var(--status-approved); }
.status-select.status-posted { background: var(--status-posted); }
.status-select.status-na { background: var(--status-na); }
.status-select.status-not-approved { background: var(--status-not-approved); }

.char-counter { font-size: 11px; color: var(--text-dim); font-weight: 400; text-transform: none; letter-spacing: 0; }
.char-counter.over-limit { color: var(--danger); font-weight: 700; }

.video-preview-wrap { margin-bottom: 18px; }
.video-preview-wrap video {
  width: 100%; max-height: 420px; border-radius: 10px; border: 1px solid var(--border);
  background: black; display: block;
}

.frame-picker { margin-top: 6px; }
.frame-seconds-label { color: var(--text-dim); font-weight: 400; }
.frame-slider { width: 100%; }
.frame-scrub-video {
  width: 100%; max-height: 360px; margin-top: 8px; border-radius: 6px; border: 1px solid var(--border);
  background: black; display: block;
}

.thumb-upload { margin-top: 10px; }
.thumb-upload input[type=file] { width: 100%; font-size: 12px; }

.post-mode { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.post-mode-options { display: flex; gap: 14px; margin-top: 4px; }
.post-mode-radio { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text); width: auto; }
.post-mode-radio input { width: auto; }
.scheduled-for-input { flex: 1; }
