/* StudioFlow — Design System Premium (Clínicas de Estética & Studios de Beleza) */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,500&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-canvas: #FAF8F6;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F4EFEA;
  --bg-sidebar: #161318;
  --bg-sidebar-hover: rgba(255, 255, 255, 0.07);
  --ink-primary: #18151A;
  --ink-secondary: #5C5560;
  --ink-muted: #8E8694;
  --border: #EAE3DC;
  --border-strong: #DDD3C8;

  --brand: #C96D63;
  --brand-hover: #B5584F;
  --brand-soft: #F9ECEA;
  --brand-glow: rgba(201, 109, 99, 0.22);
  --gold: #D4A373;
  --gold-soft: #FBF4EB;

  --success: #0F9D75;
  --success-soft: #E6F7F2;
  --warning: #D97706;
  --warning-soft: #FEF3C7;
  --danger: #DC2626;
  --danger-soft: #FEE2E2;
  --info: #4F46E5;
  --info-soft: #EEF2FF;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --shadow-sm: 0 2px 10px rgba(24, 21, 26, 0.04);
  --shadow-md: 0 10px 30px rgba(24, 21, 26, 0.07);
  --shadow-lg: 0 20px 50px rgba(24, 21, 26, 0.12);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-canvas);
  color: var(--ink-primary);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.font-serif { font-family: 'Playfair Display', Georgia, serif; }

a { color: inherit; text-decoration: none; }

/* App Shell */
.sf-shell {
  display: flex;
  min-height: 100vh;
}

.sf-sidebar {
  width: 268px;
  background: var(--bg-sidebar);
  color: #F4EFEA;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 40;
  transition: transform 0.25s ease;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.sf-sidebar-brand {
  padding: 24px 22px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sf-logo-mark {
  width: 40px; height: 40px;
  border-radius: 13px;
  background: linear-gradient(135deg, #E28B7E, #C96D63 55%, #A54B43);
  display: grid; place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 6px 18px rgba(201, 109, 99, 0.35);
  flex-shrink: 0;
}

.sf-brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
}

.sf-brand-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sf-profile-switch {
  margin: 14px 16px 8px;
  padding: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.sf-profile-btn {
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.62);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 8px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s;
}

.sf-profile-btn.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(201,109,99,0.35);
}

.sf-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px 20px;
}

.sf-nav-section {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
  padding: 14px 12px 6px;
}

.sf-nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border-radius: 12px;
  color: rgba(255,255,255,0.75);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.18s;
  margin-bottom: 2px;
}

.sf-nav-link:hover {
  background: var(--bg-sidebar-hover);
  color: #fff;
}

.sf-nav-link.active {
  background: linear-gradient(90deg, rgba(201, 109, 99, 0.26), rgba(201, 109, 99, 0.08));
  color: #fff;
  font-weight: 600;
  border-left: 3px solid var(--brand);
}

.sf-nav-link i { width: 18px; height: 18px; opacity: 0.88; }

.sf-sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sf-main {
  flex: 1;
  margin-left: 268px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sf-topbar {
  height: 68px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
}

.sf-content {
  padding: 26px 28px 48px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

/* Cards & Grids */
.sf-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.sf-card-hover {
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.sf-card-hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.sf-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.sf-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.sf-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.sf-grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; }

/* Buttons */
.sf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.18s;
  font-family: inherit;
}

.sf-btn-primary {
  background: linear-gradient(135deg, #D5796E, var(--brand));
  color: #fff;
  box-shadow: 0 6px 18px var(--brand-glow);
}
.sf-btn-primary:hover { background: var(--brand-hover); transform: translateY(-1px); }

.sf-btn-dark {
  background: var(--ink-primary);
  color: #fff;
}
.sf-btn-dark:hover { background: #2D2731; }

.sf-btn-outline {
  background: #fff;
  color: var(--ink-primary);
  border-color: var(--border-strong);
}
.sf-btn-outline:hover { background: var(--bg-subtle); border-color: var(--ink-muted); }

.sf-btn-soft {
  background: var(--brand-soft);
  color: var(--brand-hover);
}
.sf-btn-soft:hover { background: #F4DFDC; }

.sf-btn-sm { padding: 7px 13px; font-size: 12.5px; border-radius: 10px; }

/* Badges */
.sf-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}
.sf-badge-brand { background: var(--brand-soft); color: var(--brand-hover); }
.sf-badge-success { background: var(--success-soft); color: var(--success); }
.sf-badge-warning { background: var(--warning-soft); color: var(--warning); }
.sf-badge-danger { background: var(--danger-soft); color: var(--danger); }
.sf-badge-info { background: var(--info-soft); color: var(--info); }
.sf-badge-neutral { background: var(--bg-subtle); color: var(--ink-secondary); }

/* Inputs */
.sf-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-bottom: 6px;
}

.sf-input, .sf-select, .sf-textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--ink-primary);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sf-input:focus, .sf-select:focus, .sf-textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

/* Tables */
.sf-table-wrap { overflow-x: auto; }
.sf-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.sf-table th {
  text-align: left;
  padding: 12px 14px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--border);
  background: #FCFBF9;
}
.sf-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.sf-table tr:last-child td { border-bottom: none; }
.sf-table tbody tr:hover { background: #FDFBF9; }

/* Modal */
.sf-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 21, 26, 0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.sf-modal-backdrop.open { display: flex; }
.sf-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Toast */
.sf-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sf-toast {
  background: var(--ink-primary);
  color: #fff;
  padding: 13px 18px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: modalIn 0.2s ease;
}
.sf-toast.success { border-left: 4px solid var(--success); }
.sf-toast.error { border-left: 4px solid var(--danger); }

/* Mobile */
.sf-mobile-btn { display: none; }
.sf-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 35; }

@media (max-width: 1024px) {
  .sf-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sf-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sf-sidebar { transform: translateX(-100%); }
  .sf-sidebar.open { transform: translateX(0); }
  .sf-overlay.open { display: block; }
  .sf-main { margin-left: 0; }
  .sf-mobile-btn { display: inline-flex; }
}

@media (max-width: 640px) {
  .sf-grid-4, .sf-grid-3, .sf-grid-2 { grid-template-columns: 1fr; }
  .sf-content { padding: 18px 16px 40px; }
  .sf-topbar { padding: 0 16px; }
}
