/* SkyLift Portal Styles — shared by student & teacher portals */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:     #10b981;
  --brand:       #10b981;
  --brand-dark:  #059669;
  --brand-light: #d1fae5;
  --brand-glow:  rgba(16,185,129,.18);
  --green-50:    #f0fdf4;
  --green-100:   #dcfce7;
  --ink:         #0f1923;
  --ink-soft:    #374151;
  --muted:       #6b7280;
  --line:        #e5e7eb;
  --gray-50:     #f9fafb;
  --gray-100:    #f3f4f6;
  --gray-200:    #e5e7eb;
  --gray-300:    #d1d5db;
  --gray-400:    #9ca3af;
  --gray-500:    #6b7280;
  --gray-700:    #374151;
  --gray-900:    #111827;
  --surface:     #f9fafb;
  --white:       #ffffff;
  --red:         #ef4444;
  --red-light:   #fee2e2;
  --amber:       #f59e0b;
  --blue:        #3b82f6;
  --sidebar-w:   260px;
  --header-h:    64px;
  --radius:      12px;
  --radius-sm:   8px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:   0 10px 40px rgba(0,0,0,.12);
  --gradient-brand: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --font:        'Plus Jakarta Sans', sans-serif;
  --font-display:'Sora', sans-serif;
}

body { font-family: var(--font); background: var(--surface); color: var(--ink); min-height: 100vh; }

/* ── AUTH ──────────────────────────────────────────────── */
.auth-wrap {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: linear-gradient(145deg, #064e3b 0%, #065f46 50%, #10b981 100%);
  padding: 2rem;
}
.auth-card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  padding: 2.5rem; width: 100%; max-width: 420px;
}
.auth-logo { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; margin-bottom: 1.25rem; }
.auth-header { margin-bottom: 1.75rem; }
.auth-header h1 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: var(--ink); }
.auth-header h2 { font-size: 1rem; color: var(--brand); font-weight: 600; margin-bottom: .25rem; }
.auth-header p { font-size: .85rem; color: var(--muted); }
.auth-form { display: flex; flex-direction: column; }
.auth-back { display: inline-block; margin-top: 1rem; font-size: .85rem; color: var(--muted); text-decoration: none; }
.auth-back:hover { color: var(--brand); }

/* ── LAYOUT ────────────────────────────────────────────── */
.dashboard { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ── SIDEBAR ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); background: var(--ink);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 200; overflow-y: auto;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.sidebar-brand {
  padding: 1.4rem 1.25rem 1.1rem;
  display: flex; align-items: center; gap: .75rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand img { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; }
.sidebar-brand .name { font-family: var(--font-display); font-size: .95rem; font-weight: 700; color: var(--white); }
.sidebar-brand .tagline { font-size: .68rem; color: rgba(255,255,255,.38); margin-top: .05rem; }
.sidebar-user {
  margin: 1rem 1.25rem; padding: .8rem .95rem;
  background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.2);
  border-radius: var(--radius); display: flex; align-items: center; gap: .7rem;
}
.user-avatar-circle {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--gradient-brand);
  display: grid; place-items: center;
  font-weight: 800; font-size: .85rem; color: white; flex-shrink: 0;
}
.sidebar-user-info .uname { font-size: .85rem; font-weight: 700; color: var(--white); }
.sidebar-user-info .urole { font-size: .7rem; color: var(--brand); font-weight: 600; }

.sidebar-nav { flex: 1; padding: .5rem .9rem; }
.nav-section-label {
  font-size: .62rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: rgba(255,255,255,.28);
  padding: .85rem .5rem .35rem;
}
.nav-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .6rem .8rem; border-radius: var(--radius-sm);
  color: rgba(255,255,255,.52); font-size: .87rem; font-weight: 500;
  text-decoration: none; cursor: pointer;
  transition: all .18s; position: relative; margin-bottom: .08rem;
}
.nav-item:hover { color: var(--white); background: rgba(255,255,255,.07); }
.nav-item.active {
  color: var(--white); background: var(--brand); font-weight: 600;
  box-shadow: 0 4px 12px rgba(16,185,129,.28);
}
.nav-icon { font-size: .95rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: var(--red); color: white;
  font-size: .65rem; font-weight: 700; padding: .15rem .4rem;
  border-radius: 20px; min-width: 18px; text-align: center;
}

