/* ============================================================
   SisAgenda SaaS — Design System: Navy + Gold
   Arquivo: public/assets/css/style.css
   Tipografia: Playfair Display (display) + Poppins (UI)
   ============================================================ */

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

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Paleta principal */
  --navy:        #0f1923;
  --navy-2:      #162030;
  --navy-3:      #1e2d40;
  --navy-4:      #243447;
  --gold:        #c9a84c;
  --gold-2:      #e2c47a;
  --gold-3:      #f0d898;
  --gold-glow:   rgba(201,168,76,.15);
  --slate:       #8a9bb0;
  --slate-2:     #b0c0d0;
  --white:       #f4f6f8;
  --white-pure:  #ffffff;

  /* Semânticas */
  --success:     #2ecc8a;
  --success-bg:  rgba(46,204,138,.1);
  --warning:     #e8a838;
  --warning-bg:  rgba(232,168,56,.1);
  --danger:      #e05252;
  --danger-bg:   rgba(224,82,82,.1);
  --info:        #378add;
  --info-bg:     rgba(55,138,221,.1);

  /* Layout */
  --sidebar-w:   240px;
  --header-h:    64px;
  --rad-sm:      6px;
  --rad:         10px;
  --rad-lg:      16px;
  --rad-xl:      22px;

  /* Sombras */
  --shadow-sm:   0 1px 3px rgba(0,0,0,.35);
  --shadow:      0 4px 16px rgba(0,0,0,.45);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.55);

  /* Transição */
  --ease:        .2s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Poppins', system-ui, sans-serif;
  background: var(--navy);
  color: var(--white);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Tipografia ───────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--gold-2);
  line-height: 1.25;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; font-family: 'Poppins', sans-serif; font-weight: 600; color: var(--white); }

p  { color: var(--slate-2); font-size: .9rem; }
a  { color: var(--gold); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--gold-2); }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--navy-2); }
::-webkit-scrollbar-thumb { background: var(--navy-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ── Layout Principal (Sidebar + Content) ─────────────────── */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy-2);
  border-right: 1px solid rgba(201,168,76,.08);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100%;
  height: 100dvh; /* dynamic viewport height — corrige mobile */
  max-height: 100vh;
  overflow: hidden; /* previne scroll duplo */
  z-index: 100;
  transition: transform var(--ease);
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(201,168,76,.08);
}

.sidebar-logo .logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: rgba(201,168,76,.12);
  border: 1px solid rgba(201,168,76,.3);
  border-radius: var(--rad);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.sidebar-logo .logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold-2);
  line-height: 1;
}

.sidebar-logo .logo-sub {
  font-size: .65rem;
  color: var(--slate);
  font-weight: 400;
  letter-spacing: .04em;
}

/* Tenant info na sidebar */
.sidebar-tenant {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.04);
}

