/* ATCHMS - Arusha Technical College Hostel Management System
   Pure HTML + CSS. No JS. */

@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap");

:root {
  --primary: #0B5D3B;
  --dark: #083D28;
  --light: #EAF6F0;
  --white: #FFFFFF;
  --gold: #D4AF37;
  --text: #1f2a24;
  --muted: #5b6b62;
  --border: #e2ebe5;
  --shadow-sm: 0 2px 6px rgba(8,61,40,0.06);
  --shadow: 0 10px 30px rgba(8,61,40,0.08);
  --shadow-lg: 0 20px 50px rgba(8,61,40,0.14);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: #f7fbf8;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--gold); }

/* ===== Header / Nav ===== */
.topbar {
  background: var(--dark);
  color: #cfe4d8;
  font-size: 13px;
}
.topbar .wrap {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 24px;
}
.topbar a { color: #cfe4d8; }
.topbar a:hover { color: var(--gold); }

.header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.nav {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.brand-logo img {
  width: 100%; height: 100%; object-fit: contain;
}
.brand-text h1 {
  font-size: 16px; color: var(--dark); font-weight: 700; line-height: 1.1;
}
.brand-text p { font-size: 12px; color: var(--muted); }

.menu { display: flex; gap: 6px; align-items: center; list-style: none; }
.menu a {
  display: inline-block;
  padding: 10px 14px;
  color: var(--text);
  font-weight: 500;
  font-size: 14.5px;
  border-radius: 10px;
  transition: all .2s ease;
}
.menu a:hover { background: var(--light); color: var(--primary); }
.menu a.active { background: var(--primary); color: var(--white); }
.menu .btn { margin-left: 8px; }

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  border: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--dark); transform: translateY(-2px); box-shadow: var(--shadow); color: var(--white); }
.btn-gold { background: var(--gold); color: var(--dark); }
.btn-gold:hover { background: #c29c2a; transform: translateY(-2px); }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: var(--white); }

/* ===== Hero ===== */
.hero {
  position: relative;
  background:
    linear-gradient(135deg, rgba(8,61,40,.88), rgba(11,93,59,.78)),
    url("atc-building.jpg") center/cover no-repeat;
  color: var(--white);
  padding: 100px 24px 120px;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: auto 0 -1px 0; height: 80px;
  background: linear-gradient(to bottom, transparent, #f7fbf8);
}
.hero-inner {
  max-width: 1100px; margin: 0 auto; text-align: center;
  position: relative; z-index: 2;
}
.hero .eyebrow {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(212,175,55,.18);
  color: var(--gold);
  border: 1px solid rgba(212,175,55,.45);
  border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase;
  margin-bottom: 22px;
}
.hero h2 {
  font-size: clamp(30px, 5vw, 54px);
  font-weight: 800; line-height: 1.1;
  margin-bottom: 18px;
  letter-spacing: -.5px;
}
.hero h2 span { color: var(--gold); }
.hero p {
  font-size: 17px; opacity: .92;
  max-width: 720px; margin: 0 auto 32px;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ===== Sections ===== */
.section { padding: 80px 24px; }
.section-inner { max-width: 1240px; margin: 0 auto; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 50px; }
.section-head .kicker {
  color: var(--gold); font-weight: 700; letter-spacing: 2px;
  font-size: 12px; text-transform: uppercase;
}
.section-head h3 {
  font-size: clamp(26px, 3.4vw, 38px);
  color: var(--dark); margin: 10px 0 12px; font-weight: 700;
}
.section-head p { color: var(--muted); font-size: 16px; }

/* ===== Stats ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
  margin-top: -70px;
  position: relative; z-index: 3;
  padding: 0 24px;
  max-width: 1240px; margin-left: auto; margin-right: auto;
}
.stat-card {
  background: var(--white);
  padding: 28px 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 4px solid var(--primary);
  transition: transform .25s ease, box-shadow .25s ease;
}
.stat-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.stat-card .icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--light); color: var(--primary);
  display: grid; place-items: center; font-size: 22px; font-weight: 800;
  margin-bottom: 14px;
}
.stat-card h4 { font-size: 32px; color: var(--dark); font-weight: 800; }
.stat-card p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.stat-card:nth-child(2) { border-top-color: var(--gold); }
.stat-card:nth-child(2) .icon { background: #fbf3dc; color: #8a6d14; }
.stat-card:nth-child(3) { border-top-color: var(--dark); }
.stat-card:nth-child(4) { border-top-color: #2aa874; }

/* ===== Feature/info cards ===== */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #cfe4d8; }
.card .icon-lg {
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--dark));
  color: var(--gold);
  display: grid; place-items: center; font-size: 24px; font-weight: 800;
  margin-bottom: 18px;
}
.card h4 { color: var(--dark); margin-bottom: 8px; font-size: 18px; }
.card p { color: var(--muted); font-size: 14.5px; }

/* ===== Two column ===== */
.two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center;
}
.two-col img { border-radius: var(--radius); box-shadow: var(--shadow); }
.two-col h3 { font-size: 30px; color: var(--dark); margin-bottom: 14px; }
.two-col p { color: var(--muted); margin-bottom: 14px; }
.two-col ul, .two-col ol { padding-left: 22px; color: var(--text); }
.two-col li { margin: 6px 0; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }

/* ===== Forms ===== */
.form-wrap {
  max-width: 560px; margin: 0 auto;
  background: var(--white);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 5px solid var(--primary);
}
.form-wrap h3 { color: var(--dark); margin-bottom: 6px; font-size: 26px; }
.form-wrap .sub { color: var(--muted); margin-bottom: 26px; font-size: 14.5px; }

.field {
  position: relative; margin-bottom: 20px;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 18px 14px 8px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit; font-size: 15px;
  background: #fafdfb;
  color: var(--text);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.field textarea {
  height: auto;
  resize: vertical;
  padding-top: 24px;
}
.field select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235b6b62'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 20px;
  padding-right: 40px;
}
.field label {
  position: absolute;
  top: 14px; left: 14px;
  color: var(--muted); font-size: 14px;
  pointer-events: none; background: transparent;
  transition: all .2s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(11,93,59,.10);
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label,
.field select:focus + label,
.field select:valid + label {
  top: 4px; font-size: 11px; color: var(--primary); font-weight: 600;
  letter-spacing: .5px; text-transform: uppercase;
}
.field select + label {
  top: 4px; font-size: 11px; color: var(--muted); font-weight: 600;
  letter-spacing: .5px; text-transform: uppercase;
}
.form-actions { display: flex; gap: 12px; margin-top: 8px; }
.form-actions .btn { flex: 1; }
.form-note { text-align: center; margin-top: 18px; color: var(--muted); font-size: 13.5px; }

/* ===== Tables ===== */
.table-wrap {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 0; }
thead { background: var(--dark); color: var(--white); }
th {
  padding: 13px 14px; text-align: left;
  white-space: nowrap;          /* Headers NEVER wrap */
  font-size: 13.5px; font-weight: 600;
}
td { padding: 13px 14px; text-align: left; vertical-align: middle; }
tbody tr { border-top: 1px solid var(--border); transition: background .15s ease; }
tbody tr:hover { background: var(--light); }
.badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  white-space: nowrap;          /* Badges (paid/approved) NEVER wrap */
}
.badge-green { background: #d6f1e3; color: #0a5b3a; }
.badge-gold { background: #fbf0cf; color: #7a5c10; }
.badge-red { background: #fbdcdc; color: #8a1f1f; }

/* ===== Dashboard layout ===== */
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 80px);
  flex: 1;
  max-width: 100vw;
  overflow-x: hidden;
}
.sidebar {
  background: var(--dark); color: #cfe4d8;
  padding: 28px 18px;
}
.sidebar .logo-block {
  display: flex; gap: 12px; align-items: center; margin-bottom: 24px;
  padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar .brand-logo { border-color: var(--gold); background: var(--dark); }
.sidebar h5 { color: var(--white); font-size: 14px; }
.sidebar small { color: #9bbfa9; font-size: 11.5px; }
.side-menu { list-style: none; }
.side-menu li { margin: 4px 0; }
.side-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 10px;
  color: #cfe4d8; font-size: 14px; font-weight: 500;
  transition: all .2s ease;
}
.side-menu a:hover { background: rgba(255,255,255,.06); color: var(--white); }
.side-menu a.active { background: var(--primary); color: var(--white); }
.side-menu .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--gold);
  display: inline-block;
}

.main { padding: 30px; background: #f7fbf8; min-width: 0; box-sizing: border-box; max-width: 100%; overflow-x: hidden; }
.page-head {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px; margin-bottom: 24px;
}
.page-head h2 { color: var(--dark); font-size: 24px; }
.page-head p { color: var(--muted); font-size: 14px; }

.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}
/* ==========================================================================
   ROBUST RESPONSIVE MEDIA QUERIES (PCs, Tablets, iPads, Androids, iPhones)
   ========================================================================== */

/* 1. Large Desktops & Laptops (PC defaults are applied above) */
.nav-toggle-label {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 18px;
  cursor: pointer;
  z-index: 100;
}
.nav-toggle-label span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--primary);
  border-radius: 3px;
  transition: all 0.3s ease-in-out;
}

