@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
  --bg:       #FFF0DC;
  --black:    #000000;
  --cyan:     #00CCFF;
  --magenta:  #BF00FF;
  --text:     #0a0a0a;
  --muted:    #7a6a58;
  --border:   rgba(0,0,0,0.10);
  --card-bg:  rgba(255,255,255,0.55);
  --radius:   12px;
  --radius-sm: 6px;
  --shadow:   0 2px 16px rgba(0,0,0,0.08);
  --shadow-hover: 0 6px 32px rgba(0,0,0,0.13);
  --font: 'Space Grotesk', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Noise texture overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  pointer-events: none;
  z-index: 0;
}

/* ── Sidebar ── */
.layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.sidebar {
  width: 220px;
  min-height: 100vh;
  background: var(--black);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.2rem;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo .codi {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--cyan);
  line-height: 1;
  letter-spacing: -0.02em;
}
.sidebar-logo .nome {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--magenta);
  line-height: 1;
  letter-spacing: -0.02em;
}
.sidebar-logo .studio {
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 4px;
}

.sidebar-product {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  margin-bottom: 0.6rem;
  padding-left: 0.4rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.18s ease;
  margin-bottom: 2px;
}
.nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-link.active {
  background: rgba(0,204,255,0.12);
  color: var(--cyan);
  border-left: 2px solid var(--cyan);
  padding-left: calc(0.8rem - 2px);
}
.nav-link svg { opacity: 0.7; flex-shrink: 0; }
.nav-link.active svg { opacity: 1; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.2);
  line-height: 1.6;
}

/* ── Main content ── */
.main {
  margin-left: 220px;
  padding: 2.5rem 2.8rem;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2.2rem;
  gap: 1rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.page-title span {
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.3rem;
  font-weight: 400;
}

/* ── Cards ── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-hover); }

.card-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-title::before {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  flex-shrink: 0;
}

/* ── Stat cards ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--black);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.12;
}
.stat-card.cyan::after  { background: var(--cyan); }
.stat-card.magenta::after { background: var(--magenta); }

.stat-value {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}
.stat-card.cyan    .stat-value { color: var(--cyan); }
.stat-card.magenta .stat-value { color: var(--magenta); }

.stat-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  margin-top: 0.4rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}

/* ── Table ── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
thead th {
  text-align: left;
  padding: 0.6rem 1rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
tbody tr:hover { background: rgba(0,0,0,0.03); }
tbody td { padding: 0.85rem 1rem; }
tbody tr:last-child { border-bottom: none; }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.badge-cyan    { background: rgba(0,204,255,0.12); color: #008fb5; }
.badge-magenta { background: rgba(191,0,255,0.10); color: #8800bb; }
.badge-green   { background: rgba(0,200,100,0.12); color: #007a40; }
.badge-gray    { background: rgba(0,0,0,0.06);     color: var(--muted); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--black);
  color: var(--cyan);
  border: 1px solid rgba(0,204,255,0.3);
}
.btn-primary:hover {
  background: var(--cyan);
  color: var(--black);
  border-color: var(--cyan);
}
.btn-danger {
  background: transparent;
  color: #c0392b;
  border: 1px solid rgba(192,57,43,0.2);
}
.btn-danger:hover { background: rgba(192,57,43,0.08); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.78rem; }

/* ── Form ── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: end;
}
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.form-input, .form-select {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  background: rgba(255,255,255,0.7);
  color: var(--text);
  transition: border-color 0.15s;
  outline: none;
}
.form-input:focus, .form-select:focus {
  border-color: var(--cyan);
  background: #fff;
}

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 2rem; right: 2rem;
  background: var(--black);
  color: #fff;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  transform: translateY(6px);
  opacity: 0;
  transition: all 0.25s ease;
  z-index: 9999;
  border-left: 3px solid var(--cyan);
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translateY(0); }
#toast.error { border-left-color: #e74c3c; }

/* ── Accent line ── */
.accent-line {
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  border-radius: 999px;
  margin-bottom: 1.8rem;
  width: 48px;
}

/* ── Grid layouts ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

@media (max-width: 900px) {
  .sidebar { width: 60px; padding: 1.5rem 0.5rem; }
  .sidebar-logo .codi,
  .sidebar-logo .nome,
  .sidebar-logo .studio,
  .sidebar-product,
  .nav-link span { display: none; }
  .main { margin-left: 60px; padding: 2rem 1.5rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
