/* ================================================
   SEMANTIC SEO ENGINE - Admin Dashboard CSS
   ================================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --purple: #7c3aed;
  --orange: #ea580c;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --sidebar-width: 240px;
  --header-height: 60px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--gray-100); color: var(--gray-800); line-height: 1.5; }

/* ==================== LOGIN ==================== */

.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--gray-100);
}
.login-card {
  background: white; padding: 2.5rem; border-radius: var(--radius);
  box-shadow: var(--shadow-md); width: 100%; max-width: 400px; text-align: center;
}
.login-card h1 { font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--primary); }
.login-card p { color: var(--gray-500); margin-bottom: 1.5rem; font-size: 0.9rem; }

/* ==================== LAYOUT ==================== */

.admin-body { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width); background: var(--gray-900); color: white;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  display: flex; flex-direction: column; transition: transform 0.3s;
}
.sidebar-header { padding: 1.25rem; border-bottom: 1px solid var(--gray-700); }
.sidebar-header h2 { font-size: 1.2rem; color: white; }
.sidebar-subtitle { font-size: 0.75rem; color: var(--gray-400); }

.sidebar-nav { flex: 1; padding: 0.5rem 0; }
.nav-item {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1.25rem;
  color: var(--gray-300); text-decoration: none; font-size: 0.9rem; transition: all 0.2s;
}
.nav-item:hover { background: var(--gray-800); color: white; }
.nav-item.active { background: var(--primary); color: white; }
.nav-icon { font-size: 1.1rem; width: 1.2rem; text-align: center; }
.sidebar-footer { border-top: 1px solid var(--gray-700); padding: 0.5rem 0; }
.logout { color: var(--gray-400) !important; }

.admin-main {
  flex: 1; margin-left: var(--sidebar-width); min-height: 100vh;
}
.admin-header {
  background: white; border-bottom: 1px solid var(--gray-200); padding: 0 1.5rem;
  height: var(--header-height); display: flex; align-items: center; gap: 1rem;
  position: sticky; top: 0; z-index: 50;
}
.admin-header h1 { font-size: 1.25rem; font-weight: 600; }
.menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

.admin-content { padding: 1.5rem; max-width: 1200px; }

/* ==================== COMPONENTS ==================== */

/* Jodit Editor overrides */
.jodit-container { border-radius: var(--radius) !important; border-color: var(--gray-300) !important; }
.jodit-container:focus-within { border-color: var(--primary) !important; box-shadow: 0 0 0 3px rgba(37,99,235,0.1) !important; }
.jodit-workplace { font-family: Georgia, 'Times New Roman', serif !important; font-size: 1rem !important; line-height: 1.7 !important; }
.jodit-status-bar { border-top: 1px solid var(--gray-200) !important; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.5rem 1rem; border-radius: var(--radius); border: none;
  font-size: 0.875rem; font-weight: 500; cursor: pointer; text-decoration: none;
  transition: all 0.2s; line-height: 1.5;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: white; color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-outline:hover { background: var(--gray-50); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 0.25rem 0.625rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled, .btn.loading { opacity: 0.6; cursor: not-allowed; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.25rem; color: var(--gray-700); }
.form-input {
  width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--gray-300);
  border-radius: var(--radius); font-size: 0.9rem; background: white;
  transition: border-color 0.2s; font-family: inherit;
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
textarea.form-input { resize: vertical; }
.content-editor { font-family: 'Courier New', monospace; font-size: 0.85rem; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }
.form-group-btn { display: flex; align-items: flex-end; }
.field-hint { font-size: 0.75rem; color: var(--gray-400); margin-top: 0.25rem; }
.char-count { font-size: 0.75rem; color: var(--gray-400); font-weight: 400; }

/* Tabs */
.form-tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--gray-200);
  margin-bottom: 1.5rem; background: white; border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}