/* 2. Laptops & Medium Desktops (max-width: 1200px) */
@media (max-width: 1200px) {
  .nav {
    max-width: 960px;
  }
  .section-inner {
    max-width: 960px;
  }
}

/* 3. Tablets & iPads Landscape (max-width: 1024px) */
@media (max-width: 1024px) {
  .app {
    grid-template-columns: 220px 1fr;
  }
  .sidebar {
    padding: 20px 12px;
  }
  .side-menu a {
    font-size: 13px;
    padding: 10px 12px;
  }
  .main {
    padding: 24px;
  }
  .dash-grid {
    grid-template-columns: 1fr;
  }
}

/* 4. iPads / Tablets Portrait (max-width: 768px) */
@media (max-width: 768px) {
  .topbar .wrap {
    flex-direction: column;
    text-align: center;
    gap: 6px;
    padding: 8px 16px;
  }
  
  /* Stack Header Nav into Hamburger Menu */
  .nav {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    position: relative;
  }
  .brand {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 12px;
  }
  .nav-toggle-label {
    display: flex;
  }
  .menu {
    display: none; /* Hidden by default on mobile */
    flex-direction: column;
    width: 100%;
    background: var(--white);
    position: absolute;
    top: 100%;
    left: 0;
    box-shadow: var(--shadow);
    padding: 20px;
    border-top: 1px solid var(--border);
    z-index: 99;
    gap: 8px;
    list-style: none;
  }
  .menu li {
    width: 100%;
  }
  .menu a {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    text-align: left;
    border: none;
    background: transparent;
    border-radius: 8px;
  }
  .menu a:hover, .menu a.active {
    background: var(--light);
    color: var(--primary);
  }
  .menu a.active {
    background: var(--primary);
    color: var(--white);
  }
  .menu .btn {
    margin-left: 0;
    margin-top: 8px;
    width: 100%;
    text-align: center;
  }

  /* Hamburger Animation when checked */
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
  }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
  }
  .nav-toggle:checked ~ .menu {
    display: flex;
  }


  /* App Layout for Tablets Portrait */
  .app {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .sidebar {
    padding: 16px;
    border-bottom: 2px solid var(--border);
    background: var(--dark);
  }
  .sidebar .logo-block {
    margin-bottom: 14px;
    padding-bottom: 0;
    border-bottom: none;
    justify-content: center;
  }
  
  /* Horizontal pill scrollbar for sidebar on tablet/mobile */
  .side-menu {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 6px 2px 10px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .side-menu::-webkit-scrollbar { display: none; }
  .side-menu li { margin: 0; flex-shrink: 0; }
  .side-menu a {
    padding: 8px 16px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    color: #cfe4d8;
    white-space: nowrap;
    display: inline-block;
  }
  .side-menu a.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
  }

  .main {
    padding: 16px 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .two-col {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
    margin-top: -50px;
    padding: 0 20px;
    gap: 20px;
  }

  /* Form & Hero details */
  .hero {
    padding: 60px 16px 80px;
  }
  .hero h2 {
    font-size: 28px;
    line-height: 1.2;
  }
  .hero p {
    font-size: 14px;
    margin-bottom: 24px;
  }
  .section {
    padding: 44px 16px;
  }
  .form-wrap {
    padding: 28px 20px;
    border-radius: 12px;
  }
  
  /* Tables — let them scroll inside the wrap, do NOT force a min-width larger than viewport */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  .mini-stats {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}

/* 5. Androids & iPhones (max-width: 576px) */
@media (max-width: 576px) {
  .menu li {
    flex: 1 1 100%; /* Full width stack on mobile phones */
  }
  .mini-stats {
    grid-template-columns: 1fr;
  }
  .brand-text h1 {
    font-size: 13.5px;
  }
  .brand-text p {
    font-size: 10px;
  }
  .profile-card {
    flex-direction: column;
    text-align: center;
    gap: 16px;
    padding: 20px;
  }
  .avatar {
    margin: 0 auto;
  }
  .form-actions {
    flex-direction: column;
    gap: 8px;
  }
  .form-actions .btn {
    width: 100%;
  }
  .page-head {
    text-align: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
  }
  .page-head .btn {
    width: 100%;
    text-align: center;
  }
  .hostel-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
    margin-top: -40px;
    padding: 0 12px;
    gap: 12px;
  }
  .stat-card {
    padding: 16px 12px;
  }
  .stat-card .icon {
    width: 38px;
    height: 38px;
    font-size: 18px;
    margin-bottom: 8px;
    border-radius: 8px;
  }
  .stat-card h4 {
    font-size: 22px;
  }
  .stat-card p {
    font-size: 12px;
  }
  .table-wrap table {
    min-width: 650px; /* Allows horizontal scrolling instead of squishing text */
    width: 100%;
    font-size: 12.5px;
  }
  th {
    padding: 9px 10px;
    font-size: 12px;
    white-space: nowrap;   /* ALWAYS keep headers on one line */
  }
  td {
    padding: 9px 10px;
    font-size: 12.5px;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  .badge {
    font-size: 11px;
    padding: 3px 8px;
    white-space: nowrap;   /* ALWAYS keep badge text on one line */
  }
  .panel {
    overflow: hidden;
    box-sizing: border-box;
    max-width: 100%;
  }
  .mini-stats {
    grid-template-columns: 1fr 1fr;
  }
  .mini-stat h3 {
    font-size: 20px;
  }
  .hostel-grid {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 22px;
  }
}

/* 6. Small Screens / iPhone SE (max-width: 375px) */
@media (max-width: 375px) {
  .hero h2 {
    font-size: 24px;
  }
  .brand-text h1 {
    font-size: 14px;
  }
  .sidebar h5 {
    font-size: 13px;
  }
}




.profile-card {
  background: var(--white); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  display: flex; gap: 20px; align-items: flex-start;
  flex-wrap: wrap; box-sizing: border-box; overflow: hidden; width: 100%;
}
.avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--gold));
  color: var(--white); display: grid; place-items: center;
  font-size: 26px; font-weight: 700; flex-shrink: 0;
  overflow: hidden;      /* Clip image to circle */
  border: 3px solid var(--border);
}
.avatar img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block; border-radius: 50%;
}
.profile-card h4 { color: var(--dark); }
.profile-details {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 12px;
  width: 100%;
}
.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.detail-label {
  font-size: 10.5px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.5px;
}
.detail-value {
  font-size: 13.5px;
  color: var(--text);
  font-weight: 500;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.panel {
  background: var(--white); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  width: 100%; max-width: 100%; box-sizing: border-box; overflow: hidden;
}
.panel h4 { color: var(--dark); margin-bottom: 14px; }
.notif { list-style: none; }
.notif li {
  padding: 12px 0; border-bottom: 1px dashed var(--border);
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 14px; color: var(--text);
}
.notif li:last-child { border: none; }
.notif .pill {
  width: 10px; height: 10px; border-radius: 50%; background: var(--primary);
  margin-top: 7px; flex-shrink: 0;
}
.notif li small { display: block; color: var(--muted); font-size: 12px; }

/* ===== Hostel cards ===== */
.hostel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 26px;
}
.hostel-card {
  background: var(--white); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform .25s ease, box-shadow .25s ease;
}
.hostel-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.hostel-img {
  height: 200px;
  background-size: cover; background-position: center;
  position: relative;
}
.hostel-img::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(8,61,40,.55), transparent 50%);
}
.hostel-body { padding: 22px; }
.hostel-body h4 { color: var(--dark); margin-bottom: 6px; font-size: 19px; }
.hostel-meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  color: var(--muted); font-size: 13px; margin: 10px 0 14px;
}
.hostel-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hostel-body p { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.hostel-body .row {
  display: flex; justify-content: space-between; align-items: center;
}

/* ===== Contact ===== */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 36px;
}
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info .info-item {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--white); padding: 18px;
  border-radius: 12px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--border); margin-bottom: 14px;
}
.contact-info .icn {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: var(--light); color: var(--primary);
  display: grid; place-items: center; font-weight: 700;
}
.contact-info h5 { color: var(--dark); margin-bottom: 2px; font-size: 15px; }
.contact-info p { color: var(--muted); font-size: 14px; }
.map {
  margin-top: 30px;
  height: 280px; border-radius: var(--radius); overflow: hidden;
  background:
    repeating-linear-gradient(45deg, #e6efe9 0 12px, #dde8e1 12px 24px);
  display: grid; place-items: center;
  color: var(--dark); font-weight: 600;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  position: relative;
}
.map::before {
  content: "📍"; font-size: 40px; display: block;
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -70%);
}
.map span { margin-top: 50px; }

