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

:root {
  --bg: #f4f1ed;
  --surface: #ffffff;
  --ink: #1c1917;
  --muted: #6f6a64;
  --accent: #f97316;
  --accent-2: #7c3aed;
  --app-title-color: #380f96;
  --accent-3: #2563eb;
  --accent-4: #eab308;
  --line: #ece6e1;
  --shadow: 0 20px 50px rgba(17, 12, 5, 0.08);
  --radius: 22px;
  --card:white;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Override default link colors globally */
a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

a:hover {
  text-decoration: none;
}

a:visited {
  color: inherit;
}

a:active {
  color: inherit;
}

html {
    height: 100%;
    scroll-behavior: smooth;
    overflow-y: hidden;
    overflow-x: hidden;
}

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100%;
    zoom: 100% !important;
    overflow-x: hidden;
    background-color: #000000;
    scroll-behavior: smooth;
    overflow-y: hidden;
    font-family: "Poppins", "Trebuchet MS", sans-serif;
    color: var(--ink);
    background:
      radial-gradient(circle at top left, rgba(255, 120, 73, 0.18), transparent 45%),
      radial-gradient(circle at 80% 10%, rgba(124, 58, 237, 0.18), transparent 40%),
      var(--bg);
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
}


body::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar */
}

/* Hide scrollbar for Firefox */
body {
    scrollbar-width: none;
    /* Firefox */
    -moz-overflow-style: none;
    /* Older Firefox versions */
}

.no-scroll-bar::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar */
}

/* Hide scrollbar for Firefox */
.no-scroll-bar {
    scrollbar-width: none;
    /* Firefox */
    -moz-overflow-style: none;
    /* Older Firefox versions */
}

.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100%;
  padding: 20px;
  gap: 20px;
  scrollbar-width: none;
  /* Firefox */
  -moz-overflow-style: none;
  /* Older Firefox versions */
}

.app::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar */
}

.dw-content{
  left:300px;
  right: 0;
  overflow-y: auto;
  position: fixed;
  height: 100%;
  padding-top: 120px;
  padding-left: 40px;
  padding-right: 40px;
  padding-bottom: 120px;
  animation: fadeIn 0.3s ease;
  scrollbar-width: none;
  /* Firefox */
  -moz-overflow-style: none;
  /* Older Firefox versions */
}

#sidebar-placeholder {
  min-width: 280px;
  width: 280px;
}

.dw-content::-webkit-scrollbar {
  display: none;
}

.app-title{
  font-weight: 800 !important;
  font-style: normal;
  font-size: 22px !important;
  color: var(--app-title-color);
  margin-bottom: -5px;
  
}

.sidebar {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  position: sticky;
  height: calc(100vh - 40px);
  animation: slideIn 0.6s ease;
}

.brand {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.brand img {
  width: 46px;
  height: 46px;
}

.brand-text span {
  font-size: 1.1rem;
  display: block;
}

.brand-text small {
  color: var(--muted);
  font-size: 0.75rem;
}

.icon-btn {
  border: 1px solid var(--line);
  background: #faf7f5;
  border-radius: 12px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-weight: 700;
}

.icon-btn span {
  display: block;
  width: 14px;
  height: 2px;
  background: var(--ink);
  margin: 2px 0;
}

.nav {
  display: grid;
  gap: 6px;
  padding: 20px 0;
  flex: 0 0 auto;
}

.nav-item {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 14px;
  padding: 0 12px;
  height: 70px;
  font-size: 0.95rem;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  color: var(--ink);
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 600;
}

.nav-item:hover {
  background: rgb(255, 210, 165);
  transform: translateX(4px);
}

.nav-item .nav-icon {
  font-size: 1.35rem;
  transition: transform 0.3s ease;
}

.nav-item:hover .nav-icon {
  transform: scale(1.1);
}

.nav-item.active {
  background: rgb(255, 236, 218);
  font-weight: 600;
}

.nav-item.active:hover {
  transform: translateX(0);
}

.team-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff9f4;
  margin-bottom: 12px;
}

