*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand: #32655B;
  --brand-light: #80A098;
  --accent: #FFC800;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #212529;
  --text-muted: #6C757D;
  --border: #e2e8f0;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --sidebar-w: 220px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Login ─────────────────────────────────────────────────── */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
}

.login-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 40px 44px;
  width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -0.5px;
}

.login-logo p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.field input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  transition: border-color 0.15s;
  outline: none;
}

.field input:focus { border-color: var(--brand-light); background: #fff; }

.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s;
}

.btn-primary:hover { background: var(--brand-light); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }

.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 14px;
  display: none;
}

/* ── App shell ─────────────────────────────────────────────── */
#app-shell {
  display: none;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--brand);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-header {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.sidebar-header p {
  font-size: 12px;
  opacity: 0.6;
  margin-top: 2px;
}

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

.nav-section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.45;
  padding: 8px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  text-decoration: none;
}

.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }

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

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; text-transform: uppercase;
}

.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; opacity: 0.55; }

.btn-logout {
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s;
}

.btn-logout:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* ── Main content ──────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.topbar .date {
  font-size: 13px;
  color: var(--text-muted);
}

.page-content {
  flex: 1;
  padding: 28px;
}

/* ── Dashboard ─────────────────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  border-radius: 14px;
  padding: 28px 32px;
  color: #fff;
  margin-bottom: 28px;
}

.welcome-banner h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.welcome-banner p  { opacity: 0.75; font-size: 14px; }

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.module-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  text-decoration: none;
  color: var(--text);
  display: block;
}

.module-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.1);
}

.module-icon { font-size: 28px; margin-bottom: 12px; }
.module-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.module-desc { font-size: 13px; color: var(--text-muted); }

.coming-soon {
  text-align: center;
  padding: 48px 24px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 2px dashed var(--border);
  color: var(--text-muted);
}

.coming-soon p { font-size: 15px; margin-top: 8px; }

/* ── Utilidades ────────────────────────────────────────────── */
.hidden { display: none !important; }
