/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body { font-family: 'DM Sans', system-ui, sans-serif; background: #f5f2ed; color: #1c1c1a; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }

/* ===== VARIÁVEIS ===== */
:root {
  --gd: #1a3a2a; --gm: #2d5a3d; --ga: #3d7a52; --gl: #e8f0eb;
  --bg: #f5f2ed; --bg2: #eeebe4; --w: #ffffff;
  --t1: #1c1c1a; --t2: #6b6b67; --t3: #9a9a94;
  --bd: rgba(0,0,0,0.08); --bd2: rgba(0,0,0,0.14);
  --ur: #c0392b; --ub: #fdf0ef;
  --font-serif: 'Lora', Georgia, serif;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px;
}

/* ===== LAYOUT ===== */
.app  { display: flex; height: 100vh; overflow: hidden; }
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ===== SIDEBAR ===== */
.sidebar { width: 240px; background: var(--gd); display: flex; flex-direction: column; flex-shrink: 0; }
.logo { padding: 22px 20px 20px; border-bottom: 0.5px solid rgba(255,255,255,0.08); }
.logo h1 { font-family: var(--font-serif); font-size: 20px; font-weight: 500; color: #fff; letter-spacing: -0.3px; }
.logo p  { font-size: 9.5px; color: rgba(255,255,255,0.35); letter-spacing: 1.8px; text-transform: uppercase; margin-top: 3px; }
.nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-section { padding: 12px 12px 4px; }
.nav-label { display: block; font-size: 9px; letter-spacing: 1.6px; text-transform: uppercase; color: rgba(255,255,255,0.28); padding: 0 8px; margin-bottom: 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-md); color: rgba(255,255,255,0.52); font-size: 13.5px; transition: background 0.15s, color 0.15s; }
.nav-item:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.88); }
.nav-item.active { background: var(--ga); color: #fff; }
.nav-icon { width: 15px; height: 15px; flex-shrink: 0; }
.badge { margin-left: auto; background: #e8673a; color: #fff; font-size: 10px; font-weight: 500; padding: 1px 7px; border-radius: 20px; min-width: 20px; text-align: center; }
.badge--green { background: var(--ga); }
.sidebar-footer { padding: 14px 20px; border-top: 0.5px solid rgba(255,255,255,0.08); display: flex; align-items: center; gap: 10px; margin-top: auto; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; color: #fff; flex-shrink: 0; background: var(--ga); }
.avatar--sm { width: 34px; height: 34px; }
.sidebar-user__name { font-size: 13px; color: #fff; font-weight: 500; }
.sidebar-user__role { font-size: 11px; color: rgba(255,255,255,0.38); margin-top: 1px; }

/* ===== TOPBAR ===== */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 28px; background: var(--bg); border-bottom: 0.5px solid var(--bd); flex-shrink: 0; }
.topbar__title { font-family: var(--font-serif); font-size: 20px; font-weight: 400; color: var(--t1); }

/* ===== BOTÕES ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; border-radius: var(--r-md); font-size: 13px; font-weight: 500; transition: all 0.15s; }
.btn--primary  { background: var(--gd); color: #fff; border: none; }
.btn--primary:hover  { background: var(--gm); }
.btn--secondary { background: transparent; color: var(--t2); border: 0.5px solid var(--bd2); }
.btn--secondary:hover { background: var(--bg2); }

/* ===== ABAS ===== */
.cfg-tabs { display: flex; padding: 0 28px; background: var(--w); border-bottom: 0.5px solid var(--bd); flex-shrink: 0; overflow-x: auto; }
.cfg-tab { padding: 12px 16px; font-size: 13px; color: var(--t3); cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s; white-space: nowrap; user-select: none; }
.cfg-tab:hover { color: var(--t2); }
.cfg-tab.active { color: var(--ga); border-bottom-color: var(--ga); font-weight: 500; }

/* ===== CONTEÚDO ===== */
.cfg-content { flex: 1; overflow-y: auto; padding: 24px 28px; }
.cfg-pane { display: none; }
.cfg-pane.active { display: block; }

/* ===== SEÇÕES ===== */
.cfg-section { margin-bottom: 22px; }
.cfg-section h3 { font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--t3); font-weight: 500; margin-bottom: 10px; }

/* ===== CARD ===== */
.cfg-card { background: var(--w); border: 0.5px solid var(--bd); border-radius: var(--r-lg); overflow: hidden; }

/* ===== PERFIL HERO ===== */
.profile-hero { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-bottom: 0.5px solid var(--bd); }
.profile-avatar {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--ga);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 500; color: #fff;
  flex-shrink: 0; position: relative; cursor: pointer;
  user-select: none;
}
.profile-avatar__edit {
  position: absolute; bottom: 0; right: 0;
  width: 20px; height: 20px;
  background: var(--gd); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.profile-avatar__edit svg { width: 10px; height: 10px; color: #fff; }
.profile-name  { font-size: 15px; font-weight: 500; color: var(--t1); }
.profile-role  { font-size: 12px; color: var(--t3); margin-top: 2px; }
.profile-since { font-size: 11px; color: var(--t3); margin-top: 3px; }

/* ===== FIELD ROWS ===== */
.field-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 0.5px solid var(--bd); }
.field-row:last-child { border-bottom: none; }
.field-label { font-size: 13px; color: var(--t2); width: 160px; flex-shrink: 0; }
.field-value { font-size: 13px; color: var(--t1); font-weight: 500; flex: 1; }
.field-value--pwd   { color: var(--t3); letter-spacing: 3px; font-size: 16px; }
.field-value--muted { color: var(--t3); font-weight: 400; }

.field-input {
  flex: 1;
  max-width: 360px;  /* ← adiciona essa linha */
  border: 0.5px solid var(--bd2);
  border-radius: var(--r-md);
  padding: 7px 12px;
  font-size: 13px;
  color: var(--t1);
  background: var(--bg);
  transition: border-color 0.15s;
  outline: none;
}
.field-input:focus { border-color: var(--ga); background: var(--w); }

.field-select {
  border: 0.5px solid var(--bd2);
  border-radius: var(--r-md);
  padding: 7px 12px;
  font-size: 13px;
  color: var(--t1);
  background: var(--bg);
  cursor: pointer;
  outline: none;
  min-width: 200px;
  max-width: 360px;  /* ← adiciona essa linha */
  transition: border-color 0.15s;
}
.field-select:focus { border-color: var(--ga); }

.btn-edit {
  font-size: 12px; padding: 5px 12px;
  border-radius: var(--r-sm);
  border: 0.5px solid var(--bd2);
  background: var(--w); color: var(--t2);
  cursor: pointer; white-space: nowrap;
  transition: all 0.12s;
}
.btn-edit:hover { background: var(--bg2); }

/* ===== LOGO UPLOAD ===== */
.logo-upload { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 0.5px solid var(--bd); }
.logo-box {
  width: 64px; height: 64px;
  border-radius: var(--r-lg);
  background: var(--gd);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.logo-box span { font-family: var(--font-serif); font-size: 16px; font-weight: 500; color: #fff; }
.logo-box img  { width: 100%; height: 100%; object-fit: cover; }
.logo-info__title { font-size: 13px; font-weight: 500; color: var(--t1); }
.logo-info__sub   { font-size: 11.5px; color: var(--t3); margin-top: 3px; }
.btn-upload {
  display: inline-block; margin-top: 8px;
  font-size: 12px; padding: 5px 12px;
  border-radius: var(--r-sm);
  border: 0.5px solid var(--bd2);
  background: var(--w); color: var(--t2);
  cursor: pointer; transition: all 0.12s;
}
.btn-upload:hover { background: var(--bg2); }

/* ===== EQUIPE ===== */
.team-item { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 0.5px solid var(--bd); transition: background 0.1s; }
.team-item:last-child { border-bottom: none; }
.team-item:hover { background: var(--bg); }
.team-avatar { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 500; color: #fff; flex-shrink: 0; }
.team-info { flex: 1; min-width: 0; }
.team-name  { font-size: 13.5px; font-weight: 500; color: var(--t1); }
.team-email { font-size: 11.5px; color: var(--t3); margin-top: 2px; }
.team-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.online-dot--on  { background: #2d9a52; }
.online-dot--off { background: var(--t3); }
.role-badge { font-size: 10.5px; padding: 2px 8px; border-radius: 4px; background: var(--gl); color: var(--ga); font-weight: 500; white-space: nowrap; }
.role-badge--admin { background: #fdf3e0; color: #7c5c1e; }
.btn-remove {
  font-size: 11.5px; padding: 4px 10px;
  border-radius: var(--r-sm);
  border: 0.5px solid rgba(192,57,43,0.2);
  background: var(--ub); color: var(--ur);
  cursor: pointer; white-space: nowrap;
  transition: all 0.12s;
}
.btn-remove:hover { background: #fbe5e3; }

.add-member-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 20px;
  cursor: pointer; transition: background 0.12s;
  border-top: 0.5px solid var(--bd);
  width: 100%; text-align: left;
}
.add-member-btn:hover { background: var(--bg); }
.add-member-btn:hover .add-member-btn__label { color: var(--ga); }
.add-member-icon {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px dashed var(--bd2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.add-member-icon svg { width: 15px; height: 15px; color: var(--t3); }
.add-member-btn__label { font-size: 13px; color: var(--t3); transition: color 0.12s; }

/* ===== TOGGLES ===== */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 0.5px solid var(--bd); gap: 16px; }
.toggle-row:last-child { border-bottom: none; }
.toggle-info { flex: 1; }
.toggle-info h4 { font-size: 13.5px; font-weight: 500; color: var(--t1); }
.toggle-info p  { font-size: 12px; color: var(--t3); margin-top: 3px; }

.toggle {
  width: 40px; height: 22px;
  border-radius: 20px;
  background: var(--bg2);
  cursor: pointer; position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle.on { background: var(--ga); }
.toggle-knob {
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%; background: #fff;
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle.on .toggle-knob { left: 21px; }

/* ===== DANGER ZONE ===== */
.danger-title { font-size: 13.5px; font-weight: 500; color: var(--ur); }
.danger-sub   { font-size: 11.5px; color: var(--t3); margin-top: 3px; }
.btn-danger-action {
  font-size: 12px; padding: 7px 16px;
  border-radius: var(--r-md);
  border: 0.5px solid rgba(192,57,43,0.25);
  background: var(--ub); color: var(--ur);
  cursor: pointer; white-space: nowrap;
  transition: all 0.12s; flex-shrink: 0;
}
.btn-danger-action:hover { background: #fbe5e3; }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal { background: var(--w); border-radius: var(--r-xl); width: 460px; max-width: 90vw; transform: translateY(12px); transition: transform 0.2s; }
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 16px; border-bottom: 0.5px solid var(--bd); }
.modal-header h3 { font-size: 15px; font-weight: 500; }
.modal-close { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); color: var(--t2); transition: background 0.1s; }
.modal-close:hover { background: var(--bg2); }
.modal-close svg { width: 15px; height: 15px; }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 11.5px; font-weight: 500; color: var(--t2); }
.form-group input, .form-group select { padding: 8px 12px; border: 0.5px solid var(--bd2); border-radius: var(--r-md); font-size: 13px; color: var(--t1); background: var(--w); outline: none; transition: border-color 0.15s; }
.form-group input:focus, .form-group select:focus { border-color: var(--ga); }
.form-group input::placeholder { color: var(--t3); }
.modal-footer { display: flex; gap: 10px; padding: 16px 24px; border-top: 0.5px solid var(--bd); justify-content: flex-end; }
.modal-footer .btn { flex: none; }
.modal-footer .btn--primary { padding: 9px 24px; }

.cfg-content {
  display: flex;
  flex-direction: column;
  align-items: center;        /* ← centraliza */
  padding: 32px 28px;
}

.cfg-pane {
  max-width: 720px;
  width: 100%;                /* ← ocupa até o max-width */
}