/* Alertix: Rediseño Estilo Institucional Google Workspace & Admin Console */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

:root {
  --primary-color: #1a73e8;       /* Azul Google/Workspace */
  --primary-hover: #1557b0;       /* Azul Google Oscuro */
  --secondary-color: #1a73e8;     /* Azul de Enlace y Enfoque */
  --text-main: #202124;           /* Negro Google standard */
  --text-muted: #5f6368;          /* Gris Google standard */
  --bg-app: #ffffff;              /* Fondo completamente blanco */
  --bg-card: #ffffff;             /* Fondo blanco para tarjetas */
  --border-color: #dadce0;        /* Borde gris fino Google standard */
  --danger: #d93025;              /* Rojo Google standard */
  --danger-light: #fce8e6;        /* Fondo rojo claro */
  --warning: #f9ab00;             /* Amarillo Google standard */
  --warning-light: #fef7e0;       /* Fondo amarillo claro */
  --success: #188038;             /* Verde Google standard */
  --success-light: #e6f4ea;       /* Fondo verde claro */
  --info: #1a73e8;
  --info-light: #e8f0fe;
  --font-sans: 'Roboto', 'Arial', sans-serif;
  --border-radius: 4px;           /* Bordes discretamente redondeados (Google MD2) */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: none !important;    /* Deshabilitar animaciones y transiciones (anti-ia-slop) */
  animation: none !important;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
}

/* Base structural layout */
.shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Opaque Shroud Loading Overlay */
#app-shroud {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #ffffff;      /* Sólido y completamente blanco */
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  color: var(--text-muted);
  border: none;
}

/* Sidebar styling (Google Workspace Navigation Drawer) */
.sidebar {
  width: 256px;
  background-color: #ffffff;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100%;
}

.sidebar-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.sidebar-header {
  padding: 16px 20px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  display: none; /* Eliminar iconos de juguete */
}

.brand-text {
  font-size: 18px;
  font-weight: 500;
  color: #1a73e8;
  letter-spacing: -0.25px;
}

.brand-text span {
  color: #185abc;
  font-weight: 700;
}

/* Google Console / Portal Simulation Switcher */
.developer-console {
  margin-top: 12px;
  padding: 10px;
  background-color: #f8f9fa;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.console-title {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.console-btn {
  width: 100%;
  padding: 6px 12px;
  background-color: #f1f3f4;
  color: var(--text-main);
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  text-transform: none;
}

.console-btn:hover {
  background-color: #e8eaed;
}

.console-select-group {
  margin-top: 8px;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
}

.console-select-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

.console-select {
  width: 100%;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 400;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  outline: none;
  background-color: #ffffff;
}

/* Nav Menu (Google Workspace style list item highlights) */
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-section-title {
  padding: 14px 24px 6px 24px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  margin-right: 8px;
  border-radius: 0 24px 24px 0; /* Google style active pill list */
  margin-bottom: 2px;
  border-left: none !important;
}

.nav-item:hover {
  background-color: #f1f3f4;
  color: var(--text-main);
}

.nav-item.active {
  background-color: #e8f0fe;
  color: #1a73e8;
  font-weight: 500;
}

.nav-badge {
  margin-left: auto;
  background-color: var(--danger);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

/* Profile Area */
.sidebar-profile {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  background-color: #ffffff;
}

.profile-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: var(--border-radius);
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.profile-avatar {
  width: 32px;
  height: 32px;
  background-color: #185abc;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  border-radius: 50%; /* Rounded avatar like Google Accounts */
  font-size: 12px;
}

.profile-meta {
  min-width: 0;
  flex: 1;
}

.profile-name {
  font-weight: 500;
  font-size: 12px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-role {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-logout {
  width: 100%;
  padding: 8px;
  background-color: #ffffff;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
  border-radius: var(--border-radius);
  cursor: pointer;
}

.btn-logout:hover {
  background-color: #f8f9fa;
  color: var(--danger);
}

/* Main Viewport and Headers (Google Workspace style Top Header) */
.main-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.top-bar {
  height: 64px;
  background-color: #185abc;       /* Azul institucional oscuro clásico */
  color: #ffffff;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0,0,0,0.12);
  flex-shrink: 0;
}

.search-form {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.15); /* Search box inside blue bar */
  border: none;
  border-radius: var(--border-radius);
  padding: 8px 16px;
  width: 320px;
}

.search-form span {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  text-transform: none;
}

.search-input {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 13px;
  width: 100%;
  font-weight: 400;
  margin-left: 8px;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
}

.status-active {
  background-color: #e6f4ea;
  border: 1px solid #a8dab5;
  color: #137333;
}

.status-alert {
  background-color: #fce8e6;
  border: 1px solid #fad2cf;
  color: #c5221f;
}

/* Page Content Area */
.content-area {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background-color: #ffffff;
}

.page-header {
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.page-title-group {
  display: flex;
  flex-direction: column;
}

.page-title {
  font-size: 22px;
  font-weight: 400;                /* Roboto light-ish */
  color: #202124;
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

/* Classical Rectangular Cards (Google Admin Console style list cards) */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: none;                /* No sombras modernas */
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  padding: 12px 20px;
  background-color: #f8f9fa;       /* Cabecera gris neutra */
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  text-transform: none;
  letter-spacing: normal;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 20px;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: normal;
}

.form-control, select, textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 400;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  outline: none;
  background-color: #ffffff;
  color: var(--text-main);
}

.form-control:focus, select:focus, textarea:focus {
  border-color: var(--secondary-color);
  background-color: #ffffff;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* Solid Institutional Buttons - Style Material Design 2 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  background-color: #ffffff;
  color: var(--text-muted);
}

.btn:hover {
  background-color: #f1f3f4;
}

.btn-primary {
  background-color: #1a73e8;
  border-color: #1a73e8;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #1557b0;
}

.btn-secondary {
  background-color: #ffffff;
  border-color: var(--border-color);
  color: #1a73e8;
}

.btn-secondary:hover {
  background-color: #f8f9fa;
  border-color: #dadce0;
}

.btn-danger {
  background-color: #d93025;
  border-color: #d93025;
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #b31412;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 11px;
}

.w-full {
  width: 100%;
}

/* Traditional high-density administration tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th {
  background-color: #f8f9fa;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  letter-spacing: normal;
}

.table td {
  padding: 10px 16px;
  border-bottom: 1px solid #f1f3f4;
  font-size: 13px;
  vertical-align: middle;
  background-color: #ffffff;
  color: var(--text-main);
}

.table tbody tr:hover td {
  background-color: #f8f9fa;
}

/* Grids and Density */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 20px;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: normal;
}

.stat-value {
  font-size: 24px;
  font-weight: 400;
  color: var(--text-main);
  margin-top: 4px;
}

.stat-icon {
  display: none; /* No iconografía avanzada/juguetes decorativos */
}

/* Minimalist colored status labels (flat style) */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  border: 1px solid transparent;
}

