/* ═══════════════════════════════════════════════════════════
   INTRANET STYLING — Digital Kiosk
   Reuses NEST Nexus Design System 3.0
═══════════════════════════════════════════════════════════ */

.intranet-body {
  background: #f5f7fa;
  padding: 0;
  margin: 0;
  height: 100vh;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════
   INTRANET HEADER
═══════════════════════════════════════════════════════════ */
.intranet-header {
  background: linear-gradient(135deg, var(--navy) 0%, #1a3a5c 100%);
  color: #fff;
  padding: 0;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(14,40,65,0.15);
  border-bottom: 3px solid var(--teal);
  flex-shrink: 0;
}

.intranet-header-container {
  width: 100%;
  margin: 0;
  padding: 1.5rem 2rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2rem;
  position: relative;
}

.intranet-header-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
}

.intranet-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.intranet-logo {
  display: none;
}

.intranet-header-title h1 {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
  letter-spacing: 0.05em;
}

.intranet-header-title p {
  display: none;
}

.intranet-user-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-left: 2rem;
  border-left: 1px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  text-align: right;
}

.user-greeting {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.user-details {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
}

.user-role {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.7);
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.btn-sign-out {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
  text-decoration: none;
}

.btn-sign-out:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
  transform: scale(1.05);
}

/* ═══════════════════════════════════════════════════════════
   INTRANET LAYOUT (Sidebar + Main)
═══════════════════════════════════════════════════════════ */
.intranet-container {
  display: flex;
  gap: 0;
  height: 100vh;
  width: 100%;
  margin: 0;
}

.intranet-right-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  margin-bottom: 3.5rem;
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════════ */
.intranet-sidebar {
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 0;
  overflow-y: auto;
  height: 100vh;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--teal) transparent;
  display: flex;
  flex-direction: column;
  margin: 0;
  width: 280px;
  flex-shrink: 0;
}

.intranet-sidebar::-webkit-scrollbar {
  width: 6px;
}

.intranet-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.intranet-sidebar::-webkit-scrollbar-thumb {
  background: var(--teal);
  border-radius: 3px;
}

/* Sidebar Header */
.sidebar-header {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(32,120,136,0.05) 0%, transparent 100%);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.sidebar-logo {
  height: 40px;
  width: auto;
}

.sidebar-logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.sidebar-logo-link:hover {
  transform: scale(1.05);
  text-decoration: none;
}

.brand-name {
  display: none;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar-sidebar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.user-info-sidebar {
  flex: 1;
}

.user-info-sidebar h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  line-height: 1.2;
}

.user-info-sidebar p {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0.2rem 0 0;
}

/* Sidebar Navigation */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

.nav-section {
  padding: 0;
  border-bottom: 1px solid var(--border);
}

.nav-section:last-of-type {
  border-bottom: none;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0;
  padding: 1.2rem 1.5rem 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  transition: all 0.2s ease;
}

.nav-section-title:hover {
  color: var(--navy);
}

.nav-section-title i {
  font-size: 0.6rem;
  transition: transform 0.3s ease;
  color: var(--teal);
}

.nav-section-title.collapsed i {
  transform: rotate(-90deg);
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 0.5rem 1rem 0;
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.nav-list.collapsed {
  max-height: 0;
  padding: 0;
  overflow: hidden;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 1rem;
  color: var(--muted);
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  margin: 0 0.5rem;
}

.nav-link i {
  width: 20px;
  text-align: center;
  color: var(--teal);
  flex-shrink: 0;
  font-size: 0.95rem;
}

.nav-link:hover {
  background: var(--off);
  color: var(--navy);
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(32,120,136,0.15) 0%, rgba(32,120,136,0.08) 100%);
  color: var(--navy);
  font-weight: 600;
}

.nav-link.active i {
  color: var(--teal);
}

/* External link indicator (e.g. Apps Portal) */
.nav-link .nav-external {
  margin-left: auto;
  font-size: 0.65rem !important;
  color: var(--muted) !important;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.nav-link:hover .nav-external {
  color: var(--teal) !important;
  opacity: 1;
  transform: translate(2px, -2px);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
  margin-bottom: 2.5rem;
}

.btn-sign-out-sidebar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  background: var(--off);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-sign-out-sidebar:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* ═══════════════════════════════════════════════════════════
   MAIN CONTENT AREA
═══════════════════════════════════════════════════════════ */
.intranet-main {
  padding: 2.5rem;
  background: #f5f7fa;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--teal) transparent;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Welcome Section */
.welcome-section {
  margin-bottom: 2rem;
}

.welcome-card {
  background: linear-gradient(135deg, var(--navy) 0%, #1a3a5c 100%);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  color: #fff;
  box-shadow: 0 4px 16px rgba(14,40,65,0.12);
  position: relative;
  overflow: hidden;
}

.welcome-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(32,120,136,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.welcome-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  position: relative;
  z-index: 2;
}

.welcome-greeting {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.7);
}

.welcome-date {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.7);
}

.welcome-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin: 0.25rem 0 0.15rem;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 2;
}

