* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 15px; }

body {
  font-family: 'Open Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Login ── */
#loginScreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 48px 44px;
  width: 420px;
  max-width: 90vw;
  text-align: center;
  box-shadow: var(--shadow-md);
  position: relative;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 5px; height: 100%;
  background: var(--navy);
  border-radius: 8px 0 0 8px;
}

.login-card img       { height: 40px; margin-bottom: 6px; }

.login-card .brand-sub {
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 2px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.login-card h2 {
  font-family: 'Roboto Slab', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}

.login-card .login-sub { color: var(--text-3); font-size: 0.82rem; margin-bottom: 28px; }

.login-field { display: flex; flex-direction: column; text-align: left; margin-bottom: 14px; }

.login-field label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-field input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border 0.2s;
}

.login-field input:focus { border-color: var(--accent); }

.login-btn {
  width: 100%;
  padding: 12px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s, transform 0.1s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-btn:hover  { background: var(--accent); }
.login-btn:active { transform: scale(0.99); }

.login-error { color: var(--red); font-size: 0.78rem; margin-top: 10px; min-height: 20px; }

/* ── App Shell ── */
#appShell { display: none; min-height: 100vh; }

/* ── Topbar ── */
.topbar {
  height: 56px;
  background: var(--navy);
  border-bottom: 3px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: 14px; }

.topbar-left img { height: 26px; filter: brightness(0) invert(1); }

.topbar-left .sep { width: 1px; height: 22px; background: rgba(255,255,255,0.18); }

.topbar-left .page-title {
  font-family: 'Roboto Slab', serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.5px;
}

.topbar-right { display: flex; align-items: center; gap: 14px; }

.topbar-right .role-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.role-badge.admin  { background: rgba(42,125,230,0.22); color: #93c5fd; border: 1px solid rgba(42,125,230,0.35); }
.role-badge.intern { background: rgba(21,128,61,0.22);  color: #86efac; border: 1px solid rgba(21,128,61,0.35); }

.topbar-right .user-name { font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,0.9); }

.logout-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.6);
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.logout-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }

/* ── App Layout ── */
.layout { display: flex; min-height: calc(100vh - 56px); }

/* ── Sidebar ── */
.sidebar {
  width: 220px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 10px;
  flex-shrink: 0;
}

.nav-group { margin-bottom: 24px; }

.nav-group .nav-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 0 12px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}

.nav-item:hover  { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-bg); color: var(--accent); font-weight: 600; }

.nav-item svg {
  width: 16px; height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ── Main ── */
.main { flex: 1; padding: 28px; overflow-y: auto; }

.view        { display: none; }
.view.active { display: block; }
