/* ============================================================
   SyncDental — Global Stylesheet
   Inspirado no Curve Dental: limpo, profissional, moderno
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* === VARIÁVEIS === */
:root {
  --sidebar-bg:       #0f1b2d;
  --sidebar-hover:    #1a2d47;
  --sidebar-active:   #1e6fff;
  --sidebar-text:     #8ea8c3;
  --sidebar-text-act: #ffffff;
  --sidebar-width:    220px;

  --topbar-bg:        #ffffff;
  --topbar-border:    #e8edf3;
  --topbar-height:    56px;

  --bg-main:          #f4f6f9;
  --bg-card:          #ffffff;
  --border-color:     #e2e8f0;

  --brand-blue:       #1e6fff;
  --brand-blue-light: #e8f1ff;
  --brand-teal:       #00b4a6;
  --brand-green:      #10b981;
  --brand-orange:     #f59e0b;
  --brand-red:        #ef4444;

  --text-primary:     #0f1b2d;
  --text-secondary:   #64748b;
  --text-muted:       #94a3b8;

  --radius-sm:        6px;
  --radius-md:        10px;
  --radius-lg:        16px;

  --shadow-sm:        0 1px 3px rgba(15,27,45,0.06), 0 1px 2px rgba(15,27,45,0.04);
  --shadow-md:        0 4px 12px rgba(15,27,45,0.08), 0 2px 4px rgba(15,27,45,0.04);
  --shadow-lg:        0 10px 30px rgba(15,27,45,0.12);

  --font-main:        'DM Sans', -apple-system, sans-serif;
  --font-mono:        'DM Mono', monospace;
}

/* === RESET BASE === */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: var(--font-main);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-main);
  -webkit-font-smoothing: antialiased;
}

/* === LAYOUT PRINCIPAL === */
.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* === SIDEBAR === */
.app-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  box-shadow: 2px 0 12px rgba(0,0,0,0.15);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-decoration: none;
}

.sidebar-brand-icon {
  width: 32px;
  height: 32px;
  background: var(--brand-blue);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-brand-name {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.sidebar-brand-sub {
  font-size: 10px;
  color: var(--sidebar-text);
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(142, 168, 195, 0.5);
  padding: 12px 10px 6px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 450;
  transition: all 0.15s ease;
  margin-bottom: 2px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar-item i {
  font-size: 15px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-item:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.sidebar-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-act);
  font-weight: 550;
}

.sidebar-item.active i { color: #ffffff; }

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

.sidebar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar-username {
  font-size: 12.5px;
  font-weight: 500;
  color: #fff;
  line-height: 1.2;
}

.sidebar-role {
  font-size: 10.5px;
  color: var(--sidebar-text);
}

/* === CONTEÚDO PRINCIPAL === */
.app-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* === TOPBAR === */
.app-topbar {
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  z-index: 50;
}

.topbar-title {
  font-size: 16px;
  font-weight: 650;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.topbar-spacer { flex: 1; }

.topbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.topbar-btn:hover {
  background: var(--bg-main);
  color: var(--text-primary);
  border-color: #cbd5e1;
}

.topbar-btn-primary {
  background: var(--brand-blue);
  color: white;
  border-color: var(--brand-blue);
}

.topbar-btn-primary:hover {
  background: #1557d6;
  color: white;
  border-color: #1557d6;
}

/* === PAGE CONTENT === */
.app-page {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
}

/* === CARDS === */
.sd-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* === BADGES === */
.sd-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.2px;
}

.sd-badge-blue   { background: #dbeafe; color: #1d4ed8; }
.sd-badge-green  { background: #d1fae5; color: #065f46; }
.sd-badge-orange { background: #fef3c7; color: #92400e; }
.sd-badge-red    { background: #fee2e2; color: #991b1b; }
.sd-badge-gray   { background: #f1f5f9; color: #475569; }

/* === FORMS GLOBAIS === */
.form-control, .form-select {
  border-color: var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 13.5px;
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(30,111,255,0.12);
}

.form-label {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-secondary);
  margin-bottom: 5px;
  letter-spacing: 0.2px;
}

/* === BOTÕES === */
.btn {
  font-family: var(--font-main);
  font-weight: 500;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
}

.btn-primary:hover {
  background: #1557d6;
  border-color: #1557d6;
}

/* === TABELAS === */
.table {
  font-size: 13.5px;
  color: var(--text-primary);
}

.table th {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 12px;
}

.table td {
  padding: 10px 12px;
  border-color: var(--border-color);
  vertical-align: middle;
}

.table tbody tr:hover {
  background: var(--brand-blue-light);
}

/* === MODAIS === */
.modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-main);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: 18px 24px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-title {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.2px;
}

.modal-body { padding: 20px 24px; }

.modal-footer {
  border-top: 1px solid var(--border-color);
  padding: 14px 24px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* === NAVBAR LEGACY (esconder — usamos sidebar) === */
nav.navbar { display: none !important; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* === AGENDA FULLSCREEN === */
body.agenda-full .app-sidebar,
body.agenda-full .app-topbar { display: none !important; }

body.agenda-full .app-content {
  margin-left: 0 !important;
}

body.agenda-full .app-page {
  padding: 0 !important;
}

/* === UTILITIES === */
.text-primary-custom { color: var(--text-primary) !important; }
.text-secondary-custom { color: var(--text-secondary) !important; }
.text-muted-custom { color: var(--text-muted) !important; }
.bg-card { background: var(--bg-card) !important; }