/* =============================================
   BARBER SHOP DANNY BOY – ADMIN CSS
   Paleta: Preto · Branco
   ============================================= */

.page-admin {
  --acc: #ffffff;
  --acc-dim: rgba(255,255,255,0.12);
  --acc-border: rgba(255,255,255,0.18);
  --bg: #0a0a0a;
  --bg2: #111;
  --bg3: #181818;
  --bg4: #202020;
  --bg5: #282828;
  --border: rgba(255,255,255,0.07);
  --text: #fff;
  --text-muted: rgba(255,255,255,0.45);
  --radius: 12px;
  --radius-sm: 8px;
}

/* ===== BASE ===== */
.page-admin { overflow: hidden; height: 100dvh; background: var(--bg); }

/* ===== INPUTS & FORMS ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.3px;
}
.form-group label i { color: rgba(255,255,255,0.5); font-size: 0.78rem; }

.form-group input,
.form-group select,
.form-group textarea,
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group input[type="time"],
.form-group input[type="date"],
.form-group input[type="color"] {
  background: var(--bg4) !important;
  border: 1.5px solid rgba(255,255,255,0.1) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text) !important;
  font-size: 0.9rem !important;
  font-family: 'Inter', sans-serif !important;
  padding: 11px 14px !important;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: rgba(255,255,255,0.4) !important;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.06) !important;
  background: var(--bg5) !important;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: rgba(255,255,255,0.2) !important; }
.form-group select option { background: var(--bg4); color: var(--text); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group input[type="color"] { height: 44px; padding: 4px 8px !important; cursor: pointer; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ===== LOGIN OVERLAY ===== */
.login-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-overlay.active { display: flex; }
.login-box {
  background: var(--bg3);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 40px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 12px 60px rgba(0,0,0,0.9);
}
.login-box h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  text-align: center;
  margin-bottom: 6px;
}
.login-box > p {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 24px;
}
.login-hint {
  text-align: center;
  margin-top: 14px;
  color: rgba(255,255,255,0.2);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* ===== ADMIN LAYOUT ===== */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100dvh;
  overflow: hidden;
}

/* ===== SIDEBAR ===== */
.admin-sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s ease;
  z-index: 500;
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.admin-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: rgba(255,255,255,0.4);
  font-size: 0.88rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  text-align: left;
  width: 100%;
  white-space: nowrap;
}
.admin-nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.admin-nav-item.active {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border-left: 3px solid var(--acc);
  padding-left: 9px;
}
.admin-nav-item.danger { color: rgba(248,113,113,0.55); }
.admin-nav-item.danger:hover { background: rgba(248,113,113,0.07); color: #f87171; }
.admin-nav-item.agenda-btn {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.12);
  margin-top: 4px;
}
.admin-nav-item.agenda-btn:hover { background: var(--acc); color: var(--bg); }
.admin-nav-item i { width: 18px; text-align: center; font-size: 0.9rem; flex-shrink: 0; }
.admin-sidebar-footer {
  padding: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}