.form-tab {
  flex: 1; padding: 0.875rem 1.25rem; text-align: center; cursor: pointer;
  font-size: 0.9rem; font-weight: 500; color: var(--gray-500);
  background: var(--gray-50); border: none; border-bottom: 3px solid transparent;
  transition: all 0.2s; position: relative;
}
.form-tab:hover { color: var(--gray-700); background: white; }
.form-tab.active {
  color: var(--primary); background: white; border-bottom-color: var(--primary);
  font-weight: 600;
}
.form-tab .tab-desc {
  display: block; font-size: 0.72rem; font-weight: 400; color: var(--gray-400);
  margin-top: 0.15rem;
}
.form-tab.active .tab-desc { color: var(--primary); opacity: 0.7; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.form-column h3 { margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--gray-200); color: var(--gray-700); font-size: 1rem; }
.form-actions { margin-top: 1.5rem; display: flex; gap: 1rem; padding-top: 1rem; border-top: 1px solid var(--gray-200); }
.form-actions-inline { display: flex; gap: 0.75rem; align-items: center; margin-top: 0.5rem; }
.input-with-btn { display: flex; gap: 0.5rem; }
.input-with-btn .form-input { flex: 1; }

select.form-input { cursor: pointer; }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: var(--warning); border: 1px solid #fde68a; }

/* Badges */
.badge {
  display: inline-block; padding: 0.15rem 0.5rem; border-radius: 12px;
  font-size: 0.75rem; font-weight: 500; text-transform: capitalize;
}
.badge-green { background: #dcfce7; color: #166534; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-red { background: #fef2f2; color: #991b1b; }
.badge-blue { background: #dbeafe; color: #1e40af; }

/* Stats */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}
.stat-card {
  background: white; padding: 1.25rem; border-radius: var(--radius);
  box-shadow: var(--shadow); border-left: 4px solid var(--primary);
}
.stat-card.stat-green { border-left-color: var(--success); }
.stat-card.stat-yellow { border-left-color: var(--warning); }
.stat-card.stat-blue { border-left-color: var(--primary); }
.stat-card.stat-purple { border-left-color: var(--purple); }
.stat-card.stat-orange { border-left-color: var(--orange); }
.stat-number { font-size: 2rem; font-weight: 700; color: var(--gray-800); }
.stat-label { font-size: 0.8rem; color: var(--gray-500); margin-top: 0.25rem; }

/* Tables */
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.data-table th { background: var(--gray-50); padding: 0.75rem 1rem; text-align: left; font-size: 0.8rem; color: var(--gray-500); text-transform: uppercase; font-weight: 600; border-bottom: 1px solid var(--gray-200); }
.data-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--gray-100); font-size: 0.875rem; vertical-align: middle; }
.data-table tr:hover { background: var(--gray-50); }
.actions { display: flex; gap: 0.375rem; flex-wrap: wrap; }

/* Pagination */
.pagination { display: flex; gap: 0.25rem; margin-top: 1rem; justify-content: center; }
.page-link { padding: 0.4rem 0.75rem; border: 1px solid var(--gray-300); border-radius: var(--radius); text-decoration: none; color: var(--gray-600); font-size: 0.85rem; }
.page-link.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Sections */
.section { margin-bottom: 2rem; }
.section h2 { font-size: 1.1rem; margin-bottom: 1rem; color: var(--gray-700); }
.section h3 { font-size: 1rem; margin-bottom: 0.75rem; color: var(--gray-600); }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }

/* Action grid */
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.action-card {
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem; background: white; border-radius: var(--radius);
  box-shadow: var(--shadow); text-decoration: none; color: var(--primary);
  font-weight: 500; transition: all 0.2s; text-align: center;
}
.action-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; background: white; border-radius: var(--radius); color: var(--gray-500); }
.empty-state .btn { margin-top: 1rem; }

/* Theme cards */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.theme-card {
  background: white; padding: 1.25rem; border-radius: var(--radius);
  box-shadow: var(--shadow); border-top: 3px solid var(--primary);
}
.theme-card h4 { font-size: 0.95rem; margin-bottom: 0.5rem; color: var(--gray-800); }
.theme-card .theme-angle { font-size: 0.8rem; color: var(--primary); font-weight: 500; margin-bottom: 0.5rem; }
.theme-card p { font-size: 0.85rem; color: var(--gray-600); }

