/* Populi LMS Monitor Modern CSS Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-dark: #0b0f19;
  --bg-card: rgba(23, 31, 50, 0.75);
  --bg-card-hover: rgba(30, 41, 65, 0.85);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(99, 102, 241, 0.3);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;

  --badge-success-bg: rgba(34, 197, 94, 0.15);
  --badge-success-text: #4ade80;
  --badge-warning-bg: rgba(245, 158, 11, 0.15);
  --badge-warning-text: #fbbf24;
  --badge-danger-bg: rgba(239, 68, 68, 0.15);
  --badge-danger-text: #f87171;
  --badge-neutral-bg: rgba(148, 163, 184, 0.15);
  --badge-neutral-text: #cbd5e1;
}

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

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(at 10% 10%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
    radial-gradient(at 90% 90%, rgba(168, 85, 247, 0.12) 0px, transparent 50%);
}

/* Glassmorphism Navigation */
.navbar {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
}

.brand-badge {
  background: var(--primary-gradient);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;

  a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    &:hover, &.active {
      color: var(--text-main);
    }
  }
}

.user-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.role-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;

  &.role-DEAN { background: #ef4444; color: #fff; }
  &.role-FACULTY { background: #8b5cf6; color: #fff; }
  &.role-TUTOR { background: #10b981; color: #fff; }
}

/* Layout Container */
.container {
  max-width: 1320px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  width: 100%;
  flex: 1;
}

/* Glass Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  transition: transform 0.2s, border-color 0.2s;

  &:hover {
    border-color: rgba(255,255,255,0.2);
  }
}

.grid-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.kpi-card {
  display: flex;
  align-items: center;
  justify-content: space-between;

  .kpi-title {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .kpi-value {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 0.25rem;
  }

  .kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 500;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;

  &.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);

    &:hover {
      opacity: 0.9;
      transform: translateY(-1px);
    }
  }

  &.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);

    &:hover {
      background: rgba(255, 255, 255, 0.18);
    }
  }

  &.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
  }
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;

  &.badge-CALIFICADO {
    background: var(--badge-success-bg);
    color: var(--badge-success-text);
    border: 1px solid rgba(34, 197, 94, 0.3);
  }

  &.badge-PENDIENTE_REVISION {
    background: var(--badge-warning-bg);
    color: var(--badge-warning-text);
    border: 1px solid rgba(245, 158, 11, 0.3);
  }

  &.badge-NO_ENTREGADO, &.badge-ATRASADO {
    background: var(--badge-danger-bg);
    color: var(--badge-danger-text);
    border: 1px solid rgba(239, 68, 68, 0.3);
  }

  &.badge-FUTURO {
    background: var(--badge-neutral-bg);
    color: var(--badge-neutral-text);
  }
}

/* Matrix Table Styling */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background: var(--bg-card);

  th, td {
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
  }

  th {
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
  }

  tr:hover {
    background: rgba(255, 255, 255, 0.03);
  }
}

/* Modal System */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;

  &.active {
    opacity: 1 !important;
    pointer-events: auto !important;
    display: flex !important;
  }
}

.modal-overlay.active {
  opacity: 1 !important;
  pointer-events: auto !important;
  display: flex !important;
}

.modal-content {
  background: #1e293b;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  max-width: 520px;
  width: 90%;
  padding: 1.75rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;

  label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
  }

  input, select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;

    &:focus {
      border-color: var(--primary);
    }
  }
}

/* Alert Flashes */
.alert {
  padding: 0.85rem 1.2rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;

  &.alert-success { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
  &.alert-danger { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
  &.alert-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
  &.alert-info { background: rgba(99, 102, 241, 0.2); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
}

/* Toggle Switch Component */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #334155;
  transition: 0.25s ease;
  border-radius: 24px;
}
.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s ease;
  border-radius: 50%;
}
input:checked + .switch-slider {
  background-color: #10b981;
}
input:checked + .switch-slider:before {
  transform: translateX(22px);
}

