/* ============================================================
   ACCO AI Marketing Agent — app.css
   Extracted and organized from prototype. All styles live here.
   Variables → Base → Layout → Components → Calendar →
   Kanban → Modal → Media → AI Generator → Auth → Responsive
   ============================================================ */

/* ─── VARIABLES ─────────────────────────────────────────── */
:root {
  --navy:      #003478;
  --navy-dark: #002455;
  --accent:    #0057b8;
  --accent-light: #1a6fc4;
  --steel:     #1B6CA8;
  --white:     #fff;
  --bg:        #f4f7fb;
  --ink:       #222;
  --muted:     #6b7a90;
  --line:      #e3e9f2;
  --ok:        #1f9d57;
  --warn:      #d98a00;
  --err:       #d23b3b;
  --card-sh:   0 1px 3px rgba(10,47,90,.07), 0 8px 24px rgba(10,47,90,.05);
  --side:      248px;
}

/* ─── RESET / BASE ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}
h1, h2, h3, h4, .dash-num { font-family: 'Sora', sans-serif; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c3d0e3; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ─── APP SHELL ─────────────────────────────────────────── */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--side);
  background: var(--navy-dark);
  color: #cdd9ec;
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform .25s;
}
.side-logo {
  padding: 20px 22px;
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.side-logo .mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--steel));
  display: grid;
  place-items: center;
  font-size: 15px;
  color: #fff;
}
.side-logo span { color: #9fd0ff; }
.side-nav { flex: 1; overflow-y: auto; padding: 10px 12px; }
.nav-group {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #647da3;
  padding: 14px 12px 6px;
  font-weight: 700;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9.5px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  cursor: pointer;
  color: #c2d1e8;
  transition: background .13s, color .13s;
  font-weight: 500;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,87,184,.4);
}
.nav-item .ic { width: 18px; text-align: center; font-style: normal; }
.nav-item .badge {
  margin-left: auto;
  background: var(--steel);
  color: #fff;
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 20px;
  font-weight: 700;
}
.main { margin-left: var(--side); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 62px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 26px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar .menu-btn { display: none; font-size: 20px; }
.topbar h1 { font-size: 19px; font-weight: 700; }
.search { flex: 1; max-width: 380px; position: relative; }
.search input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  background: var(--bg);
  border: 1.5px solid transparent;
  border-radius: 10px;
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
.search input:focus { outline: none; border-color: var(--accent); background: #fff; }
.search::before {
  content: "⌕";
  position: absolute;
  left: 12px;
  top: 7px;
  font-size: 17px;
  color: var(--muted);
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 17px;
  color: var(--muted);
  position: relative;
  background: var(--bg);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: #e8eff8; color: var(--navy); }
.icon-btn .dot {
  position: absolute;
  top: 8px; right: 9px;
  width: 8px; height: 8px;
  background: var(--err);
  border-radius: 50%;
  border: 2px solid #fff;
}
.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--steel));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.content { padding: 26px; flex: 1; }

/* ─── COMPONENTS ─────────────────────────────────────────── */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 14px;
}
.page-head .pt { font-size: 23px; font-weight: 700; }
.page-head .ps { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--card-sh);
}
.card-pad { padding: 20px; }
.card-h {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.card-h h3 { font-size: 15px; font-weight: 700; }
.grid { display: grid; gap: 18px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--card-sh);
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute;
  right: -20px; top: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .06;
}
.stat .ic {
  width: 40px; height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 19px;
  color: #fff;
  margin-bottom: 14px;
}
.stat .lbl { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat .num { font-family: 'Sora', sans-serif; font-size: 27px; font-weight: 700; margin: 2px 0 4px; }
.stat .delta { font-size: 12px; font-weight: 600; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--err); }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}
.tag.blue  { background: #e7f0fc; color: var(--accent); }
.tag.green { background: #e3f6ec; color: var(--ok); }
.tag.amber { background: #fdf0db; color: var(--warn); }
.tag.red   { background: #fce6e6; color: var(--err); }
.tag.gray  { background: #eef2f8; color: var(--muted); }
.tag.steel { background: #e4f0f8; color: var(--steel); }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}
td { padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafcff; }
.platform-ic {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.pf-fb  { background: #1877f2; }
.pf-ig  { background: linear-gradient(45deg, #f09433, #dc2743, #bc1888); }
.pf-li  { background: #0a66c2; }
.pf-x   { background: #000; }
.pf-tt  { background: #000; }
.pf-yt  { background: #ff0000; }
.pf-pi  { background: #e60023; }
.pf-gbp { background: #4285f4; }
.pf-wp  { background: #21759b; }
.row { display: flex; align-items: center; gap: 12px; }
.muted { color: var(--muted); }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.toggle {
  position: relative;
  width: 42px; height: 24px;
  border-radius: 20px;
  background: #cfd9e8;
  transition: background .2s;
  cursor: pointer;
  flex-shrink: 0;
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: left .2s;
}
.toggle.on::after { left: 21px; }
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.set-row:last-child { border-bottom: none; }
.set-row .st { font-weight: 600; font-size: 13.5px; }
.set-row .ss { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.progress { height: 7px; background: var(--bg); border-radius: 10px; overflow: hidden; }
.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--steel));
  border-radius: 10px;
}
.chip {
  padding: 6px 13px;
  border-radius: 9px;
  background: var(--bg);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background .13s, border-color .13s, color .13s;
  user-select: none;
}
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); color: #fff; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.avatar-sm {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.empty { text-align: center; padding: 40px; color: var(--muted); }

/* ─── BUTTON ─────────────────────────────────────────────── */
.btn {
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  transition: background .15s, box-shadow .15s;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.btn:hover { background: var(--navy); }
.btn.full { width: 100%; }
.btn.ghost { background: #fff; color: var(--accent); border: 1.5px solid var(--line); }
.btn.ghost:hover { border-color: var(--accent); background: #f3f8ff; }
.btn.sm { padding: 7px 12px; font-size: 12.5px; border-radius: 7px; }
.btn.steel-btn { background: var(--steel); }
.btn.red-btn { background: var(--err); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ─── FORM FIELDS ───────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  background: #fff;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,87,184,.12);
}
.field textarea { resize: vertical; min-height: 100px; }
input[type="time"],
input[type="date"] {
  padding: 7px 10px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13.5px;
  background: #fff;
}
input[type="time"]:focus,
input[type="date"]:focus {
  outline: none;
  border-color: var(--accent);
}

/* ─── CALENDAR ──────────────────────────────────────────── */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  padding-bottom: 4px;
}
.cal-cell {
  min-height: 104px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px;
  font-size: 12px;
}
.cal-cell.dim { background: #fafbfd; color: #b9c4d4; }
.cal-cell.today { border-color: var(--accent); }
.cal-cell .dnum { font-weight: 700; font-size: 12px; margin-bottom: 5px; }
.cal-post {
  font-size: 10.5px;
  padding: 3px 6px;
  border-radius: 6px;
  margin-bottom: 4px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ─── KANBAN ─────────────────────────────────────────────── */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: start; }
.kcol { background: #eef3fa; border-radius: 14px; padding: 12px; }
.kcol-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 12px;
  font-weight: 700;
  font-size: 13px;
}
.kcard {
  background: #fff;
  border-radius: 11px;
  padding: 13px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(10,47,90,.08);
  border-left: 3px solid var(--accent);
  cursor: grab;
  transition: box-shadow .15s;
}
.kcard:hover { box-shadow: 0 4px 16px rgba(10,47,90,.12); }
.kcard .ktitle { font-weight: 600; font-size: 13px; margin-bottom: 7px; line-height: 1.35; }
.kcard .kmeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}
.kcard.steel { border-left-color: var(--steel); }
.kcard.warn  { border-left-color: var(--warn); }
.kcard.ok    { border-left-color: var(--ok); }
.kcard.red   { border-left-color: var(--err); }

/* ─── MODAL ──────────────────────────────────────────────── */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,20,55,.5);
  backdrop-filter: blur(3px);
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-bg.show { display: flex; animation: fade .2s; }
.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,20,55,.4);
}
.modal-h {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-h h3 { font-size: 17px; }
.modal-h .x { font-size: 22px; color: var(--muted); cursor: pointer; }
.modal-b { padding: 22px; }
.modal-f {
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ─── MEDIA GRID ─────────────────────────────────────────── */
.media-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.media-item {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.media-item:hover { transform: translateY(-3px); box-shadow: var(--card-sh); }
.media-thumb { height: 120px; display: grid; place-items: center; font-size: 34px; color: #fff; }
.media-cap { padding: 9px 11px; font-size: 12px; }
.media-cap .mn { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── AI GENERATOR ───────────────────────────────────────── */
.gen-out {
  background: #fafcff;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 15px;
  margin-bottom: 12px;
}
.gen-out .goh { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; font-weight: 700; font-size: 13px; }
.gen-out .gtxt { font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.typing { display: inline-block; }
.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
.spinner.dark {
  border-color: rgba(0,87,184,.25);
  border-top-color: var(--accent);
}

/* ─── AUTH ───────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy-dark), var(--navy) 55%, var(--steel));
  padding: 24px;
}
.auth-card {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 880px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,20,55,.4);
}
.auth-side {
  background: linear-gradient(160deg, var(--navy), var(--steel));
  color: #fff;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-side .logo { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 26px; letter-spacing: -.5px; }
.auth-side .logo span { color: #9fd0ff; }
.auth-side h2 { font-size: 26px; margin: 24px 0 12px; line-height: 1.2; }
.auth-side p { opacity: .85; font-size: 14px; }
.auth-feat { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.auth-feat div { display: flex; gap: 10px; align-items: center; font-size: 13px; opacity: .92; }
.auth-feat i {
  width: 22px; height: 22px;
  background: rgba(255,255,255,.18);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 12px;
}
.auth-form { padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; }
.auth-form h3 { font-size: 22px; margin-bottom: 6px; font-family: 'Sora', sans-serif; }
.auth-form .sub { color: var(--muted); margin-bottom: 24px; }
.auth-foot { margin-top: 18px; font-size: 13px; color: var(--muted); text-align: center; }
.auth-foot a { color: var(--accent); font-weight: 600; }
.auth-error {
  background: #fce6e6;
  border: 1px solid #f0bcbc;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--err);
  margin-bottom: 16px;
}

/* ─── ALERT BANNER ───────────────────────────────────────── */
.alert-info {
  background: #fff8ee;
  border: 1px solid #f0d9a8;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  font-size: 13px;
}
.alert-ai {
  background: linear-gradient(120deg, #f3f8ff, #fff);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
}

/* ─── TOAST ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  padding: 12px 22px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 600;
  z-index: 90;
  box-shadow: 0 12px 40px rgba(0,20,55,.4);
  animation: fade .3s;
  white-space: nowrap;
}

/* ─── ANIMATIONS ─────────────────────────────────────────── */
@keyframes fade {
  from { opacity: 0; transform: translateY(8px) translateX(-50%); }
  to   { opacity: 1; transform: translateY(0) translateX(-50%); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes spin { to { transform: rotate(360deg); } }
.fade-in { animation: fadeIn .3s; }

/* ─── UTILITIES ──────────────────────────────────────────── */
.hidden { display: none !important; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-18 { margin-top: 18px; }
.mb-16 { margin-bottom: 16px; }
.mb-18 { margin-bottom: 18px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-13 { font-size: 13px; }
.fs-12 { font-size: 12px; }
.fs-11 { font-size: 11px; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.w-full { width: 100%; }
code {
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-family: 'Courier New', monospace;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1200px) {
  .kanban { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .media-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .topbar .menu-btn { display: block; }
  .g4, .g3, .g2 { grid-template-columns: 1fr; }
  .auth-card { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .media-grid { grid-template-columns: repeat(2, 1fr); }
  .cal { font-size: 10px; }
  .kanban { grid-template-columns: 1fr; }
  .content { padding: 16px; }
}
@media (max-width: 480px) {
  .media-grid { grid-template-columns: 1fr 1fr; }
  .auth-form { padding: 32px 24px; }
}
