/* ================================
   KLASSROOM — theme.css (CLEAN)
   Compatible con app/views/partials/layout.php
================================ */

/* Reset */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
  color: var(--text);
  background: var(--bg-main);
}
a { color: inherit; text-decoration: none; }

/* ================================
   Variables (paleta tipo referencia)
================================ */
:root{
  --sidebar-width: 320px;

  /* Fondo general */
  --bg-main:
    radial-gradient(1100px 700px at 70% 20%, rgba(99,102,241,0.28), transparent 60%),
    radial-gradient(900px 600px at 20% 80%, rgba(59,130,246,0.20), transparent 55%),
    linear-gradient(135deg, #0b1020 0%, #111a33 45%, #1b2550 100%);

  /* Paneles */
  --card-bg: rgba(255,255,255,0.045);
  --card-bg-strong: rgba(255,255,255,0.06);

  /* Texto */
  --text: #e9eefc;
  --muted: rgba(255,255,255,0.68);

  /* Bordes y sombras */
  --line: rgba(255,255,255,0.10);
  --line-strong: rgba(255,255,255,0.14);
  --shadow: 0 18px 45px rgba(0,0,0,0.35);

  /* Acentos */
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-purple: #8b5cf6;

  /* Estados (hover/active) */
  --hover-bg: rgba(99,102,241,0.26);
  --active-bg: rgba(99,102,241,0.38);

  /* Radios (cards) */
  --radius: 16px;
  --radius2: 22px;

  /* Padding lateral del sidebar (para calcular full-width real del nav) */
  --sidebar-pad-x: 16px;
}

/* ================================
   Layout base
================================ */
.app{
  display: flex;
  min-height: 100vh;
}

/* Sidebar fijo */
.sidebar{
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;

  display: flex;
  flex-direction: column;

  padding: 18px var(--sidebar-pad-x);

  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(12px);

  z-index: 1000;
}

/* Main desplazado (evita que quede debajo del sidebar) */
.main{
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;

  display: flex;
  flex-direction: column;

  position: relative;
  z-index: 1;
}

/* ================================
   Brand
================================ */
.brand{
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 10px 14px;
}

.brand-mark{
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  box-shadow: 0 12px 24px rgba(0,0,0,0.35);
}

.brand-title{
  font-weight: 900;
  letter-spacing: .4px;
  font-size: 18px;
}

.brand-sub{
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

/* ================================
   User card + avatar (foto o inicial)
================================ */
.user-card{
  display: flex;
  gap: 12px;
  align-items: center;

  padding: 12px;
  margin: 6px 0 0;

  border: 1px solid var(--line);
  border-radius: var(--radius);

  background: rgba(0,0,0,0.18);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.avatar{
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;

  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;

  font-weight: 900;
  color: #fff;
}

.avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-meta{ line-height: 1.15; }
.user-name{ font-weight: 800; }
.user-email{ font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ================================
   NAV — full width REAL, sin radius, borde DERECHO
   (Compensa el padding lateral del sidebar)
================================ */
.nav{
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;

  padding: 0;

  /* Clave: estirar hasta el borde del sidebar */
  margin-left: calc(var(--sidebar-pad-x) * -1);
  margin-right: calc(var(--sidebar-pad-x) * -1);
}

.nav-item{
  display: block;
  width: 100%;

  /* Padding interno del botón */
  padding: 14px 18px;

  /* Sin border-radius (como pediste) */
  border-radius: 0 !important;

  /* Borde DERECHO resaltado */
  border-right: 6px solid transparent;

  color: var(--muted);
  background: transparent;

  transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.nav-item:hover{
  background: var(--hover-bg);
  color: #fff;
  border-right-color: var(--accent-indigo);
}

.nav-item.active{
  background: var(--active-bg);
  color: #fff;
  font-weight: 700;
  border-right-color: var(--accent-indigo);
}

/* ================================
   Footer sidebar
================================ */
.sidebar-footer{
  margin-top: auto;
  padding: 14px 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-note{
  font-size: 12px;
  color: var(--muted);
  opacity: .9;
  padding-left: 8px;
}

/* Botones */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 10px 12px;
  border-radius: 14px;

  border: 1px solid var(--line);
  cursor: pointer;
}

.btn-ghost{
  background: rgba(255,255,255,0.05);
}
.btn-ghost:hover{
  background: rgba(255,255,255,0.08);
}

/* ================================
   Topbar
================================ */
.topbar{
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 18px;

  border-bottom: 1px solid var(--line);
  background: rgba(0,0,0,0.10);
  backdrop-filter: blur(12px);
}

.topbar-title{ font-weight: 900; letter-spacing: .2px; }

.pill{
  font-size: 12px;
  color: var(--muted);

  border: 1px solid var(--line);
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.12);
}

.content{ padding: 18px; }

/* ================================
   Grid + Cards (Dashboard)
================================ */
.grid{
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card{
  border: 1px solid var(--line);
  border-radius: var(--radius2);
  background: rgba(0,0,0,0.18);
  box-shadow: var(--shadow);
  padding: 16px;
  backdrop-filter: blur(10px);
}

.card-wide{ grid-column: 1 / -1; }

.card-title{ font-weight: 800; }
.card-sub{ color: var(--muted); font-size: 13px; margin-top: 8px; }

/* Hover cards (sutil) */
.card:hover{
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(99,102,241,0.18), 0 18px 50px rgba(0,0,0,0.42);
  transition: transform .18s ease, box-shadow .18s ease;
}

/* ================================
   Responsive básico
================================ */
@media (max-width: 1100px){
  :root{ --sidebar-width: 280px; }
  .grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 780px){
  .grid{ grid-template-columns: 1fr; }
  .sidebar{
    position: relative;
    width: 100%;
    height: auto;
  }
  .main{
    margin-left: 0;
    width: 100%;
  }
}
/* Botones con iconos (estilo sidebar) */
.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.75;
  opacity: .9;
}

/* === Sidebar: User hero (foto grande + nombre + rol) === */
.sidebar-userhero{
  display:block;
  text-decoration:none;
  color:inherit;
  text-align:center;
  padding: 22px 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-userhero:hover{
  background: rgba(255,255,255,.02);
}

.sidebar-userhero-avatar{
  width: 112px;
  height: 112px;
  margin: 18px auto 14px; /* ↑ antes: 0 auto 14px */
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255,255,255,.06);
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 16px 34px rgba(0,0,0,.35);
}


.sidebar-userhero-avatar img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

.sidebar-userhero-avatar .avatar-fallback{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 900;
  font-size: 44px;
  color: rgba(255,255,255,.92);
}

.sidebar-userhero-name{
  font-size: 26px;
  font-weight: 900;
  color: rgba(255,255,255,.92);
  line-height: 1.1;
  margin-top: 2px;
}

.sidebar-userhero-role{
  margin-top: 6px;
  font-size: 18px;
  color: rgba(255,255,255,.65);
}

/* === Nav items con iconos (estilo dashboard) === */
.nav-item{
  display:flex;
  align-items:center;
  gap: 14px;
}

.nav-item svg{
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
  opacity: .9;
}

.nav-item span{
  display:inline-block;
}

/* Opcional: alinear visualmente el texto */
.nav{
  padding-top: 10px;
}

/* ===== Sidebar user hero (ajustes finales) ===== */

.sidebar-userhero-avatar.ring{
  position: relative;
  padding: 6px;               /* grosor del borde */
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    #1d4ed8,
    #3b82f6,
    #60a5fa
  );                           /* borde azul elegante */
}

.sidebar-userhero-avatar.ring img,
.sidebar-userhero-avatar.ring .avatar-fallback{
  border-radius: 50%;
  background: #0b1220;         /* fondo oscuro interno */
}

/* Nombre */
.sidebar-userhero-name{
  font-size: 24px;
  font-weight: 900;
  color: rgba(255,255,255,.95);
  margin-top: 6px;
}

/* Usuario (correo) */
.sidebar-userhero-email{
  font-size: 15px;
  margin-top: 6px;
  color: rgba(255,255,255,.70);
  word-break: break-all;
}

/* Rol */
.sidebar-userhero-role{
  margin-top: 8px;
  font-size: 16px;
  font-weight: 600;
  color: rgba(255,255,255,.55);
}

/* ==========================================================
   KLASSROOM / SDA — LOGIN STYLE (REFERENCE BASED)
   ========================================================== */

.login-bg{
  min-height: 100vh;
  background:
    linear-gradient(
      rgba(5,10,20,.75),
      rgba(5,10,20,.85)
    ),
    url("../img/login_bg.jpg") center/cover no-repeat;
  display: flex;
  align-items: center;
}

/* Panel izquierdo */
.login-panel{
  width: 100%;
  max-width: 520px;
  padding: 60px 56px;
}

/* Card plana (sin glass) */
.login-flat{
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

/* Títulos */
.login-flat .title{
  font-size: 32px;
  font-weight: 600;
  letter-spacing: .5px;
}

.login-flat .brand{
  border: none;
  padding: 0 0 24px 0;
  margin-bottom: 30px;
}

.login-flat .brand div:last-child{
  color: rgba(255,255,255,.75);
  font-size: 14px;
}

/* Inputs tipo underline */
.login-flat .field{
  margin-bottom: 26px;
}

.login-flat .label{
  display: none;
}

.login-flat .input{
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,.35);
  border-radius: 0;
  padding: 10px 2px;
  font-size: 14px;
  color: #fff;
}

.login-flat .input:focus{
  border-bottom-color: #3b82f6;
  box-shadow: none;
}

/* Botón */
.login-flat .btn-primary{
  background: #2563eb;
  border: none;
  border-radius: 4px;
  padding: 12px;
  font-size: 14px;
  letter-spacing: .6px;
  margin-top: 10px;
}

/* Alerta */
.login-flat .alert{
  background: rgba(239,68,68,.18);
  border: none;
  border-left: 4px solid #ef4444;
  border-radius: 2px;
}

/* Responsive */
@media(max-width: 768px){
  .login-panel{
    max-width: 100%;
    padding: 40px 24px;
  }
}

/* =========================================
   Sidebar — Logout como item de menú
========================================= */

.nav-logout{
  margin-top: auto;              /* lo empuja al fondo */
  color: var(--muted);
}

/* Hover igual al resto */
.nav-logout:hover{
  background: var(--hover-bg);
  color: #fff;
  border-right-color: var(--accent-indigo);
}

/* Ícono */
.nav-logout svg{
  width: 20px;
  height: 20px;
  stroke-width: 1.75;
  opacity: .9;
}

/* Evita overlays invisibles capturando clicks */
.main, .content {
  position: relative;
  z-index: 1;
}

.sidebar {
  z-index: 1000;
}

.table-wrap, .card, .card-body {
  position: relative;
  z-index: 2;
}

