/* ===== planner.css — Post Planner ===== */

.planner-view {
  position: fixed; inset: 0; z-index: 1500;
  background: var(--bg, #0F1113);
  display: flex; flex-direction: column;
  animation: plfade .16s ease;
}
@keyframes plfade { from { opacity: 0; } }

.planner-top {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 26px;
  border-bottom: 1px solid var(--line, #2A2F34);
  background: rgba(15,17,19,.9); backdrop-filter: blur(8px);
  flex: none;
}
.planner-top h2 {
  font-family: "Sora", sans-serif; font-size: 18px; font-weight: 700;
  margin: 0; white-space: nowrap;
}
.planner-back {
  background: none; border: 1px solid var(--line, #2A2F34); color: var(--text, #ECEDEE);
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.planner-back:hover { border-color: var(--muted, #9AA1A8); }
.planner-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

.planner-top .pl-spacer { flex: 1; }
.planner-top .pp-acc-btn { flex: none; }

/* ---- narzędzia (filtry) ---- */
.planner-tools {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 26px; border-bottom: 1px solid var(--line, #2A2F34);
  flex: none;
}
.planner-search {
  position: relative; flex: 1; min-width: 220px; max-width: 420px;
}
.planner-search svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; stroke: var(--muted, #9AA1A8); fill: none; stroke-width: 2;
  pointer-events: none;
}
.planner-search input {
  width: 100%; background: var(--panel, #1B1F23); border: 1px solid var(--line, #2A2F34);
  border-radius: 10px; padding: 10px 12px 10px 38px; color: var(--text, #ECEDEE);
  font-size: 14px; font-family: inherit; outline: none; transition: border-color .15s;
}
.planner-search input:focus { border-color: var(--accent, #C7F244); }
.planner-select {
  background: var(--panel, #1B1F23); color: var(--text, #ECEDEE);
  border: 1px solid var(--line, #2A2F34); border-radius: 10px;
  padding: 10px 30px 10px 12px; font-size: 14px; font-family: inherit; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' stroke='%239AA1A8' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
  outline: none;
}
.planner-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel, #1B1F23); color: var(--text, #ECEDEE);
  border: 1px solid var(--line, #2A2F34); border-radius: 10px;
  padding: 10px 16px; font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer;
  white-space: nowrap; transition: border-color .15s, background .15s;
}
.planner-btn:hover { border-color: var(--muted, #9AA1A8); background: var(--panel-2, #21262B); }
.planner-btn.primary { background: var(--accent, #C7F244); color: var(--accent-ink, #101207); border-color: transparent; font-weight: 700; }
.planner-btn.primary:hover { filter: brightness(1.06); background: var(--accent, #C7F244); }
.planner-btn.open { background: var(--accent, #C7F244); color: var(--accent-ink, #101207); border-color: transparent; font-weight: 800; padding: 8px 18px; }
.planner-btn.open:hover { filter: brightness(1.06); background: var(--accent, #C7F244); }
.planner-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ---- lista harmonogramów (tabela grupowana po miesiącach) ---- */
.planner-body {
  flex: 1; overflow-y: auto; padding: 24px 26px 60px;
}
.planner-groups { display: flex; flex-direction: column; gap: 26px; width: 100%; }
.planner-group-hd {
  font-family: "Sora", sans-serif; font-size: 15px; font-weight: 800;
  color: var(--accent, #C7F244); text-transform: capitalize;
  padding: 0 4px 10px; border-bottom: 1px solid var(--line, #2A2F34);
}

.pl-table {
  width: 100%; border-collapse: collapse; background: var(--bg-soft, #16191C);
  border: 1px solid var(--line, #2A2F34); border-radius: 14px; overflow: hidden;
}
.pl-table thead th {
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted, #9AA1A8);
  padding: 11px 14px; border-bottom: 1px solid var(--line, #2A2F34);
  background: rgba(255,255,255,.02);
}
.pl-table tbody td {
  padding: 11px 14px; border-bottom: 1px solid var(--line, #2A2F34);
  font-size: 13.5px; color: var(--text, #ECEDEE); vertical-align: middle;
}
.pl-table tbody tr:last-child td { border-bottom: none; }
.pl-table tbody tr { cursor: pointer; transition: background .12s; }
.pl-table tbody tr:hover { background: var(--panel, #1B1F23); }
.pl-td-name { font-weight: 600; }
.pl-td-actions { text-align: right; display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.pl-row-actions { display: inline-flex; gap: 4px; }
.pl-row-actions button {
  background: none; border: none; color: var(--muted, #9AA1A8); cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .12s, background .12s;
}
.pl-row-actions button:hover { background: var(--panel-2, #21262B); color: var(--text, #ECEDEE); }
.pl-row-actions button.danger:hover { color: var(--danger, #FF5C5C); }
.pl-row-actions svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.planner-empty { text-align: center; padding: 80px 20px; color: var(--muted, #9AA1A8); }
.planner-empty b { font-size: 17px; color: var(--text, #ECEDEE); display: block; }
.planner-empty p { margin: 6px 0 0; font-size: 14px; }

/* ---- szczegóły harmonogramu ---- */
.planner-detail-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 26px; border-bottom: 1px solid var(--line, #2A2F34);
}
.planner-detail-title { flex: 1; min-width: 200px; }
.planner-detail-title h3 { font-family: "Sora", sans-serif; font-size: 20px; font-weight: 800; margin: 0; text-transform: capitalize; }
.planner-detail-title span { font-size: 13px; color: var(--muted, #9AA1A8); }

.planner-posts { padding: 20px 26px 60px; width: 100%; }
.pl-table-card { margin-bottom: 18px; }
.pl-table-posts .pl-td-topic { font-weight: 600; max-width: 220px; }
.pl-td-content { color: var(--muted, #9AA1A8); max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-post-row.has-project .pl-td-topic::before {
  content: "◆ "; color: var(--accent, #C7F244); font-size: 10px;
}
.pl-thumb {
  width: 46px; height: 46px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--line, #2A2F34); display: block;
}
.pl-thumb-btn {
  display: block; padding: 0; margin: 0; border: none; background: none; cursor: default;
  line-height: 0; font-family: inherit;
}
.pl-thumb-btn.link { cursor: pointer; position: relative; }
.pl-thumb-btn.link:hover .pl-thumb { filter: brightness(1.1); border-color: var(--accent, #C7F244); }
.pl-td-muted { color: var(--muted, #9AA1A8); }
.pl-td-date { white-space: nowrap; color: var(--text, #ECEDEE); font-size: 13px; }
.pl-detail-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.pl-post {
  background: var(--bg-soft, #16191C); border: 1px solid var(--line, #2A2F34);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 12px;
}
.pl-post-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pl-post-type {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  border-radius: 5px; padding: 3px 7px; border: 1px solid var(--line, #2A2F34);
  color: var(--muted, #9AA1A8); flex: none;
}
.pl-post-type.post { color: #7FD1AE; border-color: rgba(127,209,174,.4); }
.pl-post-type.carousel { color: #B9A8FF; border-color: rgba(185,168,255,.4); }
.pl-post-type.story { color: #F2A7C3; border-color: rgba(242,167,195,.4); }
.pl-post-type.reel { color: #FFB58A; border-color: rgba(255,181,138,.4); }

.pl-post-topic { font-size: 15px; font-weight: 700; flex: 1; min-width: 120px; }
.pl-post-project {
  font-size: 12px; color: var(--muted, #9AA1A8); max-width: 200px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pl-post-project a { color: var(--accent, #C7F244); text-decoration: none; }
.pl-post-project a:hover { text-decoration: underline; }

.pl-status {
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 20px;
}
.pl-status.nowy { background: rgba(154,161,168,.15); color: var(--muted, #9AA1A8); }
.pl-status.poprawka { background: rgba(255,140,80,.16); color: #FF8C50; }
.pl-status.akcept_wewnetrzny { background: rgba(127,209,174,.16); color: #7FD1AE; }
.pl-status.akcept_klienta { background: rgba(97,167,255,.16); color: #61A7FF; }
.pl-status.zaplanowany { background: rgba(185,168,255,.16); color: #B9A8FF; }
.pl-status.opublikowany { background: rgba(74,222,128,.2); color: #4ade80; }

.pl-post-actions { display: flex; gap: 4px; margin-left: auto; }
.pl-post-actions button {
  background: none; border: none; color: var(--muted, #9AA1A8); cursor: pointer;
  width: 28px; height: 28px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center;
}
.pl-post-actions button:hover { background: var(--panel, #1B1F23); color: var(--text, #ECEDEE); }
.pl-post-actions button.danger:hover { color: var(--danger, #FF5C5C); }
.pl-post-actions svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.pl-post-body { margin-top: 12px; }
.pl-post-content {
  font-size: 13.5px; color: var(--text, #ECEDEE); line-height: 1.55;
  white-space: pre-wrap; margin: 0;
}
.pl-post-content.empty { color: var(--muted, #9AA1A8); font-style: italic; }

.pl-post-graphic { margin-top: 10px; }

.pl-comments { margin-top: 12px; border-top: 1px solid var(--line, #2A2F34); padding-top: 10px; }
.pl-comments-toggle {
  background: none; border: none; color: var(--muted, #9AA1A8); font-size: 12.5px;
  font-weight: 600; cursor: pointer; font-family: inherit; padding: 2px 0;
}
.pl-comments-toggle:hover { color: var(--text, #ECEDEE); }
.pl-comments-list { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.pl-comment {
  background: var(--panel, #1B1F23); border-radius: 10px; padding: 9px 12px;
  display: flex; gap: 10px; align-items: flex-start;
}
.pl-comment-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent, #C7F244);
  color: var(--accent-ink, #101207); font-size: 11px; font-weight: 800; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.pl-comment-body { flex: 1; min-width: 0; }
.pl-comment-head { display: flex; align-items: baseline; gap: 8px; }
.pl-comment-author { font-size: 12.5px; font-weight: 700; }
.pl-comment-time { font-size: 11px; color: var(--muted, #9AA1A8); }
.pl-comment-text { font-size: 13px; line-height: 1.5; margin-top: 2px; white-space: pre-wrap; }
.pl-comment-del {
  background: none; border: none; color: var(--muted, #9AA1A8); cursor: pointer;
  font-size: 12px; padding: 2px 4px; flex: none;
}
.pl-comment-del:hover { color: var(--danger, #FF5C5C); }
.pl-comment-input-row { display: flex; gap: 8px; margin-top: 8px; }
.pl-comment-input {
  flex: 1; background: var(--panel, #1B1F23); border: 1px solid var(--line, #2A2F34);
  border-radius: 10px; padding: 9px 12px; color: var(--text, #ECEDEE); font-size: 13px;
  font-family: inherit; outline: none;
}
.pl-comment-input:focus { border-color: var(--accent, #C7F244); }
.pl-comment-send {
  background: var(--accent, #C7F244); color: var(--accent-ink, #101207); border: none;
  border-radius: 10px; padding: 0 14px; font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit;
}
.pl-comment-send:hover { filter: brightness(1.06); }

/* ---- modal nowego/post planner / wybór projektu ---- */
.pl-search-results { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.pl-project-item {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px;
  cursor: pointer; border: 1px solid var(--line, #2A2F34); background: var(--panel, #1B1F23);
  transition: border-color .13s;
}
.pl-project-item:hover { border-color: var(--accent, #C7F244); }
.pl-project-thumb {
  width: 46px; height: 46px; border-radius: 8px; background: var(--panel-2, #21262B); flex: none;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  color: var(--muted, #9AA1A8); font-size: 11px;
}
.pl-project-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pl-project-info { flex: 1; min-width: 0; }
.pl-project-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-project-meta { font-size: 12px; color: var(--muted, #9AA1A8); }
.pl-project-check { color: var(--accent, #C7F244); flex: none; margin-left: 8px; }
.pl-project-check svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; }

.pl-sort-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.pl-sort-row select { max-width: 200px; }
.pl-note { font-size: 12px; color: var(--muted, #9AA1A8); line-height: 1.5; }

/* ---- picker projektu (prosta siatka podglądów) ---- */
.pp-modal-picker { width: min(760px, 100%); }
.pp-picker-toolbar { padding: 12px 14px; border-bottom: 1px solid var(--line, #2A2F34); }
.pp-picker-toolbar .planner-search { max-width: 100%; }
.pl-project-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px;
  max-height: 60vh; overflow-y: auto;
}
.pl-project-card {
  position: relative; background: var(--panel, #1B1F23); border: 1px solid var(--line, #2A2F34);
  border-radius: 12px; overflow: hidden; cursor: pointer;
  transition: border-color .12s, transform .12s;
}
.pl-project-card:hover { border-color: var(--accent, #C7F244); transform: translateY(-2px); }
.pl-project-card-thumb {
  width: 100%; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  background: var(--panel-2, #21262B); color: var(--muted, #9AA1A8); font-size: 11px;
  overflow: hidden;
}
.pl-project-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pl-project-card-add {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent, #C7F244); color: var(--accent-ink, #101207);
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(.9); transition: opacity .12s, transform .12s;
}
.pl-project-card:hover .pl-project-card-add { opacity: 1; transform: scale(1); }
.pl-project-card-add svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.pl-project-card-name {
  padding: 8px 10px; font-size: 12.5px; font-weight: 600; color: var(--text, #ECEDEE);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* typ + status przy tworzeniu/edycji posta */
.pl-inline-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pl-inline-row select {
  background: var(--panel, #1B1F23); border: 1px solid var(--line, #2A2F34); border-radius: 8px;
  color: var(--text, #ECEDEE); font-family: inherit; font-size: 12.5px; padding: 6px 8px; outline: none; flex: 1; min-width: 120px;
}

/* ---- formularz posta (dodaj / edytuj) ---- */
.pp-modal-post { width: min(900px, 100%); max-height: 86vh; }
.pp-body-split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; padding: 20px; }
.pp-field-flex { flex: 1; min-width: 0; }

/* lewa kolumna — duzy podglad posta + pasek akcji medialnych */
.pl-post-left { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.pl-post-canvas {
  flex: 1; min-height: 300px; background:
    radial-gradient(circle at 25% 20%, rgba(120,160,255,.12), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(199,242,68,.10), transparent 40%),
    var(--bg-soft, #16191C);
  border: 1px solid var(--line, #2A2F34); border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.pl-post-canvas img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.pl-post-canvas-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--muted, #9AA1A8); font-size: 13px; font-weight: 600;
}
.pl-post-canvas-empty svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1.5; opacity: .5; }
.pl-post-media-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-post-media-bar .planner-btn.media { flex: 1; justify-content: center; min-width: 0; }
.pl-post-media-bar .planner-btn.media span { white-space: normal; }

/* prawa kolumna — pola posta */
.pl-post-right { display: flex; flex-direction: column; min-width: 0; }
.pl-post-right .pl-treść { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.pl-post-right .pp-err { margin-top: auto; }

/* panel wgrywania z dysku */
.pp-modal-small { width: min(420px, 100%); }
.pp-drop {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 120px; border: 1.5px dashed var(--line, #2A2F34); border-radius: 12px;
  cursor: pointer; color: var(--muted, #9AA1A8); font-size: 13px; font-weight: 600;
  transition: border-color .15s, color .15s;
}
.pp-drop:hover { border-color: var(--accent, #C7F244); color: var(--text, #ECEDEE); }
.pp-drop input[type="file"] { display: none; }
.pp-field textarea, .pp-field select {
  background: var(--panel, #1B1F23); border: 1px solid var(--line, #2A2F34); border-radius: 10px;
  padding: 11px 13px; color: var(--text, #ECEDEE); font-size: 14px; font-family: inherit;
  outline: none; transition: border-color .15s;
}
.pp-field textarea:focus, .pp-field select:focus { border-color: var(--accent, #C7F244); }
.pp-field textarea { resize: vertical; line-height: 1.5; min-height: 100px; width: 100%; }

.pl-graphic-preview {
  margin-top: 8px; min-height: 110px; border: 1px dashed var(--line, #2A2F34);
  border-radius: 12px; padding: 10px; display: flex; align-items: center; justify-content: center;
  overflow: hidden; color: var(--muted, #9AA1A8); font-size: 12.5px; background: var(--panel, #1B1F23);
}
.pl-graphic-preview img { max-width: 100%; max-height: 180px; border-radius: 8px; object-fit: contain; }
