:root {
  --admin-bg: #0f172a;
  --admin-surface: #1e293b;
  --admin-card: #243248;
  --admin-primary: #eab308;
  --admin-primary-hover: #ca8a04;
  --admin-text: #f8fafc;
  --admin-text-muted: #94a3b8;
  --admin-border: #334155;
  --admin-success: #10b981;
  --admin-danger: #ef4444;
  --admin-info: #38bdf8;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

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

/* Auth / Login Screen */
.admin-auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.auth-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--admin-primary);
  margin-bottom: 16px;
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 14px;
  color: var(--admin-text-muted);
  margin-bottom: 24px;
}

.admin-form-group {
  margin-bottom: 18px;
  text-align: left;
}

.admin-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--admin-text-muted);
  margin-bottom: 8px;
}

.admin-input {
  width: 100%;
  padding: 12px 14px;
  background: #0f172a;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.admin-input:focus {
  border-color: var(--admin-primary);
}

.admin-btn-primary {
  width: 100%;
  background: var(--admin-primary);
  color: #000;
  border: none;
  padding: 13px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

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

/* Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background: var(--admin-surface);
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--admin-border);
}

.sidebar-brand img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--admin-primary);
}

.sidebar-brand h2 {
  font-size: 16px;
  font-weight: 800;
}

.sidebar-brand p {
  font-size: 12px;
  color: var(--admin-primary);
}

.sidebar-nav {
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-link-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--admin-text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.nav-link-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.nav-link-btn.active {
  background: var(--admin-primary);
  color: #000;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-sidebar-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--admin-border);
  background: transparent;
  color: var(--admin-text-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn-sidebar-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

/* Main Content Area */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.admin-topbar {
  padding: 16px 28px;
  background: var(--admin-surface);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-title {
  font-size: 20px;
  font-weight: 800;
}

.topbar-date {
  font-size: 13px;
  color: var(--admin-text-muted);
}

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

.admin-body {
  padding: 28px;
  flex: 1;
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-icon.yellow { background: rgba(234, 179, 8, 0.15); color: #eab308; }
.stat-icon.green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.stat-icon.blue { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.stat-icon.purple { background: rgba(168, 85, 247, 0.15); color: #a855f7; }

.stat-content h3 {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
}

.stat-content p {
  font-size: 13px;
  color: var(--admin-text-muted);
}

/* Daily Bookings Chart (CSS Flex bars) */
.chart-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 28px;
}

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

.chart-bars-wrap {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 180px;
  padding-top: 20px;
  border-bottom: 1px solid var(--admin-border);
  overflow-x: auto;
}

.chart-bar-item {
  flex: 1;
  min-width: 45px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}

.bar-column {
  width: 100%;
  background: #334155;
  border-radius: 6px 6px 0 0;
  transition: all 0.3s;
  position: relative;
  min-height: 8px;
}

.bar-column.has-bookings {
  background: var(--admin-primary);
}

.bar-column.today {
  background: var(--admin-success);
}

.bar-val-label {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.bar-date-label {
  font-size: 11px;
  color: var(--admin-text-muted);
  white-space: nowrap;
}

/* Tables */
.admin-card-table {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 24px;
}

.table-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.admin-table th {
  padding: 12px 14px;
  color: var(--admin-text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--admin-border);
  white-space: nowrap;
}

.admin-table td {
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.admin-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
}

.badge-confirmado { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.badge-pendente { background: rgba(234, 179, 8, 0.2); color: #eab308; }
.badge-concluido { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.badge-cancelado { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

/* Action Buttons inside tables */
.btn-action-icon {
  background: transparent;
  border: 1px solid var(--admin-border);
  color: var(--admin-text);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}

.btn-action-icon:hover {
  background: var(--admin-card);
  border-color: #fff;
}

.btn-action-whatsapp {
  border-color: #25d366;
  color: #25d366;
}
.btn-action-whatsapp:hover {
  background: #25d366;
  color: #000;
}

/* Horários / Agenda Slots Grid */
.slots-management-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.slot-manage-card {
  background: var(--admin-card);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.slot-manage-card.free {
  border-color: #10b981;
}
.slot-manage-card.free:hover {
  background: rgba(16, 185, 129, 0.15);
}

.slot-manage-card.booked {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  cursor: default;
}

.slot-manage-card.blocked {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}
.slot-manage-card.blocked:hover {
  background: rgba(239, 68, 68, 0.2);
}

.slot-time-bold {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 4px;
}

.slot-status-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

/* Modal */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  backdrop-filter: blur(3px);
}

.admin-modal-card {
  background: var(--admin-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 28px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.modal-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--admin-border);
}

/* Responsive */
@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--admin-border);
  }
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 10px;
  }
  .nav-link-btn {
    white-space: nowrap;
  }
  .admin-body {
    padding: 16px;
  }
}

.hidden {
  display: none !important;
}
