/* ===============================
   BASE
================================ */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #F8FAFC;
  color: #0F172A;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===============================
   TOPBAR (DASHBOARD)
================================ */
.topbar {
  height: 64px;
  background: linear-gradient(135deg, #1E3A5F, #0B3C5D);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.topbar .title {
  font-weight: 600;
  letter-spacing: 0.3px;
}

.icon-btn {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
}

.icon-btn:hover {
  opacity: 0.85;
}

.logout-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 16px;
  border-radius: 999px;
  color: white;
  font-size: 13px;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ===============================
   LAYOUT (DASHBOARD)
================================ */
.app {
  display: flex;
  min-height: calc(100vh - 64px);
}

.sidebar {
  width: 240px;
  background: #FFFFFF;
  border-right: 1px solid #E5E7EB;
  padding: 16px;
  transition: width 0.3s, padding 0.3s;
}

.sidebar a {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  color: #1E3A5F;
  font-size: 14px;
  margin-bottom: 6px;
  transition: background 0.2s;
}

.sidebar a:hover {
  background: rgba(30, 58, 95, 0.08);
}

.sidebar a.active {
  background: rgba(168, 115, 66, 0.18);
  font-weight: 600;
}

.sidebar-collapsed .sidebar {
  width: 0;
  padding: 0;
  overflow: hidden;
}

.content {
  flex: 1;
  padding: 28px;
}

/* ===============================
   CARDS
================================ */
.card {
  background: #FFFFFF;
  padding: 24px;
  border-radius: 16px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.card h2,
.card h3 {
  margin-top: 0;
  color: #1E3A5F;
}

/* ===============================
   STATS
================================ */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.stat-card {
  padding: 20px;
  border-left: 4px solid #A87342;
  border-radius: 14px;
  background: linear-gradient(135deg, #FFFFFF, #F9FAFB);
}

.stat-card span {
  font-size: 13px;
  color: #64748B;
}

.stat-card strong {
  font-size: 24px;
  color: #1E3A5F;
  display: block;
  margin-top: 6px;
}

/* ===============================
   FORMS
================================ */
label {
  font-size: 13px;
  font-weight: 500;
  color: #334155;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #CBD5E1;
  margin-top: 6px;
  margin-bottom: 14px;
  font-family: inherit;
  font-size: 14px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #1E3A5F;
}

button,
.btn-primary {
  padding: 12px 18px;
  background: #1E3A5F;
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
}

button:hover,
.btn-primary:hover {
  background: #16314F;
}

/* ===============================
   LOGIN PAGE
================================ */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0B3C5D, #F8FAFC);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: #FFFFFF;
  max-width: 420px;
  padding: 32px;
  border-radius: 18px;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.15);
}

.alert-error {
  background: #FEE2E2;
  color: #991B1B;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
}

/* ===============================
   DARK MODE
================================ */
.dark-mode {
  background: #0B1220;
  color: #E5E7EB;
}

.dark-mode .topbar,
.dark-mode .sidebar,
.dark-mode .card,
.dark-mode .login-card {
  background: #020617;
  color: #E5E7EB;
}

.dark-mode .sidebar a {
  color: #CBD5E1;
}

.dark-mode .stat-card {
  background: #020617;
  border-left-color: #A87342;
}

.dark-mode input,
.dark-mode textarea,
.dark-mode select {
  background: #020617;
  border-color: #334155;
  color: #E5E7EB;
}

/* ===============================
   PUBLIC SITE
================================ */
.public-header {
  background: #ffffff;
  border-bottom: 1px solid #E5E7EB;
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-container {
  max-width: 1200px;
  margin: auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 600;
  color: #1E3A5F;
  font-size: 15px;
}

.nav-links {
  display: flex;
  gap: 18px;
  align-items: center;
}

.nav-links a {
  font-size: 14px;
  color: #334155;
  padding: 6px 10px;
  border-radius: 8px;
}

.nav-links a:hover {
  background: rgba(30, 58, 95, 0.08);
}

.nav-links a.active {
  background: rgba(168, 115, 66, 0.18);
  font-weight: 600;
}

.nav-login {
  background: #1E3A5F;
  color: #ffffff !important;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
}

/* HERO */
.hero-public {
  background: linear-gradient(135deg, #1E3A5F, #0B3C5D);
  color: #ffffff;
  padding: 90px 20px;
  text-align: center;
}

.hero-content {
  max-width: 900px;
  margin: auto;
}

.hero-content h1 {
  font-size: 36px;
}

.hero-content p {
  opacity: 0.9;
}

/* PUBLIC CONTENT */
.public-container {
  max-width: 1100px;
  margin: 40px auto 60px;
  /* hakutakuwa na kukatwa */
  padding: 0 20px;
}

.public-item small {
  color: #64748B;
  font-size: 12px;
}

.public-footer {
  text-align: center;
  padding: 36px 20px;
  font-size: 13px;
  color: #64748B;
  border-top: 1px solid #E5E7EB;
  background: #ffffff;
}

/* ===============================
   MOBILE
================================ */
.hamburger {
  display: none;
  font-size: 22px;
  background: none;
  border: none;
  cursor: pointer;
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    background: white;
    position: absolute;
    top: 64px;
    right: 20px;
    padding: 14px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  }

  .nav-links.show {
    display: flex;
  }

  .hero-content h1 {
    font-size: 28px;
  }
}

/* FIX: MOBILE HAMBURGER VISIBILITY */
.hamburger {
  background: #1E3A5F;
  color: #ffffff;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 22px;
  cursor: pointer;
  z-index: 100;
}

/* Mobile only */
@media (max-width: 768px) {
  .hamburger {
    display: block;
  }
}

/* ===============================
   MOBILE FIX – PUBLIC PAGES
================================ */
@media (max-width: 768px) {
  .public-container {
    margin-top: 70px;
    /* nafasi salama chini ya sticky header */
  }
}