:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --accent: #f472b6;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --radius: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container { max-width: 480px; margin: 0 auto; padding: 16px; }

.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  padding: 32px 20px 48px;
  border-radius: 0 0 32px 32px;
  text-align: center;
}

.hero h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.hero .meta { opacity: .9; font-size: .875rem; }
.hero .meta span { display: block; margin-top: 4px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-top: -24px;
  margin-bottom: 16px;
}

.card h2 { font-size: 1.125rem; margin-bottom: 16px; color: var(--text); }

.store-content { font-size: .9375rem; color: var(--text-muted); }
.store-content img { max-width: 100%; border-radius: 8px; margin: 8px 0; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }

input, select, textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  transition: border-color .2s;
  background: #fff;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.datetime-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  width: 100%;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(99,102,241,.35); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  padding: 12px 24px; border-radius: 12px; color: #fff; font-size: .875rem;
  z-index: 9999; animation: slideDown .3s ease;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

@keyframes slideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.closed-banner {
  background: #fef3c7; color: #92400e; padding: 16px; border-radius: 12px;
  text-align: center; font-weight: 600; margin-bottom: 16px;
}

/* Admin styles */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: #1e293b; color: #fff; padding: 24px 0;
  position: fixed; height: 100vh; overflow-y: auto; z-index: 100;
  transition: transform .3s;
}
.sidebar .logo { padding: 0 24px 24px; font-size: 1.25rem; font-weight: 700; border-bottom: 1px solid #334155; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 12px 24px;
  color: #94a3b8; text-decoration: none; transition: all .2s; font-size: .9375rem;
}
.sidebar nav a:hover, .sidebar nav a.active { background: #334155; color: #fff; }

.main-content { flex: 1; margin-left: 240px; padding: 24px; }
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow);
}
.stat-card .label { font-size: .8125rem; color: var(--text-muted); }
.stat-card .value { font-size: 1.75rem; font-weight: 700; color: var(--primary); margin-top: 4px; }

.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #e2e8f0; }
th { background: #f8fafc; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
tr:hover td { background: #f8fafc; }

.badge {
  display: inline-block; padding: 4px 10px; border-radius: 20px;
  font-size: .75rem; font-weight: 600;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }

.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-box {
  background: #fff; border-radius: 20px; padding: 40px 32px; width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.login-box h1 { text-align: center; margin-bottom: 32px; font-size: 1.5rem; }

.toggle-switch { position: relative; width: 48px; height: 26px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0; background: #cbd5e1;
  border-radius: 26px; transition: .3s;
}
.toggle-slider:before {
  content: ''; position: absolute; height: 20px; width: 20px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: .3s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(22px); }

.menu-toggle {
  display: none; position: fixed; top: 16px; left: 16px; z-index: 200;
  background: var(--primary); color: #fff; border: none; border-radius: 8px;
  padding: 8px 12px; font-size: 1.25rem; cursor: pointer;
}

/* Screen dashboard */
.screen-page {
  min-height: 100vh; background: #0f172a; color: #fff; padding: 24px;
}
.screen-page .page-header h1 { color: #fff; }
.screen-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 32px; }
.screen-stat {
  background: linear-gradient(135deg, #1e293b, #334155); border-radius: 16px;
  padding: 24px; text-align: center;
}
.screen-stat .num { font-size: 2.5rem; font-weight: 800; background: linear-gradient(135deg, #818cf8, #f472b6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.screen-stat .lbl { color: #94a3b8; margin-top: 8px; font-size: .875rem; }
.chart-box { background: #1e293b; border-radius: 16px; padding: 24px; }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 16px; padding-top: 60px; }
  .menu-toggle { display: block; }
  .datetime-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 769px) {
  .container { max-width: 640px; }
}