.tenant-badge {
  background: var(--gold-glow);
  border: 1px solid rgba(201,168,76,.2);
  border-radius: var(--rad);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tenant-badge .avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(201,168,76,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}

.tenant-badge .info { min-width: 0; }
.tenant-badge .name { font-size: .8rem; font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tenant-badge .plan { font-size: .65rem; color: var(--gold); letter-spacing: .04em; }

/* Nav */
.sidebar-nav {
  flex: 1;
  min-height: 0; /* essencial para flex+overflow funcionar */
  padding: 12px 10px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.nav-section {
  margin-bottom: 16px;
}

.nav-section-label {
  font-size: .6rem;
  color: var(--slate);
  letter-spacing: .1em;
  font-weight: 600;
  padding: 0 10px;
  margin-bottom: 4px;
  display: block;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--rad);
  color: var(--slate);
  font-size: .82rem;
  font-weight: 500;
  transition: all var(--ease);
  position: relative;
  text-decoration: none;
  margin-bottom: 2px;
}

.nav-link i { font-size: 1rem; width: 18px; text-align: center; }

.nav-link:hover {
  background: rgba(255,255,255,.04);
  color: var(--white);
}

.nav-link.active {
  background: var(--gold-glow);
  color: var(--gold);
  border: 1px solid rgba(201,168,76,.15);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%;
  background: var(--gold);
  border-radius: 0 3px 3px 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}



/* ── Header / Topbar ──────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--header-h);
  background: var(--navy-2);
  border-bottom: 1px solid rgba(201,168,76,.08);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--gold-2);
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-btn {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--rad);
  display: flex; align-items: center; justify-content: center;
  color: var(--slate);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--ease);
  position: relative;
  text-decoration: none;
}

.topbar-btn:hover { background: rgba(255,255,255,.08); color: var(--white); }

.topbar-btn .notif-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 1.5px solid var(--navy-2);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--rad);
  transition: background var(--ease);
  text-decoration: none;
}

.topbar-user:hover { background: rgba(255,255,255,.04); }

.topbar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(201,168,76,.15);
  border: 1.5px solid rgba(201,168,76,.3);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  color: var(--gold);
  overflow: hidden;
}

.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }

.topbar-user-name {
  font-size: .8rem;
  font-weight: 500;
  color: var(--white);
}

/* ── Page Content ─────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-header-left h2 { margin-bottom: 2px; }
.page-header-left p  { font-size: .8rem; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--navy-2);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: var(--rad-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.card-gold {
  border-color: rgba(201,168,76,.15);
}

.card-gold::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: .7rem;
  font-weight: 600;
  color: var(--slate);
  letter-spacing: .07em;
  text-transform: uppercase;
}

/* ── KPI Cards ────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--navy-2);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: var(--rad-lg);
  padding: 18px 16px;
  position: relative;
  overflow: hidden;
  transition: transform var(--ease), border-color var(--ease);
}

.kpi-card:hover { transform: translateY(-2px); border-color: rgba(201,168,76,.2); }

.kpi-card .kpi-icon {
  width: 36px; height: 36px;
  border-radius: var(--rad);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  margin-bottom: 12px;
}

.kpi-card .kpi-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--white-pure);
  line-height: 1;
  margin-bottom: 4px;
}

.kpi-card .kpi-label {
  font-size: .68rem;
  color: var(--slate);
  font-weight: 500;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.kpi-card .kpi-delta {
  font-size: .72rem;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.kpi-card .kpi-delta.up   { color: var(--success); }
.kpi-card .kpi-delta.down { color: var(--danger); }

/* ── Botões ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--rad);
  font-family: 'Poppins', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--ease);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: var(--navy);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-2), var(--gold-3));
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(201,168,76,.3);
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(201,168,76,.3);
  color: var(--gold);
}

.btn-outline:hover {
  background: var(--gold-glow);
  border-color: var(--gold);
  color: var(--gold-2);
}

.btn-ghost {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  color: var(--slate-2);
}

.btn-ghost:hover { background: rgba(255,255,255,.08); color: var(--white); }

.btn-danger {
  background: var(--danger-bg);
  border: 1px solid rgba(224,82,82,.25);
  color: var(--danger);
}

.btn-danger:hover { background: rgba(224,82,82,.2); }

.btn-success {
  background: var(--success-bg);
  border: 1px solid rgba(46,204,138,.25);
  color: var(--success);
}

.btn-sm { padding: 5px 12px; font-size: .75rem; }
.btn-lg { padding: 12px 24px; font-size: .9rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Formulários ──────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: .72rem;
  color: var(--slate-2);
  font-weight: 600;
  letter-spacing: .04em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  background: var(--navy-3);
  border: 1px solid rgba(138,155,176,.2);
  border-radius: var(--rad);
  padding: 10px 14px;
  font-size: .88rem;
  color: var(--white);
  font-family: 'Poppins', sans-serif;
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
  appearance: none;
}

.form-control:focus {
  border-color: rgba(201,168,76,.5);
  box-shadow: 0 0 0 3px rgba(201,168,76,.08);
}

.form-control::placeholder { color: var(--slate); }
.form-control:disabled { opacity: .5; cursor: not-allowed; }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%238a9bb0' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

select.form-control option { background: var(--navy-1); }
/* select.form-control option { background: var(--navy-2); } */

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

.form-hint {
  font-size: .72rem;
  color: var(--slate);
  margin-top: 4px;
}

.form-error {
  font-size: .72rem;
  color: var(--danger);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Radio e Checkbox personalizados */
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: .85rem;
  color: var(--slate-2);
  margin-bottom: 6px;
}

.form-check input[type="radio"],
.form-check input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
}

/* ── Tabelas ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--rad-lg); }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

.table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: .68rem;
  font-weight: 600;
  color: var(--slate);
  letter-spacing: .07em;
  text-transform: uppercase;
  background: rgba(255,255,255,.02);
  border-bottom: 1px solid rgba(255,255,255,.05);
}

.table tbody td {
  padding: 13px 16px;
  color: var(--slate-2);
  border-bottom: 1px solid rgba(255,255,255,.03);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr {
  transition: background var(--ease);
}

.table tbody tr:hover { background: rgba(255,255,255,.02); }

.table tbody td strong { color: var(--white); }

/* ── Badges / Status ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .03em;
}

.badge-success  { background: var(--success-bg); color: var(--success); border: 1px solid rgba(46,204,138,.2); }
.badge-warning  { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(232,168,56,.2); }
.badge-danger   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid rgba(224,82,82,.2); }
.badge-info     { background: var(--info-bg);    color: var(--info);    border: 1px solid rgba(55,138,221,.2); }
.badge-gold     { background: var(--gold-glow);  color: var(--gold);    border: 1px solid rgba(201,168,76,.2); }
.badge-muted    { background: rgba(138,155,176,.08); color: var(--slate); border: 1px solid rgba(138,155,176,.15); }

/* ── Calendário ───────────────────────────────────────────── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-day-header {
  text-align: center;
  padding: 6px;
  font-size: .65rem;
  font-weight: 600;
  color: var(--slate);
  letter-spacing: .07em;
  text-transform: uppercase;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--rad);
  font-size: .82rem;
  color: var(--slate-2);
  cursor: pointer;
  transition: all var(--ease);
  position: relative;
  text-decoration: none;
}

.cal-day:hover { background: rgba(255,255,255,.05); color: var(--white); }
.cal-day.today { background: var(--gold-glow); color: var(--gold); font-weight: 600; border: 1px solid rgba(201,168,76,.3); }
.cal-day.selected { background: var(--gold); color: var(--navy); font-weight: 700; }
.cal-day.other-month { opacity: .3; }
.cal-day.has-appt::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold);
}

.cal-day.folga {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(224,82,82,.2);
  cursor: default;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .05em;
}

/* ── Agenda / Time Slots ─────────────────────────────────── */
.agenda-list { display: flex; flex-direction: column; gap: 4px; }

.agenda-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--rad);
  border: 1px solid transparent;
  transition: all var(--ease);
}