.badge-disponible {
  background-color: #e6f4ea;
  color: #137333;
  border-color: #a8dab5;
}

.badge-observacion {
  background-color: #fef7e0;
  color: #b06000;
  border-color: #fde293;
}

.badge-reposando {
  background-color: #e8f0fe;
  color: #1a73e8;
  border-color: #adcbfa;
}

.badge-atendido {
  background-color: #f1f3f4;
  color: #5f6368;
  border-color: #dadce0;
}

.badge-emergencia {
  background-color: #fce8e6;
  color: #c5221f;
  border-color: #fad2cf;
}

.badge-critical {
  background-color: #fce8e6;
  color: #c5221f;
  border-color: #fad2cf;
}

.badge-resolved {
  background-color: #e6f4ea;
  color: #137333;
  border-color: #a8dab5;
}

/* Chat Box Design (Google Chat / Hangouts style) */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 420px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.chat-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background-color: #f8f9fa;
  font-weight: 500;
  color: var(--text-main);
  text-transform: none;
  font-size: 13px;
}

.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: #ffffff;
}

.message-bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
}

.message-received {
  align-self: flex-start;
  background-color: #f1f3f4;
  color: var(--text-main);
  border: none;
}

.message-sent {
  align-self: flex-end;
  background-color: #e8f0fe;
  color: #1a73e8;
  border: none;
}

.message-meta {
  font-size: 10px;
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

.chat-input-area {
  padding: 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
  background-color: #ffffff;
}

/* QR Code & Student Details */
.student-card-grid {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px;
}

.student-photo {
  width: 100px;
  height: 100px;
  background-color: #f1f3f4;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.student-info-item {
  margin-bottom: 8px;
}

.student-info-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.student-info-value {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-main);
}

/* Administrative Modals (GSuite style) */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(32, 33, 36, 0.6); /* Color de superposición de Google standard */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 550px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  overflow: hidden;
}

/* Notification panel inside top bar */
.notification-dropdown {
  position: absolute;
  top: 50px;
  right: 16px;
  width: 320px;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-main);
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
  z-index: 100;
}

.notification-item {
  padding: 10px 16px;
  border-bottom: 1px solid #f1f3f4;
  font-size: 12px;
  color: var(--text-main);
}

.notification-item:hover {
  background-color: #f1f3f4;
}

.notification-header {
  padding: 10px 16px;
  background-color: #f8f9fa;
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
}

/* Auth Login Panel */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f1f3f4;        /* Fondo gris claro Google standard */
  padding: 16px;
}

.auth-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;              /* Un poco más redondeado para el login de Google standard */
  width: 100%;
  max-width: 440px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1), 0 0 1px rgba(0,0,0,0.1);
  overflow: hidden;
}

.auth-header {
  background-color: #ffffff;       /* Cabecera blanca como Google Accounts */
  padding: 32px 32px 16px 32px;
  text-align: center;
  color: var(--text-main);
  border-bottom: none;
}

.auth-logo {
  font-size: 24px;
  color: #1a73e8;
  margin: 0 auto 16px auto;
  font-weight: 700;
  border: none;
  background: none;
  width: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.auth-title {
  font-size: 22px;
  font-weight: 400;
  text-transform: none;
  color: #202124;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
}

.auth-body {
  padding: 0 32px 32px 32px;
}

/* Scrollbar customization */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #dadce0;
  border-radius: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #bdc1c6;
}

/* Material Icons size helper */
.select-icon {
  font-size: 18px !important;
  vertical-align: middle;
}
