@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #E8536D;
  --primary-hover: #D4374A;
  --primary-light: #FFF0F3;
  --primary-bg: linear-gradient(135deg, #E8536D 0%, #D4374A 100%);
  --gold: #C9A96E;
  --gold-light: #F5ECD7;
  --bg: #F7F8FC;
  --card-bg: #fff;
  --text: #1A1D26;
  --text-secondary: #6B7280;
  --text-light: #9CA3AF;
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.06), 0 4px 6px -2px rgba(0,0,0,0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --font: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --transition: all 0.2s ease;
}

body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-hover); }

/* ===== Login Page ===== */
.login-page {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: linear-gradient(135deg, #FDF2F4 0%, #FBF0E8 50%, #F5ECD7 100%);
  position: relative; overflow: hidden;
}
.login-page::before {
  content: ''; position: absolute; top: -30%; right: -20%;
  width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232,83,109,0.06) 0%, transparent 70%);
}
.login-page::after {
  content: ''; position: absolute; bottom: -20%; left: -10%;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,169,110,0.08) 0%, transparent 70%);
}
.login-box {
  background: rgba(255,255,255,0.9); backdrop-filter: blur(20px);
  padding: 48px 40px; border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.06); width: 400px;
  position: relative; z-index: 1;
  border: 1px solid rgba(255,255,255,0.8);
}
.login-box h2 {
  text-align: center; font-size: 24px; font-weight: 700;
  background: var(--primary-bg); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; margin-bottom: 4px;
}
.login-box .subtitle {
  text-align: center; color: var(--text-light); font-size: 13px;
  margin-bottom: 32px; letter-spacing: 1px;
}

/* ===== Form ===== */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 6px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; outline: none;
  transition: var(--transition); background: var(--card-bg);
  font-family: var(--font);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232,83,109,0.08);
}
.form-group input::placeholder { color: var(--text-light); }

/* ===== Buttons ===== */
.btn {
  padding: 10px 20px; border: none; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: var(--transition); font-family: var(--font);
  display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--primary-bg); color: #fff;
  box-shadow: 0 2px 8px rgba(232,83,109,0.25);
}
.btn-primary:hover { box-shadow: 0 4px 12px rgba(232,83,109,0.35); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 6px; }
.btn-danger {
  background: #FEF2F2; color: #EF4444; border: 1px solid #FECACA;
}
.btn-danger:hover { background: #FEE2E2; }
.btn-default {
  background: var(--card-bg); color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.btn-default:hover { border-color: var(--primary); color: var(--primary); }

/* ===== Layout ===== */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: linear-gradient(180deg, #1E1B2E 0%, #2D2640 100%);
  color: #fff; flex-shrink: 0; position: fixed; top: 0; left: 0;
  height: 100vh; z-index: 10; overflow-y: auto;
}
.sidebar-header {
  padding: 24px 24px 20px; font-size: 18px; font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(135deg, rgba(232,83,109,0.15) 0%, transparent 100%);
  letter-spacing: 1px;
}
.sidebar-menu { list-style: none; padding: 12px 0; }
.sidebar-menu li a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 24px; color: rgba(255,255,255,0.55); font-size: 14px;
  transition: var(--transition); text-decoration: none;
  border-left: 3px solid transparent; font-weight: 500;
}
.sidebar-menu li a:hover {
  color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.04);
}
.sidebar-menu li a.active {
  color: #fff; background: rgba(232,83,109,0.12);
  border-left-color: var(--primary);
}
.sidebar-menu li a::before {
  content: ''; width: 4px; height: 4px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}
.main-content {
  flex: 1; padding: 28px 32px; margin-left: 240px;
  min-height: 100vh;
}
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.page-header h3 { font-size: 22px; font-weight: 700; color: var(--text); }

