:root {
  --header-height: 48px;
  --sidebar-width: 250px;
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fb;
  --bg-sidebar: #f3f4f7;
  --bg-input: #f0f1f5;
  --bg-hover: #e8eaef;
  --text-primary: #1a1d2e;
  --text-secondary: #4b5068;
  --text-muted: #8b8fa3;
  --accent: #4f6bed;
  --border: #d8dbe5;
  --success: #16a34a;
  --divider: #e5e7ed;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); background: var(--bg-primary); color: var(--text-primary); height: 100vh; overflow: hidden; }

.header {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; position: fixed; top: 0; left: 0; right: 0; z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.logo { width: 26px; height: 26px; background: linear-gradient(135deg, var(--accent), #a78bfa); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; }
.header-title { font-size: 14px; font-weight: 600; }
.header-subtitle { font-size: 11px; color: var(--text-muted); margin-left: 6px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.env-badge { font-size: 10px; padding: 2px 7px; border-radius: 4px; font-weight: 600; background: rgba(139,143,163,0.15); color: var(--text-secondary); }
.env-badge.badge-prod { background: rgba(22,163,74,0.1); color: var(--success); }
.user-badge { display: flex; align-items: center; gap: 6px; padding: 3px 10px; background: var(--bg-input); border-radius: 16px; font-size: 12px; color: var(--text-secondary); }
.user-avatar { width: 22px; height: 22px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: #fff; text-transform: uppercase; }
.user-menu { display: flex; align-items: center; gap: 8px; }
.logout-btn { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); font-size: 11px; padding: 4px 10px; border-radius: 14px; cursor: pointer; font-family: var(--font); transition: all 0.12s; }
.logout-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Login screen ── */
.login-overlay { position: fixed; inset: 0; z-index: 1000; background: linear-gradient(135deg, #eef1fb, #f6f0fd); display: flex; align-items: center; justify-content: center; }
.login-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 40px 48px; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,0.08); max-width: 380px; }
.login-logo { width: 48px; height: 48px; margin: 0 auto 16px; background: linear-gradient(135deg, var(--accent), #a78bfa); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; }
.login-card h1 { font-size: 18px; margin-bottom: 8px; }
.login-card p { font-size: 13px; margin-bottom: 20px; }
.login-btn { background: var(--accent); color: #fff; border: none; border-radius: 8px; padding: 10px 20px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--font); }
.login-btn:hover { background: #3d59db; }

.layout { display: flex; height: calc(100vh - var(--header-height)); margin-top: var(--header-height); }
.sidebar { width: var(--sidebar-width); min-width: var(--sidebar-width); background: var(--bg-sidebar); border-right: 1px solid var(--border); overflow-y: auto; }
.sidebar-section { padding: 14px 12px 6px; }
.sidebar-section-title { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 6px; padding: 0 8px; }
.sidebar-divider { height: 1px; background: var(--divider); margin: 6px 12px; }
.dashboard-item { display: flex; align-items: center; gap: 7px; padding: 7px 8px; border-radius: 5px; cursor: pointer; color: var(--text-secondary); font-size: 12.5px; }
.dashboard-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dashboard-item.active { background: var(--bg-hover); color: var(--text-primary); font-weight: 600; }
.dashboard-icon { font-size: 13px; flex-shrink: 0; }
.dashboard-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.placeholder { padding: 40px; }
.placeholder h1 { font-size: 20px; margin-bottom: 8px; }
.embed-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.embed-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--bg-secondary); }
.embed-title { font-size: 14px; font-weight: 600; }
.embed-container { flex: 1; overflow: hidden; }
.embed-container iframe { border: 0; width: 100%; height: 100%; }
.embed-error { padding: 40px; }

.muted { color: var(--text-muted); }
.small { font-size: 11px; }
.error { color: #dc2626; }
code { background: var(--bg-input); padding: 1px 5px; border-radius: 4px; font-family: "SF Mono", monospace; font-size: 12px; }
