/* ─── Reset & Base ─────────────────────────────── */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --navy:      #1a3a6b;
      --navy-dark: #122a52;
      --navy-light:#2151a0;
      --accent:    #d4891a;
      --accent-lt: #f0a830;
      --bg:        #f0f3f8;
      --white:     #ffffff;
      --card:      #ffffff;
      --border:    #dde3ef;
      --text:      #2c3e50;
      --muted:     #7a8ba8;
      --danger:    #c0392b;
      --success:   #27ae60;
      --info:      #2980b9;
      --sidebar-w: 250px;
      --topbar-h:  60px;
      --radius:    10px;
      --shadow:    0 2px 12px rgba(26,58,107,.10);
    }

    html { font-size: 15px; }
    body {
      font-family: 'Open Sans', sans-serif;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
    }

    a { text-decoration: none; color: inherit; }
    ul { list-style: none; }

    /* ─── Top Navigation Bar ───────────────────────── */
    .topbar {
      position: fixed;
      top: 0; left: 0; right: 0;
      height: var(--topbar-h);
      background: var(--navy);
      display: flex;
      align-items: center;
      padding: 0 20px 0 0;
      z-index: 200;
      box-shadow: 0 2px 10px rgba(0,0,0,.25);
    }

    .topbar__logo {
      width: var(--sidebar-w);
      flex-shrink: 0;
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 0 20px;
      height: 100%;
      border-right: 1px solid rgba(255,255,255,.12);
    }
    .topbar__logo-emblem {
      width: 36px; height: 36px;
      background: var(--accent);
      border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      color: #fff;
      font-family: 'Montserrat', sans-serif;
      font-weight: 700;
      font-size: 13px;
      flex-shrink: 0;
    }
    .topbar__logo-text {
      color: #fff;
      font-family: 'Montserrat', sans-serif;
      font-weight: 700;
      font-size: 14px;
      line-height: 1.25;
    }
    .topbar__logo-text span {
      display: block;
      font-weight: 400;
      font-size: 11px;
      opacity: .75;
    }

    .topbar__nav {
      display: flex;
      align-items: center;
      gap: 4px;
      padding-left: 16px;
      flex: 1;
    }
    .topbar__nav a {
      color: rgba(255,255,255,.82);
      font-size: 13px;
      padding: 6px 14px;
      border-radius: 5px;
      transition: background .18s, color .18s;
      white-space: nowrap;
    }
    .topbar__nav a:hover,
    .topbar__nav a.active {
      background: rgba(255,255,255,.13);
      color: #fff;
    }
    .topbar__nav .dropdown { position: relative; }
    .topbar__nav .dropdown:hover .dropdown-menu { display: block; }
    .dropdown-menu {
      display: none;
      position: absolute;
      top: calc(100% + 4px);
      left: 0;
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      min-width: 230px;
      padding: 6px;
      box-shadow: var(--shadow);
      z-index: 300;
    }
    .dropdown-menu a {
      display: block;
      padding: 8px 14px;
      color: var(--text) !important;
      font-size: 13px;
      border-radius: 6px;
      transition: background .15s;
    }
    .dropdown-menu a:hover { background: var(--bg); }

    .topbar__actions {
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .topbar__icon-btn {
      width: 36px; height: 36px;
      border-radius: 50%;
      background: rgba(255,255,255,.10);
      border: none;
      cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      color: rgba(255,255,255,.85);
      transition: background .18s;
      position: relative;
    }
    .topbar__icon-btn:hover { background: rgba(255,255,255,.20); color: #fff; }
    .badge-dot {
      position: absolute;
      top: 6px; right: 6px;
      width: 8px; height: 8px;
      border-radius: 50%;
      background: var(--accent-lt);
      border: 2px solid var(--navy);
    }

    .topbar__avatar {
      width: 36px; height: 36px;
      border-radius: 50%;
      background: var(--accent);
      color: #fff;
      font-family: 'Montserrat', sans-serif;
      font-weight: 700;
      font-size: 13px;
      display: flex; align-items: center; justify-content: center;
      cursor: pointer;
      border: 2px solid rgba(255,255,255,.3);
      transition: border-color .18s;
    }
    .topbar__avatar:hover { border-color: rgba(255,255,255,.7); }

    /* ─── Layout ────────────────────────────────────── */
    .layout {
      display: flex;
      padding-top: var(--topbar-h);
      flex: 1;
    }

    /* ─── Sidebar ───────────────────────────────────── */
    .sidebar {
      width: var(--sidebar-w);
      background: var(--white);
      border-right: 1px solid var(--border);
      position: fixed;
      top: var(--topbar-h);
      bottom: 0;
      left: 0;
      overflow-y: auto;
      padding: 20px 0 30px;
      z-index: 100;
    }
    .sidebar::-webkit-scrollbar { width: 4px; }
    .sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

    .sidebar__section { margin-bottom: 8px; }
    .sidebar__label {
      font-size: 10.5px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .08em;
      color: var(--muted);
      padding: 0 20px;
      margin-bottom: 4px;
      margin-top: 14px;
    }
    .sidebar__item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 9px 20px;
      color: var(--text);
      font-size: 13.5px;
      border-radius: 0;
      transition: background .15s, color .15s;
      cursor: pointer;
      position: relative;
    }
    .sidebar__item:hover { background: var(--bg); color: var(--navy-light); }
    .sidebar__item.active {
      background: #edf2fb;
      color: var(--navy);
      font-weight: 600;
    }
    .sidebar__item.active::before {
      content: '';
      position: absolute;
      left: 0; top: 0; bottom: 0;
      width: 3px;
      background: var(--navy-light);
      border-radius: 0 3px 3px 0;
    }
    .sidebar__item i {
      width: 18px;
      text-align: center;
      color: var(--muted);
      font-size: 14px;
      transition: color .15s;
    }
    .sidebar__item:hover i,
    .sidebar__item.active i { color: var(--navy-light); }

    .sidebar__sub {
      padding-left: 48px;
      display: none;
    }
    .sidebar__sub.open { display: block; }
    .sidebar__sub a {
      display: block;
      padding: 7px 20px 7px 0;
      font-size: 12.5px;
      color: var(--muted);
      border-left: 2px solid var(--border);
      padding-left: 12px;
      transition: color .15s, border-color .15s;
    }
    .sidebar__sub a:hover {
      color: var(--navy-light);
      border-left-color: var(--navy-light);
    }

    /* ─── Main Content ──────────────────────────────── */
    .main {
      margin-left: var(--sidebar-w);
      flex: 1;
      padding: 28px 28px 40px;
      min-height: calc(100vh - var(--topbar-h));
    }

    /* ─── Page Header ───────────────────────────────── */
    .page-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 24px;
      flex-wrap: wrap;
      gap: 12px;
    }
    .page-header__title {
      font-family: 'Montserrat', sans-serif;
      font-size: 22px;
      font-weight: 700;
      color: var(--navy);
    }
    .page-header__subtitle {
      font-size: 13px;
      color: var(--muted);
      margin-top: 2px;
    }
    .page-header__tag {
      background: #edf2fb;
      color: var(--navy-light);
      font-size: 12px;
      font-weight: 600;
      padding: 4px 12px;
      border-radius: 20px;
      border: 1px solid #c9d9f5;
    }

    /* ─── Grid Layout ───────────────────────────────── */
    .dashboard-grid {
      display: grid;
      grid-template-columns: 1fr 340px;
      gap: 20px;
      align-items: start;
    }
    .dashboard-left { display: flex; flex-direction: column; gap: 20px; }
    .dashboard-right { display: flex; flex-direction: column; gap: 20px; }

    /* ─── Cards ─────────────────────────────────────── */
    .card {
      background: var(--card);
      border-radius: var(--radius);
      border: 1px solid var(--border);
      box-shadow: var(--shadow);
      overflow: hidden;
    }
    .card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 18px;
      border-bottom: 1px solid var(--border);
      background: var(--white);
    }
    .card-header__title {
      display: flex;
      align-items: center;
      gap: 9px;
      font-family: 'Montserrat', sans-serif;
      font-size: 14px;
      font-weight: 600;
      color: var(--navy);
    }
    .card-header__title i {
      width: 30px; height: 30px;
      border-radius: 8px;
      background: #edf2fb;
      display: flex; align-items: center; justify-content: center;
      color: var(--navy-light);
      font-size: 13px;
    }
    .card-header__action {
      font-size: 12px;
      color: var(--navy-light);
      font-weight: 500;
      transition: color .15s;
    }
    .card-header__action:hover { color: var(--navy); text-decoration: underline; }
    .card-body { padding: 18px; }

    /* ─── Alert Block ───────────────────────────────── */
    .alert-item {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      background: #fff5f5;
      border: 1px solid #fcd0cc;
      border-left: 4px solid var(--danger);
      border-radius: 8px;
      padding: 12px 14px;
    }
    .alert-item i { color: var(--danger); margin-top: 2px; font-size: 15px; }
    .alert-item p { font-size: 13.5px; color: var(--text); line-height: 1.5; }

    /* ─── Schedule ──────────────────────────────────── */
    .schedule-group-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: #edf2fb;
      color: var(--navy);
      font-size: 12px;
      font-weight: 600;
      padding: 4px 12px;
      border-radius: 20px;
      margin-bottom: 14px;
    }
    .schedule-tabs {
      display: flex;
      gap: 6px;
      margin-bottom: 16px;
      overflow-x: auto;
      padding-bottom: 2px;
    }
    .schedule-tab {
      flex-shrink: 0;
      padding: 6px 14px;
      font-size: 12.5px;
      font-weight: 600;
      border-radius: 20px;
      background: var(--bg);
      color: var(--muted);
      border: 1px solid var(--border);
      cursor: pointer;
      transition: all .18s;
    }
    .schedule-tab:hover { background: #e0e8f7; color: var(--navy); }
    .schedule-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
    .schedule-tab.today-tab { border-color: var(--accent); color: var(--accent); }
    .schedule-tab.today-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

    .schedule-day-panel { display: none; }
    .schedule-day-panel.active { display: block; }

    .lesson-row {
      display: flex;
      gap: 14px;
      align-items: flex-start;
      padding: 10px 0;
      border-bottom: 1px solid var(--border);
    }
    .lesson-row:last-child { border-bottom: none; }
    .lesson-time {
      flex-shrink: 0;
      width: 82px;
      font-size: 12px;
      font-weight: 600;
      color: var(--navy);
      padding-top: 2px;
    }
    .lesson-body { flex: 1; }
    .lesson-type {
      display: inline-block;
      font-size: 10.5px;
      font-weight: 700;
      padding: 1px 7px;
      border-radius: 4px;
      text-transform: uppercase;
      letter-spacing: .04em;
      margin-bottom: 4px;
    }
    .lesson-type.lec { background: #e8f0fe; color: #1967d2; }
    .lesson-type.pr  { background: #e6f4ea; color: #1e8e3e; }
    .lesson-type.fk  { background: #fce8b2; color: #b06000; }
    .lesson-name {
      font-size: 13px;
      color: var(--text);
      line-height: 1.4;
    }
    .lesson-meta {
      font-size: 11.5px;
      color: var(--muted);
      margin-top: 2px;
    }
    .lesson-room {
      display: inline-flex;
      align-items: center;
      gap: 3px;
      margin-top: 3px;
      font-size: 11px;
      background: var(--bg);
      border-radius: 4px;
      padding: 2px 7px;
      color: var(--muted);
    }

    /* ─── Messages ──────────────────────────────────── */
    .empty-state {
      text-align: center;
      padding: 20px;
      color: var(--muted);
    }
    .empty-state i { font-size: 28px; margin-bottom: 8px; opacity: .35; }
    .empty-state p { font-size: 13px; }

    /* ─── Grades ────────────────────────────────────── */
    .grade-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 9px 0;
      border-bottom: 1px solid var(--border);
    }
    .grade-row:last-child { border-bottom: none; }

    /* ─── News ──────────────────────────────────────── */
    .news-item {
      padding: 12px 0;
      border-bottom: 1px solid var(--border);
    }
    .news-item:last-child { border-bottom: none; padding-bottom: 0; }
    .news-item__date {
      font-size: 11.5px;
      color: var(--muted);
      margin-bottom: 4px;
    }
    .news-item__title {
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
      line-height: 1.4;
      margin-bottom: 4px;
      transition: color .15s;
    }
    .news-item__title:hover { color: var(--navy-light); }
    .news-item__link {
      font-size: 12px;
      color: var(--navy-light);
      font-weight: 500;
    }
    .news-item__link:hover { text-decoration: underline; }

    /* ─── Quick Links (Schedule cards) ─────────────── */
    .quick-links {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
    }
    .ql-card {
      border-radius: 10px;
      padding: 18px;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 10px;
      transition: transform .18s, box-shadow .18s;
      cursor: pointer;
      text-decoration: none;
    }
    .ql-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(26,58,107,.15);
    }
    .ql-card.student { background: linear-gradient(135deg, #1a3a6b 0%, #2151a0 100%); }
    .ql-card.teacher { background: linear-gradient(135deg, #1e6b3a 0%, #27ae60 100%); }
    .ql-card__icon {
      width: 42px; height: 42px;
      border-radius: 10px;
      background: rgba(255,255,255,.18);
      display: flex; align-items: center; justify-content: center;
      font-size: 18px;
      color: #fff;
    }
    .ql-card__title {
      font-family: 'Montserrat', sans-serif;
      font-size: 13.5px;
      font-weight: 700;
      color: #fff;
    }
    .ql-card__desc {
      font-size: 11.5px;
      color: rgba(255,255,255,.78);
      line-height: 1.45;
      flex: 1;
    }
    .ql-card__btn {
      font-size: 12px;
      font-weight: 600;
      color: #fff;
      background: rgba(255,255,255,.22);
      border-radius: 6px;
      padding: 5px 14px;
      transition: background .18s;
    }
    .ql-card:hover .ql-card__btn { background: rgba(255,255,255,.35); }

    /* ─── FOS Tests ─────────────────────────────────── */
    .test-btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: var(--navy);
      color: #fff;
      font-size: 13px;
      font-weight: 600;
      padding: 10px 18px;
      border-radius: 8px;
      transition: background .18s;
      margin-bottom: 8px;
      width: 100%;
    }
    .test-btn:hover { background: var(--navy-light); }
    .test-btn i { font-size: 14px; }

    /* ─── Profile Card ──────────────────────────────── */
    .profile-card {
      background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 100%);
      border-radius: var(--radius);
      padding: 22px 18px;
      color: #fff;
      position: relative;
      overflow: hidden;
    }
    .profile-card::after {
      content: '';
      position: absolute;
      right: -30px; bottom: -30px;
      width: 120px; height: 120px;
      border-radius: 50%;
      background: rgba(255,255,255,.06);
    }
    .profile-card__avatar {
      width: 52px; height: 52px;
      border-radius: 50%;
      background: var(--accent);
      color: #fff;
      font-family: 'Montserrat', sans-serif;
      font-weight: 700;
      font-size: 18px;
      display: flex; align-items: center; justify-content: center;
      border: 3px solid rgba(255,255,255,.3);
      margin-bottom: 12px;
    }
    .profile-card__name {
      font-family: 'Montserrat', sans-serif;
      font-weight: 700;
      font-size: 16px;
      margin-bottom: 4px;
    }
    .profile-card__role {
      font-size: 12px;
      opacity: .75;
      margin-bottom: 14px;
    }
    .profile-card__stats {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      border-top: 1px solid rgba(255,255,255,.15);
      padding-top: 14px;
    }
    .profile-stat {
      text-align: center;
    }
    .profile-stat__val {
      font-family: 'Montserrat', sans-serif;
      font-size: 20px;
      font-weight: 700;
    }
    .profile-stat__lbl {
      font-size: 10.5px;
      opacity: .65;
      margin-top: 1px;
    }
    .profile-card__links {
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-top: 14px;
    }
    .profile-link {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 12.5px;
      color: rgba(255,255,255,.85);
      padding: 7px 0;
      border-top: 1px solid rgba(255,255,255,.10);
      transition: color .15s;
    }
    .profile-link:hover { color: #fff; }
    .profile-link i { width: 16px; text-align: center; opacity: .7; }

    /* ─── Information block ─────────────────────────── */
    .info-block {
      background: #f7f9fc;
      border-left: 4px solid var(--navy-light);
      border-radius: 0 8px 8px 0;
      padding: 12px 14px;
      font-size: 13.5px;
      line-height: 1.55;
      color: var(--text);
    }

    /* ─── Scrollable lists ──────────────────────────── */
    .scroll-list { max-height: 300px; overflow-y: auto; padding-right: 2px; }
    .scroll-list::-webkit-scrollbar { width: 4px; }
    .scroll-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

    /* ─── Footer ────────────────────────────────────── */
    .footer {
      margin-left: var(--sidebar-w);
      background: var(--white);
      border-top: 1px solid var(--border);
      padding: 14px 28px;
      font-size: 12px;
      color: var(--muted);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
    }
    .footer a { color: var(--navy-light); }
    .footer a:hover { text-decoration: underline; }

    /* ─── Responsive ─────────────────────────────────── */
    @media (max-width: 1100px) {
      .dashboard-grid { grid-template-columns: 1fr; }
      .dashboard-right { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
    }
    @media (max-width: 820px) {
      :root { --sidebar-w: 0px; }
      .sidebar { display: none; }
      .main, .footer { margin-left: 0; }
      .dashboard-right { grid-template-columns: 1fr; }
      .quick-links { grid-template-columns: 1fr; }
    }
    @media (max-width: 560px) {
      .main { padding: 16px; }
      .topbar__nav { display: none; }
    }
