/* Panoram Content Tracker, clean editorial styling */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #ffffff;
  color: #111111;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

.hidden { display: none !important; }
.no-scroll { overflow: hidden; }

h1, h2, h3, .card-title, .stat-value, .week-label {
  font-family: Georgia, "Times New Roman", serif;
}

/* ---------- header ---------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 20px 0;
  border-bottom: 1px solid #e2e2e2;
  max-width: 1240px;
  margin: 0 auto;
}

.brand h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.tricolor {
  height: 4px;
  width: 130px;
  margin-top: 6px;
  border: 1px solid #dcdcdc;
  background: linear-gradient(
    to right,
    #009246 0 33.33%,
    #ffffff 33.33% 66.66%,
    #CE2B37 66.66% 100%
  );
}

.tabs { display: flex; gap: 2px; }

.tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 14px;
  font: inherit;
  font-size: 14px;
  color: #555555;
  cursor: pointer;
}

.tab:hover { color: #111111; }

.tab.active {
  color: #111111;
  font-weight: 600;
  border-bottom-color: #CE2B37;
}

.whoami {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-bottom: 9px;
  font-size: 12px;
  color: #666666;
}

.whoami label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
}

.whoami select {
  font: inherit;
  font-size: 13px;
  padding: 4px 6px;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
  background: #ffffff;
  color: #111111;
  cursor: pointer;
}

.whoami select:focus {
  outline: none;
  border-color: #111111;
}

/* ---------- layout ---------- */

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 20px 60px;
}

.tabpanel { display: none; }
.tabpanel.active { display: block; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toolbar h2 { margin: 0; font-size: 19px; }

.weeknav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.week-label {
  font-size: 16px;
  margin-left: 8px;
}

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

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  cursor: pointer;
}

/* ---------- buttons ---------- */

.btn {
  font: inherit;
  font-size: 13.5px;
  padding: 7px 13px;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
  background: #ffffff;
  color: #111111;
  cursor: pointer;
}

