:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Inter, system-ui, sans-serif;
}
body {
  background: var(--bg);
  color: var(--text);
  padding: 24px;
}
.app {
  max-width: 1600px;
  margin: auto;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}
.subtitle {
  display: inline-block;
  padding: 7px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 10px;
}
.topbar h1 {
  font-size: 2rem;
  margin-bottom: 6px;
}
.topbar p {
  color: var(--muted);
}
.top-actions {
  display: flex;
  gap: 10px;
}
.btn {
  border: none;
  cursor: pointer;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 600;
  transition: 0.25s;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
}
.btn-light {
  background: #fff;
  border: 1px solid var(--border);
}
.full-btn {
  width: 100%;
  margin-top: 20px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 25px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: var(--shadow);
}
.stat-icon {
  width: 55px;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(37, 99, 235, 0.08);
}
.stat-icon i {
  font-size: 24px;
  color: var(--primary);
}
.stat-card h2 {
  font-size: 1.5rem;
}
.stat-card p {
  color: var(--muted);
}
.tabs {
  display: flex;
  gap: 10px;
  background: #fff;
  padding: 8px;
  border-radius: 20px;
  margin-bottom: 25px;
  box-shadow: var(--shadow);
}
.tab {
  flex: 1;
  border: none;
  background: 0 0;
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.25s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.tab:hover {
  background: #f1f5f9;
}
.tab.active {
  background: var(--primary);
  color: #fff;
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}
.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-bottom: 25px;
}
.panel,
.preview-card {
  background: #fff;
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.panel h3,
.preview-card h2 {
  margin-bottom: 18px;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px;
  outline: 0;
  background: #fff;
  transition: 0.2s;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}
textarea {
  resize: vertical;
  min-height: 140px;
}
.upload-box {
  border: 2px dashed var(--border);
  border-radius: 20px;
  padding: 25px;
  text-align: center;
  cursor: pointer;
  margin-top: 10px;
  transition: 0.25s;
}
.upload-box:hover {
  border-color: var(--primary);
}
.upload-box i {
  display: block;
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 10px;
}
.preview-card p {
  line-height: 1.7;
  color: var(--muted);
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  color: var(--muted);
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 18px;
}
.badge.green {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}
.badge.orange {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
}
.content-section {
  background: #fff;
  border-radius: 28px;
  padding: 25px;
  box-shadow: var(--shadow);
}
.section-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}
.search-box {
  width: 320px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0 14px;
  background: #fff;
}
.search-box input {
  border: none;
  padding: 12px 0;
}
.search-box input:focus {
  box-shadow: none;
}
.content-grid {
  display: grid;
  gap: 15px;
}
.content-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}
.content-info h4 {
  margin: 8px 0;
}
.content-info p {
  color: var(--muted);
  font-size: 0.9rem;
}
.content-type {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}
.content-type.document {
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
}
.content-type.article {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}
.content-type.project {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
}
.card-actions {
  position: relative;
}
.menu-toggle {
  width: 42px;
  height: 42px;
  border: none;
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
}
.menu-toggle i {
  font-size: 1.2rem;
}
.dropdown-menu {
  position: absolute;
  top: 50px;
  right: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: none;
  overflow: hidden;
  z-index: 100;
}
.dropdown-menu.active {
  display: block;
}
.dropdown-menu button {
  width: 100%;
  border: none;
  background: 0 0;
  padding: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dropdown-menu button:hover {
  background: #f8fafc;
}
.delete-btn {
  color: var(--danger);
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 999;
}
.modal.active {
  display: flex;
}
.modal-content {
  width: min(700px, 100%);
  background: #fff;
  border-radius: 30px;
  padding: 30px;
  position: relative;
}
.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: #f1f5f9;
}
.modal-content {
  width: min(700px, 100%);
  background: #fff;
  border-radius: 30px;
  padding: 30px;
  position: relative;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-content .badge {
  width: fit-content;
}
@media (max-width: 1024px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  body {
    padding: 15px;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .tabs {
    flex-direction: column;
  }
  .section-top {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box {
    width: 100%;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .content-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  .card-actions {
    width: 100%;
  }
  .menu-toggle {
    width: 100%;
  }
}
@media (max-width: 480px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .content-section,
  .panel,
  .preview-card {
    padding: 18px;
  }
  .topbar h1 {
    font-size: 1.5rem;
  }
  .stat-card {
    padding: 15px;
  }
  .stat-card h2 {
    font-size: 1.2rem;
  }
}
.image-upload-box {
  border: 2px dashed #dbe4f0;
  border-radius: 20px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.3s;
  background: #fafcff;
  overflow: hidden;
}
.image-upload-box:hover {
  border-color: var(--primary);
  background: #f5f9ff;
}
.upload-placeholder {
  text-align: center;
  padding: 30px;
}
.upload-placeholder i {
  font-size: 3rem;
  color: var(--primary);
  display: block;
  margin-bottom: 10px;
}
.upload-placeholder h4 {
  margin-bottom: 8px;
}
.upload-placeholder p {
  color: var(--muted);
}
.upload-placeholder small {
  display: block;
  margin-top: 8px;
  color: #94a3b8;
}
.image-preview-wrapper {
  display: none;
  margin-top: 20px;
}
.image-preview-wrapper.active {
  display: block;
}
.image-preview-wrapper img {
  width: 100%;
  border-radius: 18px;
  max-height: 350px;
  object-fit: cover;
}
.image-stats {
  display: flex;
  gap: 15px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}
.preview-image-container {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  margin-bottom: 20px;
  border: 1px solid #ccc;
}
.preview-image-container img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}
.preview-overlay {
  position: absolute;
  top: 15px;
  left: 15px;
}
.preview-content h2 {
  margin-bottom: 15px;
}
@media (max-width: 768px) {
  .preview-image-container img {
    height: 220px;
  }
}
.custom-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.custom-toast {
  min-width: 260px;
  max-width: 320px;
  padding: 14px 16px;
  border-radius: 14px;
  color: #fff;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  animation: slideIn 0.25s ease;
}
.custom-toast i {
  font-size: 20px;
}
.custom-toast.success {
  background: linear-gradient(135deg, #16a34a, #22c55e);
}
.custom-toast.error {
  background: linear-gradient(135deg, #dc2626, #ef4444);
}
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  margin-bottom: 20px;
}
.pagination button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: none;
  border-radius: 12px;
  background: #2563eb;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s ease;
}
.pagination button:hover {
  transform: translateY(-2px);
  background: #1d4ed8;
}
.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.pagination button i {
  font-size: 18px;
}
.pagination2 {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  margin-bottom: 20px;
}
.pagination2 button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: none;
  border-radius: 12px;
  background: #2563eb;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s ease;
}
.pagination2 button:hover {
  transform: translateY(-2px);
  background: #1d4ed8;
}
.pagination2 button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.pagination2 button i {
  font-size: 18px;
}
.pagination3 {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  margin-bottom: 20px;
}
.pagination3 button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: none;
  border-radius: 12px;
  background: #2563eb;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s ease;
}
.pagination3 button:hover {
  transform: translateY(-2px);
  background: #1d4ed8;
}
.pagination3 button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.pagination3 button i {
  font-size: 18px;
}
.modal-body {
  margin-top: 15px;
  line-height: 1.6;
  color: #334155;
}
.modal-meta {
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: #64748b;
  margin-top: 5px;
}
