:root { --primary:#1e5aa8; --accent:#f4a300; --text:#222; --bg:#f7f9fc; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; }
.container { width: min(1100px, 92%); margin-inline: auto; padding: 1.5rem 0; }

.site-header { background: var(--primary); color: #fff; position: sticky; top: 0; z-index: 10; }
.nav { display: flex; justify-content: space-between; align-items: center; }
.nav a { color: #fff; text-decoration: none; margin-left: 1rem; }
#menu-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.6rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.2rem; }
.card { background: #fff; padding: 1rem; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.teacher img { width: 100%; height: 220px; object-fit: cover; border-radius: 8px; }

@media (max-width: 700px) {
  #menu-toggle { display: block; }
  #menu { display: none; flex-direction: column; width: 100%; }
  #menu.open { display: flex; }
  .nav { flex-wrap: wrap; }
  .nav a { margin: .5rem 0; }
}

.form { max-width: 500px; background: #fff; padding: 1.2rem; border-radius: 10px;
        box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.form label { display: block; margin-top: 1rem; font-weight: 600; }
.form input[type=text], .form input[type=file] { width: 100%; padding: .6rem;
        margin-top: .3rem; border: 1px solid #ccd; border-radius: 6px; }
.form button { margin-top: 1.2rem; padding: .7rem 1.4rem; background: var(--primary);
        color: #fff; border: 0; border-radius: 6px; cursor: pointer; }
.alert { padding: .8rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.alert.success { background: #e6f6ea; color: #17692f; }
.alert.error { background: #fdeaea; color: #8a1f1f; }

.form textarea { width: 100%; padding: .6rem; margin-top: .3rem;
                 border: 1px solid #ccd; border-radius: 6px; font-family: inherit; }

.nav-auth { display: inline-flex; align-items: center; gap: .5rem; margin-left: 1rem; }
.nav-user { font-size: .9rem; opacity: .9; }
.nav .btn { padding: .4rem .9rem; border-radius: 6px; margin-left: 0; font-weight: 600; }
.nav .btn-outline { border: 1px solid #fff; }
.nav .btn-accent { background: var(--accent); color: #222; }

@media (max-width: 700px) {
  .nav-auth { margin-left: 0; margin-top: .5rem; flex-wrap: wrap; }
}

.dropdown { position: relative; display: inline-block; margin-left: 1rem; }
.dropdown > a { margin-left: 0; }

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 170px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,.15);
  overflow: hidden;
  z-index: 20;
}
.dropdown-menu a { display: block; color: var(--text); margin: 0; padding: .6rem 1rem; }
.dropdown-menu a:hover { background: var(--bg); }

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu { display: block; }

@media (max-width: 700px) {
  .dropdown { margin-left: 0; width: 100%; }
  .dropdown-menu { position: static; box-shadow: none; background: rgba(255,255,255,.12); border-radius: 0; }
  .dropdown-menu a { color: #fff; }
  .dropdown:hover .dropdown-menu,
  .dropdown:focus-within .dropdown-menu { display: none; }
  .dropdown.open .dropdown-menu { display: block; }
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat { text-align: center; }
.stat strong { display: block; font-size: 1.8rem; color: var(--primary); }

.form select, .form input[type=date] { width: 100%; padding: .6rem; margin-top: .3rem;
  border: 1px solid #ccd; border-radius: 6px; background: #fff; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
.table th, .table td { padding: .7rem 1rem; text-align: left; border-bottom: 1px solid #e6eaf0; }
.table th { background: #eef2f8; }
.actions a { margin-right: .8rem; }
.link-danger { background: none; border: 0; color: #b42318; cursor: pointer; font: inherit; padding: 0; }


.post-img { width: 100%; height: 180px; object-fit: cover; border-radius: 8px; margin-bottom: .6rem; }
.thumb { width: 56px; height: 40px; object-fit: cover; border-radius: 4px; display: block; }

.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.news-card { background: #fff; border-radius: 10px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.08); display: flex; flex-direction: column; }

.news-text { margin: 0; }
.clamp { display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4;
  -webkit-box-orient: vertical; overflow: hidden; }

.read-more { background: none; border: 0; padding: 0; margin-top: .5rem; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--primary); }
.read-more[hidden] { display: none; }

@media (max-width: 900px) { .news-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .news-grid { grid-template-columns: 1fr; } }

.teacher-bio { margin-top: .5rem; font-size: .9rem; color: #444; }