.btn:hover { background: #f4f4f2; }

.btn-dark {
  background: #111111;
  border-color: #111111;
  color: #ffffff;
}
.btn-dark:hover { background: #333333; border-color: #333333; }

.btn-accent {
  background: #009246;
  border-color: #009246;
  color: #ffffff;
}
.btn-accent:hover { background: #007a3a; border-color: #007a3a; }

.btn-danger {
  border-color: #CE2B37;
  color: #CE2B37;
  background: #ffffff;
  margin-left: auto;
}
.btn-danger:hover { background: #fbeef0; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-accent:disabled:hover { background: #009246; }

.mini-btn {
  font: inherit;
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid #cccccc;
  border-radius: 3px;
  background: #ffffff;
  cursor: pointer;
  color: #333333;
}
.mini-btn:hover { background: #f2f2f2; }

.linklike {
  background: none;
  border: none;
  padding: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  color: #111111;
  text-decoration: underline;
  cursor: pointer;
  text-align: left;
}
.linklike:hover { color: #CE2B37; }

/* ---------- week grid ---------- */

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.day-col {
  border: 1px solid #e4e4e4;
  border-radius: 6px;
  background: #fbfbfa;
  display: flex;
  flex-direction: column;
  min-height: 190px;
}

.day-col.today { border-color: #009246; }

.day-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 10px;
  border-bottom: 1px solid #ececec;
}

.day-name {
  display: block;
  font-weight: 600;
  font-size: 13px;
}

.day-col.today .day-name { color: #009246; }

.day-theme {
  display: block;
  font-size: 11px;
  color: #999999;
}

.day-add {
  font: inherit;
  font-size: 15px;
  line-height: 1;
  width: 24px;
  height: 24px;
  border: 1px solid #cccccc;
  border-radius: 4px;
  background: #ffffff;
  color: #555555;
  cursor: pointer;
}
.day-add:hover { background: #f0f0ee; color: #111111; }

.day-items {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- cards ---------- */

.card {
  background: #ffffff;
  border: 1px solid #e2e2e2;
  border-radius: 5px;
  padding: 8px 10px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.card:hover { border-color: #b5b5b5; }

.card-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.chip {
  color: #ffffff;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.plat {
  font-size: 10.5px;
  color: #555555;
  border: 1px solid #d8d8d8;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.pill {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-transform: capitalize;
  white-space: nowrap;
}
.pill-idea      { background: #f1f1f1; color: #555555; border-color: #dddddd; }
.pill-drafted   { background: #fbf3da; color: #7a5b00; border-color: #eadfb8; }
.pill-ready     { background: #e6f4ea; color: #1a7f37; border-color: #c6e6cf; }
.pill-scheduled { background: #e8f0fe; color: #1a56db; border-color: #c9dcf8; }
.pill-posted    { background: #111111; color: #ffffff; border-color: #111111; }

.appr {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.appr-requested { background: #fff4dd; color: #8a6100; border-color: #eeda9f; }
.appr-changes   { background: #fbeef0; color: #CE2B37; border-color: #f0c2c7; }

.card-date { font-size: 11px; color: #777777; }

.card-actions {
  margin-top: 7px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.empty {
  color: #999999;
  font-size: 12.5px;
  margin: 4px 2px;
}

/* ---------- pipeline ---------- */

.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.kanban-col {
  border: 1px solid #e4e4e4;
  border-radius: 6px;
  background: #fbfbfa;
  display: flex;
  flex-direction: column;
  min-height: 190px;
}

.kanban-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #ececec;
  font-size: 13px;
  font-weight: 600;
  text-transform: capitalize;
}

.kanban-count { color: #888888; font-weight: 400; }

.kanban-items {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- score table ---------- */

.table-wrap { overflow-x: auto; }

#score-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

#score-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #666666;
  padding: 8px;
  border-bottom: 2px solid #111111;
  white-space: nowrap;
}

#score-table td {
  padding: 8px;
  border-bottom: 1px solid #ececec;
  vertical-align: middle;
}

#score-table input[type="number"] {
  width: 84px;
  padding: 5px 7px;
  border: 1px solid #cccccc;
  border-radius: 4px;
  font: inherit;
  font-size: 13px;
  transition: background 0.3s, border-color 0.3s;
}

#score-table input[type="number"]:focus {
  outline: none;
  border-color: #111111;
}

#score-table input.saved {
  border-color: #009246;
  background: #eef8f1;
}

.score-title { max-width: 340px; }

.empty-cell {
  color: #999999;
  font-size: 13px;
  padding: 22px 8px;
}

/* ---------- mix ---------- */

.mix-range {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.range-field span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #666666;
  margin-bottom: 3px;
}

.range-field input {
  padding: 6px 8px;
  border: 1px solid #cccccc;
  border-radius: 4px;
  font: inherit;
  font-size: 13px;
}

.mix-row {
  display: grid;
  grid-template-columns: 140px 1fr 240px;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.mix-label {
  font-weight: 600;
  font-size: 13.5px;
}

.mix-track {
  position: relative;
  height: 20px;
  background: #f1f1ef;
  border-radius: 4px;
}

.mix-fill {
  height: 100%;
  border-radius: 4px 0 0 4px;
  transition: width 0.3s ease;
}

.mix-target {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: #111111;
}

.mix-nums {
  font-size: 12.5px;
  color: #555555;
}

.stat-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.stat {
  border: 1px solid #e4e4e4;
  border-radius: 6px;
  background: #fbfbfa;
  padding: 10px 16px;
  min-width: 110px;
}

.stat-value { font-size: 22px; }

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #777777;
  margin-top: 2px;
}

/* ---------- overlay, drawer ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 50;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 440px;
  max-width: 100%;
  background: #ffffff;
  border-left: 1px solid #dddddd;
  box-shadow: -4px 0 18px rgba(0, 0, 0, 0.12);
  transform: translateX(102%);
  transition: transform 0.22s ease;
  z-index: 60;
  display: flex;
  flex-direction: column;
}

.drawer.open { transform: none; }

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #ececec;
}

.drawer-head h2 { margin: 0; font-size: 19px; }

#item-form {
  padding: 16px 18px 32px;
  overflow-y: auto;
  flex: 1;
}

.field { display: block; margin-bottom: 12px; }

.field span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #666666;
  margin-bottom: 4px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 8px 9px;
  border: 1px solid #cccccc;
  border-radius: 4px;
  font: inherit;
  font-size: 14px;
  background: #ffffff;
  color: #111111;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: #111111;
}

.field textarea { resize: vertical; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.caption-count {
  font-size: 12px;
  color: #888888;
  margin: -8px 0 12px;
  text-align: right;
}

.caption-count.over {
  color: #CE2B37;
  font-weight: 600;
}

.drawer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.queue-block {
  margin-top: 16px;
  border-top: 1px solid #ececec;
  padding-top: 14px;
}

.queue-hint {
  font-size: 12.5px;
  color: #555555;
  margin: 8px 0 0;
}

/* ---------- comments ---------- */

.comments-block {
  margin-top: 16px;
  border-top: 1px solid #ececec;
  padding-top: 14px;
}

.comments-block h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.comment {
  border: 1px solid #ececec;
  border-radius: 5px;
  background: #fbfbfa;
  padding: 8px 10px;
  margin-bottom: 8px;
}

.comment-meta {
  font-size: 11.5px;
  color: #777777;
  margin-bottom: 3px;
}

.comment-meta strong { color: #111111; }

.comment-body {
  font-size: 13.5px;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.comments-empty {
  color: #999999;
  font-size: 12.5px;
  margin: 0 0 10px;
}

.comment-form {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.comment-form textarea {
  flex: 1;
  padding: 8px 9px;
  border: 1px solid #cccccc;
  border-radius: 4px;
  font: inherit;
  font-size: 14px;
  resize: vertical;
}

.comment-form textarea:focus {
  outline: none;
  border-color: #111111;
}

/* ---------- activity ---------- */

.activity-day { margin-bottom: 24px; }

.activity-day h3 {
  font-size: 16px;
  margin: 0 0 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid #ececec;
}

.activity-entry {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 7px 2px;
  border-bottom: 1px solid #f4f4f2;
  font-size: 13.5px;
}

.activity-time {
  color: #999999;
  font-size: 12px;
  white-space: nowrap;
  min-width: 62px;
}

.activity-actor { font-weight: 600; }

.activity-detail { color: #777777; }

.activity-gone {
  color: #999999;
  font-style: italic;
}

.activity-entry .linklike { font-size: 13.5px; }

/* ---------- modal ---------- */

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  border-radius: 8px;
  padding: 22px 24px;
  width: 400px;
  max-width: 92vw;
  z-index: 80;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

#modal-backdrop { z-index: 70; }

.modal h2 { margin: 0 0 6px; font-size: 20px; }

.modal-sub {
  font-size: 13px;
  color: #666666;
  margin: 0 0 14px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0;
  font-size: 14px;
  cursor: pointer;
}

.check input { margin-top: 2px; }

.modal fieldset {
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  margin: 14px 0 0;
  padding: 10px 12px;
}

.modal legend {
  font-size: 12px;
  color: #666666;
  padding: 0 4px;
}

.radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 16px;
  font-size: 14px;
  cursor: pointer;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

/* ---------- login ---------- */

.login {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 360px;
  max-width: 100%;
  text-align: center;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 26px;
}

.login-card .tricolor { margin: 0 auto 16px; }

.login-card p {
  color: #555555;
  font-size: 14px;
  margin: 0 0 16px;
}

#login-form {
  display: flex;
  gap: 8px;
}

#login-form input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #cccccc;
  border-radius: 4px;
  font: inherit;
  font-size: 14px;
}

#login-form input:focus {
  outline: none;
  border-color: #111111;
}

.login-error {
  color: #CE2B37;
  font-size: 13px;
  margin: 10px 0 0;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  background: #111111;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 14px;
  max-width: 90vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 110;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- mobile ---------- */

@media (max-width: 719px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    padding-top: 14px;
  }

  .whoami {
    order: -1;
    align-self: flex-end;
    padding-bottom: 0;
  }

  .tabs {
    width: 100%;
    overflow-x: auto;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-actions .btn { flex: 1; }

  .week-grid { grid-template-columns: 1fr; }
  .kanban-board { grid-template-columns: 1fr; }

  .day-col, .kanban-col { min-height: auto; }

  .drawer {
    width: 100%;
    border-left: none;
  }

  .mix-row {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 20px;
  }

  .stat { flex: 1; min-width: 96px; }
}
