/* ============================================
   Blog Automation — SaaS Admin Dashboard Styles
   ============================================ */

:root {
  /* Colors */
  --bg-body: #1a1c2e;
  --bg-sidebar: #111328;
  --bg-topbar: rgba(17, 19, 40, 0.85);
  --bg-card: rgba(22, 24, 45, 0.92);
  --bg-card-hover: rgba(30, 33, 58, 0.95);
  --bg-input: rgba(255, 255, 255, 0.04);
  --bg-input-focus: rgba(255, 255, 255, 0.07);

  --text-primary: #f0f0f5;
  --text-secondary: #8b8da8;
  --text-muted: #5a5c78;
  --text-accent: #a78bfa;

  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --accent-border: rgba(99, 102, 241, 0.25);

  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --error: #ef4444;
  --error-glow: rgba(239, 68, 68, 0.15);

  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  --sidebar-width: 260px;
  --topbar-height: 64px;
}

/* ===== LIGHT THEME ===== */
[data-theme="light"] {
  --bg-body: #f3f4f6;
  --bg-sidebar: #ffffff;
  --bg-topbar: rgba(255, 255, 255, 0.92);
  --bg-card: #ffffff;
  --bg-card-hover: #f9fafb;
  --bg-input: rgba(0, 0, 0, 0.04);
  --bg-input-focus: rgba(0, 0, 0, 0.07);

  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --text-accent: #6366f1;

  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-glow: rgba(99, 102, 241, 0.1);
  --accent-border: rgba(99, 102, 241, 0.2);

  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --error: #ef4444;
  --error-glow: rgba(239, 68, 68, 0.1);

  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.15);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .sidebar {
  border-right: 1px solid var(--border);
}

[data-theme="light"] .topbar {
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .card {
  border: 1px solid var(--border);
}

/* ===== RESET ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s, color 0.3s;
}

/* Remix Icon integration */
.nav-icon i {
  font-size: 1.15rem;
}

.drop-icon i {
  font-size: 2.4rem;
  color: var(--text-muted);
}

.card-title i {
  margin-right: 6px;
  color: var(--text-accent);
}

.section-label .label-icon i {
  font-size: 1.1rem;
}

.btn-icon i {
  font-size: 1.1rem;
}

.success-icon i {
  font-size: 3.5rem;
  color: var(--success);
}

.stat-change i {
  margin-right: 2px;
}

.empty-icon i {
  font-size: 2.2rem;
  color: var(--text-muted);
}

.status-badge i {
  font-size: 0.72rem;
}

.post-action-link i {
  margin-right: 2px;
}

.post-thumb-placeholder i {
  font-size: 1.2rem;
}

.file-action-btn i {
  margin-right: 2px;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--text-primary), var(--text-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 1px;
}

.sidebar-menu {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.menu-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  padding: 8px 12px 6px;
  margin-top: 8px;
}

.menu-label:first-child {
  margin-top: 0;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(99, 102, 241, 0.08);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  font-weight: 600;
}

.nav-icon {
  font-size: 1.05rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.nav-text {
  flex: 1;
}

.nav-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--accent-primary);
  color: white;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.nav-pro {
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* ===== TOP BAR ===== */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: var(--bg-topbar);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 50;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all var(--transition);
}

.sidebar-toggle:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.topbar-search {
  flex: 1;
  max-width: 480px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 9px 80px 9px 40px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition);
}

