/* Explorador Sociable — design tokens lifted from exploradorats.com so the two
   products read as one family: navy ink, a single confident blue, Inter, 8–12px
   radii, and one soft navy-tinted shadow rather than a stack of greys. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --navy: #0d1b3d;          /* ink, and the header bar */
  --navy-soft: #16255083;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --line: #e2e8f2;
  --muted: #667085;
  --muted-2: #96a2b8;
  --accent: #2d8cff;
  --accent-hover: #1f79e8;
  --accent-soft: #e6f1ff;
  --ok: #0f9d58;
  --ok-soft: #e6f6ee;
  --warn: #b45309;
  --warn-soft: #fef4e6;
  --err: #d92d20;
  --err-soft: #fdecea;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 12px 32px -8px rgba(13, 27, 61, .18);
  --shadow-sm: 0 1px 2px rgba(13, 27, 61, .06);

  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto,
          'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--navy);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
.hidden { display: none !important; }

/* ---------- top bar ---------- */

header.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  height: 62px;
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 20;
}

/* logo-bar.png is the lockup knocked out to white-on-transparent (blue accent
   kept) with the tagline trimmed, so it stays legible at bar height on navy. */
.topbar .logo { height: 30px; width: auto; display: block; }

.topbar .divider { width: 1px; height: 26px; background: rgba(255,255,255,.16); margin: 0 6px; }
.spacer { flex: 1; }

.month-label {
  font-weight: 600;
  min-width: 176px;
  text-align: center;
  color: #fff;
  letter-spacing: -.01em;
}

.topbar button {
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #fff;
}
.topbar button:hover { background: rgba(255, 255, 255, .18); }
.topbar button.primary { background: var(--accent); border-color: var(--accent); }
.topbar button.primary:hover { background: var(--accent-hover); }
.topbar button.ghost { background: transparent; border-color: transparent; color: rgba(255,255,255,.72); }
.topbar button.ghost:hover { color: #fff; background: rgba(255,255,255,.10); }
.topbar .notice { color: rgba(255, 255, 255, .7); }

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

button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--navy);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
button:hover { background: #eef2f8; }
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger { color: var(--err); border-color: #f4cfcc; background: var(--panel); }
button.danger:hover { background: var(--err-soft); }
button.ghost { border-color: transparent; background: transparent; }
button:disabled { opacity: .45; cursor: not-allowed; }

main { padding: 22px; max-width: 1440px; margin: 0 auto; }

/* ---------- calendar ---------- */

.weekdays, .grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.weekdays { margin-bottom: 8px; }
.weekdays div {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted-2);
  text-align: center;
  font-weight: 600;
}

.day {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 132px;
  padding: 7px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color .12s ease, background .12s ease;
}
.day.other-month { background: #fafcff; }
.day.other-month .day-head .num { color: var(--muted-2); }
.day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.day.drop-target { background: var(--accent-soft); border-color: var(--accent); }

.day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}
.day-head .num { font-weight: 600; font-size: 13px; }
.day-head .add {
  opacity: 0;
  border: none;
  background: transparent;
  padding: 0 4px;
  font-size: 17px;
  line-height: 1;
  color: var(--accent);
}
.day:hover .day-head .add { opacity: 1; }

.chip {
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 12px;
  cursor: grab;
  border: 1px solid var(--line);
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.chip:active { cursor: grabbing; }
.chip.dragging { opacity: .35; }
.chip .time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 500;
}
.chip .text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.chip .icons { display: flex; gap: 3px; flex-wrap: wrap; }

.chip.status-draft     { border-left: 3px solid var(--muted-2); }
.chip.status-scheduled { border-left: 3px solid var(--accent); }
.chip.status-publishing{ border-left: 3px solid var(--warn); }
.chip.status-published { border-left: 3px solid var(--ok); background: var(--ok-soft); }
.chip.status-partial   { border-left: 3px solid var(--warn); background: var(--warn-soft); }
.chip.status-failed    { border-left: 3px solid var(--err); background: var(--err-soft); }
.chip.status-canceled  { border-left: 3px solid var(--line); opacity: .6; }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px; height: 17px;
  padding: 0 3px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .02em;
}
.pill.facebook  { background: #1877f2; }
.pill.instagram { background: #d62976; }
.pill.linkedin  { background: #0a66c2; }
.pill.x         { background: var(--navy); }
.pill.mock      { background: var(--muted-2); }

/* ---------- drawer ---------- */

.backdrop {
  position: fixed; inset: 0;
  background: rgba(13, 27, 61, .38);
  backdrop-filter: blur(2px);
  z-index: 40;
  display: flex; justify-content: flex-end;
}
.drawer {
  width: min(640px, 100%);
  background: var(--panel);
  height: 100%;
  overflow-y: auto;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.drawer header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--panel); z-index: 2;
}
.drawer header h2 { font-size: 17px; margin: 0; letter-spacing: -.015em; }
.drawer .body { padding: 22px; display: flex; flex-direction: column; gap: 18px; flex: 1; }
.drawer footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 14px 22px; border-top: 1px solid var(--line);
  position: sticky; bottom: 0; background: var(--panel);
}

label.field { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 600; }
label.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; line-height: 1.45; }