.team-badge {
  background: var(--accent);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.team-card small {
  color: var(--muted);
  display: block;
  font-size: 0.75rem;
}

.ghost-btn {
  border: 1px dashed var(--line);
  background: transparent;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

.main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.topbar {
  background: linear-gradient(135deg, #1c1917 0%, #292524 100%);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 16px;
  box-shadow: var(--shadow);
  position: sticky;
  z-index: 5;
}

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

.topbar-content {
  min-width: 0;
  flex: 1;
}

.topbar h1 {
  font-size: clamp(1.0rem, 3vw, 1.7rem);
  margin-bottom: 4px;
  line-height: 1.2;
  color: #ffffff;
}

.topbar p {
  color: #d6d3d1;
  font-size: 0.9rem;
  line-height: 1.4;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.orange-btn{
  color:white !important; 
  background: rgb(255,80,43) !important; 
  border:none !important;
}

@media (max-width: 980px) {
  .topbar {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    z-index: 100;
    grid-template-columns: 1fr;
    padding: 16px 18px;
    gap: 12px;
  }
  
  .topbar h1 {
    font-size: 1.3rem;
  }
  
  .topbar p {
    font-size: 0.85rem;
  }
  
  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  
  .topbar-actions .chip,
  .topbar-actions .outline-btn {
    font-size: 0.8rem;
    padding: 8px 10px;
  }
  
  .topbar-actions .profile {
    display: none;
  }
}

.chip {
  background: #f7f3f0;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.9rem;
}

.divider {
  width: 1px;
  height: 18px;
  background: var(--line);
}

.outline-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  transition: all 0.3s ease;
}

.back-btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateX(-2px);
}

.items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
}

.item-row {
  background: #fdfaf7;
  border: 1px solid var(--line);
  border-left: 3px solid transparent;
  border-radius: 12px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  transition: all 0.3s ease;
}

.item-row:hover {
  border-left-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(17, 12, 5, 0.06);
  transform: translateX(4px);
}

.item-serial {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
}

.item-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.item-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}

.item-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.item-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.item-badge {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #f0f0f0;
  color: var(--muted);
  white-space: nowrap;
}

.item-badge.primary {
  background: #fff3e6;
  color: var(--accent);
}

.item-badge.secondary {
  background: #f3e8ff;
  color: var(--accent-2);
}

.profile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f7f3f0;
  border-radius: 14px;
  padding: 8px 12px;
}

.profile img {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
}

.profile small {
  color: var(--muted);
  display: block;
  font-size: 0.75rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.stat-card-no-bg {
  background: none;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
}

.link-card {
  cursor: pointer;
  position: relative;
}

.link-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: var(--primary);
}

.link-card .icon-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.link-card:hover .icon-btn {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.stat-card h3 {
  font-size: 1.6rem;
}

.stat-card p {
  color: var(--muted);
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.1rem;
}

.stat-icon.orange {
  background: var(--accent);
}

.stat-icon.red {
  background: #ef4444;
}

.stat-icon.purple {
  background: var(--accent-2);
}

.stat-icon.blue {
  background: var(--accent-3);
}

.stat-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.stat-meta.up::before {
  content: "↑ ";
  color: #16a34a;
  font-weight: 700;
}

.stat-meta.steady::before {
  content: "✓ ";
  color: #16a34a;
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  gap: 12px;
}

.link-card {
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.link-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 60px rgba(17, 12, 5, 0.12);
}

.card header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card h2 {
  font-size: 1.3rem;
}

.card:has(table) {
  gap: 12px;
}

.link-card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.link-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.link-card:hover::before {
  transform: translateX(0);
}

.link-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 60px rgba(17, 12, 5, 0.12);
  border-color: var(--accent);
}

.link-card header {
  margin-bottom: 8px;
}

.link-card .icon-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  border: none;
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.link-card:hover .icon-btn {
  transform: translateX(4px);
}

.link-card .helper {
  margin-top: 8px;
  line-height: 1.5;
}