.search-input:focus {
  background: var(--bg-input-focus);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-shortcut {
  position: absolute;
  right: 12px;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-input);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.topbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.topbar-btn:hover {
  background: var(--bg-input);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  background: var(--error);
  border-radius: 50%;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.topbar-user:hover {
  background: var(--bg-input);
  border-color: var(--border-hover);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* ===== CONTENT AREA ===== */
.content {
  padding: 28px 28px 60px;
}

.content-section {
  display: none;
  animation: fadeSlideIn 0.3s ease-out;
}

.content-section.active {
  display: block;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.content-header {
  margin-bottom: 24px;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ===== STATS ROW ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat-value-sm {
  font-size: 1.2rem;
}

.stat-change {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.stat-change.positive {
  color: var(--success);
}


/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  margin-bottom: 20px;
  overflow: hidden;
  animation: fadeSlideIn 0.4s ease-out;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-actions {
  display: flex;
  gap: 8px;
}

.card-body {
  padding: 0;
}

/* ===== FORM STYLES ===== */
.form {
  padding: 24px;
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 0;
}

.form-row .form-group {
  flex: 1;
}

.form-group-wide {
  flex: 1 !important;
}

.form-group {
  margin-bottom: 18px;
  position: relative;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  transition: all var(--transition);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  background: var(--bg-input-focus);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b8ba3' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-select option {
  background: var(--bg-sidebar);
  color: var(--text-primary);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  display: block;
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 5px;
}

.char-count {
  position: absolute;
  right: 0;
  top: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 0.78rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-primary:hover {
  box-shadow: 0 4px 24px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-success {
  background: linear-gradient(135deg, #059669, var(--success));
  color: white;
  box-shadow: 0 2px 12px var(--success-glow);
}

.btn-success:hover {
  box-shadow: 0 4px 24px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg-input);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-outline {
  background: transparent;
  color: var(--text-accent);
  border: 1px solid var(--accent-border);
}

.btn-outline:hover {
  background: var(--accent-glow);
}

.btn-generate {
  width: 100%;
  padding: 13px;
  font-size: 0.92rem;
  margin-top: 4px;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn-icon {
  font-size: 1.05rem;
}

/* ===== SPINNER ===== */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== SEO SECTION ===== */
.seo-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.section-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.label-icon {
  font-size: 1rem;
}

.seo-fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ===== DROP ZONE ===== */
.drop-zone {
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-input);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent-primary);
  background: var(--accent-glow);
}

.drop-zone.drag-over {
  transform: scale(1.01);
}

.drop-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.drop-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.drop-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.drop-browse {
  background: none;
  border: none;
  color: var(--text-accent);
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
  padding: 0;
}

.drop-zone-uploading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-accent);
  font-size: 0.85rem;
  font-weight: 500;
}

/* ===== UPLOADED FILES ===== */
.uploaded-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.uploaded-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: var(--radius-sm);
  animation: fadeSlideIn 0.3s ease-out;
}

.uploaded-file-item .file-thumb {
  width: 48px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--bg-input);
}

.uploaded-file-item .file-info {
  flex: 1;
  min-width: 0;
}

.uploaded-file-item .file-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uploaded-file-item .file-url {
  font-size: 0.7rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
  margin-top: 2px;
}

.uploaded-file-item .file-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.file-action-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all var(--transition);
}

.file-action-btn:hover {
  background: var(--bg-input);
  color: var(--text-primary);
  border-color: var(--accent-border);
}

.file-action-btn.set-featured {
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.3);
}

.file-action-btn.set-featured:hover {
  background: rgba(16, 185, 129, 0.1);
}

/* ===== PUBLISH CONTROLS ===== */
.publish-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 18px 24px;
  background: rgba(16, 185, 129, 0.04);
  border-top: 1px solid var(--border);
  gap: 16px;
}

.publish-controls {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex: 1;
}

.publish-status-group {
  min-width: 160px;
}

.publish-select {
  padding: 10px 14px;
  font-size: 0.83rem;
}

.schedule-group {
  flex: 1;
  min-width: 200px;
}

.schedule-input {
  padding: 10px 14px;
  font-size: 0.83rem;
  color-scheme: dark;
}

/* ===== CALENDAR WIDGET ===== */
.calendar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 8px;
}

.calendar-selected {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(99, 102, 241, 0.08);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-accent);
  font-weight: 500;
}