textarea, input[type=text], input[type=url], input[type=email],
input[type=password], input[type=datetime-local], select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 11px;
  background: #fff;
  font-weight: 400;
  transition: border-color .12s ease, box-shadow .12s ease;
}
textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.accounts-list { display: flex; flex-direction: column; gap: 7px; }
.account-row {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 11px;
  font-weight: 400;
  transition: border-color .12s ease, background .12s ease;
}
.account-row.checked { border-color: var(--accent); background: var(--accent-soft); }
.account-row .name { flex: 1; }
.account-row .warn { color: var(--warn); font-size: 12px; }

.counters { display: flex; flex-wrap: wrap; gap: 6px; }
.counter {
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
  background: #eef2f8; color: var(--muted); font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.counter.over { background: var(--err-soft); color: var(--err); font-weight: 600; }

.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.tabs button {
  border: none; background: transparent; border-bottom: 2px solid transparent;
  border-radius: 0; padding: 8px 11px; font-size: 13px; color: var(--muted);
}
.tabs button:hover { background: transparent; color: var(--navy); }
.tabs button.active { color: var(--navy); border-bottom-color: var(--accent); font-weight: 600; }

.media-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.media-thumb {
  position: relative; width: 86px; height: 86px; border-radius: var(--radius-sm);
  overflow: hidden; border: 1px solid var(--line); background: #eef2f8;
}
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-thumb button {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px;
  padding: 0; border-radius: 50%; line-height: 1; font-size: 13px;
  background: rgba(13, 27, 61, .7); color: #fff; border: none;
}

.problems {
  border: 1px solid #f4cfcc; background: var(--err-soft); color: #8a1c14;
  border-radius: var(--radius-sm); padding: 11px 13px; font-size: 13px;
}
.problems ul { margin: 6px 0 0; padding-left: 18px; }

.notice { font-size: 13px; color: var(--muted); font-weight: 400; }

.target-row {
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px;
}
.target-row .meta { flex: 1; }
.target-row .err { color: var(--err); font-size: 12px; margin-top: 4px; }
.status-tag {
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
  background: #eef2f8; color: var(--muted); font-weight: 600;
}
.status-tag.published { background: var(--ok-soft); color: var(--ok); }
.status-tag.failed { background: var(--err-soft); color: var(--err); }
.status-tag.pending { background: var(--accent-soft); color: var(--accent); }
.status-tag.missed { background: var(--warn-soft); color: var(--warn); }

/* File inputs are the one control browsers refuse to style consistently, so
   the button half is restyled and the rest left to the platform. */
input[type=file] { font-size: 13px; color: var(--muted); }
input[type=file]::file-selector-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--navy);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  margin-right: 10px;
  font-weight: 500;
  cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: #eef2f8; }

/* ---------- sign in ---------- */

.login-wrap {
  display: grid; place-items: center; min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 50% -10%, #ffffff 0%, rgba(255,255,255,0) 60%),
    var(--bg);
}
.login-card {
  background: var(--panel); padding: 32px; border-radius: var(--radius);
  box-shadow: var(--shadow); width: 372px; border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 15px;
}
.login-card .logo { width: 236px; align-self: center; margin: 4px 0 10px; }
.error-text { color: var(--err); font-size: 13px; }
.login-card h1 { font-size: 18px; margin: 0; text-align: center; letter-spacing: -.015em; }
.setup-note {
  margin: -6px 0 2px; font-size: 13px; line-height: 1.5;
  color: var(--muted); text-align: center;
}

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 11px 18px; border-radius: var(--radius-sm);
  font-size: 13px; z-index: 100; box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .day { min-height: 96px; }
  .topbar { padding: 0 12px; gap: 6px; }
  .month-label { min-width: auto; font-size: 13px; }
}

/* --- Settings panel --------------------------------------------------- */
/* Each platform gets its own card so the App ID / App Secret pair reads as
   one unit, and so "ready" is visible at a glance without opening anything. */
.settings-card {
  display: flex; flex-direction: column; gap: 12px;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; background: #fff;
}
.settings-head { display: flex; align-items: center; gap: 10px; }
.settings-head strong { font-size: 14px; letter-spacing: -.01em; }
.settings-head .notice, .settings-head .ok-text { margin-left: auto; font-size: 12px; }
.settings-card > .hint { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: -4px; }
.ok-text { color: #157a4a; font-weight: 600; }

/* Approval-gated options inside a settings card. Set apart from the credential
   fields above them, because they describe a state of the world rather than a
   value to type. */
.scope-note {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex; flex-direction: column; gap: 7px;
}
.checkline {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.checkline input { width: 15px; height: 15px; margin: 0; cursor: pointer; }
.scope-note .hint { font-size: 12px; line-height: 1.5; color: var(--muted); }
