/* ==========================================================================
   Society Dekho - Native Responsive Layout & Navigation System
   Seamlessly adapts from desktop dashboard to native mobile screen dimensions
   Strictly NO emojis - Clean SVG Icons only
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
}

/* App Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Mobile Backdrop Drawer */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 95;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
}

/* Sidebar Navigation (Hidden for Clean Header-Driven Layout) */
.app-sidebar {
  display: none !important;
}

/* Main Content Area (Full Width Layout matching Reference Screenshot) */
.app-main {
  flex: 1;
  margin-left: 0;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-app);
}

/* Top Navigation Bar (Matches Reference Image Exactly) */
.app-topbar {
  height: var(--header-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
}

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

.topbar-brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.topbar-logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
  background: #2563eb;
}

.topbar-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topbar-brand-text {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
}

/* Center Capsule Pill Navigation (Matching Reference Image) */
.topbar-pill-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  border-radius: 30px;
  padding: 4px;
  border: 1px solid #e2e8f0;
}

.topbar-pill-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 24px;
  font-size: 13.5px;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  transition: all 0.2s ease;
}

.topbar-pill-tab:hover {
  color: var(--primary);
}

.topbar-pill-tab.active {
  background: #ffffff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.topbar-pill-tab.active svg {
  stroke: var(--primary);
}

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

/* Circular Icon Button System */
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #334155;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  flex-shrink: 0;
  padding: 0;
  outline: none;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.icon-button:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.icon-button:active {
  transform: translateY(0);
}

.notif-circle-btn {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #334155;
}

.notif-circle-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: var(--primary);
}

.bell-count-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #dc2626;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 5px rgba(220, 38, 38, 0.35);
}

/* ==========================================================================
   NOTIFICATION TRAY / DROPDOWN STYLES
   ========================================================================== */
.notif-bell-container {
  position: relative;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px -4px rgba(15, 23, 42, 0.16), 0 4px 10px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  display: none;
  overflow: hidden;
  animation: notifDropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.notif-dropdown.show {
  display: block;
}

@keyframes notifDropdownFade {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.notif-header {
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-header-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.notif-list {
  max-height: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  transition: var(--transition-smooth);
  cursor: pointer;
}

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

.notif-item:hover {
  background: #f8fafc;
}

.notif-item.unread {
  background: #eff6ff;
}

.notif-item.unread:hover {
  background: #e0f2fe;
}

.notif-item-left {
  flex: 1;
  min-width: 0;
}

.notif-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 2px;
}

.notif-item-msg {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 4px;
}

.notif-item-time {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--primary);
}

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 4px;
}

/* ==========================================================================
   RESIDENT GREETING BAR & PROFILE HEADER
   ========================================================================== */
.resident-greeting-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 12px 18px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.resident-greeting-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.resident-greeting-bar .user-avatar-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: var(--primary);
  font-weight: 800;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
  flex-shrink: 0;
}

.resident-greeting-time {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
  line-height: 1.2;
}

.resident-greeting-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.resident-greeting-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.resident-greeting-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-quick-btn {
  color: #64748b;
  text-decoration: none;
  background: #f8fafc;
  border-color: #e2e8f0;
}

.settings-quick-btn:hover {
  color: var(--primary);
  background: #eff6ff;
  border-color: #bfdbfe;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.15);
}

.user-info-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.user-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.user-role-tag {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* Page Content Container (Centered Full Width) */
.app-content {
  padding: 28px 24px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Mobile Floating Blue Capsule Bottom Navigation (Matching Image 3) */
.mobile-bottom-nav {
  display: none;
}

/* ==========================================================================
   NATIVE MOBILE SCREEN RESPONSIVENESS (<= 768px Screen Dimensions)
   ========================================================================== */

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 220px;
  }
  .app-topbar {
    padding: 0 18px;
  }
  .app-content {
    padding: 18px;
  }
  .topbar-pill-tab span {
    display: none;
  }
  .topbar-pill-tab {
    padding: 6px 10px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }

  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    background-color: #f8fafc;
    -webkit-overflow-scrolling: touch;
  }

  /* Main layout is full width header-driven */
  .app-sidebar {
    display: none !important;
  }

  .app-main {
    margin-left: 0;
    background-color: #f8fafc;
    min-height: calc(100vh - 76px);
  }

  .mobile-menu-btn {
    display: flex;
  }

  .mobile-header-brand {
    display: flex;
  }

  .page-breadcrumb {
    display: none;
  }

  .topbar-pill-nav {
    display: none;
  }

  /* Floating Blue Capsule Bottom Navigation (Matching Image 3) */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 12px;
    left: 14px;
    right: 14px;
    height: 54px;
    background: #1d4ed8;
    border-radius: 36px;
    z-index: 1000;
    align-items: center;
    justify-content: space-around;
    padding: 4px 6px;
    box-shadow: 0 10px 25px rgba(29, 78, 216, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
  }

  .mobile-nav-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 20px;
    transition: all 0.2s ease;
  }

  .mobile-nav-tab svg {
    stroke: currentColor;
    width: 19px;
    height: 19px;
  }

  .mobile-nav-tab span {
    display: none;
  }

  .mobile-nav-tab.active {
    background: #2563eb;
    color: #ffffff;
    font-weight: 700;
    border-radius: 24px;
    padding: 7px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  .mobile-nav-tab.active span {
    display: inline;
    font-size: 12.5px;
    font-weight: 700;
  }

  .user-info-text {
    display: none;
  }

  .app-topbar {
    padding: 0 12px;
    height: 56px;
  }

  .app-content {
    padding: 14px 12px 24px;
    max-width: 100%;
  }

  .role-select-pill {
    max-width: 140px;
    font-size: 11px;
    padding: 4px 8px;
    font-weight: 700;
  }

  .topbar-left {
    gap: 8px;
  }

  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
  }

  .modal-dialog {
    max-height: 85vh;
    border-radius: var(--radius-md);
  }
}


