/* Italian Delivery — Admin SaaS (separado do site público) */
:root {
  --adm-brand: #15245A;
  --adm-accent: #3b6fd4;
  --adm-bg: #f8fafc;
  --adm-surface: #ffffff;
  --adm-border: #e2e8f0;
  --adm-text: #0f172a;
  --adm-muted: #64748b;
  --adm-radius: 12px;
  --adm-shadow: 0 1px 3px rgba(15,23,42,.06), 0 4px 12px rgba(15,23,42,.04);
  --adm-sidebar: 240px;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--adm-bg);
  color: var(--adm-text);
  line-height: 1.5;
}

/* ── Auth ── */
.adm-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: linear-gradient(160deg, #f1f5f9 0%, #e8eef8 100%);
}
.adm-auth__card {
  width: min(400px, 100%);
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--adm-shadow);
}
.adm-auth__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--adm-muted);
  margin-bottom: 1.25rem;
}
.adm-auth__dot, .adm-sidebar__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--adm-accent);
  box-shadow: 0 0 8px rgba(59,111,212,.5);
}
.adm-auth__card h1 { margin: 0 0 0.35rem; font-size: 1.35rem; }
.adm-auth__sub { margin: 0 0 1.5rem; color: var(--adm-muted); font-size: 0.9rem; }
.adm-auth__erro { color: #dc2626; font-size: 0.88rem; margin-bottom: 1rem; }
.adm-auth__back { display: inline-block; margin-top: 1.25rem; color: var(--adm-muted); font-size: 0.85rem; text-decoration: none; }
.adm-auth__back:hover { color: var(--adm-brand); }

/* ── App layout ── */
.adm-app { display: flex; min-height: 100vh; }

.adm-sidebar {
  width: var(--adm-sidebar);
  background: var(--adm-surface);
  border-right: 1px solid var(--adm-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  transition: transform .3s;
}
.adm-sidebar__brand {
  padding: 1.25rem 1.25rem 1rem;
  font-size: 0.95rem;
  color: var(--adm-muted);
  border-bottom: 1px solid var(--adm-border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.adm-sidebar__nav {
  flex: 1;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.adm-sidebar__nav button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.85rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--adm-muted);
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, color .15s;
}
.adm-sidebar__nav button:hover { background: var(--adm-bg); color: var(--adm-text); }
.adm-sidebar__nav button.is-active {
  background: rgba(21,36,90,.08);
  color: var(--adm-brand);
  font-weight: 600;
}
.adm-sidebar__foot {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--adm-border);
}
.adm-sidebar__foot a {
  font-size: 0.82rem;
  color: var(--adm-muted);
  text-decoration: none;
}
.adm-sidebar__foot a:hover { color: var(--adm-brand); }

.adm-shell {
  flex: 1;
  margin-left: var(--adm-sidebar);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.adm-topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: var(--adm-surface);
  border-bottom: 1px solid var(--adm-border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.adm-topbar__menu {
  display: none;
  background: none;
  border: 1px solid var(--adm-border);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  font-size: 1rem;
}
.adm-topbar__title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--adm-muted);
}
.adm-topbar__user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.88rem;
}
.adm-topbar__user a {
  color: var(--adm-accent);
  text-decoration: none;
  font-weight: 600;
}

.adm-content {
  padding: 1.5rem;
  flex: 1;
  max-width: 1100px;
}
.adm-content h1 {
  margin: 0 0 1.25rem;
  font-size: 1.5rem;
  font-weight: 700;
}
.adm-subtitle {
  margin: 1.5rem 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--adm-muted);
}

.adm-panel { display: none; }
.adm-panel.is-active { display: block; }

/* Cards & KPIs */
.adm-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.adm-kpi {
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  padding: 1.1rem;
  box-shadow: var(--adm-shadow);
}
.adm-kpi strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--adm-brand);
}
.adm-kpi span { font-size: 0.8rem; color: var(--adm-muted); }

.adm-card {
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: var(--adm-radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--adm-shadow);
}
.adm-card--muted { background: var(--adm-bg); }

.adm-toolbar, .adm-form--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
}
.adm-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.adm-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--adm-muted);
}
.adm-field input, .adm-field select, .adm-field textarea, .adm-form--inline input {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--adm-border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  color: var(--adm-text);
  min-width: 0;
}
.adm-auth label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.adm-auth input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--adm-border);
  border-radius: 8px;
}

.adm-btn {
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--adm-border);
  background: var(--adm-surface);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  font-family: inherit;
  color: var(--adm-text);
  transition: background .15s;
}
.adm-btn:hover { background: var(--adm-bg); }
.adm-btn--primary {
  background: var(--adm-brand);
  color: #fff;
  border-color: var(--adm-brand);
}
.adm-btn--primary:hover { background: #1a3068; }
.adm-btn--ghost { background: transparent; }
.adm-btn--block { width: 100%; }

.adm-muted { color: var(--adm-muted); font-size: 0.85rem; }
.adm-stack { display: grid; gap: 0.65rem; margin-bottom: 1.25rem; }
.adm-card-item {
  background: var(--adm-bg);
  border: 1px solid var(--adm-border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}
.adm-card-item h4 { margin: 0 0 0.3rem; font-size: 0.95rem; }

.adm-table-wrap { overflow-x: auto; border-radius: var(--adm-radius); border: 1px solid var(--adm-border); }
.adm-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--adm-surface);
  font-size: 0.82rem;
}
.adm-table th, .adm-table td {
  border-bottom: 1px solid var(--adm-border);
  padding: 0.5rem 0.65rem;
  text-align: center;
}
.adm-table th {
  background: var(--adm-bg);
  font-weight: 600;
  color: var(--adm-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
}
.adm-table th:first-child, .adm-table td:first-child { text-align: left; }

.adm-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.adm-list { list-style: none; padding: 0; margin: 0; }
.adm-list li {
  background: var(--adm-surface);
  border: 1px solid var(--adm-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  box-shadow: var(--adm-shadow);
}

.adm-form__checks {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}
.adm-form__checks label { display: flex; align-items: center; gap: 0.4rem; font-weight: 500; color: var(--adm-text); }
.adm-field textarea { resize: vertical; min-height: 80px; font-family: inherit; }

.despesa-row {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

@media (max-width: 800px) {
  .adm-sidebar {
    transform: translateX(-100%);
  }
  body.sidebar-open .adm-sidebar {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.1);
  }
  .adm-shell { margin-left: 0; }
  .adm-topbar__menu { display: block; }
  .adm-grid-2 { grid-template-columns: 1fr; }
}