.donut {
  width: 180px;
  height: 180px;
  margin: 0 auto;
  border-radius: 50%;
  background: conic-gradient(
    var(--accent-2) 0% 50%,
    var(--accent) 50% 80%,
    var(--accent-4) 80% 100%
  );
  display: grid;
  place-items: center;
  position: relative;
  transition: background 0.8s ease-in-out;
}

.donut.animated {
  animation: donutReveal 1.5s ease-out forwards;
  clip-path: circle(0% at 50% 50%);
}

@keyframes donutReveal {
  0% {
    clip-path: circle(0% at 50% 50%);
    opacity: 0;
  }
  100% {
    clip-path: circle(100% at 50% 50%);
    opacity: 1;
  }
}

.donut::before {
  content: "";
  width: 130px;
  height: 130px;
  background: var(--surface);
  border-radius: 50%;
  position: absolute;
}

.donut-center {
  position: relative;
  text-align: center;
}

.donut-center strong {
  display: block;
  font-size: 1.6rem;
}

.donut-center span {
  color: var(--muted);
  font-size: 0.8rem;
}

.legend {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.legend-item {
  font-size: 0.85rem;
  color: var(--muted);
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

.dot.purple {
  background: var(--accent-2);
}

.dot.orange {
  background: var(--accent);
}

.dot.yellow {
  background: var(--accent-4);
}

.bar-chart {
  height: 160px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 12px;
}

.bar {
  height: var(--h);
  background: linear-gradient(180deg, #8b5cf6, #f97316);
  border-radius: 12px 12px 6px 6px;
}

.bar-labels {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  font-size: 0.8rem;
  color: var(--muted);
}

.income {
  display: grid;
  gap: 14px;
}

.income svg {
  width: 100%;
  height: 180px;
}

.income-badge {
  background: #ff4d1f;
  color: #fff;
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  width: fit-content;
}

.bottom {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.session-form {
  display: grid;
  gap: 14px;
}

.session-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

.session-form input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fdfaf7;
  font-family: inherit;
}

.session-form select {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fdfaf7;
  font-family: inherit;
}

.session-form textarea {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fdfaf7;
  font-family: inherit;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.helper {
  font-size: 0.85rem;
  color: var(--muted);
}

.helper.success {
  color: #15803d;
  font-weight: 600;
}

thead th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  padding-bottom: 10px;
}

tbody td {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.pill.pending {
  background: #fff3dc;
  color: #b45309;
}

.pill.approved {
  background: #dcfce7;
  color: #15803d;
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .topbar-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile {
    width: 100%;
    justify-content: space-between;
  }
}

.mobile-nav {
  display: none;
}

@media (max-width: 980px) {
  .app {
    padding-bottom: 90px;
  }

  .dw-content,
  .sidebar-collapsed .dw-content {
    left: 0 !important;
    right: 0;
    width: 100vw;
    overflow-y: auto;
    position: fixed;
    height: 100%;
    margin-top: 20px;
    padding-top: 130px;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 140px;
  }

  #logoutBtn{
    align-self: end;
  }

  .mobile-nav {
    /* Fixed positioning - stays at bottom */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 999;
    
    /* Styling */
    background-color: var(--bg);
    padding: 10px 16px 14px;
    box-shadow: var(--shadow);
    
    /* Display and sizing */
    display: block;
    height: auto;
    max-height: 80px;
    
    /* Prevent any scrolling on the container itself */
    overflow: hidden;
    overscroll-behavior: none;
    
    /* Hardware acceleration for smooth rendering */
    transform: translateZ(0);
    will-change: transform;
    
    /* Touch behavior - only allow horizontal pan on children */
    touch-action: pan-x;
  }

  .mobile-nav-scroll {
    /* Layout */
    display: flex;
    gap: 8px;
    
    /* Horizontal scroll only */
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: none;
    
    /* Smooth scrolling */
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    
    /* Hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
    
    /* Touch behavior */
    touch-action: pan-x;
  }

  .mobile-nav-scroll::-webkit-scrollbar {
    display: none;
    height: 0;
    width: 0;
  }

  .mobile-item {
    /* Sizing */
    min-width: 64px;
    height: 56px;
    flex: 1 0 auto;
    
    /* Styling */
    border-radius: 16px;
    border: 1px solid transparent;
    background: transparent;
    
    /* Layout */
    display: grid;
    place-items: center;
    
    /* Typography */
    font-size: 1.4rem;
    text-decoration: none;
    color: inherit;
    
    /* Behavior */
    cursor: pointer;
    scroll-snap-align: start;
    
    /* Prevent text selection on touch */
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-item.active {
    border-color: var(--line);
    background: #fff3e6;
  }
}

@keyframes slideIn {
  from {
    transform: translateX(-10px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes lift {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.sidebar-collapsed .sidebar {
  width: 80px;
  padding: 24px 12px;
}

.sidebar-collapsed .brand {
  justify-content: center;
  grid-template-columns: 1fr;
  place-items: center;
}

.sidebar-collapsed .brand img {
  margin: 0 auto;
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .team-card,
.sidebar-collapsed .ghost-btn,
.sidebar-collapsed .sidebar-footer {
  display: none;
}

.sidebar-collapsed .app {
  grid-template-columns: 80px 1fr;
}

.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 0;
  font-size: 0;
  gap: 0;
}

.sidebar-collapsed .nav-item .nav-icon {
  font-size: 1.4rem;
}

.sidebar-collapsed .sidebar {
  position: sticky;
}

.sidebar-collapsed #sidebarToggle {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}

.sidebar-collapsed .dw-content {
  left: 100px;
}

/* Action Buttons */
.item-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fdfaf7;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(17, 12, 5, 0.1);
}

.action-btn.edit-btn {
  color: var(--ink);
}

.action-btn.edit-btn:hover {
  background: var(--accent-3);
  color: white;
  border-color: var(--accent-3);
}

.action-btn.delete-btn {
  color: #ef4444;
}

.action-btn.delete-btn:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
  scrollbar-width: none;
  /* Firefox */
  -moz-overflow-style: none;
  /* Older Firefox versions */
}

.modal::-webkit-scrollbar {
  display: none;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(17, 12, 5, 0.2);
  animation: slideUp 0.3s ease;
  scrollbar-width: none;
  /* Firefox */
  -moz-overflow-style: none;
  /* Older Firefox versions */
}

.modal-content::-webkit-scrollbar {
  display: none;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  font-size: 1.4rem;
  margin: 0;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fdfaf7;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--muted);
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Camera Modal Styles */
.camera-modal {
  max-width: 700px;
  background: #f4f1ed;
}

.d-none {
  display: none !important;
}

.camera-header {
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  margin: -24px -24px 0 -24px;
  padding: 20px 24px;
}

.camera-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.4rem;
  margin: 0;
}

.camera-title i {
  font-size: 1.3rem;
}

.camera-container {
  margin-top: 20px;
}

.camera-feed {
  position: relative;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
}

/* Mobile Responsive Camera */
@media (max-width: 768px) {
  .camera-modal {
    width: 95%;
    max-width: 95%;
    max-height: 95vh;
    padding: 16px;
  }
  
  .camera-header {
    margin: -16px -16px 0 -16px;
    padding: 16px;
    border-radius: 12px 12px 0 0;
  }
  
  .camera-title {
    font-size: 1.1rem;
    gap: 8px;
  }
  
  .camera-title i {
    font-size: 1rem;
  }
  
  .camera-title span {
    display: inline;
  }
  
  .camera-container {
    margin-top: 12px;
  }
  
  .camera-feed {
    border-radius: 12px;
  }
  
  #fullCanvas {
    border-radius: 12px !important;
  }
  
  /* Status indicators responsive */
  #cam-status,
  #process-status {
    padding: 6px 10px !important;
    font-size: 0.75rem !important;
  }
  
  /* Countdown responsive */
  #counter {
    font-size: 80px !important;
  }
  
  /* Photo grid - 2 columns on mobile */
  #profileContainer > div {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  
  #profileContainer p {
    font-size: 0.85rem;
    margin-bottom: 8px;
  }
  
  /* Control buttons responsive */
  #controlContainer {
    margin-top: 12px !important;
    flex-direction: row !important;
    gap: 8px !important;
  }
  
  #controlContainer button {
    flex: 1;
    padding: 10px 12px !important;
    font-size: 0.85rem !important;
  }
  
  #controlContainer button i {
    margin-right: 6px !important;
  }
}

