/* Platora - Shared styles. Primary: #C62828, Secondary: #FFC107 */

:root {
  --primary: #C62828;
  --primary-dark: #a02020;
  --secondary: #FFC107;
  --neutral: #faf8f5;
  --neutral-dark: #5c5c5c;
  --white: #fff;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--neutral);
  color: #1f2937;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; opacity: 0.92; }
img { max-width: 100%; height: auto; display: block; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
  border: none; cursor: pointer; transition: opacity 0.2s, transform 0.1s;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-secondary { background: var(--white); color: var(--primary); border: 2px solid var(--primary); }
.btn-secondary:hover:not(:disabled) { background: #fff5f5; }
.btn-success { background: #2e7d32; color: var(--white); }
.btn-danger { background: var(--primary); color: var(--white); }

.card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.input-group { margin-bottom: 16px; }
.input-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 14px; }
.input-group input,
.input-group select,
.input-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: var(--radius-sm); font-size: 14px;
}
.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(198,40,40,0.2);
}

.badge {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 500;
}
.badge-green { background: #e8f5e9; color: #2e7d32; }
.badge-red { background: #ffebee; color: #c62828; }
.badge-yellow { background: #fff8e1; color: #f57f17; }
.badge-gray { background: #f5f5f5; color: #616161; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.page-title { font-size: 24px; font-weight: 700; margin: 0 0 4px; }
.page-subtitle { color: var(--neutral-dark); font-size: 14px; margin: 0 0 24px; }

/* Sidebar layout for owner & admin */
.sidebar-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px;
  background: var(--white);
  color: #0f172a;
  flex-shrink: 0;
  display: flex; flex-direction: column; padding: 24px 0;
  border-right: 1px solid #e7eaef;
}
.sidebar-brand { padding: 0 24px 24px; border-bottom: 1px solid #edf0f4; margin-bottom: 16px; }
.sidebar-brand h1 { margin: 0; font-size: 20px; font-weight: 700; color: #111827; }
.sidebar-brand p { margin: 4px 0 0; font-size: 12px; color: #6b7280; }
.sidebar-nav { flex: 1; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px; padding: 12px 24px; color: #475569; font-size: 14px;
  transition: background 0.2s, color 0.2s;
}
.sidebar-nav a:hover { background: #f8fafc; color: var(--primary); }
.sidebar-nav a.active {
  background: rgba(198,40,40,0.08);
  color: var(--primary);
  border-left: 3px solid var(--primary);
  padding-left: 21px;
}
.sidebar-nav .icon { width: 20px; height: 20px; opacity: 0.9; }
.sidebar-nav [data-lucide] { width: 20px; height: 20px; display: inline-block; }
.sidebar-footer { padding: 16px 24px; border-top: 1px solid #edf0f4; }
.sidebar-footer a { color: #64748b; font-size: 14px; }
.main-content { flex: 1; padding: 24px; background: var(--neutral); overflow-x: auto; }

/* Stats cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.stat-card {
  background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 8px;
}
.stat-card .value { font-size: 24px; font-weight: 700; color: #111; }
.stat-card .label { font-size: 13px; color: var(--neutral-dark); }
.stat-card .sub { font-size: 12px; color: #2e7d32; }

/* Table */
.table-wrap { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #eee; }
th { background: #fafafa; font-weight: 600; font-size: 12px; text-transform: uppercase; color: var(--neutral-dark); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafafa; }

/* Spice level chilis */
.spice-level { display: inline-flex; gap: 2px; }
.spice-level .chili { color: var(--primary); font-size: 14px; }

/* Upload zone */
.upload-zone {
  border: 2px dashed #ddd; border-radius: var(--radius-sm); padding: 24px; text-align: center;
  background: #fafafa; cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.upload-zone:hover, .upload-zone.dragover { border-color: var(--primary); background: #fff5f5; }
.upload-zone input[type=file] { display: none; }

progress { width: 100%; height: 10px; border-radius: 999px; overflow: hidden; }
progress::-webkit-progress-bar { background: #e5e7eb; border-radius: 999px; }
progress::-webkit-progress-value { background: var(--primary); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--primary); border-radius: 999px; }

.nav-icon { width: 18px; height: 18px; display: inline-block; vertical-align: -3px; }

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--primary);
  animation: platora-spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes platora-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