.calendar-selected i {
  font-size: 1.1rem;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.cal-month-year {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.cal-nav {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-body);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.cal-nav:hover {
  background: var(--text-accent);
  color: white;
  border-color: var(--text-accent);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0 12px;
  gap: 2px;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 6px 0;
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 4px 12px 12px;
  gap: 4px;
}

.cal-day {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.cal-day:hover:not(.disabled):not(.empty) {
  background: rgba(99, 102, 241, 0.12);
  color: var(--text-accent);
}

.cal-day.today {
  border: 1.5px solid var(--text-accent);
  color: var(--text-accent);
  font-weight: 700;
}

.cal-day.selected {
  background: var(--text-accent);
  color: white;
  font-weight: 700;
}

.cal-day.selected.today {
  border-color: var(--text-accent);
}

.cal-day.disabled {
  color: var(--text-muted);
  opacity: 0.35;
  cursor: not-allowed;
}

.cal-day.empty {
  cursor: default;
}

.calendar-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: rgba(99, 102, 241, 0.04);
}

.cal-time-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.cal-time-label i {
  font-size: 1rem;
  color: var(--text-accent);
}

.cal-time-selects {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cal-select {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
  min-width: 54px;
}

.cal-select:focus {
  outline: none;
  border-color: var(--text-accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.cal-select-ampm {
  min-width: 52px;
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
  color: var(--text-accent);
  font-weight: 600;
}

.cal-colon {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===== CONTENT CALENDAR (Full Month View) ===== */
.content-cal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.content-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
}

.content-cal-weekdays span {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 10px 0;
}

.content-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.content-cal-cell {
  min-height: 100px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6px 8px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.content-cal-cell:nth-child(7n) {
  border-right: none;
}

.content-cal-cell:hover {
  background: rgba(99, 102, 241, 0.05);
}

.content-cal-cell.today {
  background: rgba(99, 102, 241, 0.06);
}

.content-cal-cell.selected {
  background: rgba(99, 102, 241, 0.1);
  box-shadow: inset 0 0 0 2px var(--text-accent);
}

.content-cal-cell.other-month {
  opacity: 0.3;
}

.cal-cell-day {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.content-cal-cell.today .cal-cell-day {
  color: var(--text-accent);
  font-weight: 800;
}

.cal-cell-posts {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cal-cell-post {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-cell-post.scheduled {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border-left: 2px solid #f59e0b;
}

.cal-cell-post.published {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border-left: 2px solid #10b981;
}

.cal-cell-more {
  font-size: 0.65rem;
  color: var(--text-muted);
  padding: 1px 6px;
  font-weight: 500;
}

/* Filter Toggles */
.cal-view-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 8px;
}

.cal-filter {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: all 0.15s;
  user-select: none;
}

.cal-filter.active {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--border);
}

.cal-filter:hover {
  background: rgba(99, 102, 241, 0.06);
}

.cal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.cal-dot-scheduled {
  background: #f59e0b;
}

.cal-dot-published {
  background: #10b981;
}


.slug-preview {
  display: flex;
  align-items: center;
  gap: 0;
}

.slug-base {
  padding: 11px 14px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.83rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.slug-input {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
}

/* ===== TAGS ===== */
.tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--text-accent);
  font-weight: 500;
  transition: all var(--transition);
}

.tag-chip:hover {
  background: rgba(99, 102, 241, 0.2);
}

.tag-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  transition: color var(--transition);
}

.tag-remove:hover {
  color: var(--error);
}

.no-tags {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-style: italic;
}

/* ===== IMAGE SEARCH ===== */
.image-search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.image-search-bar .form-input {
  flex: 1;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
  max-height: 400px;
  overflow-y: auto;
  padding: 4px;
}

.image-grid-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  aspect-ratio: 16/10;
}

.image-grid-item:hover {
  border-color: var(--accent-primary);
  transform: scale(1.02);
}

.image-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-grid-item .img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 50%);
  display: flex;
  align-items: flex-end;
  padding: 8px;
  opacity: 0;
  transition: opacity var(--transition);
}

.image-grid-item:hover .img-overlay {
  opacity: 1;
}

.img-overlay span {
  color: white;
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.image-grid-item.selected {
  border-color: var(--success);
  box-shadow: 0 0 12px var(--success-glow);
}

.image-grid-item.selected::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}

.load-more-bar {
  text-align: center;
  padding: 8px 0;
}

/* ===== SELECTED IMAGES ===== */
.selected-images {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.selected-image-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.selected-image-item img {
  width: 60px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.selected-image-item .img-details {
  flex: 1;
  min-width: 0;
}

.selected-image-item .img-name {
  font-size: 0.78rem;
  color: var(--text-primary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-image-item .img-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  transition: color var(--transition);
}

.selected-image-item .img-remove:hover {
  color: var(--error);
}

/* ===== CONTENT PREVIEW ===== */
.content-preview {
  padding: 24px;
}

.preview-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  line-height: 1.3;
}

.preview-section {
  margin-bottom: 24px;
}

.preview-section h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-accent);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.preview-section .section-content {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.7;
}

.preview-section .section-content p {
  margin-bottom: 10px;
}

.preview-faq {
  margin-top: 28px;
}

.preview-faq h2 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-accent);
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.faq-item {
  margin-bottom: 14px;
  padding: 14px 16px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.faq-item h4 {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.faq-item p {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.btn-publish {
  padding: 11px 28px;
}

/* ===== SUCCESS CARD ===== */
.success-card {
  text-align: center;
}

.success-content {
  padding: 48px 24px;
}

.success-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  animation: bounceIn 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes bounceIn {
  0% {
    transform: scale(0);
  }

  60% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

.success-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--success), #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.success-message {
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-size: 0.88rem;
}

.success-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ===== POST LIST PANELS ===== */
.posts-list {
  padding: 16px 24px 20px;
}

.posts-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.83rem;
}

.posts-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 0.83rem;
}

.posts-empty .empty-icon {
  font-size: 2rem;
  margin-bottom: 8px;
  display: block;
}

.post-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-input);
  margin-bottom: 8px;
  transition: all var(--transition);
  animation: fadeSlideIn 0.3s ease-out;
}

