/* ==========================================================================
   Painel "Áreas × Módulos" — mockup de notebook com prévia ilustrativa de
   cada módulo. Ver js/modules-panel.js. Usado em index.html (#modulos,
   versão compacta) e em painel.html (versão em página cheia).
   ========================================================================== */

.mpanel{
  display:flex; border-radius:24px; overflow:hidden;
  background:linear-gradient(160deg, #F8FAFC 0%, #EEF1F4 100%);
  box-shadow:0 20px 60px rgba(11,20,34,.10);
  min-height:640px;
  margin-top:40px;
}
.mpanel--fullpage{ min-height:100vh; border-radius:0; box-shadow:none; }
@media (max-width:900px){ .mpanel{ flex-direction:column; min-height:0; } }

/* versão compacta (home) — mais enxuta para caber na tela sem cortar */
.mpanel:not(.mpanel--fullpage){ min-height:0; }
.mpanel:not(.mpanel--fullpage) .mpanel-main{ padding:24px; }
.mpanel:not(.mpanel--fullpage) .mpanel-heading{ margin-bottom:10px; }
.mpanel:not(.mpanel--fullpage) .mpanel-area-name{ font-size:clamp(1.2rem,2.4vw,1.6rem); }
.mpanel:not(.mpanel--fullpage) .mpanel-pills{ margin-bottom:14px; }
.mpanel:not(.mpanel--fullpage) .mpanel-laptop{ max-width:520px; }
.mpanel:not(.mpanel--fullpage) .mpanel-sidebar{ padding:20px 16px; flex-basis:190px; }

/* ---------- Sidebar de áreas ---------- */
.mpanel-sidebar{
  flex:0 0 220px; background:var(--surface-white); padding:28px 20px;
  display:flex; flex-direction:column; gap:16px; overflow-y:auto;
  border-right:1px solid var(--border-light);
}
@media (max-width:900px){ .mpanel-sidebar{ flex-direction:row; flex-wrap:wrap; border-right:none; border-bottom:1px solid var(--border-light); } }
.mpanel-sidebar-head h3{ font-family:var(--font-display); font-size:17px; font-weight:700; color:var(--text-primary); margin-bottom:2px; }
.mpanel-sidebar-head p{ font-size:12px; color:var(--text-muted); }
@media (max-width:900px){ .mpanel-sidebar-head{ flex:1 1 100%; } }

.mpanel-area-list{ display:flex; flex-direction:column; gap:6px; }
@media (max-width:900px){ .mpanel-area-list{ flex-direction:row; flex-wrap:wrap; } }

.mpanel-area-row{ display:flex; align-items:stretch; gap:4px; }
@media (max-width:900px){ .mpanel-area-row{ flex:1 1 auto; } }

.mpanel-area-btn{
  flex:1; min-width:0; display:flex; align-items:center; gap:10px; text-align:left;
  padding:9px 10px; border-radius:10px; border:none; cursor:pointer;
  background:var(--surface-soft); color:var(--text-secondary);
  font-size:13px; font-weight:600; font-family:var(--font-body);
  transition:transform var(--motion-fast) var(--ease-premium), background var(--motion-fast) var(--ease-premium), color var(--motion-fast) var(--ease-premium);
}

.mpanel-area-reorder{ display:flex; flex-direction:column; gap:2px; flex-shrink:0; }
.mpanel-area-order-btn{
  width:22px; height:19px; padding:0; display:flex; align-items:center; justify-content:center;
  border:none; border-radius:5px; background:var(--surface-soft); color:var(--text-muted); cursor:pointer;
  transition:background var(--motion-fast) var(--ease-premium), color var(--motion-fast) var(--ease-premium);
}
.mpanel-area-order-btn svg{ width:11px; height:11px; }
.mpanel-area-order-btn:hover:not(:disabled){ background:var(--border-light); color:var(--text-primary); }
.mpanel-area-order-btn:disabled{ opacity:.3; cursor:not-allowed; }
.mpanel-area-btn:hover{ background:var(--border-light); }
.mpanel-area-btn.is-active{ color:#fff; box-shadow:0 8px 18px rgba(11,20,34,.18); transform:scale(1.02); }
.mpanel-area-icon{
  width:26px; height:26px; border-radius:7px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  background:rgba(20,25,29,.06);
}
.mpanel-area-btn.is-active .mpanel-area-icon{ background:rgba(255,255,255,.22); }
.mpanel-area-icon svg{ width:14px; height:14px; }

/* ---------- Área principal ---------- */
.mpanel-main{ flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:36px; min-width:0; }
@media (max-width:900px){ .mpanel-main{ padding:24px; } }

.mpanel-heading{ text-align:center; margin-bottom:14px; }
.mpanel-area-name{ font-family:var(--font-display); font-size:clamp(1.5rem,3vw,2.1rem); font-weight:700; color:var(--text-primary); }
.mpanel-module-name{ font-size:14px; color:var(--text-secondary); margin-top:2px; }

.mpanel-pills{ display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:8px; margin-bottom:22px; }
.mpanel-pill{
  display:inline-flex; align-items:center; gap:7px;
  padding:7px 16px; border-radius:999px; border:1px solid var(--border-light);
  background:var(--surface-white); color:var(--text-secondary);
  font-size:13px; font-family:var(--font-body); cursor:pointer;
  transition:all var(--motion-fast) var(--ease-premium);
}
.mpanel-pill:hover{ background:var(--surface-soft); }
.mpanel-pill.is-active{ color:#fff; font-weight:600; }
.mpanel-pill-dot{ width:6px; height:6px; border-radius:50%; }

/* ---------- Mockup do notebook ---------- */
.mpanel-laptop{ position:relative; width:100%; max-width:760px; user-select:none; }
.mpanel-laptop-body{ background:#0B0B0D; border-radius:18px 18px 8px 8px; padding:10px; box-shadow:0 30px 60px rgba(11,20,34,.35); }
.mpanel-notch{ display:flex; justify-content:center; margin-bottom:-2px; }
.mpanel-notch span{ width:6px; height:6px; border-radius:50%; background:#232327; border:1px solid #333; }
.mpanel-notch{ position:relative; height:14px; }
.mpanel-notch::before{ content:''; position:absolute; left:50%; top:-10px; transform:translateX(-50%); width:80px; height:14px; background:#0B0B0D; border-radius:0 0 10px 10px; }
.mpanel-notch span{ position:relative; z-index:1; margin:0 auto; display:block; }

.mpanel-browserbar{
  background:#F1F2F4; border-radius:6px 6px 0 0; padding:8px 12px 6px;
  display:flex; align-items:center; gap:12px;
}
.mpanel-traffic{ display:flex; gap:6px; flex-shrink:0; }
.mpanel-traffic i{ width:10px; height:10px; border-radius:50%; display:block; }
.mpanel-traffic i:nth-child(1){ background:#FF6159; }
.mpanel-traffic i:nth-child(2){ background:#FFBD2E; }
.mpanel-traffic i:nth-child(3){ background:#28C840; }
.mpanel-url{
  flex:1; min-width:0; background:#fff; border:1px solid var(--border-light); border-radius:6px;
  padding:5px 10px; display:flex; align-items:center; gap:7px; font-size:11px; color:var(--text-muted);
}
.mpanel-url svg{ width:12px; height:12px; flex-shrink:0; color:var(--text-muted); }
.mpanel-url-text{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.mpanel-screen{ background:#fff; aspect-ratio:16/9; overflow:hidden; position:relative; }

.mpanel-hinge{ height:6px; width:97%; margin:0 auto; background:linear-gradient(to bottom,#c9cdd3,#9aa0aa); box-shadow:inset 0 1px 2px rgba(0,0,0,.2); }
.mpanel-base{
  width:108%; margin-left:-4%; height:14px;
  background:linear-gradient(to bottom,#e7e9ec,#c7cbd1);
  clip-path:polygon(3% 0, 97% 0, 100% 100%, 0% 100%);
  border-radius:0 0 8px 8px; position:relative;
}
.mpanel-base::after{ content:''; position:absolute; left:50%; bottom:0; transform:translateX(-50%); width:90px; height:5px; background:var(--bg-primary); border-radius:0 0 6px 6px; }
.mpanel-shadow{ width:66%; height:10px; margin:8px auto 0; background:rgba(11,20,34,.14); border-radius:999px; filter:blur(7px); }

/* ---------- Dashboard mockup (dentro da "tela") ---------- */
.mpanel-dash{ height:100%; display:flex; flex-direction:column; padding:5% 6%; box-sizing:border-box; }
.mpanel-dash-head{ display:flex; align-items:flex-start; justify-content:space-between; }
.mpanel-dash-eyebrow{ font-size:.72em; font-weight:700; letter-spacing:.05em; text-transform:uppercase; color:var(--accent); }
.mpanel-dash-title{ font-family:var(--font-display); font-size:1.35em; font-weight:700; color:var(--text-primary); margin-top:2px; }
.mpanel-dash-actions{ display:flex; gap:8px; }
.mpanel-dash-btn{ width:52px; height:20px; border-radius:6px; background:var(--surface-soft); }
.mpanel-dash-btn--ghost{ background:var(--surface-soft); }

.mpanel-dash-stats{ display:flex; gap:5%; margin-top:5%; }
.mpanel-stat{ flex:1; background:var(--surface-white); border:1px solid var(--border-light); border-radius:10px; padding:3.5% 4%; }
.mpanel-stat-label{ display:block; font-size:.62em; color:var(--text-muted); }
.mpanel-stat-num{ display:block; font-family:var(--font-display); font-size:1.15em; font-weight:700; color:var(--text-primary); margin-top:2px; }

.mpanel-dash-body{ flex:1; display:flex; gap:5%; margin-top:5%; min-height:0; }
.mpanel-chart{ flex:1; background:var(--surface-white); border:1px solid var(--border-light); border-radius:10px; display:flex; align-items:flex-end; gap:6%; padding:6%; }
.mpanel-bar{ flex:1; border-radius:3px 3px 0 0; }
.mpanel-list{ flex:1; background:var(--surface-white); border:1px solid var(--border-light); border-radius:10px; padding:5%; display:flex; flex-direction:column; justify-content:center; gap:12%; }
.mpanel-row{ display:flex; align-items:center; gap:6%; }
.mpanel-row-dot{ width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.mpanel-row-bar{ height:5px; border-radius:3px; background:var(--surface-soft); }
.mpanel-row-bar--sm{ flex-shrink:0; }

.mpanel-screen-img{ width:100%; height:100%; object-fit:cover; display:block; }

/* ---------- Modo administrador ---------- */
.mpanel-sidebar-foot{ margin-top:auto; padding-top:16px; border-top:1px solid var(--border-light); display:flex; flex-direction:column; gap:8px; }
@media (max-width:900px){ .mpanel-sidebar-foot{ flex:1 1 100%; flex-direction:row; border-top:none; margin-top:0; } }

.mpanel-adminbar{ display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:8px; margin:-10px 0 18px; }

.mpanel-admin-btn{
  display:inline-flex; align-items:center; gap:6px; cursor:pointer;
  padding:8px 14px; border-radius:999px; border:1px solid var(--border-light);
  background:var(--surface-white); color:var(--text-secondary);
  font-size:12.5px; font-weight:600; font-family:var(--font-body);
  transition:all var(--motion-fast) var(--ease-premium);
}
.mpanel-admin-btn:hover{ background:var(--surface-soft); }
.mpanel-admin-btn--accent{ background:var(--brand-navy-950); color:#fff; border-color:transparent; }
.mpanel-admin-btn--accent:hover{ background:var(--brand-navy-900); }
.mpanel-admin-btn--ghost{ background:transparent; border-color:transparent; color:var(--text-muted); }
.mpanel-admin-btn--file{ position:relative; overflow:hidden; }
.mpanel-admin-btn--danger{ background:transparent; border-color:rgba(194,34,34,.3); color:#C22; }
.mpanel-admin-btn--danger:hover{ background:rgba(194,34,34,.08); }

/* ---------- Modal (senha / nova área / novo módulo) ---------- */
.mpanel-modal-overlay{
  position:fixed; inset:0; z-index:200; background:rgba(11,20,34,.45);
  display:flex; align-items:center; justify-content:center; padding:20px;
  backdrop-filter:blur(3px);
}
.mpanel-modal{
  background:var(--surface-white); border-radius:18px; padding:28px;
  width:100%; max-width:380px; box-shadow:0 30px 70px rgba(11,20,34,.3);
}
.mpanel-modal-title{ font-family:var(--font-display); font-size:19px; font-weight:700; color:var(--text-primary); margin-bottom:6px; }
.mpanel-modal-sub{ font-size:13px; color:var(--text-secondary); margin-bottom:18px; }
.mpanel-modal-label{ display:block; font-size:12.5px; font-weight:600; color:var(--text-secondary); margin-bottom:12px; }
.mpanel-modal-input{
  display:block; width:100%; margin-top:6px; padding:10px 12px;
  border:1px solid var(--border-light); border-radius:10px; font-size:14px;
  font-family:var(--font-body); color:var(--text-primary); background:var(--surface-white);
}
.mpanel-modal-input--color{ padding:4px; height:40px; cursor:pointer; }
.mpanel-modal-error{ color:#C22; font-size:12.5px; margin:-6px 0 12px; }
.mpanel-modal-actions{ display:flex; justify-content:flex-end; gap:8px; margin-top:20px; }