/* Audit */
.audit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.audit-score-card { text-align: center; background: white; padding: 2rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.score-circle {
  width: 120px; height: 120px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem; font-size: 2.5rem; font-weight: 700; border: 6px solid var(--gray-200);
}
.score-circle.score-good { border-color: var(--success); color: var(--success); }
.score-circle.score-warn { border-color: var(--warning); color: var(--warning); }
.score-circle.score-bad { border-color: var(--danger); color: var(--danger); }
.audit-notes { font-size: 0.9rem; color: var(--gray-600); margin-top: 1rem; }

.audit-breakdown { background: white; padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.score-bar { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.score-bar label { width: 130px; font-size: 0.85rem; color: var(--gray-600); }
.progress { flex: 1; height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width 0.5s; }
.score-bar span { font-size: 0.8rem; color: var(--gray-500); width: 40px; text-align: right; }

.brief-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.brief-card {
  background: white; padding: 1.25rem; border-radius: var(--radius);
  box-shadow: var(--shadow); border-left: 3px solid var(--purple);
}
.brief-card h4 { font-size: 0.9rem; color: var(--purple); margin-bottom: 0.5rem; }
.brief-card p { font-size: 0.85rem; color: var(--gray-600); margin-bottom: 0.5rem; }
.brief-card .alt-text { font-size: 0.8rem; color: var(--gray-400); font-style: italic; }

/* Article Preview (tab pratinjau) */
.preview-toolbar {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem;
  padding-bottom: 1rem; border-bottom: 1px solid var(--gray-200);
}
.article-preview-container {
  background: white; border-radius: var(--radius); box-shadow: var(--shadow);
  max-width: 720px; margin: 0 auto; overflow: hidden;
}
.article-preview { padding: 2rem 2.5rem; }
.article-preview-header { margin-bottom: 2rem; }
.ap-category {
  display: inline-block; font-size: 0.8rem; color: var(--primary);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.5rem;
}
.ap-title {
  font-size: 2rem; font-weight: 700; line-height: 1.3;
  margin-bottom: 0.75rem; color: var(--gray-900);
}
.ap-excerpt {
  font-size: 1.1rem; color: var(--gray-500); line-height: 1.6;
  margin-bottom: 1rem;
}
.ap-meta {
  display: flex; gap: 1rem; align-items: center; padding-top: 0.75rem;
  border-top: 1px solid var(--gray-200); font-size: 0.85rem; color: var(--gray-500);
}
.ap-author { font-weight: 600; color: var(--gray-700); }
.ap-featured-image { margin-bottom: 1.5rem; }
.ap-featured-image img {
  width: 100%; height: auto; border-radius: var(--radius);
}
.ap-body {
  font-family: Georgia, 'Times New Roman', serif; font-size: 1.05rem;
  line-height: 1.8; color: var(--gray-800);
}
.ap-body h2 { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 1.5rem; margin-top: 2rem; margin-bottom: 0.75rem; color: var(--gray-900); }
.ap-body h3 { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; font-size: 1.25rem; margin-top: 1.5rem; margin-bottom: 0.75rem; color: var(--gray-900); }
.ap-body p { margin-bottom: 1.25rem; }
.ap-body ul, .ap-body ol { margin-bottom: 1.25rem; padding-left: 1.5rem; }
.ap-body li { margin-bottom: 0.4rem; }
.ap-body blockquote {
  border-left: 4px solid var(--primary); padding-left: 1.25rem;
  margin: 1.5rem 0; font-style: italic; color: var(--gray-500);
}
.ap-body img {
  max-width: 100%; height: auto; border-radius: var(--radius);
  margin: 1rem 0;
}
/* Image alignment in preview & editor */
.ap-body img[style*="float: left"], .ap-body img.img-left,
.jodit-wysiwyg img[style*="float: left"] {
  float: left; margin: 0.5rem 1.5rem 1rem 0; max-width: 50%;
}
.ap-body img[style*="float: right"], .ap-body img.img-right,
.jodit-wysiwyg img[style*="float: right"] {
  float: right; margin: 0.5rem 0 1rem 1.5rem; max-width: 50%;
}
.ap-body img[style*="margin-left: auto"][style*="margin-right: auto"],
.ap-body img[style*="display: block"],
.jodit-wysiwyg img[style*="margin-left: auto"][style*="margin-right: auto"],
.jodit-wysiwyg img[style*="display: block"] {
  display: block; margin-left: auto; margin-right: auto;
}
.ap-body::after, .jodit-wysiwyg::after { content: ''; display: table; clear: both; }
.ap-footer { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--gray-200); }
.ap-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.ap-tags .tag {
  display: inline-block; padding: 0.2rem 0.6rem; background: var(--gray-100);
  border-radius: 4px; font-size: 0.8rem; color: var(--gray-600);
}

/* Keyword density */
.keyword-density-box {
  padding: 0.75rem 1rem; background: var(--gray-50); border-radius: var(--radius);
  border: 1px solid var(--gray-200); margin-bottom: 1rem; font-size: 0.85rem;
  display: flex; align-items: center; gap: 0.5rem;
}

/* SEO Preview */
.seo-preview { margin-top: 1rem; }
.seo-preview h4 { font-size: 0.85rem; color: var(--gray-500); margin-bottom: 0.5rem; }
.google-preview { background: white; padding: 1rem; border-radius: var(--radius); border: 1px solid var(--gray-200); }
.gp-title { color: #1a0dab; font-size: 1.1rem; margin-bottom: 0.25rem; }
.gp-url { color: #006621; font-size: 0.8rem; margin-bottom: 0.25rem; }
.gp-desc { color: var(--gray-600); font-size: 0.85rem; }

/* Settings */
.settings-grid { display: grid; gap: 1.5rem; }
.settings-card { background: white; padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.settings-card h2 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.settings-card p { font-size: 0.85rem; color: var(--gray-500); margin-bottom: 1rem; }
.link { color: var(--primary); text-decoration: none; }
.link:hover { text-decoration: underline; }
.status-indicator { font-size: 0.85rem; }
code { background: var(--gray-100); padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.85rem; }

/* Usage Stats */
.usage-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.usage-stat-card { background: var(--gray-50); border-radius: var(--radius); padding: 1rem; text-align: center; border: 1px solid var(--gray-200); }
.usage-stat-number { font-size: 1.5rem; font-weight: 700; color: var(--gray-800); }
.usage-stat-label { font-size: 0.8rem; color: var(--gray-500); margin-top: 0.25rem; }
.usage-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.usage-table th { text-align: left; padding: 0.5rem 0.75rem; background: var(--gray-50); border-bottom: 2px solid var(--gray-200); font-weight: 600; font-size: 0.8rem; color: var(--gray-600); }
.usage-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--gray-100); }
.usage-table tbody tr:hover { background: var(--gray-50); }
.usage-period-selector { display: flex; align-items: center; gap: 0.5rem; }
@media (max-width: 640px) { .usage-stats-grid { grid-template-columns: 1fr; } }

/* AI Assistant Panel */
.ai-assistant-panel {
  background: white; border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 1.5rem; border: 2px solid var(--primary); overflow: hidden;
}
.ai-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.25rem; cursor: pointer; background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: white; user-select: none;
}
.ai-panel-header h3 { font-size: 0.95rem; margin: 0; }
.toggle-icon { font-size: 0.8rem; }
.ai-panel-body { padding: 1.25rem; }
.ai-hint { font-size: 0.85rem; color: var(--gray-500); margin-bottom: 1rem; }
.ai-step { margin-bottom: 1rem; border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; }
.step-header {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem;
  background: var(--gray-50); cursor: pointer; user-select: none; font-weight: 500; font-size: 0.9rem;
}
.step-header small { font-weight: 400; color: var(--gray-400); }
.step-number {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; background: var(--primary);
  color: white; font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
}
.step-toggle-icon { margin-left: auto; font-size: 0.7rem; color: var(--gray-400); }
.step-body { padding: 1rem; }
.theme-card-selectable { cursor: default; transition: all 0.2s; position: relative; }
.theme-card-selectable .btn-use-theme { margin-top: 0.75rem; width: 100%; }
.theme-card-selectable.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.draft-loading-box {
  display: flex; align-items: center; gap: 0.75rem; padding: 1.25rem;
  background: #eff6ff; border-radius: var(--radius); margin-top: 1rem;
  color: var(--primary); font-weight: 500; font-size: 0.9rem;
}
.draft-loading-box .spinner { width: 22px; height: 22px; border-width: 3px; }

/* Loading spinner */
.spinner {
  display: inline-block; width: 18px; height: 18px; border: 2px solid var(--gray-300);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.6s linear infinite; vertical-align: middle; margin-right: 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Notification toast */
.notification {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 1000;
  padding: 0.75rem 1.5rem; border-radius: var(--radius); font-size: 0.9rem;
  box-shadow: var(--shadow-md); display: none; max-width: 400px;
  transition: opacity 0.3s, transform 0.3s;
}
.notification.show { display: block; animation: slideUp 0.3s ease; }
.notification.success { background: #166534; color: white; }
.notification.error { background: var(--danger); color: white; }
.notification.warning { background: var(--warning); color: white; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .menu-toggle { display: block; }
  .form-grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
  .audit-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-tab .tab-desc { display: none; }
  .form-tab { font-size: 0.8rem; padding: 0.75rem 0.5rem; }
  .crop-variants { flex-direction: column; }
  .variant-card { min-width: auto; }
  .variant-selector { flex-direction: column; align-items: flex-start; }
  .variant-selector select { max-width: 100%; }
}

/* ═══ IMAGE UPLOAD ZONE ═══ */
.image-upload-zone { margin-bottom: 0.5rem; }

.upload-dropzone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--gray-50);
}
.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--primary);
  background: #eff6ff;
}
.dropzone-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.dropzone-text { font-size: 1rem; font-weight: 500; color: var(--gray-700); margin-bottom: 0.25rem; }
.dropzone-hint { font-size: 0.85rem; color: var(--gray-400); }
.dropzone-formats { font-size: 0.75rem; color: var(--gray-400); margin-top: 0.5rem; }

