/* Lavajato Dani - Mobile-first */
:root {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #334155;
  --accent: #0ea5e9;
  --accent-hover: #38bdf8;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --radius: 12px;
  --touch: 48px;
}

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

html {
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:active {
  opacity: 0.9;
}

/* Layout */
.app-header {
  background: var(--bg-card);
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.app-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
}

.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Hamburger: só aparece no mobile, sem fundo */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

body.nav-open .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
body.nav-open .hamburger-line:nth-child(2) {
  opacity: 0;
}
body.nav-open .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 20;
  opacity: 0;
  transition: opacity 0.2s;
}

.nav-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nav-menu a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);
  padding: 0 16px;
  background: var(--bg-input);
  color: var(--text);
  border-radius: var(--radius);
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}

.nav-menu a:hover, .nav-menu a.active {
  background: var(--accent);
  color: var(--bg);
}

.nav-menu__logout {
  color: var(--text-muted);
}

/* Mobile: menu vira drawer + hamburger */
@media (max-width: 640px) {
  .hamburger-btn {
    display: flex;
  }

  .nav-overlay {
    display: block;
    pointer-events: none;
  }

  body.nav-open .nav-overlay {
    pointer-events: auto;
    opacity: 1;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 85vw);
    z-index: 30;
    flex-direction: column;
    align-items: stretch;
    padding: 60px 16px 24px;
    gap: 4px;
    border-bottom: none;
    border-right: 1px solid rgba(255,255,255,0.06);
    transform: translateX(-100%);
    transition: transform 0.25s ease-out;
    overflow-y: auto;
  }

  body.nav-open .nav-menu {
    transform: translateX(0);
  }

  .nav-menu a {
    justify-content: flex-start;
    padding-left: 16px;
  }

  .nav-menu__logout {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 12px;
  }
}

.main {
  padding: 16px;
  max-width: 640px;
  margin: 0 auto;
}

/* Cards & Lists */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.card h2 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.list-item {
  display: block;
  padding: 14px 16px;
  background: var(--bg-input);
  border-radius: var(--radius);
  margin-bottom: 8px;
  color: var(--text);
  min-height: var(--touch);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  -webkit-tap-highlight-color: transparent;
}

.list-item:active {
  opacity: 0.95;
}

.list-item .meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.list-item .valor {
  font-weight: 700;
  color: var(--accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch);
  padding: 0 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn--primary {
  background: var(--accent);
  color: var(--bg);
}

.btn--primary:hover { background: var(--accent-hover); }

.btn--block {
  width: 100%;
  margin-top: 8px;
}

.btn--danger {
  background: var(--danger);
  color: white;
}

.btn--small {
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.9rem;
}

/* Forms */
.form label {
  display: block;
  margin-bottom: 14px;
}

.form label span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.form input,
.form select,
.form textarea {
  width: 100%;
  min-height: var(--touch);
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form textarea {
  min-height: 100px;
  resize: vertical;
}

.form .btn {
  margin-top: 16px;
}

/* Messages */
.msg {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.msg--erro {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.msg--sucesso {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

/* Login */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-box {
  width: 100%;
  max-width: 360px;
  background: var(--bg-card);
  padding: 28px;
  border-radius: var(--radius);
}

.login-box h1 {
  text-align: center;
  margin-bottom: 4px;
}

.login-box .subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.login-hint {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* Home dashboard */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.dash-tile {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dash-tile .num {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
}

.dash-tile .label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.dash-tile a {
  color: inherit;
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge--agendado { background: #3b82f6; color: #fff; }
.badge--em_andamento { background: var(--warning); color: #000; }
.badge--concluido { background: var(--success); color: #fff; }
.badge--cancelado { background: var(--danger); color: #fff; }

/* Empty state */
.empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
}

.empty a {
  margin-top: 12px;
  display: inline-block;
}

/* Actions row */
.actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.actions-row .btn { flex: 1; min-width: 0; }

/* Página pública de agendamento */
body.public-page .main {
  padding-top: 8px;
}

.app-header--public {
  text-align: center;
  padding: 20px 16px;
}

.app-header--public .app-header__sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 400;
}

.card--public {
  margin-top: 0;
}

.form-intro {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

.form-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 16px;
  text-align: center;
}

.form-hint a {
  color: var(--text-muted);
  text-decoration: underline;
}

.card--success p {
  margin-bottom: 8px;
  color: var(--text-muted);
}

.card--success p:first-of-type {
  color: var(--text);
  font-weight: 500;
}
