/* Ratevo Admin Panel CSS */

:root {
  --blue-600: #2563eb; --blue-700: #1d4ed8; --blue-50: #eff6ff; --blue-100: #dbeafe;
  --slate-50: #f8fafc; --slate-100: #f1f5f9; --slate-200: #e2e8f0; --slate-300: #cbd5e1;
  --slate-400: #94a3b8; --slate-500: #64748b; --slate-600: #475569; --slate-700: #334155;
  --slate-800: #1e293b; --slate-900: #0f172a;
  --green-500: #22c55e; --green-100: #dcfce7;
  --red-500: #ef4444; --red-100: #fee2e2;
  --yellow-400: #facc15;
  --orange-400: #fb923c;
  --sidebar-w: 240px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', -apple-system, sans-serif; color: var(--slate-800); background: var(--slate-100); -webkit-font-smoothing: antialiased; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== ADMIN LAYOUT ===== */
.admin-layout { display: flex; min-height: 100vh; }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-content { flex: 1; padding: 28px; overflow-y: auto; }

/* ===== SIDEBAR ===== */
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--slate-900);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-header { padding: 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-logo {
  display: flex; align-items: center; gap: 2px;
  text-decoration: none; color: var(--slate-100);
  font-weight: 700; font-size: 16px;
}
.sidebar-logo:hover { text-decoration: none; color: var(--slate-100); }
.sidebar-logo-icon {
  width: 32px; height: 32px;
  background: var(--blue-600);
  color: white;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px;
  flex-shrink: 0;
}
.sidebar-nav { padding: 12px 8px; flex: 1; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--slate-400);
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  margin-bottom: 2px;
  transition: all 0.15s;
  text-decoration: none;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.sidebar-link:hover { background: rgba(255,255,255,0.07); color: var(--slate-200); text-decoration: none; }
.sidebar-link.active { background: var(--blue-600); color: white; }
.sidebar-link svg { flex-shrink: 0; }
.sidebar-link-sm { font-size: 13px; }
.sidebar-footer { padding: 12px 8px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-logout { color: #f87171; }
.sidebar-logout:hover { background: rgba(239,68,68,0.15); color: #f87171; }

/* ===== TOPBAR ===== */
.admin-topbar {
  background: white;
  border-bottom: 1px solid var(--slate-200);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.admin-topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-title { font-size: 20px; font-weight: 700; color: var(--slate-900); }
.admin-topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-shop-name { font-size: 14px; color: var(--slate-500); font-weight: 500; }
.sidebar-toggle {
  background: none; border: none; cursor: pointer; color: var(--slate-500); padding: 8px; border-radius: 6px;
  display: none;
}
.sidebar-toggle:hover { background: var(--slate-100); }

/* ===== CARDS ===== */
.admin-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--slate-200);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.admin-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 8px; }
.admin-card-title { font-size: 18px; font-weight: 700; margin: 0 0 8px 0; }
.card-desc { color: var(--slate-500); font-size: 14px; margin-bottom: 20px; line-height: 1.6; }

/* ===== STATS GRID ===== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--slate-200);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon-blue { background: var(--blue-100); color: var(--blue-600); }
.stat-icon-yellow { background: #fef9c3; color: #854d0e; }
.stat-icon-green { background: var(--green-100); color: #15803d; }
.stat-icon-orange { background: #ffedd5; color: #9a3412; }
.stat-number { font-size: 28px; font-weight: 800; color: var(--slate-900); line-height: 1; }
.stat-label { font-size: 13px; color: var(--slate-500); margin-top: 4px; }

/* ===== QUICK ACTIONS ===== */
.quick-actions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.quick-action-card {
  background: white;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: var(--slate-800);
  transition: all 0.15s;
}
.quick-action-card:hover { border-color: var(--blue-600); box-shadow: 0 4px 12px rgba(37,99,235,0.1); text-decoration: none; }
.quick-action-icon {
  width: 44px; height: 44px;
  background: var(--blue-50);
  color: var(--blue-600);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.quick-action-title { font-weight: 700; font-size: 14px; }
.quick-action-desc { font-size: 12px; color: var(--slate-500); margin-top: 2px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--slate-700); margin-bottom: 6px; }
.form-input {
  width: 100%; border: 1px solid var(--slate-300); border-radius: 8px;
  padding: 9px 12px; font-size: 14px; color: var(--slate-900); background: white; font-family: inherit;
  transition: border-color 0.2s;
}
.form-input:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.form-input-sm { padding: 7px 10px; font-size: 13px; }
.form-textarea {
  width: 100%; border: 1px solid var(--slate-300); border-radius: 8px;
  padding: 9px 12px; font-size: 14px; color: var(--slate-900); resize: vertical;
  font-family: inherit; min-height: 100px; transition: border-color 0.2s;
}
.form-textarea:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.form-message { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 12px; }
.form-message-success { background: var(--green-100); color: #15803d; }
.form-message-error { background: var(--red-100); color: #dc2626; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--slate-600); cursor: pointer; }
.form-check input { margin-top: 2px; flex-shrink: 0; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 8px; font-weight: 600; font-size: 14px;
  cursor: pointer; border: 2px solid transparent; transition: all 0.15s;
  text-decoration: none; white-space: nowrap; line-height: 1; font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blue-600); color: white; border-color: var(--blue-600); }
.btn-primary:hover { background: var(--blue-700); border-color: var(--blue-700); color: white; }
.btn-outline { background: transparent; color: var(--blue-600); border-color: var(--blue-600); }
.btn-outline:hover { background: var(--blue-50); }
.btn-ghost { background: transparent; color: var(--slate-600); border-color: transparent; }
.btn-ghost:hover { background: var(--slate-100); color: var(--slate-800); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 9999px; font-size: 12px; font-weight: 600;
}
.badge-green { background: var(--green-100); color: #15803d; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-gray { background: var(--slate-100); color: var(--slate-600); }
.badge-blue { background: var(--blue-100); color: var(--blue-700); }
.badge-orange { background: #ffedd5; color: #9a3412; }

/* ===== NOTICE ===== */
.notice {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-radius: 10px; font-size: 14px; margin-bottom: 20px;
}
.notice-warning { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }

/* ===== TABLE ===== */
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; font-weight: 600; font-size: 13px; color: var(--slate-500); padding: 10px 12px; border-bottom: 2px solid var(--slate-200); }
.admin-table td { padding: 12px; border-bottom: 1px solid var(--slate-100); color: var(--slate-700); }
.admin-table tr:hover td { background: var(--slate-50); }
.admin-table code { background: var(--slate-100); padding: 2px 6px; border-radius: 4px; font-size: 12px; }

/* ===== REVIEWS ===== */
.reviews-filters { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.filter-check { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--slate-600); cursor: pointer; }
.review-admin-card {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 12px;
}
.review-admin-header { display: flex; justify-content: space-between; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.review-admin-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-admin-name { font-weight: 600; font-size: 15px; }
.review-admin-date { font-size: 12px; color: var(--slate-400); }
.review-admin-stars { color: var(--yellow-400); font-size: 18px; letter-spacing: 2px; }
.review-admin-title { font-weight: 700; margin-bottom: 6px; }
.review-admin-body { color: var(--slate-600); font-size: 14px; margin-bottom: 12px; line-height: 1.6; }
.review-admin-reply {
  background: var(--blue-50); border-left: 3px solid var(--blue-600);
  border-radius: 6px; padding: 12px; margin-top: 10px;
  font-size: 13px; color: var(--slate-700);
}
.review-admin-reply strong { color: var(--blue-700); }
.review-admin-reply small { color: var(--slate-400); display: block; margin-top: 4px; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  padding: 20px;
}
.modal {
  background: white; border-radius: 16px; max-width: 560px; width: 100%;
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--slate-200); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--slate-400); padding: 4px; border-radius: 6px; }
.modal-close:hover { background: var(--slate-100); color: var(--slate-700); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--slate-200); display: flex; justify-content: flex-end; gap: 10px; }
.review-preview { font-size: 14px; color: var(--slate-600); background: var(--slate-50); padding: 12px; border-radius: 8px; margin-bottom: 16px; font-style: italic; }

/* ===== CSV IMPORT ===== */
.csv-format-info { background: var(--slate-50); border-radius: 10px; padding: 16px; margin-bottom: 20px; font-size: 13px; }
.csv-format-info code { background: var(--slate-200); padding: 2px 6px; border-radius: 4px; }
.csv-example { margin-top: 8px; }
.csv-example pre { background: var(--slate-800); color: #e2e8f0; padding: 12px; border-radius: 8px; font-size: 12px; overflow-x: auto; }
.file-upload-area {
  border: 2px dashed var(--slate-300); border-radius: 10px; padding: 32px;
  text-align: center; color: var(--slate-500); cursor: pointer; transition: all 0.2s;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.file-upload-area:hover { border-color: var(--blue-400); background: var(--blue-50); }
.file-upload-area.drag-over { border-color: var(--blue-600); background: var(--blue-100); }
.file-upload-area p { font-size: 15px; }
.file-upload-area small { font-size: 12px; }
.link-btn { background: none; border: none; color: var(--blue-600); cursor: pointer; font-weight: 600; font-size: inherit; }
.selected-file { background: var(--blue-50); color: var(--blue-700); padding: 6px 12px; border-radius: 6px; font-size: 13px; }

/* ===== WIDGET PAGE ===== */
.widget-preview { background: var(--slate-50); border-radius: 10px; padding: 24px; display: flex; justify-content: center; margin-bottom: 8px; }
.trust-widget-badge {
  background: white; border: 1px solid var(--slate-200); border-radius: 12px;
  padding: 16px 20px; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08); min-width: 240px;
}
.tw-logo {
  width: 40px; height: 40px; background: var(--blue-600); color: white;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; flex-shrink: 0;
}
.tw-name { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.tw-stars { color: var(--yellow-400); font-size: 15px; }
.tw-count { font-size: 12px; color: var(--slate-500); }
.api-key-display { display: flex; gap: 8px; margin-bottom: 8px; }
.api-key-notice {
  display: flex; align-items: center; gap: 6px;
  background: #fef9c3; color: #854d0e; padding: 10px 14px; border-radius: 8px;
  font-size: 13px; margin-bottom: 16px;
}
.code-block { background: var(--slate-800); border-radius: 10px; padding: 20px; margin: 12px 0; position: relative; }
.code-block pre { color: #e2e8f0; font-size: 13px; line-height: 1.6; overflow-x: auto; white-space: pre-wrap; }
.code-copy-btn { position: absolute; top: 10px; right: 10px; color: var(--slate-300); }
.code-copy-btn:hover { background: rgba(255,255,255,0.1); color: white; }
.api-docs { }
.api-endpoint { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.api-method { padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.api-method.post { background: #dcfce7; color: #15803d; }
.api-method.get { background: var(--blue-100); color: var(--blue-700); }
.api-path { font-family: monospace; font-size: 14px; font-weight: 600; color: var(--slate-800); }
.api-desc { font-size: 13px; color: var(--slate-500); }

/* ===== BILLING ===== */
.billing-plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.billing-plan-card {
  background: var(--slate-50); border: 1px solid var(--slate-200); border-radius: 12px;
  padding: 24px; position: relative;
}
.billing-plan-featured { border-color: var(--blue-600); background: var(--blue-50); }
.plan-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--blue-600); color: white; font-size: 11px; font-weight: 700;
  padding: 3px 12px; border-radius: 9999px;
}
.billing-plan-name { font-weight: 700; font-size: 18px; margin-bottom: 6px; }
.billing-plan-price { font-size: 28px; font-weight: 800; color: var(--slate-900); margin-bottom: 4px; }
.billing-plan-price small { font-size: 14px; color: var(--slate-500); font-weight: 400; }
.billing-plan-limit { font-size: 13px; color: var(--slate-500); margin-bottom: 16px; }
.billing-plan-features { list-style: none; margin-bottom: 20px; }
.billing-plan-features li { font-size: 14px; color: var(--slate-600); padding: 5px 0; border-bottom: 1px solid var(--slate-200); }
.billing-plan-features li::before { content: '✓ '; color: var(--green-500); font-weight: 700; }
.billing-plan-features li:last-child { border-bottom: none; }
.current-plan-info { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.current-plan-badge { background: var(--blue-100); color: var(--blue-700); padding: 6px 16px; border-radius: 9999px; font-weight: 700; }
.current-plan-price { font-size: 22px; font-weight: 800; }

/* ===== AUTH ===== */
.auth-body { background: var(--slate-100); }
.admin-auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.admin-auth-card { background: white; border-radius: 16px; padding: 40px; width: 100%; max-width: 440px; box-shadow: 0 20px 40px rgba(0,0,0,0.1); }
.admin-auth-card-wide { max-width: 560px; }
.admin-auth-header { text-align: center; margin-bottom: 28px; }
.admin-logo { display: inline-flex; align-items: center; gap: 2px; font-weight: 800; font-size: 18px; margin-bottom: 16px; }
.admin-logo-icon { width: 36px; height: 36px; background: var(--blue-600); color: white; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; }
.admin-auth-header h1 { font-size: 24px; margin-bottom: 6px; }
.admin-auth-header p { color: var(--slate-500); font-size: 14px; }
.admin-auth-alt { text-align: center; font-size: 14px; color: var(--slate-500); margin-top: 20px; }
.admin-form { display: flex; flex-direction: column; }

/* ===== MISC ===== */
.loading-state { display: flex; align-items: center; justify-content: center; padding: 40px; }
.loading-spinner { width: 32px; height: 32px; border: 3px solid var(--blue-100); border-top-color: var(--blue-600); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 40px; color: var(--slate-500); font-size: 14px; }

@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-actions-grid { grid-template-columns: 1fr; }
  .billing-plans-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .admin-sidebar { position: fixed; left: -var(--sidebar-w); z-index: 100; transition: transform 0.3s; transform: translateX(calc(-1 * var(--sidebar-w))); }
  .admin-sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-content { padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) { .stats-grid { grid-template-columns: 1fr; } }