.upload-preview {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem;
}
.preview-image-container {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin-bottom: 1rem;
}
.preview-image-container img {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius);
  object-fit: contain;
}
.btn-remove-image {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  background: var(--danger);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-remove-image:hover { opacity: 0.85; }

.crop-variants {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.variant-card {
  flex: 1;
  min-width: 140px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.variant-card:hover { border-color: var(--gray-400); }
.variant-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}
.variant-label {
  display: block;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--gray-700);
  margin-bottom: 0.25rem;
}
.variant-thumb {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 0.25rem;
  background: var(--gray-100);
}
.variant-use {
  display: block;
  font-size: 0.7rem;
  color: var(--gray-400);
}
.variant-selector {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}
.variant-selector label {
  white-space: nowrap;
  color: var(--gray-600);
  margin: 0;
  font-weight: 500;
}
.variant-selector select { max-width: 280px; }

.upload-progress {
  padding: 1rem;
  text-align: center;
}
.progress-bar-track {
  width: 100%;
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  width: 0%;
  animation: progressPulse 1.5s ease-in-out infinite;
}
@keyframes progressPulse {
  0% { width: 10%; }
  50% { width: 80%; }
  100% { width: 10%; }
}

.upload-warning {
  padding: 0.5rem 0.75rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  color: #92400e;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.legacy-image-notice {
  padding: 1rem;
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  margin-bottom: 0.75rem;
}
.legacy-image-notice img {
  max-width: 300px;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  display: block;
}