.agenda-slot.booked {
  background: var(--gold-glow);
  border-color: rgba(201,168,76,.15);
}

.agenda-slot.free {
  background: rgba(255,255,255,.02);
  border-color: rgba(255,255,255,.03);
}

.agenda-slot:hover { border-color: rgba(201,168,76,.2); }

.slot-time {
  font-size: .78rem;
  font-weight: 700;
  color: var(--gold);
  min-width: 42px;
  font-variant-numeric: tabular-nums;
}

.slot-info { flex: 1; min-width: 0; }
.slot-client { font-size: .85rem; font-weight: 600; color: var(--white); }
.slot-service { font-size: .75rem; color: var(--slate); }
.slot-free-label { font-size: .8rem; color: var(--slate); font-style: italic; }

/* ── Time Slot Picker ─────────────────────────────────────── */
.time-slot-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.time-slot-btn {
  padding: 9px;
  background: var(--navy-3);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--rad);
  color: var(--slate-2);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--ease);
  text-align: center;
  font-family: 'Poppins', sans-serif;
}

.time-slot-btn:hover { border-color: rgba(201,168,76,.4); color: var(--gold); background: var(--gold-glow); }
.time-slot-btn.selected { background: var(--gold); color: var(--navy); border-color: var(--gold); font-weight: 700; }
.time-slot-btn.busy {
  background: rgba(224,82,82,.06) !important;
  border-color: rgba(224,82,82,.2) !important;
  color: rgba(200,80,80,.5) !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  text-decoration: line-through;
  opacity: .55;
}