.sidebar-bottom {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
}
.btn-logout {
  width: 100%; padding: .65rem 1rem;
  background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.22);
  color: #f87171; border-radius: var(--radius-sm);
  font-family: var(--font); font-size: .85rem; font-weight: 600;
  cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
}
.btn-logout:hover { background: rgba(239,68,68,.2); color: #fca5a5; }
.sidebar-close-btn {
  display: none; width: 100%; padding: .55rem 1rem;
  background: rgba(255,255,255,.06); border: none; border-radius: var(--radius-sm);
  color: rgba(255,255,255,.45); font-family: var(--font); font-size: .84rem;
  cursor: pointer; margin-bottom: .6rem;
}

/* ── MAIN ──────────────────────────────────────────────── */
.main-content { margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  height: var(--header-h); background: var(--white);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.75rem; position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.topbar-left { display: flex; align-items: center; gap: 1rem; }
.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: .4rem; border: none; background: none; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: all .3s; }
.topbar-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.topbar-datetime { font-size: .78rem; color: var(--muted); }
.topbar-user { display: flex; align-items: center; gap: .5rem; }
.topbar-avatar { width: 34px; height: 34px; border-radius: 9px; background: var(--gradient-brand); display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: white; }
.topbar-name { font-size: .88rem; font-weight: 600; color: var(--ink); }
.content-area { flex: 1; padding: 1.75rem; }

/* ── PAGE ANIMATION ────────────────────────────────────── */
.page-content { animation: fadeUp .28s ease; }
@keyframes fadeUp { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

/* ── STATS ─────────────────────────────────────────────── */
.stats-row-hero {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem; margin-bottom: 1.4rem;
}
.stat-hero {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 1.35rem 1.4rem; border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.stat-hero:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-hero::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--brand); }
.stat-hero.accent-blue::before { background: var(--blue); }
.stat-hero.accent-amber::before { background: var(--amber); }
.stat-hero.accent-red::before { background: var(--red); }
.stat-icon { font-size: 1.5rem; margin-bottom: .75rem; display: block; }
.stat-num { font-family: var(--font-display); font-size: 2rem; font-weight: 800; color: var(--ink); line-height: 1; margin-bottom: .25rem; }
.stat-lbl { font-size: .78rem; color: var(--muted); font-weight: 500; }

/* ── CARDS ─────────────────────────────────────────────── */
.dashboard-card {
  background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  padding: 1.4rem; margin-bottom: 1.25rem;
}
.dashboard-card h2 {
  font-size: 1rem; font-weight: 700; color: var(--ink);
  margin-bottom: 1rem; padding-bottom: .75rem;
  border-bottom: 1px solid var(--line);
}
.card {
  background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); overflow: hidden;
  transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.card-body { padding: 1.1rem 1.25rem; }
.card-footer {
  padding: .85rem 1.25rem; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: .65rem; flex-wrap: wrap;
  background: var(--gray-50);
}

/* ── BUTTONS ───────────────────────────────────────────── */
.btn-green {
  background: var(--brand); color: white; border: none;
  border-radius: var(--radius-sm); padding: .55rem 1.1rem;
  font-family: var(--font); font-size: .85rem; font-weight: 600;
  cursor: pointer; transition: background .2s, transform .15s;
  display: inline-flex; align-items: center; gap: .4rem;
}
.btn-green:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: .55rem 1.1rem; font-family: var(--font);
  font-size: .85rem; font-weight: 600; cursor: pointer; transition: all .2s;
  display: inline-flex; align-items: center; gap: .4rem;
}
.btn-outline:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.btn-danger {
  background: rgba(239,68,68,.08); color: var(--red);
  border: 1.5px solid rgba(239,68,68,.18); border-radius: var(--radius-sm);
  padding: .55rem 1.1rem; font-family: var(--font);
  font-size: .85rem; font-weight: 600; cursor: pointer; transition: all .2s;
  display: inline-flex; align-items: center; gap: .4rem;
}
.btn-danger:hover { background: var(--red); color: white; border-color: var(--red); }
.btn-submit {
  width: 100%; padding: .85rem; background: var(--brand); color: white;
  border: none; border-radius: var(--radius-sm); font-family: var(--font);
  font-size: .95rem; font-weight: 700; cursor: pointer;
  transition: background .2s, transform .15s; box-shadow: 0 4px 14px var(--brand-glow);
}
.btn-submit:hover { background: var(--brand-dark); transform: translateY(-1px); }