/* ===== Footer ===== */
.footer {
  background: var(--dark); color: #cfe4d8;
  padding: 60px 24px 20px;
  margin-top: 60px;
}
.footer-grid {
  max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 36px;
}
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer h5 {
  color: var(--white); font-size: 15px; margin-bottom: 14px;
  letter-spacing: 1px; text-transform: uppercase;
}
.footer p, .footer a { color: #b8d0c2; font-size: 14px; }
.footer ul { list-style: none; }
.footer ul li { margin: 8px 0; }
.footer a:hover { color: var(--gold); }
.footer-bottom {
  max-width: 1240px; margin: 40px auto 0;
  padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1);
  text-align: center; font-size: 13px; color: #9bbfa9;
}
.footer .brand-text h1 { color: var(--white); }
.footer .brand-text p { color: #9bbfa9; }

/* ===== Page banner ===== */
.banner {
  background: linear-gradient(135deg, var(--dark), var(--primary));
  color: var(--white);
  padding: 70px 24px;
  text-align: center;
}
.banner h1 {
  font-size: clamp(28px, 4vw, 42px);
  color: var(--white); margin-bottom: 10px; font-weight: 700;
}
.banner p { color: #cfe4d8; max-width: 680px; margin: 0 auto; }
.crumbs {
  margin-top: 14px; font-size: 13px; color: #cfe4d8;
}
.crumbs a { color: var(--gold); }

/* ===== Quick actions ===== */
.actions-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.action-card {
  background: var(--white); border-radius: 12px;
  padding: 22px 18px; text-align: center;
  border: 1px solid var(--border); cursor: pointer;
  transition: all .2s ease;
}
.action-card:hover {
  background: var(--primary); color: var(--white);
  transform: translateY(-4px); box-shadow: var(--shadow);
}
.action-card .emoji { font-size: 28px; display: block; margin-bottom: 8px; }
.action-card span { font-weight: 600; font-size: 14px; }

/* ===== Mini stats inside dashboard ===== */
.mini-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.mini-stat {
  background: var(--white); border-radius: 12px; padding: 20px;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.mini-stat small { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.mini-stat h3 { font-size: 26px; color: var(--dark); margin-top: 6px; }
.mini-stat .delta { font-size: 12.5px; color: #2aa874; font-weight: 600; margin-top: 4px; }
.mini-stat .delta.down { color: #c0392b; }

/* ===== Loading & Skeleton Animations ===== */
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(11, 93, 59, 0.15);
  border-radius: 50%;
  border-top-color: var(--primary, #0B5D3B);
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  gap: 12px;
  color: var(--muted, #888888);
  font-size: 14px;
  font-weight: 500;
}
.loading-pulse {
  animation: pulse 1.5s infinite ease-in-out;
  color: var(--muted, #888888);
}

/* ===== Bottom Navigation Bar for Mobile ===== */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: var(--white);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 18px rgba(8, 61, 40, 0.12);
  z-index: 9999;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  padding: 0 6px;
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  gap: 4px;
  transition: color 0.15s ease, transform 0.2s ease;
  height: 100%;
  width: 100%;
  padding: 8px 0;
}
.bottom-nav-item:hover {
  transform: translateY(-1px);
}
.bottom-nav-item.active {
  color: var(--primary);
}
.bottom-nav-item svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

@media (max-width: 820px) {
  .footer {
    padding: 48px 18px 24px;
  }
  .footer p,
  .footer a {
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  .nav {
    flex-wrap: wrap;
  }
  .menu {
    max-height: calc(100vh - 118px);
  }
  .hero {
    padding: 54px 16px 70px;
  }
  .section {
    padding: 40px 16px;
  }
  .form-wrap {
    padding: 26px 18px;
  }
  .hostel-body .row {
    flex-direction: column;
    gap: 12px;
  }
  .table-wrap {
    overflow-x: auto;
  }
  .table-wrap table {
    min-width: 100%;
  }
  .card,
  .panel,
  .form-wrap,
  .hostel-card,
  .actions-grid {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .topbar .wrap {
    padding: 10px 14px;
  }
  .nav {
    padding: 14px 16px;
  }
  .brand-text h1 {
    font-size: 14px;
  }
  .brand-text p {
    font-size: 11px;
  }
  .menu a {
    padding: 12px 16px;
  }
  .hero {
    padding: 48px 14px 60px;
  }
  .hero h2 {
    font-size: 24px;
  }
  .hero p {
    font-size: 14px;
  }
  .section {
    padding: 36px 14px;
  }
  .section-inner,
  .page-head,
  .form-wrap,
  .panel,
  .hostel-card,
  .contact-info .info-item {
    width: 100%;
  }
  .section-inner {
    padding: 0;
  }
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none !important;
  }
  .bottom-nav {
    display: grid !important;
  }
  .main {
    padding: 18px 14px 80px !important;
  }
  .profile-details {
    grid-template-columns: 1fr;
    text-align: left;
    background: #f8fbf9;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    width: 100%;
    margin-top: 16px;
  }
  .page-head {
    gap: 14px;
  }
  .page-head .btn {
    width: 100%;
  }
  .footer {
    padding: 40px 16px 18px;
  }
  .footer-bottom {
    margin-top: 20px;
  }
  .contact-info .info-item {
    padding: 16px;
  }
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    box-sizing: border-box;
  }
  .table-wrap table {
    min-width: 650px; /* Allows horizontal scrolling instead of squishing text */
    width: 100%;
    font-size: 12.5px;
  }
  th {
    padding: 9px 10px;
    font-size: 12px;
    white-space: nowrap;   /* ALWAYS keep headers on one line */
  }
  td {
    padding: 9px 10px;
    font-size: 12.5px;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  .badge {
    font-size: 11px;
    padding: 3px 8px;
    white-space: nowrap;   /* ALWAYS keep badge text on one line */
  }
  .panel {
    overflow: hidden;
    box-sizing: border-box;
    max-width: 100%;
  }
  .mini-stats {
    grid-template-columns: 1fr 1fr;
  }
  .mini-stat h3 {
    font-size: 20px;
  }
  .hostel-grid {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 22px;
  }
}

/* ===== Profile Page Styles ===== */
.profile-edit-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.profile-banner {
  height: 130px;
  background: linear-gradient(135deg, var(--primary) 0%, #1a8c5d 60%, #0d7a4f 100%);
  position: relative;
}
.profile-banner-overlay {
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.avatar-upload-wrap {
  position: relative;
  display: inline-block;
  margin: -50px 0 0 32px;
}
.avatar-preview {
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 4px solid var(--white);
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  background: var(--primary);
  color: #fff;
  font-size: 32px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: pointer;
  transition: filter 0.2s;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-preview:hover { filter: brightness(0.88); }
.avatar-cam-icon {
  position: absolute; bottom: 4px; right: 4px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); border: 2.5px solid var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: transform 0.2s, background 0.2s;
}
.avatar-cam-icon:hover { transform: scale(1.1); background: #09472d; }
.avatar-cam-icon svg { width: 14px; height: 14px; fill: #fff; }
.profile-header-info { padding: 14px 32px 26px; }
.profile-header-info h3 {
  font-size: clamp(16px, 2.5vw, 20px);
  font-weight: 700; color: var(--dark); margin: 0 0 4px;
}
.profile-header-info p { color: var(--muted); font-size: 13.5px; margin: 0; }

.upload-progress {
  display: none; height: 4px; background: #e2e8f0;
  border-radius: 2px; margin: 0 32px 12px; overflow: hidden;
}
.upload-progress-bar {
  height: 100%; background: var(--primary);
  width: 0%; transition: width 0.3s; border-radius: 2px;
}

/* Form Sections */
.form-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.form-section h4 {
  font-size: 15px; font-weight: 700; color: var(--dark);
  margin: 0 0 20px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label {
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.form-group input,
.form-group select,
.form-group textarea {
  height: 44px; padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px; color: var(--dark); background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none; font-family: inherit;
  width: 100%; box-sizing: border-box;
}
.form-group textarea {
  height: auto;
  padding: 10px 14px;
  resize: vertical;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11,93,59,0.1);
}
.form-group input[readonly] {
  background: #f4f7f6; color: var(--muted); cursor: not-allowed;
}
.form-actions {
  display: flex; gap: 12px; justify-content: flex-end;
  margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border);
}
.save-btn {
  min-width: 140px; height: 44px; border-radius: 10px;
  font-weight: 600; font-size: 14px; cursor: pointer;
  border: none; transition: all 0.2s; font-family: inherit;
}
.save-btn.primary { background: var(--primary); color: #fff; }
.save-btn.primary:hover { background: #0a5032; transform: translateY(-1px); }
.save-btn.primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.save-btn.outline {
  background: transparent; color: var(--muted);
  border: 1.5px solid var(--border);
}
.save-btn.outline:hover { border-color: var(--primary); color: var(--primary); }

/* Profile toast */
.profile-toast {
  position: fixed; bottom: 80px; right: 24px;
  padding: 12px 22px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  z-index: 9999; transform: translateY(20px); opacity: 0;
  transition: all 0.3s ease; max-width: calc(100vw - 48px);
}
.profile-toast.show { transform: translateY(0); opacity: 1; }
.profile-toast.success { background: #0B5D3B; }
.profile-toast.error { background: #c0392b; }

/* Profile responsive */
@media (max-width: 768px) {
  .profile-banner { height: 110px; }
  .avatar-upload-wrap { margin: -46px 0 0 24px; }
  .avatar-preview { width: 88px; height: 88px; font-size: 28px; }
  .profile-header-info { padding: 10px 24px 22px; }
  .form-section { padding: 22px 18px; }
}
@media (max-width: 576px) {
  .profile-banner { height: 95px; }
  .avatar-upload-wrap {
    display: flex; justify-content: center;
    margin: -44px 0 0 0;
  }
  .profile-edit-card { text-align: center; }
  .profile-header-info { padding: 10px 16px 20px; text-align: center; }
  .upload-progress { margin: 0 16px 12px; }
  .form-section { padding: 18px 14px; border-radius: 12px; }
  .form-section h4 { font-size: 14px; margin-bottom: 16px; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .form-group.full-width { grid-column: 1; }
  .form-group input, .form-group select, .form-group textarea { height: 48px; font-size: 15px; }
  .form-group textarea { height: auto; }
  .form-actions { flex-direction: column-reverse; gap: 10px; }
  .save-btn { width: 100%; min-width: unset; height: 48px; font-size: 15px; }
  .profile-toast { left: 14px; right: 14px; bottom: 88px; text-align: center; }
}
@media (max-width: 375px) {
  .avatar-preview { width: 78px; height: 78px; font-size: 24px; }
  .profile-banner { height: 82px; }
  .form-section { padding: 14px 12px; }
  .form-group input, .form-group select, .form-group textarea { height: 46px; }
  .form-group textarea { height: auto; }
}

@media (max-width: 480px) {
  .stats {
    grid-template-columns: 1fr; /* Stacks stats grid vertically on narrow screens */
  }
}

@media (max-height: 480px) and (orientation: landscape) {
  .bottom-nav {
    height: 54px; /* Shrinks the height of bottom nav in landscape mode to save screen estate */
  }
  .bottom-nav-item {
    padding: 4px 0;
    font-size: 10px;
  }
  .bottom-nav-item svg {
    width: 20px;
    height: 20px;
  }
}