/* ============================================================
   La Nudela Innovative School portal — Portal add-ons (v2.3)
   Extends assets/style.css. Uses the existing tokens only.
   ============================================================ */

/* ── Sidebar unread pill ── */
.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff !important;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* ── Login role switch ── */
.login-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  background: var(--blue-xpale);
  border-radius: 12px;
  margin-bottom: 18px;
}
.login-tabs a {
  flex: 1;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  transition: .18s;
}
.login-tabs a.on {
  background: var(--surface);
  color: var(--blue-dark);
  box-shadow: 0 2px 8px rgba(26, 35, 126, .13);
}

/* ── Message list ── */
.msg-list { display: flex; flex-direction: column; gap: 10px; }
.msg-item {
  display: block;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: .18s;
}
.msg-item:hover { border-color: var(--blue-soft); box-shadow: 0 4px 14px rgba(26, 35, 126, .08); }
.msg-item.unread { border-left-color: var(--blue); background: var(--blue-xpale); }
.msg-item.mine   { border-left-color: var(--teal); }
.msg-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}
.msg-from { font-weight: 700; font-size: 14px; color: var(--ink); }
.msg-time { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.msg-subject { font-weight: 600; font-size: 14.5px; color: var(--blue-dark); margin-bottom: 4px; }
.msg-snippet { font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.msg-body {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Event cards ── */
.evt-list { display: flex; flex-direction: column; gap: 12px; }
.evt-item {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.evt-item.past { opacity: .62; }
.evt-date {
  flex-shrink: 0;
  width: 62px;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--blue-pale), #fff);
  border: 1px solid var(--line);
  text-align: center;
  padding: 8px 4px;
}
.evt-date .d { font-size: 22px; font-weight: 800; color: var(--blue-dark); line-height: 1.1; }
.evt-date .m { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--blue-soft); text-transform: uppercase; }
.evt-body { flex: 1; min-width: 0; }
.evt-title { font-weight: 700; font-size: 15px; color: var(--ink); margin-bottom: 3px; }
.evt-meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.evt-desc { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; white-space: pre-wrap; }

/* ── Assignment log ── */
.asg-list { display: flex; flex-direction: column; gap: 12px; }
.asg-item {
  padding: 15px 16px;
  border: 1.5px solid var(--line);
  border-left: 4px solid var(--blue-soft);
  border-radius: 13px;
  background: var(--surface);
}
.asg-item.overdue   { border-left-color: var(--red); }
.asg-item.graded    { border-left-color: var(--green); }
.asg-item.submitted { border-left-color: var(--teal); }
.asg-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 6px; }
.asg-title { font-weight: 700; font-size: 15px; color: var(--ink); }
.asg-meta { font-size: 12px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.asg-instr { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; white-space: pre-wrap; margin-bottom: 10px; }
.asg-feedback {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--green-pale);
  border: 1px solid #c8e6c9;
  font-size: 13px;
  color: #1b5e20;
  line-height: 1.6;
}

/* ── Performance bars ── */
.pf-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
}
.pf-bar-row:last-child { border-bottom: 0; }
.pf-bar-label {
  width: 150px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pf-bar-track {
  position: relative;
  flex: 1;
  height: 13px;
  border-radius: 999px;
  background: var(--blue-xpale);
  overflow: visible;
}
.pf-bar-fill { height: 100%; border-radius: 999px; transition: width .5s ease; }
.pf-bar-avg {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 19px;
  background: var(--ink);
  opacity: .45;
  border-radius: 2px;
}
.pf-bar-value {
  width: 84px;
  flex-shrink: 0;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.pf-trend { width: 100%; height: auto; display: block; }
.pf-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.pf-legend span { display: flex; align-items: center; gap: 6px; }
.pf-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 38px 20px;
  color: var(--muted);
}
.empty-state .ico { font-size: 40px; display: block; margin-bottom: 10px; opacity: .55; }
.empty-state p { font-size: 14px; margin: 0; }

/* ── Credential chip ── */
.cred {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--blue-xpale);
  border: 1px solid var(--line);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  color: var(--blue-dark);
}

/* ── Mobile ── */
@media (max-width: 640px) {
  .pf-bar-label { width: 104px; font-size: 12px; }
  .pf-bar-value { width: 70px; font-size: 12px; }
  .evt-date { width: 54px; }
  .msg-time { margin-left: 0; width: 100%; }
}
