/* ── WeStay CRM – Layout ─────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
  display: flex;
}

/* ── Scrollbar ────────────────────────────────── */
::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: var(--border); border-radius: 3px; }

/* ── Sidebar ──────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo               { padding: 24px 20px 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-logo .logo-name    { font-family: 'DM Sans', sans-serif; font-size: 22px; color: #fff; }
.sidebar-logo .logo-sub     { font-size: 11px; color: rgba(255,255,255,.4); letter-spacing: 1.5px; text-transform: uppercase; margin-top: 2px; }

.sidebar-section            { padding: 16px 12px 4px; }
.sidebar-section-label      { font-size: 10px; color: rgba(255,255,255,.3); text-transform: uppercase; letter-spacing: 1.5px; padding: 0 8px; margin-bottom: 4px; }

.nav-item                   { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; cursor: pointer; color: rgba(255,255,255,.55); font-size: 13.5px; transition: .15s; margin-bottom: 1px; text-decoration: none; }
.nav-item:hover             { background: rgba(255,255,255,.07); color: rgba(255,255,255,.85); }
.nav-item.active            { background: var(--background); color: #fff; font-weight: 500; }
.nav-item .nav-icon         { font-size: 16px; width: 20px; text-align: center; }
.nav-badge                  { margin-left: auto; background: rgba(255,255,255,.15); color: rgba(255,255,255,.7); font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 99px; }
.nav-item.active .nav-badge { background: rgba(255,255,255,.25); color: #fff; }

.sidebar-user               { margin-top: auto; padding: 16px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; cursor: pointer; }
.sidebar-user:hover         { background: rgba(255,255,255,.04); }
.user-avatar                { width: 34px; height: 34px; border-radius: 50%; background: var(--background); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; color: #fff; flex-shrink: 0; }
.user-info .user-name       { color: #fff; font-size: 13px; font-weight: 500; }
.user-info .user-role       { font-size: 11px; color: rgba(255,255,255,.4); }
.user-logout                { margin-left: auto; font-size: 18px; color: rgba(255,255,255,.3); transition: .15s; }
.sidebar-user:hover .user-logout { color: rgba(255,255,255,.7); }

/* ── Main ─────────────────────────────────────── */
.main      { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ── Topbar ───────────────────────────────────── */
.topbar       { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 28px; height: var(--topbar-h); display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.topbar-title { font-family: 'DM Sans', sans-serif; font-size: 20px; color: var(--text); flex: 1; }
.notif-btn    { position: relative; background: none; border: none; cursor: pointer; font-size: 20px; color: var(--text-secondary); padding: 4px; transition: .15s; }
.notif-btn:hover { color: var(--text); }
.notif-dot    { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; background: var(--red); border-radius: 50%; border: 2px solid var(--surface); }

/* ── Content ──────────────────────────────────── */
.content       { flex: 1; overflow-y: auto; padding: 24px 28px; }
.view          { display: none; }
.view.active   { display: block; }

/* ── Page header ──────────────────────────────── */
.page-header      { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.page-header-info { flex: 1; }
.page-title       { font-family: 'DM Sans', sans-serif; font-size: 26px; color: var(--text); }
.page-subtitle    { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ── Login ────────────────────────────────────── */
#login-screen { position: fixed; inset: 0; background-image: url('../../images/casaferias.jpg'); background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; z-index: 9999; flex-direction: column; }
#login-screen::before { content: ''; position: absolute; inset: 0; background: var(--background-light); z-index: 0; }
.login-box { position: relative; z-index: 1; background: var(--surface); border-radius: 16px; padding: 40px 44px; width: 400px; box-shadow: var(--shadow-lg); }
.login-logo     { font-family: 'DM Sans', sans-serif; font-size: 28px; color: var(--text); margin-bottom: 4px; }
.login-sub      { font-size: 12px; color: var(--text-secondary); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 32px; }
.login-divider  { text-align: center; font-size: 12px; color: var(--text-secondary); margin: 16px 0; position: relative; }
.login-divider::before, .login-divider::after { content: ''; position: absolute; top: 50%; width: 42%; height: 1px; background: var(--border); }
.login-divider::before { left: 0; } .login-divider::after { right: 0; }

/* Mobile sidebar overlay */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(26,23,20,.5); z-index: 300; backdrop-filter: blur(2px); }
.sidebar-overlay.open { display: block; }
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 6px; color: var(--text); font-size: 22px; line-height: 1; }

/* Bottom nav */
.bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--text); border-top: 1px solid rgba(255,255,255,.1); z-index: 200; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav-inner { display: flex; align-items: stretch; }
.bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 4px 8px; cursor: pointer; color: rgba(255,255,255,.45); font-size: 10px; gap: 3px; transition: .15s; position: relative; border: none; background: none; font-family: 'DM Sans', sans-serif; }
.bn-item.active { color: #fff; }
.bn-item.active::after { content: ''; position: absolute; top: 0; left: 20%; right: 20%; height: 2px; background: var(--accent); border-radius: 0 0 2px 2px; }
.bn-icon { font-size: 20px; line-height: 1; }
.bn-badge { position: absolute; top: 6px; right: calc(50% - 18px); background: var(--accent); color: #fff; font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 99px; min-width: 16px; text-align: center; }

/* FAB */
.fab { display: none; position: fixed; bottom: 80px; right: 20px; width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 26px; border: none; cursor: pointer; box-shadow: 0 4px 16px rgba(196,101,26,.4); align-items: center; justify-content: center; z-index: 199; transition: .15s; }
.fab:active { transform: scale(.93); }
