:root {
  --navy: #112d4e;
  --orange: #e56b21;
  --gray: #757270;
  --bg: #ffffff;
  --panel: #f7f8fa;
  --border: #e4e7ec;
  --text: #1d2733;
  --text-light: #5b6570;
  --green: #1e8e4d;
  --amber: #b97a0c;
  --red: #c0392b;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Montserrat", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

header.topbar {
  background: var(--navy);
  color: #fff;
  padding: 14px 18px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.topbar-inner { max-width: 1100px; margin: 0 auto; }
.brand-lockup { font-weight: 300; letter-spacing: 2px; font-size: 20px; }
.brand-lockup .go { color: var(--orange); font-weight: 600; }
.brand-lockup .logic { color: #fff; }
.brand-sub { font-size: 11px; letter-spacing: 5px; color: #9fb3c8; margin-top: 1px; }
.topbar h1 { font-size: 17px; font-weight: 600; margin-top: 6px; }
.topbar .tagline { font-size: 12px; color: #9fb3c8; }

nav.tabs {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 92px;
  z-index: 40;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tabs-inner {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 10px;
}
.tab-btn {
  flex: 0 0 auto;
  border: none;
  background: none;
  padding: 13px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  font-family: inherit;
}
.tab-btn.active { color: var(--navy); border-bottom-color: var(--orange); }
.tab-btn:hover { color: var(--navy); }

main { max-width: 1100px; margin: 0 auto; padding: 18px 16px 60px; }

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

.section-title {
  color: var(--navy);
  font-size: 20px;
  font-weight: 700;
  margin: 6px 0 4px;
}
.section-sub { color: var(--text-light); font-size: 13px; margin-bottom: 16px; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(17,45,78,.06);
}
.card h3 { color: var(--navy); font-size: 15.5px; margin-bottom: 6px; }
.card p.desc { font-size: 13.5px; color: var(--text-light); margin-bottom: 8px; }
.card .next-action {
  font-size: 13px;
  background: var(--panel);
  border-left: 3px solid var(--orange);
  padding: 8px 10px;
  border-radius: 0 6px 6px 0;
  margin: 8px 0;
}
.card .next-action strong { color: var(--navy); }

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.badge.not-started { background: #eceff3; color: #5b6570; }
.badge.in-progress { background: #fff4e5; color: var(--amber); }
.badge.waiting { background: #fdecea; color: var(--red); }
.badge.done { background: #e6f6ec; color: var(--green); }
.badge.draft { background: #eceff3; color: #5b6570; }
.badge.ready { background: #e8f0fe; color: #1a56c4; }
.badge.scheduled { background: #fff4e5; color: var(--amber); }
.badge.posted { background: #e6f6ec; color: var(--green); }

.doc-links { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.doc-links a {
  font-size: 12.5px;
  color: var(--navy);
  text-decoration: none;
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--panel);
}
.doc-links a:hover { border-color: var(--orange); color: var(--orange); }

/* Calendar */
.cal-toolbar {
  display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap;
}
.cal-toolbar button {
  background: var(--navy); color: #fff; border: none; border-radius: 6px;
  padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.cal-toolbar button.ghost { background: #fff; color: var(--navy); border: 1px solid var(--border); }
.cal-toolbar .month-label { font-size: 16px; font-weight: 700; color: var(--navy); flex: 1; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filter-chip {
  font-size: 12px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; cursor: pointer; color: var(--text-light); font-family: inherit; font-weight: 600;
}
.filter-chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.cal-dow {
  text-align: center; font-size: 11px; font-weight: 700; color: var(--text-light);
  padding: 6px 0; text-transform: uppercase;
}
.cal-day {
  min-height: 64px; border: 1px solid var(--border); border-radius: 8px;
  padding: 5px; font-size: 12px; cursor: pointer; background: #fff;
}
.cal-day:hover { border-color: var(--orange); }
.cal-day.other-month { background: var(--panel); color: #b6bcc4; }
.cal-day.today { border: 2px solid var(--orange); }
.cal-day .day-num { font-weight: 700; color: var(--navy); font-size: 12px; }
.cal-day .dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin: 2px 2px 0 0;
}
.dot.instagram { background: #c13584; }
.dot.youtube { background: #ff0000; }
.dot.blog { background: var(--navy); }
.cal-day .mini { font-size: 10px; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.view-toggle { display: flex; gap: 6px; margin-bottom: 12px; }
.view-toggle button {
  border: 1px solid var(--border); background: #fff; border-radius: 6px;
  padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  color: var(--text-light); font-family: inherit;
}
.view-toggle button.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.list-item {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 10px; background: #fff;
}
.list-item .date-chip {
  flex: 0 0 52px; text-align: center; background: var(--panel);
  border-radius: 8px; padding: 6px 4px;
}
.list-item .date-chip .m { font-size: 10px; text-transform: uppercase; color: var(--text-light); font-weight: 700; }
.list-item .date-chip .d { font-size: 18px; font-weight: 700; color: var(--navy); }
.list-item .body { flex: 1; }
.list-item .body h4 { font-size: 14px; color: var(--navy); margin-bottom: 2px; }
.list-item .meta { font-size: 12px; color: var(--text-light); }
.list-item .notes { font-size: 12.5px; color: var(--text); margin-top: 4px; }
.list-item .del {
  border: none; background: none; color: #c0392b; cursor: pointer; font-size: 16px; padding: 2px 6px;
}
.item-btns { display: flex; flex-direction: column; gap: 2px; flex: 0 0 auto; }
.item-btns .edit {
  border: none; background: none; color: var(--navy); cursor: pointer; font-size: 15px; padding: 2px 6px;
}

/* Image thumbnails + lightbox */
.thumb {
  flex: 0 0 64px; width: 64px; height: 64px; object-fit: cover;
  border-radius: 8px; cursor: pointer; border: 1px solid var(--border);
}
.thumb:active { transform: scale(.96); }

#f-img-preview { margin-top: 8px; }
#f-img-preview img {
  max-width: 100%; max-height: 140px; border-radius: 8px;
  border: 1px solid var(--border); display: block; margin-bottom: 8px;
}
.btn-sm { flex: 0 0 auto; padding: 7px 12px; font-size: 12.5px; }

.lightbox-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(10,20,35,.92);
  z-index: 200; align-items: center; justify-content: center; padding: 16px;
}
.lightbox-backdrop.open { display: flex; }
.lightbox-box { max-width: 100%; text-align: center; }
.lightbox-box img { max-width: 100%; max-height: 76vh; border-radius: 10px; }
.lightbox-actions { display: flex; gap: 10px; margin-top: 14px; justify-content: center; }
.lightbox-actions a, .lightbox-actions button {
  padding: 11px 22px; border-radius: 8px; font-size: 14px; font-weight: 700;
  font-family: inherit; cursor: pointer; text-decoration: none; border: none;
}
#lightbox-dl { background: var(--orange); color: #fff; }
#lightbox-close { background: rgba(255,255,255,.15); color: #fff; }

/* Deadlines */
.deadline {
  display: flex; gap: 14px; align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px; background: #fff;
}
.deadline .dbox {
  flex: 0 0 60px; text-align: center; border-radius: 8px; padding: 8px 4px;
  background: var(--navy); color: #fff;
}
.deadline .dbox.urgent { background: var(--red); }
.deadline .dbox.soon { background: var(--orange); }
.deadline .dbox .m { font-size: 10px; text-transform: uppercase; font-weight: 700; opacity: .85; }
.deadline .dbox .d { font-size: 20px; font-weight: 700; }
.deadline .body h4 { font-size: 15px; color: var(--navy); }
.deadline .body p { font-size: 13px; color: var(--text-light); }
.deadline.done { opacity: .55; }
.deadline .check { margin-left: auto; }

/* Modal */
.modal-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(17,45,78,.45);
  z-index: 100; align-items: center; justify-content: center; padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff; border-radius: 12px; padding: 20px; width: 100%; max-width: 440px;
  max-height: 90vh; overflow-y: auto;
}
.modal h3 { color: var(--navy); margin-bottom: 12px; font-size: 17px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit;
}
.field textarea { min-height: 70px; resize: vertical; }
.modal-actions { display: flex; gap: 10px; margin-top: 14px; }
.btn {
  flex: 1; padding: 11px; border: none; border-radius: 8px; font-size: 14px;
  font-weight: 700; cursor: pointer; font-family: inherit;
}
.btn.primary { background: var(--orange); color: #fff; }
.btn.secondary { background: var(--panel); color: var(--navy); border: 1px solid var(--border); }

.fab {
  position: fixed; right: 18px; bottom: 18px; width: 56px; height: 56px;
  border-radius: 50%; background: var(--orange); color: #fff; border: none;
  font-size: 28px; line-height: 1; cursor: pointer; z-index: 60;
  box-shadow: 0 4px 14px rgba(229,107,33,.4);
}

.empty { text-align: center; color: var(--text-light); padding: 30px 10px; font-size: 14px; }

footer.app-foot {
  text-align: center; color: var(--text-light); font-size: 11.5px; padding: 24px 16px 80px;
}
footer.app-foot code { background: var(--panel); padding: 1px 6px; border-radius: 4px; }

@media (max-width: 560px) {
  .cal-day { min-height: 52px; }
  .topbar h1 { font-size: 15px; }
  main { padding: 14px 12px 60px; }
}
