/* Dashboard — Creative Campaigns Workspace */
/* Inherits design tokens from theme.css */

.workspace {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  min-height: calc(100vh - 61px);
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  gap: 0;
}

.panel {
  border-right: 1px solid var(--border);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.panel:last-child { border-right: none; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--fg);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, background 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-ghost {
  background: var(--surface);
  color: var(--fg-muted);
  border: 1px solid var(--border);
}
.btn-sm { padding: 5px 10px; font-size: 0.75rem; }
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px 4px;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.btn-icon:hover { opacity: 1; }

/* Campaign cards */
.campaign-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}

.campaign-card {
  padding: 14px 14px 12px;
  background: var(--surface);
  border: 1.5px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.campaign-card:hover {
  border-color: var(--border);
}
.campaign-card.active {
  border-color: var(--accent);
  background: var(--accent-light);
}

.campaign-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.campaign-name {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--fg);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.campaign-desc {
  font-size: 0.75rem;
  color: var(--fg-muted);
  line-height: 1.5;
  margin-bottom: 6px;
}
.campaign-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.campaign-date {
  font-size: 0.6875rem;
  color: var(--fg-muted);
}

.status-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 20px;
  flex-shrink: 0;
}
.status-idea    { background: #E8F0FE; color: #1A73E8; }
.status-live    { background: #E6F4EA; color: #137333; }
.status-archived { background: var(--surface); color: var(--fg-muted); border: 1px solid var(--border); }

/* Calendar */
.calendar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--fg-muted);
  font-size: 0.875rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.calendar-month {
  background: var(--surface);
  border-radius: 8px;
  padding: 14px;
}
.calendar-month-label {
  font-family: var(--font-display);
  font-size: 0.875rem;
  color: var(--fg);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.calendar-items { display: flex; flex-direction: column; gap: 4px; }
.calendar-empty {
  font-size: 0.75rem;
  color: var(--fg-muted);
  font-style: italic;
  padding: 4px 0;
}
.calendar-item {
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: opacity 0.15s;
}
.calendar-item:hover { opacity: 0.8; }
.ci-date { font-weight: 600; display: block; }
.ci-title { display: block; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-platform { display: none; }

.post-status-draft     { background: #F4EFE8; color: var(--fg-muted); }
.post-status-scheduled { background: #E8F0FE; color: #1A73E8; }
.post-status-published { background: #E6F4EA; color: #137333; }
.post-status-paused   { background: #FEEFC3; color: #B06000; }

/* Content table */
.content-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.content-table th {
  text-align: left;
  padding: 8px 10px;
  font-weight: 500;
  color: var(--fg-muted);
  font-size: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.content-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.content-table tr:hover td { background: var(--surface); }
.ci-title-cell strong { font-weight: 500; }
.ci-body-preview {
  font-size: 0.75rem;
  color: var(--fg-muted);
  display: block;
  margin-top: 2px;
}
.post-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.post-badge-draft     { background: #F4EFE8; color: var(--fg-muted); }
.post-badge-scheduled { background: #E8F0FE; color: #1A73E8; }
.post-badge-published { background: #E6F4EA; color: #137333; }
.post-badge-paused    { background: #FEEFC3; color: #B06000; }

/* Assets */
.asset-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}
.asset-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: 7px;
  transition: background 0.15s;
}
.asset-card:hover { background: var(--accent-light); }
.asset-icon { font-size: 1.2rem; flex-shrink: 0; }
.asset-info { flex: 1; min-width: 0; }
.asset-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asset-type {
  font-size: 0.6875rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.asset-ci {
  font-size: 0.6875rem;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asset-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.asset-link {
  font-size: 0.8rem;
  opacity: 0.6;
  text-decoration: none;
}
.asset-link:hover { opacity: 1; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg);
  border-radius: 12px;
  padding: 28px;
  width: 480px;
  max-width: calc(100vw - 40px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  border: 1px solid var(--border);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 400;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--fg-muted);
  padding: 4px 8px;
  line-height: 1;
}
.modal-close:hover { color: var(--fg); }

.modal-fields { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-muted);
  letter-spacing: 0.03em;
}
.field input, .field textarea, .field select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  background: var(--surface);
  color: var(--fg);
  transition: border-color 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
}
.field textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--fg-muted);
}
.empty-state p { font-size: 0.875rem; margin-bottom: 12px; }

/* Responsive */
@media (max-width: 1024px) {
  .workspace { grid-template-columns: 1fr; padding: 0 16px; }
  .panel { border-right: none; border-bottom: 1px solid var(--border); }
  .calendar-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .calendar-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
}