@media (max-width: 480px) {
  .camera-modal {
    width: 98%;
    max-width: 98%;
    padding: 12px;
  }
  
  .camera-header {
    margin: -12px -12px 0 -12px;
    padding: 12px;
  }
  
  .camera-title {
    font-size: 1rem;
  }
  
  .camera-title span {
    font-size: 0.9rem;
  }
  
  /* Very small screens - single column grid */
  #profileContainer > div {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  
  #counter {
    font-size: 60px !important;
  }
  
  #cam-status,
  #process-status {
    padding: 4px 8px !important;
    font-size: 0.7rem !important;
  }
}

/* Gate pass item styles */
.gatepass-item {
  background: white;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
  display: grid;
  grid-template-columns: 140px 1fr 380px 140px;
  gap: 14px;
  align-items: start;
}

.gatepass-photo {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gatepass-students {
  width: 380px;
}

/* Mobile-friendly Gate Pass List */
@media (max-width: 980px) {
  /* Ensure main container has proper background */
  .dw-content {
    background: transparent !important;
  }
  
  /* Gate pass items - stack vertically on mobile */
  .gatepass-item {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    gap: 16px !important;
  }
  
  .gatepass-photo {
    width: 100% !important;
    align-items: center !important;
  }
  
  .gatepass-photo > div:first-child {
    width: 180px !important;
    height: 220px !important;
  }
  
  .gatepass-photo > a {
    width: 100% !important;
    max-width: 180px !important;
  }
  
  .gatepass-students {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Date group containers - no background */
  #gatePassList > div {
    background: transparent !important;
    padding: 0 !important;
    margin-bottom: 16px !important;
  }
  
  /* Individual gate pass items - white background cards */
  .gatepass-item {
    background: white !important;
    padding: 16px !important;
    margin-bottom: 12px !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    grid-template-columns: none !important;
    border: 1px solid #e5e5e5 !important;
  }
  
  /* Bearer photo section - center it */
  .gatepass-item > div:first-child {
    width: 100% !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
    margin-top: 20px !important;
  }
  
  .gatepass-item > div:first-child > div:first-child {
    width: 180px !important;
    height: 220px !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: #f5f5f5 !important;
  }
  
  .gatepass-item > div:first-child > div:first-child img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
  
  /* View QR button - full width on mobile */
  .gatepass-item > div:first-child > a {
    width: 100% !important;
    max-width: 180px !important;
  }
  
  /* Main content section - full width */
  .gatepass-item > div:nth-child(2) {
    width: 100% !important;
    min-width: 100% !important;
  }
  
  /* Gate Pass ID and Bearer Name grid - stack on mobile */
  .gatepass-item > div:nth-child(2) > div:first-child {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  
  /* Reason box */
  .gatepass-item > div:nth-child(2) > div:last-child {
    margin-top: 12px !important;
  }
  
  /* Student information section - full width */
  .gatepass-item > div:nth-child(3) {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }
  
  /* Student section header */
  .gatepass-item > div:nth-child(3) > div:first-child {
    margin-bottom: 10px !important;
  }
  
  .gatepass-item > div:nth-child(3) h3 {
    font-size: 0.9rem !important;
  }
  
  /* Student cards container - adjust height */
  .gatepass-item > div:nth-child(3) > div:last-child {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
  
  /* Individual student cards - make them more compact */
  .gatepass-item > div:nth-child(3) > div:last-child > div {
    padding: 10px 12px !important;
    gap: 10px !important;
    margin-bottom: 8px !important;
    font-size: 0.85rem !important;
  }
  
  /* Student card images */
  .gatepass-item > div:nth-child(3) > div:last-child > div img {
    width: 36px !important;
    height: 36px !important;
  }
  
  /* Student card text */
  .gatepass-item > div:nth-child(3) > div:last-child > div > div {
    font-size: 0.8rem !important;
  }
  
  /* Bearer history button in student card */
  .gatepass-item > div:nth-child(3) > div:last-child > div button {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    padding: 0 !important;
    flex: 0 0 36px !important;
    aspect-ratio: 1/1 !important;
  }
  
  /* Actions section - full width, stack buttons */
  .gatepass-item > div:nth-child(4) {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }
  
  /* Action buttons - full width on mobile */
  .gatepass-item > div:nth-child(4) button {
    width: 100% !important;
    min-width: 100% !important;
    font-size: 0.85rem !important;
    padding: 10px 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  /* Status badges in actions - full width */
  .gatepass-item > div:nth-child(4) > div[style*="background"] {
    width: 100% !important;
  }
  
  /* Filter chips container - horizontal scroll */
  div[style*="display: flex"][style*="gap: 12px"]:has(button[data-status]) {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-bottom: 4px !important;
  }
  
  div[style*="display: flex"][style*="gap: 12px"]:has(button[data-status])::-webkit-scrollbar {
    display: none !important;
  }
  
  /* Filter chips */
  [data-status] {
    font-size: 0.85rem !important;
    padding: 8px 12px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
  
  /* Pagination - better mobile layout */
  #pagination {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: center !important;
    background: white !important;
  }
  
  #pagination > div:first-child {
    text-align: center !important;
    font-size: 0.85rem !important;
  }
  
  #pagination > div:last-child {
    display: flex !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
  }
  
  #pagination button {
    font-size: 0.85rem !important;
    padding: 8px 14px !important;
  }
}

/* Extra small screens - further optimize */
@media (max-width: 640px) {
  /* Individual gate pass cards - smaller spacing */
  .gatepass-item {
    padding: 14px !important;
    gap: 14px !important;
  }
  
  /* Smaller bearer photo */
  .gatepass-item > div:first-child > div:first-child {
    width: 150px !important;
    height: 180px !important;
  }
  
  .gatepass-item > div:first-child > a {
    max-width: 150px !important;
    font-size: 0.75rem !important;
    padding: 8px !important;
  }
  
  /* Gate Pass ID and Bearer labels */
  .gatepass-item > div:nth-child(2) > div:first-child > div > div:first-child {
    font-size: 0.65rem !important;
  }
  
  /* Gate Pass values */
  .gatepass-item > div:nth-child(2) > div:first-child > div > div:last-child {
    font-size: 0.95rem !important;
  }
  
  /* Reason box text */
  .gatepass-item > div:nth-child(2) > div:last-child > div:first-child {
    font-size: 0.65rem !important;
  }
  
  .gatepass-item > div:nth-child(2) > div:last-child > div:last-child {
    font-size: 0.8rem !important;
  }
  
  /* Student section header */
  .gatepass-item > div:nth-child(3) h3 {
    font-size: 0.85rem !important;
  }
  
  /* Student cards - smaller */
  .gatepass-item > div:nth-child(3) > div:last-child > div {
    padding: 8px 10px !important;
  }
  
  /* Action buttons text */
  .gatepass-item > div:nth-child(4) button {
    font-size: 0.8rem !important;
    padding: 10px !important;
  }
  
  .gatepass-item > div:nth-child(4) button i {
    margin-right: 6px !important;
  }
}

/* Mobile-friendly Create Gate Pass Page */
@media (max-width: 980px) {
  /* Bearer Information Section - stack photo and form */
  .card div[style*="grid-template-columns: 200px 1fr"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
  }
  
  /* Bearer photo container */
  .card div[style*="grid-template-columns: 200px 1fr"] > div:first-child {
    width: 100% !important;
  }
  
  .card div[style*="grid-template-columns: 200px 1fr"] > div:first-child > div {
    max-width: 280px !important;
    margin: 0 auto !important;
  }
  
  /* Form fields section */
  .card div[style*="grid-template-columns: 200px 1fr"] > .session-form {
    width: 100% !important;
  }
  
  /* Student information cards - make them single column on mobile */
  #selectedStudentsList > div {
    padding: 16px !important;
  }
  
  #selectedStudentsList > div > div:first-child {
    flex-direction: column !important;
    gap: 16px !important;
  }
  
  /* Student photo */
  #selectedStudentsList img[style*="width: 80px"] {
    width: 100% !important;
    max-width: 200px !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    margin: 0 auto !important;
  }
  
  /* Student details grid */
  #selectedStudentsList > div > div:first-child > div:nth-child(2) {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  
  /* Phone numbers section */
  #selectedStudentsList > div > div:first-child > div:nth-child(3) {
    min-width: 100% !important;
  }
  
  /* Remove button */
  #selectedStudentsList .student-remove-btn {
    width: 100% !important;
  }
  
  /* Relationship selector row */
  #selectedStudentsList > div > div:last-child {
    flex-direction: column !important;
    gap: 12px !important;
  }
  
  #selectedStudentsList > div > div:last-child > div:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  
  #selectedStudentsList select.relationship-select {
    width: 100% !important;
    min-width: 100% !important;
  }
  
  #selectedStudentsList .add-siblings-btn,
  #selectedStudentsList .orange-btn {
    width: 100% !important;
  }
  
  /* Identity verification checkboxes */
  .card div[style*="flex-direction: column"] label[style*="display: flex"] {
    padding: 12px !important;
  }
  
  .card div[style*="flex-direction: column"] label[style*="display: flex"] input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
  }
  
  /* Submit buttons section */
  #createGatePassForm > div[style*="justify-content: flex-end"] {
    flex-direction: column !important;
    gap: 10px !important;
  }
  
  #createGatePassForm > div[style*="justify-content: flex-end"] button {
    width: 100% !important;
    min-width: 100% !important;
  }
  
  /* Photo preview */
  #photoPreview > div {
    flex-direction: column !important;
  }
  
  #photoPreview img {
    max-width: 100% !important;
  }
  
  /* Search modal - make it fullscreen on mobile */
  #studentSearchModal .modal-content {
    width: 95% !important;
    max-width: 95% !important;
    max-height: 90vh !important;
    padding: 16px !important;
  }
  
  /* Search filters - stack them */
  #studentSearchModal > div > div > div[style*="display: flex"][style*="gap: 12px"] {
    flex-direction: column !important;
  }
  
  #studentSearchModal input {
    width: 100% !important;
    min-width: 100% !important;
  }
  
  /* Search results - make cards stack properly */
  .item-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 12px !important;
  }
  
  .item-row > div:first-child {
    width: 100% !important;
    height: auto !important;
    max-width: 150px !important;
    margin: 0 auto !important;
  }
  
  .item-row .item-content {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  
  .item-row .item-actions {
    width: 100% !important;
    justify-content: stretch !important;
  }
  
  .item-row .item-actions button {
    flex: 1 !important;
  }
}

@media (max-width: 640px) {
  /* Even smaller adjustments */
  .card {
    padding: 16px !important;
  }
  
  .card header h2 {
    font-size: 1.1rem !important;
  }
  
  /* Student card text size */
  #selectedStudentsList small {
    font-size: 0.7rem !important;
  }
  
  #selectedStudentsList p {
    font-size: 0.9rem !important;
  }
  
  /* Search button */
  #executeSearchBtn,
  #clearSearchBtn {
    font-size: 0.85rem !important;
    padding: 10px 14px !important;
  }
  
  /* Topbar actions for create page */
  .topbar-actions .outline-btn {
    width: 100%;
  }
}
