:root {
  --primary: #0b1f3a;
  --accent: #c9a227;
  --bg: #f2f4f7;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #667085;
  --border: #e2e5ea;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(16,24,40,0.06);
  --success: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; }
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary), #16305a);
}
.auth-card {
  background: #fff;
  border-radius: 14px;
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.auth-card h1 { font-size: 1.4rem; margin: 0 0 4px; }
.auth-card p.subtitle { color: var(--text-muted); margin: 0 0 24px; font-size: 0.92rem; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
.field textarea { resize: vertical; min-height: 90px; }
.field small { color: var(--text-muted); display: block; margin-top: 4px; font-size: 0.78rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .field-row, .field-row-3 { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 8px; font-weight: 600; font-size: 0.92rem;
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-accent { background: var(--accent); color: #1a1a1a; }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 0.88rem; margin-bottom: 16px; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #166534; }

/* ---------- Admin shell (dashboard/settings/form) ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 230px; background: var(--primary); color: #fff; flex-shrink: 0;
  display: flex; flex-direction: column; padding: 22px 0;
}
.admin-sidebar .brand { padding: 0 22px 22px; font-weight: 700; font-size: 1.1rem; border-bottom: 1px solid rgba(255,255,255,0.12); margin-bottom: 14px; }
.admin-sidebar nav a {
  display: block; padding: 11px 22px; color: rgba(255,255,255,0.75); font-size: 0.92rem; font-weight: 500;
  border-left: 3px solid transparent;
}
.admin-sidebar nav a:hover { color: #fff; background: rgba(255,255,255,0.06); }
.admin-sidebar nav a.active { color: #fff; background: rgba(255,255,255,0.1); border-left-color: var(--accent); }
.admin-sidebar .sidebar-footer { margin-top: auto; padding: 14px 22px 0; }
.admin-sidebar .view-site { display: block; margin-top: 10px; font-size: 0.85rem; color: rgba(255,255,255,0.6); }

.admin-main { flex: 1; padding: 30px 36px; max-width: 1100px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; flex-wrap: wrap; gap: 12px; }
.admin-header h1 { margin: 0 0 4px; font-size: 1.5rem; }
.admin-header p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 22px; }
.card h2 { margin-top: 0; font-size: 1.05rem; }

.toolbar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.toolbar .filters { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar input, .toolbar select { padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.88rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 0.9rem; vertical-align: middle; }
th { color: var(--text-muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
td.thumb-cell img { width: 64px; height: 46px; object-fit: cover; border-radius: 6px; background: #eee; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; }
.badge-available { background: #dcfce7; color: var(--success); }
.badge-reserved { background: #fef3c7; color: var(--warn); }
.badge-sold { background: #fee2e2; color: var(--danger); }
.badge-active { background: #dcfce7; color: var(--success); }
.badge-past_due { background: #fef3c7; color: var(--warn); }
.badge-suspended { background: #fee2e2; color: var(--danger); }
.badge-pending_payment { background: #e5e7eb; color: var(--text-muted); }
.badge-manual { background: #e0e7ff; color: #3730a3; }
.badge-auto { background: #e5e7eb; color: var(--text-muted); }

.inline-form {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px; margin-top: 8px; display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
}
.inline-form .field { margin: 0; min-width: 120px; }
.inline-form .field label { font-size: 0.72rem; }
.inline-form input, .inline-form select { padding: 7px 9px; font-size: 0.85rem; }

.status-select { padding: 5px 8px; border-radius: 6px; border: 1px solid var(--border); font-size: 0.8rem; }

.image-upload-zone {
  border: 2px dashed var(--border); border-radius: 10px; padding: 20px; text-align: center; color: var(--text-muted);
  cursor: pointer; font-size: 0.9rem; background: #fafbfc;
}
.image-preview-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.image-preview-grid .img-item { position: relative; width: 100px; height: 76px; }
.image-preview-grid img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.image-preview-grid .remove-img {
  position: absolute; top: -6px; right: -6px; background: var(--danger); color: #fff; border: none;
  width: 22px; height: 22px; border-radius: 50%; font-size: 0.8rem; line-height: 1; cursor: pointer;
}

.color-swatch-row { display: flex; align-items: center; gap: 12px; }
.color-swatch-row input[type="color"] { width: 52px; height: 40px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; }

.empty-row td { text-align: center; color: var(--text-muted); padding: 40px 10px; }

.logo-preview { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.logo-preview img { max-height: 56px; border-radius: 6px; background: #f2f2f2; padding: 4px; }
