/* Perfect Solutions Group - admin panel styles */
:root {
  --amber: #f59e0b; --amber-soft: #fef3c7; --navy: #0f172a; --side: #0b0f17; --bg: #f5f5f4; --white: #fff;
  --text: #0f172a; --muted: #64748b; --border: #e2e8f0; --emerald: #059669; --red: #dc2626;
  --font-head: 'Outfit', system-ui, sans-serif; --font-body: 'IBM Plex Sans', system-ui, sans-serif; --font-mono: 'JetBrains Mono', monospace;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-body); color: var(--text); background: var(--bg); line-height: 1.55; font-size: 14px; }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -.02em; margin: 0; line-height: 1.15; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 600; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
code { font-family: var(--font-mono); font-size: 12px; background: #f1f5f9; padding: 2px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.eyebrow { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: #b45309; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.between { justify-content: space-between; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; padding: 10px 16px; font: inherit; font-size: 13px; font-weight: 700; border: 1px solid transparent; cursor: pointer; transition: transform .15s, background-color .15s, border-color .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--amber); color: var(--navy); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-ghost { background: #fff; border-color: #cbd5e1; color: var(--text); }
.btn-danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }

/* auth */
.auth-body { display: grid; place-items: center; min-height: 100vh; background: radial-gradient(circle at 20% 10%, #fef3c7 0, transparent 40%), var(--bg); padding: 20px; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 32px; box-shadow: 0 20px 60px rgba(15, 23, 42, .08); }
.auth-card h1 { margin-top: 8px; font-size: 26px; }
.auth-card form { margin-top: 24px; }
.checklist { margin: 12px 0 0; padding-left: 18px; color: #334155; }

/* forms */
label { display: block; margin-top: 14px; font-size: 12px; font-weight: 600; color: #334155; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=tel], select, textarea { width: 100%; margin-top: 6px; border: 1px solid var(--border); border-radius: 10px; background: #fafaf9; padding: 10px 12px; font: inherit; font-size: 14px; color: var(--text); outline: none; transition: border-color .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--amber); background: #fff; }
textarea { resize: vertical; min-height: 90px; }
input[type=file] { margin-top: 6px; font-size: 13px; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-weight: 600; }
.check input { width: 16px; height: 16px; margin: 0; }
.form-grid { display: grid; gap: 0 16px; }
.form-grid.cols-2 { grid-template-columns: 1fr; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hint { margin-top: 6px; font-size: 12px; color: var(--muted); }

/* layout */
.admin-shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 250px; background: var(--side); color: #cbd5e1; display: flex; flex-direction: column; padding: 20px 14px; transform: translateX(-100%); transition: transform .25s ease; }
.sidebar.open { transform: translateX(0); }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 20px; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.side-brand strong { display: block; font-family: var(--font-head); font-size: 15px; }
.side-brand small { display: block; font-family: var(--font-mono); font-size: 9px; letter-spacing: .15em; text-transform: uppercase; color: #94a3b8; margin-top: 3px; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--amber); color: var(--navy); flex-shrink: 0; }
.side-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 16px; flex: 1; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; color: #cbd5e1; transition: background-color .15s, color .15s; }
.side-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-nav a.active { background: var(--amber); color: var(--navy); }
.side-nav .count { margin-left: auto; font-style: normal; background: var(--emerald); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700; }
.side-nav a.active .count { background: var(--navy); }
.side-foot { display: grid; gap: 4px; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; }
.side-foot a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; font-size: 13px; color: #94a3b8; }
.side-foot a:hover { color: #fff; }
.admin-main { flex: 1; width: 100%; padding: 20px; }
.topbar { display: flex; align-items: center; gap: 14px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.topbar h1 { margin-top: 4px; }
.topbar .who { margin-left: auto; text-align: right; display: none; }
.role { display: inline-block; background: var(--navy); color: #fcd34d; border-radius: 999px; padding: 3px 10px; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.who small { display: block; margin-top: 4px; color: var(--muted); }
.menu-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: #fff; cursor: pointer; }
.content { padding-top: 20px; }

/* cards & tables */
.card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.card + .card { margin-top: 20px; }
.card h2 { display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.grid { display: grid; gap: 20px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.stat small { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stat p { margin-top: 8px; font-family: var(--font-head); font-size: 30px; font-weight: 700; }
.stat.amber { background: var(--amber-soft); border-color: #fde68a; }
.quick { display: grid; gap: 10px; margin-top: 12px; }
.quick a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: #fafaf9; font-weight: 600; transition: border-color .15s; }
.quick a:hover { border-color: var(--amber); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
td form { display: inline; }
.thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; background: #f1f5f9; }
.thumb.round { width: 48px; height: 48px; border-radius: 50%; }
.badge { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 11px; font-weight: 700; background: #f1f5f9; color: #334155; }
.badge.ok { background: #ecfdf5; color: #065f46; }
.badge.off { background: #fef2f2; color: #991b1b; }
.badge.solar { background: var(--amber-soft); color: #92400e; }
.badge.new { background: #dbeafe; color: #1e40af; }
.alert { margin-top: 16px; border-radius: 12px; padding: 12px 14px; font-weight: 600; border: 1px solid var(--border); background: #fff; }
.alert-ok { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.image-picker { display: grid; gap: 14px; margin-top: 14px; padding: 14px; border: 1px dashed #cbd5e1; border-radius: 14px; background: #fafaf9; }
.image-picker img { width: 100%; max-width: 220px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: #e2e8f0; }
.image-picker label:first-child { margin-top: 0; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.photo-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.photo-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-card div { padding: 10px 12px; }
.photo-card strong { display: block; font-size: 13px; }
.photo-card small { color: var(--muted); font-size: 11px; }
.photo-card .row { margin-top: 8px; gap: 6px; }
.empty { padding: 30px; text-align: center; color: var(--muted); border: 1px dashed #cbd5e1; border-radius: 14px; }

@media (min-width: 640px) {
  .form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .image-picker { grid-template-columns: 220px 1fr; }
  .quick { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .sidebar { transform: none; }
  .admin-main { margin-left: 250px; padding: 28px 36px; }
  .menu-btn { display: none; }
  .topbar .who { display: block; }
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .grid.side { grid-template-columns: 1.1fr .9fr; align-items: start; }
}
