* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f3f5f8;
  color: #223047;
}
a { color: inherit; text-decoration: none; }
.topbar {
  height: 58px;
  background: #334567;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.14);
}
.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-link {
  padding: 9px 12px;
  border-radius: 8px;
  transition: background .18s ease;
}
.topbar-link:hover, .topbar-link.active {
  background: rgba(255,255,255,.16);
}
.user-chip {
  background: rgba(255,255,255,.14);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
}
.page-wrap {
  padding: 18px;
}
.page-title {
  margin: 0 0 14px 0;
  font-size: 28px;
}
.card {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 4px 16px rgba(34, 48, 71, .08);
}
.login-shell {
  min-height: calc(100vh - 58px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 440px;
}
label {
  display: block;
  margin: 0 0 6px 0;
  font-weight: 700;
  color: #334567;
}
input[type="email"],
input[type="password"],
input[type="text"],
select,
textarea,
input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cfd6e3;
  border-radius: 10px;
  background: #fff;
  margin-bottom: 14px;
  font-size: 14px;
}
textarea { min-height: 84px; resize: vertical; }
.btn {
  border: 0;
  background: #334567;
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}
.btn.secondary { background: #7687a5; }
.btn.gold { background: #e6c96d; color: #223047; }
.btn.danger { background: #984242; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.notice {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
}
.notice.error { background: #f8e5e5; color: #7b2f2f; }
.notice.success { background: #e8f3ea; color: #255e33; }
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr .9fr;
  gap: 18px;
}
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid #e7ebf2;
  vertical-align: top;
}
th {
  color: #334567;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.headshot-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 50%;
  background: #edf1f7;
  border: 1px solid #d6deea;
}
.department-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef2f8;
  color: #334567;
  font-size: 12px;
  font-weight: 700;
}
.secondary-menu {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.secondary-menu .btn {
  padding: 8px 12px;
}
.workspace-shell {
  height: calc(100vh - 130px);
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 18px;
  margin-top: 16px;
}
.nav-panel, .editor-panel {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(34, 48, 71, .08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.panel-header {
  padding: 14px 16px;
  background: linear-gradient(180deg, #3a4d73 0%, #334567 100%);
  color: #fff;
  font-weight: 700;
}
.panel-body {
  padding: 16px 16px 100px 16px;
  min-height:100%;
  height:auto;
  overflow:auto;
}
.tree-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f4f7fb;
  margin-bottom: 8px;
  border-left: 4px solid #e6c96d;
}
.editor-preview {
  min-height: 320px;
  border: 1px solid #d6deea;
  border-radius: 12px;
  padding: 16px;
  background: #fcfdff;
}
.split-edit {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.muted-bright { color: #e0e3e9; }
.muted-dark { color: #66758e; }
.small { font-size: 12px; }
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f6f8fb;
  padding: 8px 10px;
  border-radius: 10px;
}
.checkbox-item input { width: auto; margin: 0; }
@media (max-width: 980px) {
  .dashboard-grid, .split-edit, .workspace-shell {
    grid-template-columns: 1fr;
  }
  .workspace-shell {
    height: auto;
  }
}