/* ── BADGES ────────────────────────────────────────────── */
.badge { display: inline-block; padding: .2rem .65rem; border-radius: 20px; font-size: .72rem; font-weight: 700; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-blue { background: #dbeafe; color: #1e40af; }

/* ── FORMS ─────────────────────────────────────────────── */
.form-group { margin-bottom: 1.15rem; }
.form-group label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .4rem; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: .7rem 1rem;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: .88rem; color: var(--ink);
  background: var(--white); transition: border-color .2s, box-shadow .2s; outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow);
}
.form-group textarea { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .85rem center; padding-right: 2.5rem !important; }

/* ── TABLE ─────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table thead tr { background: var(--gray-50); }
.data-table th { padding: .7rem 1rem; text-align: left; font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.data-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); color: var(--ink-soft); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--gray-50); }

/* ── EMPTY STATE ───────────────────────────────────────── */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: .75rem; opacity: .45; display: block; }
.empty-state h3 { font-size: .95rem; font-weight: 600; margin-bottom: .3rem; color: var(--ink-soft); }
.empty-state p { font-size: .84rem; }

/* ── MESSAGES ──────────────────────────────────────────── */
.messages-area { height: 340px; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: .75rem; }
.message-bubble { max-width: 72%; padding: .65rem 1rem; border-radius: 14px; font-size: .875rem; line-height: 1.5; }
.message-bubble.sent { background: var(--brand); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
.message-bubble.received { background: var(--gray-100); color: var(--ink); align-self: flex-start; border-bottom-left-radius: 4px; border: 1px solid var(--line); }
.msg-time { font-size: .7rem; opacity: .6; margin-top: .25rem; }
.msg-input-row { display: flex; gap: .65rem; padding: 1rem 1.25rem; border-top: 1px solid var(--line); }
.msg-input-row input { flex: 1; padding: .65rem 1rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm); font-family: var(--font); font-size: .88rem; outline: none; }
.msg-input-row input:focus { border-color: var(--brand); }
.msg-input-row button { background: var(--brand); color: white; border: none; border-radius: var(--radius-sm); padding: .65rem 1.25rem; font-family: var(--font); font-weight: 600; font-size: .88rem; cursor: pointer; white-space: nowrap; }

/* ── PROGRESS ──────────────────────────────────────────── */
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--gradient-brand); border-radius: 99px; transition: width .6s; }

/* ── TOAST ─────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  background: var(--ink); color: white;
  padding: .8rem 1.35rem; border-radius: var(--radius);
  font-size: .88rem; font-weight: 500; box-shadow: var(--shadow-lg);
  pointer-events: none; transform: translateY(120%); opacity: 0;
  transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .3s;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.toast-success { background: var(--brand-dark); }
.toast.toast-error { background: var(--red); }

/* ── OVERLAY ───────────────────────────────────────────── */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 199; backdrop-filter: blur(2px); }
.sidebar-overlay.active { display: block; }

/* ── UTIL ──────────────────────────────────────────────── */
.d-flex { display: flex; align-items: center; }
.justify-between { justify-content: space-between; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }

/* ── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-row-hero { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .hamburger { display: flex; }
  .sidebar-close-btn { display: block; }
  .stats-row-hero { grid-template-columns: 1fr 1fr; }
  .topbar-datetime { display: none; }
  .content-area { padding: 1.1rem; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats-row-hero { grid-template-columns: 1fr; }
}