/* ===== CONTEÚDO ===== */
.admin-content { display: flex; flex-direction: column; overflow: hidden; height: 100dvh; }
.admin-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 56px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  display: none;
  padding: 6px;
}
.admin-page-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.admin-user {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* ===== TABS ===== */
.admin-tab { display: none; flex: 1; overflow-y: auto; padding: 16px; -webkit-overflow-scrolling: touch; }
.admin-tab.active { display: block; }

/* ===== CARDS ===== */
.admin-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}
.admin-card-header h3 { font-size: 0.95rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.header-actions select,
.header-actions input[type="date"] {
  background: var(--bg4);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.82rem;
  font-family: 'Inter', sans-serif;
  padding: 7px 10px;
  outline: none;
}
.header-actions select:focus,
.header-actions input[type="date"]:focus { border-color: rgba(255,255,255,0.35); }

/* ===== DASHBOARD ===== */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.dash-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.dash-card-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.dash-card-icon.blue   { background: rgba(96,165,250,0.12); color: #60a5fa; }
.dash-card-icon.gold   { background: rgba(255,255,255,0.08); color: #fff; }
.dash-card-icon.green  { background: rgba(74,222,128,0.12);  color: #4ade80; }
.dash-card-icon.purple { background: rgba(167,139,250,0.12); color: #a78bfa; }
.dash-card-info { display: flex; flex-direction: column; min-width: 0; }
.dash-card-num {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: 'Playfair Display', serif;
  color: var(--text);
  line-height: 1;
}
.dash-card-info span:last-child {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.stats-list { padding: 14px 16px; }
.stat-bar-item { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.stat-bar-label { display: flex; justify-content: space-between; font-size: 0.82rem; }
.stat-bar-label span:last-child { color: rgba(255,255,255,0.7); font-weight: 600; }
.stat-bar-track { height: 5px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.stat-bar-fill { height: 100%; background: linear-gradient(90deg, #fff, #aaa); border-radius: 3px; transition: width 0.8s ease; }

/* ===== TABELAS ===== */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.83rem; min-width: 500px; }
thead tr { background: var(--bg4); }
thead th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid rgba(255,255,255,0.03); transition: background 0.15s; }
tbody tr:hover { background: rgba(255,255,255,0.02); }
tbody td { padding: 10px 12px; color: rgba(255,255,255,0.75); vertical-align: middle; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 50px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.badge-pendente  { background: rgba(251,191,36,0.15);  color: #fbbf24; }
.badge-confirmado{ background: rgba(74,222,128,0.15);  color: #4ade80; }
.badge-concluido { background: rgba(96,165,250,0.15);  color: #60a5fa; }
.badge-cancelado { background: rgba(248,113,113,0.15); color: #f87171; }
.badge-ativo     { background: rgba(74,222,128,0.15);  color: #4ade80; }
.badge-inativo   { background: rgba(248,113,113,0.15); color: #f87171; }

.table-actions { display: flex; gap: 5px; align-items: center; }
.btn-icon {
  width: 30px; height: 30px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-icon.edit   { background: rgba(96,165,250,0.1);  color: #60a5fa; }
.btn-icon.edit:hover   { background: rgba(96,165,250,0.25); }
.btn-icon.delete { background: rgba(248,113,113,0.1); color: #f87171; }
.btn-icon.delete:hover { background: rgba(248,113,113,0.25); }
.btn-icon.confirm{ background: rgba(74,222,128,0.1);  color: #4ade80; }
.btn-icon.confirm:hover { background: rgba(74,222,128,0.25); }

.status-select {
  background: var(--bg4);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.78rem;
  font-family: 'Inter', sans-serif;
  padding: 5px 8px;
  cursor: pointer;
  outline: none;
}
.status-select:focus { border-color: rgba(255,255,255,0.35); }

/* ===== MODAL (bottom-sheet) ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 9000;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: var(--bg3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px 20px 0 0;
  padding: 28px 20px 32px;
  width: 100%;
  max-width: 560px;
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: var(--bg4);
  border: none;
  color: rgba(255,255,255,0.45);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.2s;
  z-index: 1;
}
.modal-close:hover { background: rgba(248,113,113,0.15); color: #f87171; }
.modal-handle {
  width: 40px; height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
  margin: 0 auto 20px;
}
#modalContent h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  margin-bottom: 20px;
  padding-right: 36px;
}
.modal-form { display: flex; flex-direction: column; gap: 16px; }
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: stretch;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.btn-cancel {
  flex: 1;
  padding: 12px 20px;
  border-radius: 50px;
  background: var(--bg4);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.55);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.btn-cancel:hover { color: var(--text); }
.btn-salvar {
  flex: 2;
  padding: 12px 20px;
  border-radius: 50px;
  background: var(--acc);
  border: none;
  color: #000;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(255,255,255,0.1);
}
.btn-salvar:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(255,255,255,0.16); background: #e8e8e8; }

/* Checkbox group (dias) */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 7px; }
.checkbox-option {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 50px;
  background: var(--bg4);
  border: 1.5px solid rgba(255,255,255,0.08);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
  user-select: none;
}
.checkbox-option input { accent-color: var(--acc); width: 14px; height: 14px; }
.checkbox-option:has(input:checked) {
  border-color: rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.09);
  color: #fff;
}

/* Tags de exceção */
.excecao-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.excecao-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.75);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 50px;
}
.excecao-tag button {
  background: none;
  border: none;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  padding: 0;
  font-size: 0.75rem;
  line-height: 1;
}
.excecao-tag button:hover { color: #f87171; }
.add-excecao-row { display: flex; gap: 8px; align-items: center; }
.add-excecao-row input {
  flex: 1;
  background: var(--bg4) !important;
  border: 1.5px solid rgba(255,255,255,0.1) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text) !important;
  font-size: 0.85rem !important;
  padding: 9px 12px !important;
}
.add-excecao-row button {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.add-excecao-row button:hover { background: var(--acc); color: #000; }

/* ===== CONFIG ===== */
.config-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.config-form { padding: 16px; display: flex; flex-direction: column; gap: 16px; }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state i { font-size: 2.5rem; margin-bottom: 10px; display: block; color: rgba(255,255,255,0.12); }
.empty-state p { font-size: 0.85rem; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 20px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg3);
  color: white;
  padding: 12px 22px;
  border-radius: 50px;
  font-size: 0.88rem;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  z-index: 99999;
  transition: transform 0.3s ease;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(74,222,128,0.4); background: rgba(5,20,5,0.98); }
.toast.error   { border-color: rgba(255,255,255,0.15); background: rgba(25,20,20,0.98); }

/* ===== BOTÕES GLOBAIS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--acc);
  color: #000 !important;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 11px 22px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(255,255,255,0.08);
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(255,255,255,0.14); background: #e8e8e8; }

/* ===== SEÇÃO DE EXCEÇÕES ===== */
.secao-excecoes {
  border: 1.5px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: rgba(255,255,255,0.02);
}
.secao-excecoes h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 260px;
    z-index: 8000;
    transform: translateX(-100%);
    box-shadow: 4px 0 20px rgba(0,0,0,0.7);
  }
  .admin-sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .dashboard-cards { grid-template-columns: 1fr 1fr; }
  .admin-tab { padding: 12px; }
}
@media (max-width: 480px) {
  .dashboard-cards { grid-template-columns: 1fr 1fr; }
  .admin-card-header { flex-direction: column; align-items: flex-start; }
  .modal-box { padding: 22px 16px 28px; }
  #modalContent h2 { font-size: 1.2rem; }
  .dash-card-num { font-size: 1.3rem; }
}
