/* Rolling Pin Snacks — design system (aligned with rp-datacompiling-v1 / Retail Intel) */

@font-face {
  font-family: 'Nunito';
  src: url('/fonts/Nunito-var.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/Fraunces-var.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --radius: 0.75rem;
  --background: #fcf5f0;
  --foreground: #54351f;
  --card: #ffffff;
  --card-foreground: #54351f;
  --primary: #f67aa9;
  --primary-foreground: #54351f;
  --secondary: #f9e3ee;
  --secondary-foreground: #54351f;
  --muted: #f4e8de;
  --muted-foreground: #8b5e40;
  --accent: #fdebdd;
  --accent-foreground: #b85a1b;
  --destructive: #b92f2d;
  --destructive-foreground: #ffffff;
  --border: #ebd8c8;
  --input: #e5cbb6;
  --ring: #f67aa9;
  --sidebar: #faf0e8;
  --shadow: 0px 4px 8px -1px hsl(22 45% 32% / 0.12), 0px 1px 2px -2px hsl(22 45% 32% / 0.12);
  --shadow-md: 0px 4px 8px -1px hsl(22 45% 32% / 0.12), 0px 2px 4px -2px hsl(22 45% 32% / 0.12);
  --font-sans: 'Nunito', ui-rounded, system-ui, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: 'SOFT' 100;
  letter-spacing: -0.01em;
  color: var(--foreground);
}
h1 { font-size: 1.75rem; margin: 0 0 4px; }
h2 { font-size: 1.2rem; margin: 0 0 10px; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--font-mono);
  background: var(--muted);
  color: var(--foreground);
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 0.88em;
}

.muted { color: var(--muted-foreground); }
.small { font-size: 0.85rem; }
.nowrap { white-space: nowrap; }
.empty { padding: 28px; text-align: center; color: var(--muted-foreground); }

::selection { background: var(--primary); color: var(--primary-foreground); }

/* ---------- App shell (sidebar) ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  text-decoration: none;
}
.sidebar-brand img { width: 38px; height: 38px; border-radius: 10px; box-shadow: var(--shadow); }
.sidebar-brand span { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; line-height: 1.2; }

.sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 0.92rem;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: background 0.12s ease;
}
.nav-item:hover { background: var(--muted); color: var(--foreground); text-decoration: none; }
.nav-item.active { background: rgba(246, 122, 169, 0.14); color: var(--primary); font-weight: 700; }

.sidebar-foot { border-top: 1px solid var(--border); padding-top: 12px; }
.sidebar-foot .who { padding: 0 8px 8px; font-size: 0.85rem; color: var(--muted-foreground); }
.logout-form { margin: 0; padding: 0 4px; }
.link-button {
  background: none; border: none; padding: 8px;
  width: 100%; text-align: left;
  color: var(--muted-foreground); cursor: pointer;
  font: inherit; font-size: 0.92rem; border-radius: 9px;
}
.link-button:hover { background: var(--muted); color: var(--destructive); }

.content { flex: 1; min-width: 0; padding: 30px 34px 60px; }
.content-inner { max-width: 1060px; margin: 0 auto; }
.page-head { margin-bottom: 22px; }
.page-head .sub { color: var(--muted-foreground); margin: 2px 0 0; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 20px;
}
.card > h2:first-child { margin-top: 0; }

/* ---------- Auth page ---------- */
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.auth-card { width: 100%; max-width: 400px; text-align: center; padding: 30px 28px; }
.auth-card img.logo { width: 64px; height: 64px; border-radius: 16px; box-shadow: var(--shadow-md); margin-bottom: 10px; }
.auth-card h1 { font-size: 1.65rem; }
.auth-card .sub { color: var(--muted-foreground); margin: 0 0 22px; }
.auth-card form { text-align: left; }

/* ---------- Forms ---------- */
.stack { display: grid; gap: 14px; }
.stack label span, .inline-form label span {
  display: block; font-size: 0.85rem; font-weight: 700;
  margin-bottom: 5px;
}
input[type="text"], input[type="password"], input[type="url"], input[type="email"], select {
  font: inherit;
  color: var(--foreground);
  background: #fff;
  border: 1px solid var(--input);
  border-radius: 9px;
  padding: 8px 12px;
  width: 100%;
}
input:focus, select:focus {
  outline: 2px solid rgba(246, 122, 169, 0.45);
  outline-offset: 1px;
  border-color: var(--ring);
}
.inline-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.inline-form label { flex: 1 1 150px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 700; font-size: 0.92rem;
  color: var(--primary-foreground);
  background: var(--primary);
  border: 1px solid transparent;
  border-radius: 9px;
  min-height: 38px;
  padding: 7px 16px;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.12s ease, background 0.12s ease;
}
.btn:hover { filter: brightness(0.96); text-decoration: none; }
.btn-outline {
  background: #fff; color: var(--foreground);
  border-color: var(--input);
}
.btn-outline:hover { background: var(--accent); color: var(--accent-foreground); filter: none; }
.btn-small { min-height: 30px; padding: 3px 12px; font-size: 0.84rem; border-radius: 8px; }
.btn-danger { background: var(--destructive); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-block { width: 100%; }

/* ---------- Alerts ---------- */
.alert { border-radius: 9px; padding: 11px 15px; font-size: 0.9rem; font-weight: 600; }
.alert-error { background: #fbe4e3; color: var(--destructive); border: 1px solid rgba(185, 47, 45, 0.35); }
.alert-ok { background: #ddf3e4; color: #1e6b3a; border: 1px solid rgba(30, 107, 58, 0.3); }

/* ---------- App grid ---------- */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.app-card { margin: 0; display: flex; flex-direction: column; }
.app-card h2 { margin: 0; font-size: 1.12rem; }
.app-card-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; margin-bottom: 6px; }
.app-card p { margin: 5px 0; }
.creds {
  margin: 10px 0 0; padding: 11px 13px;
  background: var(--muted); border: 1px solid var(--border); border-radius: 9px;
  display: grid; gap: 5px;
}
.creds div { display: flex; gap: 10px; align-items: baseline; }
.creds dt { font-weight: 700; font-size: 0.8rem; min-width: 78px; color: var(--muted-foreground); }
.creds dd { margin: 0; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px;
  background: var(--secondary); color: var(--secondary-foreground);
  white-space: nowrap;
}
.badge-vps { background: var(--secondary); }
.badge-vercel { background: var(--accent); color: var(--accent-foreground); }
.badge-external { background: var(--muted); }
.badge-ok { background: #ddf3e4; color: #1e6b3a; }
.badge-off { background: var(--muted); color: var(--muted-foreground); }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th {
  text-align: left; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted-foreground); font-weight: 800;
  border-bottom: 1px solid var(--border);
  padding: 8px 10px;
}
.table td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.row-inactive { opacity: 0.55; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions .inline-form { display: inline-flex; }

/* ---------- Checklist ---------- */
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.check-label {
  display: flex; gap: 10px; align-items: center;
  background: #fff; border: 1px solid var(--border);
  padding: 10px 14px; border-radius: 9px; cursor: pointer;
  font-weight: 600;
}
.check-label:hover { border-color: var(--ring); }
.check-label input { accent-color: var(--primary); width: 17px; height: 17px; }

/* ---------- Footer (auth pages) ---------- */
.auth-foot { position: fixed; bottom: 14px; left: 0; right: 0; text-align: center; font-size: 0.8rem; color: var(--muted-foreground); }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: column; }
  .content { padding: 20px 16px 48px; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .table { display: block; overflow-x: auto; }
}