/* ===== Cards ===== */
.card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px;
  border: 1px solid var(--border-light);
}
.stat-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 28px;
}
.stat-card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  transition: var(--transition); position: relative; overflow: hidden;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--primary-bg); opacity: 0;
  transition: var(--transition);
}
.stat-card:hover::before { opacity: 1; }
.stat-card .stat-value {
  font-size: 32px; font-weight: 700;
  background: var(--primary-bg); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-card .stat-label {
  font-size: 13px; color: var(--text-light); margin-top: 4px; font-weight: 500;
}

/* PLACEHOLDER_TABLE */

/* ===== Table ===== */
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 12px 16px; text-align: left; font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}
th {
  background: var(--bg); font-weight: 600; color: var(--text-secondary);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
}
tr { transition: var(--transition); }
tr:hover { background: #FAFBFF; }
td { color: var(--text-secondary); }

/* ===== Pagination ===== */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 20px;
}
.pagination button {
  padding: 8px 16px; border: 1.5px solid var(--border);
  background: var(--card-bg); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; font-weight: 500;
  transition: var(--transition); font-family: var(--font);
}
.pagination button:hover:not(:disabled) {
  border-color: var(--primary); color: var(--primary);
}
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination span { font-size: 13px; color: var(--text-light); }

/* ===== Tags ===== */
.tag {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 20px; font-size: 12px; font-weight: 500;
}
.tag-success { background: #ECFDF5; color: #059669; }
.tag-warning { background: #FFFBEB; color: #D97706; }
.tag-info { background: #F0F9FF; color: #0284C7; }

/* ===== Steps ===== */
.steps { display: flex; margin-bottom: 28px; position: relative; }
.steps::before {
  content: ''; position: absolute; top: 16px; left: 10%; right: 10%;
  height: 2px; background: var(--border-light);
}
.step { flex: 1; text-align: center; position: relative; z-index: 1; }
.step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--border); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; transition: var(--transition);
}
.step.active .step-num {
  background: var(--primary-bg);
  box-shadow: 0 2px 8px rgba(232,83,109,0.3);
}
.step.done .step-num { background: #10B981; }
.step-label {
  font-size: 12px; color: var(--text-light); margin-top: 6px; font-weight: 500;
}
.step.active .step-label { color: var(--primary); }

/* ===== Upload ===== */
.upload-area {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 28px; text-align: center; cursor: pointer;
  transition: var(--transition); color: var(--text-light);
  background: var(--bg);
}
.upload-area:hover {
  border-color: var(--primary); background: var(--primary-light);
  color: var(--primary);
}
.upload-area input[type="file"] { display: none; }
.upload-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.upload-preview-item {
  width: 80px; height: 80px; border-radius: var(--radius-sm);
  overflow: hidden; position: relative; background: var(--bg);
  border: 1px solid var(--border-light);
}
.upload-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview-item .remove-btn {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px;
  background: rgba(0,0,0,0.5); color: #fff; border: none; border-radius: 50%;
  font-size: 12px; cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: var(--transition);
}
.upload-preview-item .remove-btn:hover { background: #EF4444; }

/* ===== Color Picker ===== */
.color-picker-wrap { display: flex; align-items: center; gap: 10px; }
.color-picker-wrap input[type="color"] {
  width: 44px; height: 36px; border: 2px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; padding: 2px;
}

/* ===== Preview ===== */
.preview-frame {
  width: 375px; height: 667px; border: 3px solid #1E1B2E;
  border-radius: 28px; overflow: hidden; margin: 0 auto;
  box-shadow: var(--shadow-lg);
}
.preview-frame iframe { width: 100%; height: 100%; border: none; }

/* ===== Modal ===== */
.modal-mask {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(4px);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: var(--card-bg); border-radius: var(--radius-lg);
  padding: 28px; min-width: 400px; max-width: 90vw; max-height: 80vh;
  overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-box h4 { margin-bottom: 20px; font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; padding: 16px; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .preview-frame { width: 100%; height: 500px; border-width: 2px; border-radius: 16px; }
  .login-box { width: 90vw; padding: 32px 24px; }
}
