:root {
  --primary: #d4618f;
  --primary-dark: #b84879;
  --primary-light: #f8dfe8;
  --bg: #f5f0eb;
  --bg-card: #ffffff;
  --sidebar-bg: #2c2c2c;
  --sidebar-text: #ccc;
  --text: #2c2c2c;
  --text-light: #888;
  --shadow: 0 2px 10px rgba(0,0,0,0.06);
  --shadow-lg: 0 5px 20px rgba(0,0,0,0.1);
  --radius: 12px;
  --sidebar-width: 260px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--text);
}
.hidden { display: none !important; }

/* Login */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), #c9a84c);
  padding: 20px;
}
.login-card {
  background: white; border-radius: var(--radius); padding: 40px;
  text-align: center; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg);
}
.login-logo {
  width: 120px; height: auto; margin: 0 auto 20px;
}
.login-logo img {
  width: 100%; height: auto;
}
.login-card h1 { font-size: 24px; margin-bottom: 6px; }
.login-card > p { color: var(--text-light); margin-bottom: 30px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.error { color: #e74c3c; font-size: 13px; margin-top: 8px; }

.input-group {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg); border-radius: 10px; padding: 0 16px;
  border: 2px solid transparent; transition: border-color 0.3s;
}
.input-group:focus-within { border-color: var(--primary); }
.input-group i { color: var(--primary); font-size: 16px; }
.input-group input {
  flex: 1; border: none; padding: 14px 0; font-size: 15px;
  background: none; outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #c9a84c);
  color: white; border: none; padding: 14px 28px; border-radius: 50px;
  font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.3s;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(212,97,143,0.35); }
.btn-sm { padding: 10px 20px; font-size: 13px; }

.btn-danger {
  background: #e74c3c; color: white; border: none; padding: 8px 16px;
  border-radius: 8px; font-size: 12px; cursor: pointer; transition: all 0.3s;
}
.btn-danger:hover { background: #c0392b; }

.btn-icon {
  background: none; border: none; cursor: pointer; font-size: 16px;
  padding: 8px; border-radius: 8px; transition: all 0.2s; color: var(--text-light);
}
.btn-icon:hover { background: var(--bg); color: var(--primary); }
.btn-icon.danger:hover { color: #e74c3c; }

/* Admin Panel */
.admin-panel { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-width); background: var(--sidebar-bg);
  color: var(--sidebar-text); display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 100;
  transition: transform 0.3s;
}
.sidebar-header {
  padding: 24px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo {
  width: 40px; height: 40px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
}
.sidebar-logo img {
  width: 100%; height: 100%; object-fit: contain;
}
.sidebar-header h2 { font-size: 18px; color: white; }
.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-btn {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border: none; background: none; color: var(--sidebar-text);
  font-size: 14px; cursor: pointer; border-radius: 10px;
  transition: all 0.2s; text-align: left; width: 100%;
}
.sidebar-btn:hover { background: rgba(255,255,255,0.08); color: white; }
.sidebar-btn.active { background: var(--primary); color: white; }
.sidebar-btn i { width: 20px; text-align: center; }
.sidebar-footer {
  padding: 16px; border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; flex-direction: column; gap: 8px;
}
.sidebar-footer a, .sidebar-footer button {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border: none; background: none; color: var(--sidebar-text);
  font-size: 13px; cursor: pointer; border-radius: 8px;
  text-decoration: none; transition: all 0.2s;
}
.sidebar-footer a:hover, .sidebar-footer button:hover { background: rgba(255,255,255,0.08); color: white; }

/* Mobile Header */
.mobile-header {
  display: none; position: fixed; top: 0; left: 0; right: 0;
  height: 56px; background: white; box-shadow: var(--shadow);
  align-items: center; padding: 0 16px; gap: 12px; z-index: 90;
}
.menu-toggle { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text); }
.mobile-header h1 { font-size: 18px; flex: 1; }
.mobile-header span { font-size: 12px; color: var(--text-light); }

/* Content */
.admin-content {
  flex: 1; margin-left: var(--sidebar-width); padding: 30px;
  min-height: 100vh;
}

.section { display: none; animation: fadeIn 0.3s; }
.section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.section > h2, .section-header h2 {
  font-size: 22px; margin-bottom: 24px;
  display: flex; align-items: center; gap: 10px;
}
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}

/* Stats */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 30px;
}
.stat-card {
  background: white; border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px;
}
.stat-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.stat-icon.blue { background: #e8f4fd; color: #3498db; }
.stat-icon.green { background: #e8f8f0; color: #27ae60; }
.stat-icon.orange { background: #fef5e7; color: #f39c12; }
.stat-icon.pink { background: #fde8ee; color: #e74c3c; }
.stat-icon.purple { background: #f0e6f6; color: #9b59b6; }
.stat-icon.teal { background: #e0f7f7; color: #1abc9c; }
.stat-info h4 { font-size: 28px; font-weight: 700; }
.stat-info p { font-size: 13px; color: var(--text-light); }

/* Tables */
.table-wrapper { overflow-x: auto; }
table {
  width: 100%; background: white; border-radius: var(--radius);
  box-shadow: var(--shadow); border-collapse: collapse; overflow: hidden;
}
th { background: var(--bg); padding: 14px 16px; text-align: left; font-size: 13px; color: var(--text-light); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
td { padding: 14px 16px; border-top: 1px solid #f0ebe5; font-size: 14px; }
tr:hover td { background: #faf7f4; }
.badge {
  display: inline-block; padding: 4px 12px; border-radius: 50px;
  font-size: 12px; font-weight: 600;
}
.badge-success { background: #e8f8f0; color: #27ae60; }
.badge-danger { background: #fde8ee; color: #e74c3c; }
.badge-warning { background: #fef5e7; color: #f39c12; }
.action-btns { display: flex; gap: 4px; }

/* Toggle */
.toggle { position: relative; width: 44px; height: 24px; display: inline-block; }
.toggle input { display: none; }
.toggle-slider {
  position: absolute; inset: 0; background: #ccc; border-radius: 12px;
  cursor: pointer; transition: 0.3s;
}
.toggle-slider::before {
  content: ''; position: absolute; width: 18px; height: 18px;
  border-radius: 50%; background: white; left: 3px; top: 3px;
  transition: 0.3s;
}
.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Forms */
.form-card {
  background: white; border-radius: var(--radius); padding: 30px;
  box-shadow: var(--shadow); max-width: 700px;
}
.form-card h3 { font-size: 16px; color: var(--primary); margin: 24px 0 16px; border-bottom: 2px solid var(--primary-light); padding-bottom: 8px; }
.form-card h3:first-child { margin-top: 0; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-light); }
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
  width: 100%; padding: 12px 16px; border: 2px solid #e8e2dc;
  border-radius: 10px; font-size: 14px; transition: border-color 0.3s;
  background: white; outline: none; font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--primary);
}
.form-group input[type="color"] { width: 60px; height: 40px; padding: 4px; cursor: pointer; }
.form-group input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); margin-right: 8px; vertical-align: middle; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }

.hour-setting { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding: 10px; background: var(--bg); border-radius: 8px; }
.hour-setting label { min-width: 80px; font-weight: 600; text-transform: capitalize; font-size: 14px; margin: 0; }
.hour-setting input[type="time"] { padding: 8px; border: 2px solid #e8e2dc; border-radius: 8px; font-size: 14px; }
.hour-setting .hour-closed-check { display: flex; align-items: center; gap: 4px; font-size: 13px; }

/* Modal */
.modal {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-content {
  background: white; border-radius: var(--radius); width: 100%;
  max-width: 500px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid #f0ebe5;
}
.modal-header h3 { font-size: 18px; }
.modal-close {
  background: none; border: none; font-size: 18px; cursor: pointer;
  color: var(--text-light); padding: 4px;
}
.modal-body { padding: 24px; }
.modal-body .form-group { margin-bottom: 14px; }
.modal-body .btn-primary { width: 100%; margin-top: 8px; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .mobile-header { display: flex; }
  .admin-content { margin-left: 0; padding: 76px 16px 20px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* Upload zone */
.upload-zone {
  border: 2px dashed #ddd; border-radius: 12px;
  min-height: 120px; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; background: #fafafa;
  transition: border-color 0.3s;
}
.upload-zone:hover { border-color: var(--primary); }
.upload-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: #aaa; font-size: 14px;
}
.upload-placeholder i { font-size: 32px; color: #ccc; }
.upload-preview {
  width: 100%; max-height: 200px; object-fit: cover; border-radius: 10px;
}
