/* ── Acada Ace College — Shared Portal Styles (Student & Teacher) ── */

:root {
  --accent:      #2563eb;
  --accent-dark: #1d4ed8;
  --accent-bg:   rgba(37, 99, 235, 0.08);
  --sidebar-bg:  #0f172a;
  --sidebar-w:   242px;
  --topbar-h:    60px;
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f0f2f7;
  color: #1e293b;
  margin: 0;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  height: auto;
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  transition: transform 0.25s ease;
  display: block;
}
#sidebar::-webkit-scrollbar { width: 7px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 4px; }
#sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.32); }

#sidebar.collapsed {
  transform: translateX(calc(-1 * var(--sidebar-w)));
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  text-decoration: none;
}

.sidebar-logo {
  width: 38px; height: 38px;
  object-fit: contain;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 3px;
}

.brand-name {
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.2;
}

.brand-sub {
  color: rgba(255,255,255,0.38);
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-user {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-name {
  color: rgba(255,255,255,0.85);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-role {
  color: rgba(255,255,255,0.35);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.sidebar-nav { padding: 10px 0 20px; }

.nav-section {
  padding: 12px 16px 4px;
  font-size: 0.61rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.26);
  font-weight: 700;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: rgba(255,255,255,0.62);
  font-size: 0.845rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav .nav-link i {
  width: 16px;
  text-align: center;
  font-size: 0.78rem;
  opacity: 0.72;
}

.sidebar-nav .nav-link:hover { background: rgba(255,255,255,0.07); color: #fff; }
.sidebar-nav .nav-link:hover i { opacity: 1; }
.sidebar-nav .nav-link.active { background: var(--accent); color: #fff; font-weight: 600; }
.sidebar-nav .nav-link.active i { opacity: 1; }
.nav-link-logout { color: #f87171 !important; }
.nav-link-logout:hover { background: rgba(248,113,113,0.1) !important; }

/* ── Layout ──────────────────────────────────────────────────────── */
#page-content {
  margin-left: var(--sidebar-w);
  transition: margin-left 0.25s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#page-content.expanded { margin-left: 0; }

/* ── Topbar ──────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 900;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.page-heading { font-size: 1rem; font-weight: 600; color: #0f172a; }

/* ── Main ────────────────────────────────────────────────────────── */
main { flex: 1; padding: 24px; }

/* ── Stat cards ──────────────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.15s;
}

.stat-card:hover { transform: translateY(-2px); }

.stat-icon {
  width: 50px; height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.stat-value { font-size: 1.7rem; font-weight: 700; line-height: 1; color: #0f172a; }
.stat-label { font-size: 0.73rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; }

/* ── Content cards ───────────────────────────────────────────────── */
.content-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border: 1px solid #f1f5f9;
  overflow: hidden;
}

.content-card .card-header {
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
  padding: 15px 20px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Tables ──────────────────────────────────────────────────────── */
.table th {
  font-size: 0.71rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  font-weight: 700;
  background: #f8fafc;
  border-top: none;
}

.table td { font-size: 0.875rem; vertical-align: middle; }
.table-hover tbody tr:hover { background: #f8fafc; }

/* ── Forms ───────────────────────────────────────────────────────── */
.form-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border: 1px solid #f1f5f9;
  padding: 24px;
}

.form-section-title {
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.form-label { font-weight: 500; font-size: 0.875rem; }
.form-control, .form-select { font-size: 0.875rem; }

/* ── Grade / status badges ───────────────────────────────────────── */
.badge-grade-A { background:#dcfce7; color:#15803d; padding:3px 8px; border-radius:6px; font-weight:700; font-size:0.75rem; }
.badge-grade-B { background:#dbeafe; color:#1d4ed8; padding:3px 8px; border-radius:6px; font-weight:700; font-size:0.75rem; }
.badge-grade-C { background:#fef9c3; color:#854d0e; padding:3px 8px; border-radius:6px; font-weight:700; font-size:0.75rem; }
.badge-grade-D { background:#ffedd5; color:#c2410c; padding:3px 8px; border-radius:6px; font-weight:700; font-size:0.75rem; }
.badge-grade-F { background:#fee2e2; color:#b91c1c; padding:3px 8px; border-radius:6px; font-weight:700; font-size:0.75rem; }

.att-present { background:#dcfce7; color:#15803d; }
.att-absent  { background:#fee2e2; color:#b91c1c; }
.att-late    { background:#fef9c3; color:#854d0e; }
.att-excused { background:#dbeafe; color:#1d4ed8; }

/* ── Profile info list ───────────────────────────────────────────── */
.info-row { padding: 12px 0; border-bottom: 1px solid #f1f5f9; display: flex; gap: 16px; }
.info-row:last-child { border-bottom: none; }
.info-label { width: 160px; flex-shrink: 0; font-size: 0.78rem; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.3px; padding-top: 2px; }
.info-value { font-size: 0.9rem; color: #0f172a; flex: 1; }
.info-empty { color: #94a3b8; font-style: italic; }

/* ── Progress bar ────────────────────────────────────────────────── */
.att-bar-track { background:#f1f5f9; border-radius:10px; height:8px; overflow:hidden; margin-top:6px; }
.att-bar-fill  { height:100%; border-radius:10px; background:var(--accent); }

/* ── Login ───────────────────────────────────────────────────────── */
.login-page { min-height:100vh; display:flex; background:#f0f2f7; }

.login-brand {
  flex: 1;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 52px;
  position: relative;
  overflow: hidden;
}

.login-brand::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-bg) 0%, transparent 70%);
  top: -150px; right: -150px;
}

.login-brand::after {
  content: '';
  position: absolute;
  width: 350px; height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-bg) 0%, transparent 70%);
  bottom: -100px; left: -100px;
}

.brand-content { position:relative; z-index:1; text-align:center; max-width:320px; }

.brand-logo-wrap {
  width:96px; height:96px;
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.12);
  border-radius:22px;
  display:inline-flex; align-items:center; justify-content:center;
  margin-bottom:26px;
}

.brand-logo { width:68px; height:68px; object-fit:contain; filter:drop-shadow(0 4px 12px rgba(0,0,0,0.3)); }

.brand-title { color:#fff; font-size:1.55rem; font-weight:700; line-height:1.3; margin-bottom:6px; letter-spacing:-0.3px; }
.brand-tagline { color:rgba(255,255,255,0.36); font-size:0.77rem; letter-spacing:1px; text-transform:uppercase; margin-bottom:46px; }

.brand-features { display:flex; flex-direction:column; gap:10px; width:100%; }

.brand-feature {
  background:rgba(255,255,255,0.05);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:11px;
  padding:12px 16px;
  display:flex; align-items:center; gap:12px;
  color:rgba(255,255,255,0.62); font-size:0.81rem; text-align:left;
}

.brand-feature-icon {
  width:30px; height:30px;
  background:var(--accent-bg);
  border-radius:7px;
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}

.brand-feature-icon i { color:var(--accent); font-size:0.77rem; }

.brand-year { position:absolute; bottom:24px; left:0; right:0; text-align:center; color:rgba(255,255,255,0.17); font-size:0.68rem; }

.login-form-panel {
  width:460px; min-width:460px;
  background:#fff;
  display:flex; align-items:center; justify-content:center;
  padding:60px 48px;
}

.login-form-inner { width:100%; }

.login-eyebrow {
  display:inline-flex; align-items:center; gap:6px;
  background:var(--accent-bg);
  color:var(--accent);
  font-size:0.67rem; font-weight:700; letter-spacing:1.2px; text-transform:uppercase;
  padding:5px 11px; border-radius:20px; margin-bottom:14px;
}

.login-header h1 { font-size:1.6rem; font-weight:700; color:#0f172a; letter-spacing:-0.3px; margin-bottom:5px; }
.login-header p  { font-size:0.875rem; color:#64748b; margin-bottom:28px; line-height:1.5; }

.login-alert { border-radius:10px; padding:11px 15px; margin-bottom:20px; font-size:0.84rem; display:flex; align-items:flex-start; gap:10px; line-height:1.45; }
.login-alert i { margin-top:1px; flex-shrink:0; }
.login-alert.danger  { background:#fef2f2; border:1px solid #fecaca; color:#b91c1c; }
.login-alert.warning { background:#fffbeb; border:1px solid #fde68a; color:#92400e; }

.field-wrap { margin-bottom:18px; }

.field-label { display:block; font-size:0.74rem; font-weight:700; color:#374151; text-transform:uppercase; letter-spacing:0.5px; margin-bottom:7px; }

.field-group { position:relative; display:flex; align-items:center; }

.field-icon { position:absolute; left:14px; color:#cbd5e1; font-size:0.82rem; pointer-events:none; transition:color 0.15s; }

.field-input {
  width:100%;
  padding:12px 14px 12px 40px;
  border:1.5px solid #e2e8f0;
  border-radius:10px;
  font-size:0.9rem;
  color:#0f172a;
  background:#f8fafc;
  outline:none;
  transition:border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.field-input::placeholder { color:#cbd5e1; }

.field-input:focus { border-color:var(--accent); background:#fff; box-shadow:0 0 0 3px var(--accent-bg); }
.field-group:focus-within .field-icon { color:var(--accent); }
.field-input.has-toggle { padding-right:44px; }

.toggle-pw { position:absolute; right:12px; background:none; border:none; color:#94a3b8; cursor:pointer; padding:4px 6px; font-size:0.85rem; transition:color 0.15s; line-height:1; }
.toggle-pw:hover { color:var(--accent); }

.btn-login {
  width:100%; padding:13px;
  background:var(--accent); color:#fff; border:none; border-radius:10px;
  font-size:0.92rem; font-weight:600; cursor:pointer;
  display:flex; align-items:center; justify-content:center; gap:9px;
  box-shadow:0 4px 14px var(--accent-bg);
  transition:opacity 0.15s, transform 0.1s;
  margin-top:6px;
}

.btn-login:hover { opacity:0.91; transform:translateY(-1px); }
.btn-login:active { transform:translateY(0); }

.login-footer-sep { height:1px; background:#f1f5f9; margin:28px 0; }

.portal-badge { display:flex; align-items:center; justify-content:center; gap:7px; font-size:0.74rem; color:#94a3b8; }
.portal-badge i { font-size:0.63rem; color:#cbd5e1; }

.back-link { display:flex; align-items:center; justify-content:center; gap:6px; color:#94a3b8; font-size:0.79rem; text-decoration:none; margin-top:16px; transition:color 0.15s; }
.back-link:hover { color:var(--accent); }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width:920px) {
  .login-brand { display:none; }
  .login-form-panel { width:100%; min-width:0; }
}

@media (max-width:768px) {
  #sidebar { transform:translateX(calc(-1 * var(--sidebar-w))); }
  #sidebar.open { transform:translateX(0); }
  #page-content { margin-left:0; }
}

@media (max-width:520px) {
  .login-form-panel { padding:44px 24px; }
  main { padding:16px; }
}