/* ── Modal / Drawer ───────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease);
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--navy-2);
  border: 1px solid rgba(201,168,76,.12);
  border-radius: var(--rad-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(20px);
  transition: transform var(--ease);
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal::before {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 50%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: 2px;
}

.modal-header {
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.05);
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--gold-2);
}

.modal-close {
  width: 28px; height: 28px;
  border-radius: var(--rad);
  background: rgba(255,255,255,.04);
  border: none;
  color: var(--slate);
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--ease);
}

.modal-close:hover { background: var(--danger-bg); color: var(--danger); }

.modal-body { padding: 20px; }
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.05);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Drawer lateral (novo agendamento) */
.drawer {
  position: fixed;
  top: 0; right: 0;
  width: 380px;
  height: 100%;
  max-height: 100vh;
  max-height: 100dvh;
  background: var(--navy-2);
  border-left: 1px solid rgba(201,168,76,.1);
  z-index: 150;
  overflow-y: scroll;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

.drawer.open { transform: translateX(0); }

.drawer::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 2px; height: 100%;
  background: linear-gradient(180deg, transparent, var(--gold), transparent);
}

.drawer {
  overflow-y: scroll !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
  height: 100vh !important;
  height: 100dvh !important;
  display: block !important;
}

/* Remove qualquer restrição de altura em elementos filhos do drawer */
.drawer > div {
  max-height: none !important;
  overflow: visible !important;
}

/* Garante espaço no final para o botão aparecer */
.drawer form {
  padding-bottom: 80px !important;
}

/* ── Toast Notifications ─────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.toast {
  background: var(--navy-2);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--rad-lg);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight .3s ease forwards;
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}

.toast-success::before { background: var(--success); }
.toast-error::before   { background: var(--danger);  }
.toast-warning::before { background: var(--warning); }
.toast-info::before    { background: var(--info);    }

.toast-icon { font-size: 1.1rem; margin-top: 1px; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--success); }
.toast-error   .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info    .toast-icon { color: var(--info); }

.toast-message { font-size: .82rem; color: var(--slate-2); flex: 1; }
.toast-title   { font-size: .85rem; font-weight: 600; color: var(--white); margin-bottom: 2px; }

.toast-close {
  background: none; border: none;
  color: var(--slate); cursor: pointer;
  font-size: .9rem; padding: 0;
  flex-shrink: 0;
  transition: color var(--ease);
}

.toast-close:hover { color: var(--white); }

/* ── Skeleton Loading ─────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--navy-3) 25%, var(--navy-4) 50%, var(--navy-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--rad);
}

/* ── Charts (barras e linhas simples CSS) ─────────────────── */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80px;
}

.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }

.chart-bar {
  width: 100%;
  background: rgba(201,168,76,.2);
  border-radius: 3px 3px 0 0;
  transition: background var(--ease);
}

.chart-bar.hi { background: rgba(201,168,76,.7); }
.chart-bar:hover { background: rgba(201,168,76,.9); }

.chart-label { font-size: .62rem; color: var(--slate); }

/* Progress bar */
.progress-bar-wrap {
  background: rgba(255,255,255,.06);
  border-radius: 20px;
  height: 6px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  transition: width .6s ease;
}

/* ── Login Page ───────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,.04) 0%, transparent 70%);
  top: -150px; right: -150px;
}

.auth-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(55,138,221,.04) 0%, transparent 70%);
  bottom: -100px; left: -100px;
}

.auth-card {
  background: var(--navy-2);
  border: 1px solid rgba(201,168,76,.12);
  border-radius: var(--rad-xl);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 60%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  border-radius: 2px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo .logo-icon-lg {
  width: 56px; height: 56px;
  background: rgba(201,168,76,.1);
  border: 1px solid rgba(201,168,76,.25);
  border-radius: var(--rad-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 12px;
}

.auth-logo h1 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

.auth-logo p {
  font-size: .8rem;
  color: var(--slate);
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.05);
  font-size: .8rem;
  color: var(--slate);
}

/* ── Responsividade ───────────────────────────────────────── */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ── Seletor de slot de horário ─────────────────────────────── */
.slot-opt {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.03);
  color: var(--slate-2);
  transition: all .15s;
  user-select: none;
}
.slot-opt:hover {
  border-color: rgba(201,168,76,.3);
  color: var(--white);
  background: rgba(201,168,76,.05);
}
.slot-opt-active {
  background: var(--gold-glow) !important;
  border-color: rgba(201,168,76,.4) !important;
  color: var(--gold) !important;
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(-240px);
    width: 240px;
  }

  .sidebar.open { transform: translateX(0); }

  .main-content { margin-left: 0; }

  .topbar { padding: 0 16px; }

  .page-content { padding: 16px; }

  .kpi-grid { grid-template-columns: repeat(2, 1fr); }

  .drawer { width: 100%; max-width: 100%; }

  .toast-container { bottom: 16px; right: 16px; left: 16px; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 28px 20px; }
  .time-slot-picker { grid-template-columns: repeat(2, 1fr); }
}