.welcome-subtitle {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  margin: 0;
  position: relative;
  z-index: 2;
}

.section-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

/* Celebrations Section */
.celebrations-section {
  margin-top: auto;
  margin-bottom: 2.5rem;
}

.celebrations-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.celebration-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  box-shadow: 0 2px 12px rgba(14,40,65,0.07);
}

.celebration-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.8rem;
}

.celebration-header i {
  font-size: 1.4rem;
  color: var(--teal);
}

.celebration-header h3 {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0;
}

.celebration-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
}

.celebration-item:last-child {
  border-bottom: none;
}

.celebration-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
}

.celebration-date {
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--off);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
}

.celebration-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.no-items {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
  padding: 0.8rem 0;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════
   INTRANET FOOTER
═══════════════════════════════════════════════════════════ */
.intranet-footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 0.35rem 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  flex-shrink: 0;
}

.intranet-footer p {
  margin: 0;
  line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════════
   HAMBURGER BUTTON (mobile only)
═══════════════════════════════════════════════════════════ */
.hamburger-btn {
  display: none;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  padding: 9px 8px;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 101;
}

.hamburger-btn span {
  display: block;
  height: 2.5px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.hamburger-btn.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}
.hamburger-btn.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR OVERLAY (mobile only)
═══════════════════════════════════════════════════════════ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(14, 40, 65, 0.6);
  backdrop-filter: blur(2px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
═══════════════════════════════════════════════════════════ */

/* ─── Tablet landscape & smaller laptops ─── */
@media (max-width: 1200px) {
  .intranet-sidebar { width: 240px; }
  .intranet-main { padding: 2rem; }
}

/* ─── Tablet portrait ─── */
@media (max-width: 992px) {
  .intranet-sidebar { width: 220px; }
  .celebrations-grid { grid-template-columns: 1fr; }
  .welcome-title { font-size: 1.4rem; }
  .intranet-header-title h1 { font-size: 1.1rem; }
}

/* ─── Mobile (the big breakpoint) ─── */
@media (max-width: 768px) {
  .intranet-body { overflow: auto; }

  .intranet-container {
    display: block;
    height: auto;
    min-height: 100vh;
  }

  /* Sidebar becomes off-canvas drawer */
  .intranet-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80vw;
    max-width: 320px;
    height: 100vh;
    z-index: 999;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  }
  .intranet-sidebar.active { left: 0; }

  /* Show hamburger */
  .hamburger-btn {
    display: flex;
  }

  /* Header centers nicely */
  .intranet-right-section {
    margin-bottom: 2.4rem;
  }
  .intranet-header-container {
    grid-template-columns: 1fr;
    padding: 1rem 1rem 1rem 4rem; /* leave room for hamburger */
  }
  .intranet-header-title h1 {
    font-size: 1.05rem;
    text-align: center;
  }

  /* Compact user menu — hide details on mobile */
  .intranet-user-menu {
    padding-left: 0;
    border-left: none;
    gap: 0.5rem;
    justify-self: end;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
  }
  .intranet-user-menu .user-info { display: none; }
  .user-avatar { width: 36px; height: 36px; font-size: 0.8rem; }
  .btn-sign-out { width: 34px; height: 34px; font-size: 0.85rem; }

  /* Main area */
  .intranet-main {
    padding: 1rem;
  }

  /* Welcome card */
  .welcome-card { padding: 1.2rem 1rem; }
  .welcome-title { font-size: 1.3rem; }
  .welcome-subtitle { font-size: 0.85rem; }
  .welcome-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
  }
  .welcome-greeting, .welcome-date { font-size: 0.65rem; }

  /* Sidebar footer doesn't need fixed positioning on mobile */
  .sidebar-footer {
    margin-bottom: 0;
    padding-bottom: 2.5rem;
  }

  /* Footer fixed-bottom but smaller */
  .intranet-footer {
    font-size: 0.55rem;
    padding: 0.35rem 0.75rem;
    line-height: 1.2;
  }
}

/* ─── Small mobile ─── */
@media (max-width: 480px) {
  .intranet-header-title h1 { font-size: 0.95rem; letter-spacing: 0.03em; }
  .welcome-title { font-size: 1.15rem; }
  .welcome-card { padding: 1rem; }
  .celebration-card { padding: 1rem; }

  .intranet-main { padding: 0.75rem; }
  .intranet-sidebar { width: 85vw; }
}