.post-row:last-child {
  margin-bottom: 0;
}

.post-row:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.post-thumb {
  width: 52px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-sidebar);
}

.post-thumb-placeholder {
  width: 52px;
  height: 38px;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.post-info {
  flex: 1;
  min-width: 0;
}

.post-title-text {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 3px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-badge.scheduled {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.status-badge.published {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.post-countdown {
  font-size: 0.7rem;
  color: var(--warning);
  font-weight: 500;
}

.post-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.post-action-link {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 4px;
  text-decoration: none;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all var(--transition);
  font-weight: 500;
}

.post-action-link:hover {
  color: var(--text-primary);
  background: var(--bg-input);
  border-color: var(--accent-border);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  font-size: 0.83rem;
  font-weight: 500;
  animation: toastSlide 0.3s ease-out;
  max-width: 380px;
}

@keyframes toastSlide {
  from {
    opacity: 0;
    transform: translateX(40px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.toast-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.toast-info {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-wrapper {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: flex;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .content {
    padding: 16px 14px 40px;
  }

  .topbar {
    padding: 0 14px;
  }

  .topbar-search {
    display: none;
  }

  .user-name {
    display: none;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .form {
    padding: 16px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .seo-section {
    padding: 16px;
  }

  .content-preview {
    padding: 16px;
  }

  .publish-bar {
    flex-direction: column;
    gap: 14px;
    padding: 16px;
  }

  .publish-controls {
    flex-direction: column;
    gap: 12px;
  }

  .btn-publish {
    width: 100%;
  }

  .success-actions {
    flex-direction: column;
  }

  .success-actions .btn {
    width: 100%;
  }

  .slug-preview {
    flex-direction: column;
  }

  .slug-base {
    border-right: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    width: 100%;
  }

  .slug-input {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important;
  }

  .post-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .post-actions {
    width: 100%;
  }
}

/* ============================================
   MODALS AND NEW ACTIONS
   ============================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: fadeIn 0.2s ease forwards;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(20px);
  animation: slideUp 0.3s ease forwards;
}

.modal-card-sm {
  max-width: 400px;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  transition: color var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.delete-confirm-text {
  color: var(--text-secondary);
  line-height: 1.5;
}

.delete-confirm-text strong {
  color: var(--text-primary);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-footer-right {
  display: flex;
  gap: 12px;
}

.edit-post-btn {
  color: var(--text-secondary);
  background: var(--bg-input);
}

.edit-post-btn:hover {
  color: var(--accent-primary);
  background: var(--accent-glow);
}

.delete-post-btn {
  color: var(--text-secondary);
  background: var(--bg-input);
}

.delete-post-btn:hover {
  color: var(--error);
  background: var(--error-glow);
}

/* Modal Animations */
@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  to {
    transform: translateY(0);
  }
}

/* ===== DATA TABLES ===== */
.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th, .data-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: rgba(0, 0, 0, 0.15);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

[data-theme="light"] .data-table th {
  background: var(--bg-input);
}

.data-table tr {
  transition: background-color var(--transition);
}

.data-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.data-table td {
  color: var(--text-primary);
  font-size: 0.9rem;
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}