@import url("/admin/styles.css");

:root {
  --accent-bar: #e07b2a;
}

.sidebar {
  border-right: none;
}

.nav-list {
  list-style: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.15s;
  position: relative;
}

.nav-item:hover:not(.disabled) {
  background: var(--sidebar-hover);
}

.nav-item.active {
  background: var(--sidebar-active);
  font-weight: 600;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--accent-bar);
  border-radius: 0 3px 3px 0;
}

.nav-item.disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

.badge {
  margin-left: auto;
  background: #f0b429;
  color: #1a2e1a;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 12px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.page-header-left {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.page-header-icon {
  font-size: 28px;
}

.page-header-title {
  font-size: 24px;
  font-weight: 700;
}

.page-header-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab {
  background: none;
  border: none;
  padding: 10px 2px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  margin-left: 6px;
  background: #eee;
  border-radius: 11px;
  font-size: 11px;
  color: var(--text-muted);
}

.tab.active .tab-count {
  background: var(--primary-light);
  color: var(--primary);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.btn-add-video {
  margin-bottom: 16px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.media-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.media-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #f0f0ea;
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.size-badge,
.featured-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.featured-badge {
  background: var(--primary);
}

.video-thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1a3a1a, #3d7a3d);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.video-emoji {
  font-size: 42px;
}

.media-info {
  padding: 12px 14px;
}

.media-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.media-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.media-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.btn-icon.danger:hover {
  background: #fff5f5;
  border-color: #f5c6c6;
}

.empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
  gap: 12px;
}

.empty-icon {
  font-size: 48px;
  opacity: 0.5;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: #fffbf0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.modal-body {
  padding: 20px;
}

.modal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 4px;
  font-size: 14px;
  cursor: pointer;
}

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

@media (max-width: 640px) {
  .page-header {
    flex-direction: column;
  }

  .modal-row {
    grid-template-columns: 1fr;
  }
}

.modal-lg {
  max-width: 680px;
}

.blog-toolbar {
  margin-bottom: 20px;
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: white;
  min-width: 180px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.stat-card-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.post-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.post-card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #f0f0ea;
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  background: linear-gradient(135deg, #e8f5e8, #f5f0e6);
}

.draft-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #f0b429;
  color: #1a2e1a;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.post-card-body {
  padding: 14px 16px 16px;
}

.post-card-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.post-category {
  color: var(--primary);
  font-weight: 600;
}

.post-card-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
}

.post-card-excerpt {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.post-read-time {
  font-size: 11px;
  color: var(--text-muted);
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  background: #fafaf6;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.upload-icon {
  font-size: 24px;
}

.upload-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.upload-preview img {
  max-width: 100%;
  max-height: 180px;
  border-radius: 6px;
  object-fit: cover;
}

.upload-remove {
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
}

@media (max-width: 768px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
}

.page-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.rfq-stats-row { grid-template-columns: repeat(4, 1fr); }
.rfq-stat { border-top: 3px solid var(--border); }
.rfq-stat-new { border-top-color: #3b82f6; }
.rfq-stat-review { border-top-color: #f59e0b; }
.rfq-stat-sent { border-top-color: #22c55e; }
.rfq-stat-won { border-top-color: #a855f7; }
.rfq-toolbar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; align-items: center; }
.rfq-search-wrap { position: relative; flex: 1; min-width: 220px; }
.rfq-search-wrap input { width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.rfq-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: 0.6; }
.rfq-table-wrap { background: white; border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow); }
.rfq-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rfq-table thead { background: #fffbf0; }
.rfq-table th, .rfq-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.rfq-table th { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; color: var(--text-muted); text-transform: uppercase; }
.rfq-contact-name { font-weight: 600; color: var(--text-dark); }
.rfq-contact-email { font-size: 11px; color: var(--text-muted); }
.rfq-status-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.status-new { background: #dbeafe; color: #1d4ed8; }
.status-review, .status-in-review { background: #ffedd5; color: #c2410c; }
.status-sent, .status-quote-sent { background: #dcfce7; color: #15803d; }
.status-won, .status-closed-won { background: #f3e8ff; color: #7e22ce; }
.status-lost, .status-closed-lost { background: #f3f4f6; color: #6b7280; }
@media (max-width: 900px) { .rfq-stats-row { grid-template-columns: repeat(2, 1fr); } }