/* ── Animações ────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .6; }
}

.fade-in { animation: fadeIn .35s ease forwards; }

/* ── Utilitários ──────────────────────────────────────────── */
.text-gold    { color: var(--gold); }
.text-muted   { color: var(--slate); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-sm      { font-size: .8rem; }
.text-xs      { font-size: .72rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }

.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,.05);
  margin: 16px 0;
}

/* Linha de separação gold */
.gold-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,.3), transparent);
  margin: 20px 0;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--slate);
}

.empty-state i { font-size: 2.5rem; opacity: .3; margin-bottom: 12px; display: block; }
.empty-state p { font-size: .85rem; }

/* ============================================================
   RESPONSIVIDADE GLOBAL — Mobile-first additions
   ============================================================ */

/* ── Tabela → Cards em mobile ──────────────────────────── */
.mob-table thead       { display: table-header-group; }
.mob-table tbody tr    { display: table-row; }
.mob-table tbody td    { display: table-cell; }

@media (max-width: 768px) {
  /* Page header empilha em mobile */
  .page-header { flex-direction: column; align-items: flex-start !important; gap: 10px; }
  .page-header .btn, .page-header div { width: 100%; }

  /* Grid de 2 colunas vira 1 */
  .grid-mob-1 { grid-template-columns: 1fr !important; }

  /* Grid de agenda (calendário + lista) */
  .agenda-layout { grid-template-columns: 1fr !important; }

  /* KPI grid: 2 colunas em mobile */
  .kpi-grid { grid-template-columns: 1fr 1fr !important; }

  /* Tabelas viram cards */
  .mob-table thead { display: none !important; }
  .mob-table tbody tr {
    display: block;
    background: var(--navy-3);
    border-radius: var(--rad);
    margin-bottom: 8px;
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,.05);
  }
  .mob-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border: none !important;
    font-size: .83rem;
    min-height: 30px;
    gap: 8px;
  }
  .mob-table tbody td::before {
    content: attr(data-label);
    color: var(--slate);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .04em;
    flex-shrink: 0;
    min-width: 90px;
  }
  .mob-table tbody td:empty { display: none; }

  /* Drawer full-width */
  .drawer { width: 100% !important; max-width: 100% !important; }

  /* Slots em 2 colunas no mobile */
  .time-slot-picker { grid-template-columns: repeat(3, 1fr) !important; }

  /* Formulários de perfil: 1 coluna */
  .perfil-grid { grid-template-columns: 1fr !important; }

  /* Filtros empilhados */
  .filter-form { flex-direction: column !important; }
  .filter-form > * { width: 100% !important; min-width: unset !important; }

  /* Cards de serviço: 1 coluna */
  .svc-grid { grid-template-columns: 1fr !important; }

  /* Botões do page-header */
  .page-header-actions { flex-wrap: wrap; width: 100%; }
  .page-header-actions .btn { flex: 1; justify-content: center; min-width: 120px; }

  /* Período do relatório */
  .period-btns { flex-wrap: wrap; width: 100%; }
  .period-btns .btn { flex: 1; text-align: center; justify-content: center; }

  /* Oculta colunas menos importantes em mobile */
  .hide-mob { display: none !important; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr !important; }
  .kpi-card { padding: 12px 10px !important; text-align: center !important; }
  .kpi-card .kpi-icon  { width: 28px !important; height: 28px !important; font-size: .8rem !important; margin: 0 auto 6px !important; }
  .kpi-card .kpi-value { font-size: 1.2rem !important; }
  .kpi-card .kpi-label { font-size: .62rem !important; }
  .kpi-card .kpi-delta { font-size: .62rem !important; justify-content: center !important; }
  .time-slot-picker { grid-template-columns: repeat(2, 1fr) !important; }
}
