/* ============================================================
   Scheduling SaaS — CSS Global
   Tema dark profissional
   ============================================================ */

:root {
  --bg:          #0f172a;
  --bg-card:     #1e293b;
  --bg-input:    #0f172a;
  --bg-hover:    #263348;
  --border:      #334155;
  --green:       #22c55e;
  --green-dark:  #16a34a;
  --green-light: #dcfce7;
  --yellow:      #eab308;
  --red:         #ef4444;
  --blue:        #3b82f6;
  --text:        #e2e8f0;
  --text-muted:  #94a3b8;
  --text-dim:    #475569;
  --radius:      0.5rem;
  --radius-lg:   0.75rem;
  --shadow:      0 4px 24px rgba(0,0,0,0.35);
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.2);
  --transition:  0.18s cubic-bezier(0.23,1,0.32,1);
}

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

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Tipografia ─────────────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p  { color: var(--text-muted); }

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}

.card-sm { padding: 1rem; }

/* ── Botões ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary  { background: var(--green); color: #fff; }
.btn-primary:hover  { background: var(--green-dark); }

.btn-danger   { background: var(--red); color: #fff; }
.btn-danger:hover   { background: #dc2626; }

.btn-ghost    { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover    { background: var(--bg-hover); color: var(--text); }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── Formulários ────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }

.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.6rem 0.85rem;
  width: 100%;
  transition: border-color var(--transition);
  outline: none;
}

.form-control:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(34,197,94,0.15); }
.form-control::placeholder { color: var(--text-dim); }

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-green  { background: rgba(34,197,94,0.15);  color: var(--green); }
.badge-yellow { background: rgba(234,179,8,0.15);  color: var(--yellow); }
.badge-red    { background: rgba(239,68,68,0.15);  color: var(--red); }
.badge-blue   { background: rgba(59,130,246,0.15); color: var(--blue); }
.badge-gray   { background: rgba(148,163,184,0.15); color: var(--text-muted); }

/* ── Tabelas ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

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

thead th {
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

tbody tr:hover { background: var(--bg-hover); }
tbody td { padding: 0.75rem 1rem; color: var(--text); }

/* ── Alertas ────────────────────────────────────────────────── */
.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.alert-success { background: rgba(34,197,94,0.12);  border: 1px solid rgba(34,197,94,0.3);  color: var(--green); }
.alert-error   { background: rgba(239,68,68,0.12);  border: 1px solid rgba(239,68,68,0.3);  color: var(--red); }
.alert-warning { background: rgba(234,179,8,0.12);  border: 1px solid rgba(234,179,8,0.3);  color: var(--yellow); }
.alert-info    { background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.3); color: var(--blue); }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 1rem;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.15s ease;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.2s cubic-bezier(0.23,1,0.32,1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-body    { padding: 1.5rem; }
.modal-footer  { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; gap: 0.75rem; justify-content: flex-end; }

.modal-close {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1.25rem; line-height: 1;
  padding: 0.25rem; border-radius: var(--radius);
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text); }

/* ── Toast ──────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.85rem 1.1rem;
  font-size: 0.875rem;
  display: flex; align-items: center; gap: 0.5rem;
  min-width: 280px; max-width: 380px;
  animation: slideInRight 0.2s cubic-bezier(0.23,1,0.32,1);
}

.toast-success { border-left: 3px solid var(--green); }
.toast-error   { border-left: 3px solid var(--red); }
.toast-warning { border-left: 3px solid var(--yellow); }

/* ── Spinner ────────────────────────────────────────────────── */
.spinner {
  width: 1.25rem; height: 1.25rem;
  border: 2px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ── Utilitários ────────────────────────────────────────────── */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.text-sm   { font-size: 0.875rem; }
.text-xs   { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-green { color: var(--green); }
.text-red   { color: var(--red); }
.font-bold  { font-weight: 700; }
.hidden     { display: none !important; }
.w-full     { width: 100%; }
.text-center { text-align: center; }

/* ── Animações ──────────────────────────────────────────────── */
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp   { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes spin      { to { transform: rotate(360deg); } }

/* ── Responsivo ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  h1 { font-size: 1.4rem; }
  .card { padding: 1rem; }
  .modal { max-width: 100%; }
}
