/* --- Desktop: keep your 2-column layout (already used inline),
   these rules ensure consistent height/scrolling and thumb sizing --- */


.assign-assets-right {
  max-height: 420px;
  overflow: auto;
  padding-left: 8px;
  position: relative;
}

/* sticky title + buttons wrapper */
.assign-assets-header {
  position: sticky;
  top: 0; /* stays at top of asset scroll area */
  background: #fff; /* ensure no overlap transparency */
  padding: 6px 0;
  z-index: 5;
  border-bottom: 1px solid #eef2f6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* title on the left */
.assign-assets-title {
  font-weight: 600;
  font-size: 14px;
  color: #0f172a;
}

/* buttons on the right */
.assign-assets-actions {
  display: flex;
  gap: 6px;
}
.assign-assets-actions .btn {
  font-size: 13px;
  padding: 6px 2px;
  border-radius: 6px;
}


.assign-assets-right .btn {
  font-size: 13px;
  padding: 6px 12px;   /* tighter spacing */
  border-radius: 6px;
}


/* image thumbnail */
.assign-asset-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #eef2f6;
  background: #fff;
}

/* uniform attachment icon box */
.assign-asset-attachment-thumb {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid #eef2f6;
  background: #fff;
  color: #2563eb;
  font-size: 22px;
}



/* controls align right */
.assign-asset-controls { justify-self: end; }


.assign-modal-left {
  display:flex;
  flex-direction:column;
  gap:5px;
  height:600px;            /* keep same height on desktop */
  overflow:hidden;
  border-right:1px solid #eef2f6;
}
.assign-list-scroll {
  overflow:auto;
  padding:6px;
  flex:1;
}

/* Right side */
.assign-assets-right {
  max-height:420px;
  overflow:auto;
  padding-left:8px;
}

/* ensure thumbnails visible on small screens */
.assign-asset-thumb, .assign-asset-thumb--icon {
  width:72px;
  height:72px;
  object-fit:cover;
  border-radius:8px;
  border:1px solid #e6eef8;
  background:#fff;
}

/* --- MOBILE: switch to single column stacked layout --- */
@media (max-width: 720px) {
  /* stack the two columns vertically */
  .assign-modal-body {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* left column (search + list) sits on top and scrolls independently */
  .assign-modal-left {
    height: auto;
    overflow: auto;
    padding: 5px;
    border-right: none;
    border-bottom: none;
  }

  /* list rows should be easier to tap on mobile */
  .assign-list-row { padding: 10px; }

  /* right column (assets) below; allow it to grow and scroll */
  .assign-assets-right {
    max-height: 60vh; /* remainder of modal can be used for assets */
    overflow: auto;
    padding-left: 6px;
    padding-right: 6px;
    position: relative; /* keeps sticky children within this scroll region */
  }

  /* ensure the assets header (select/deselect etc) stays visible and doesn't overlap */
  .assign-assets-header,
  #assignAssetsHeaderAgents,
  #assignAssetsHeaderBuilders {
    position: sticky;
    top: 0;
    z-index: 8;
    background: #fff;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  /* small spacing tweak for the action buttons row so they appear under header */
  .assign-assets-right > div + div { margin-top: 6px; }

  /* make modal content use most of screen on mobile */
  .content {
    width: calc(100% - 24px) !important;
    max-width: 100% !important;
    padding: 0 0px 5px 0px !important;
  }

  /* ensure the modal/backdrop use full viewport height so inner areas can scroll
     use a safe-area aware small top inset rather than a large fixed padding */
  .modal-backdrop {
    align-items: start; /* keep modal toward top */
    padding-top: env(safe-area-inset-top, 0px); /* tiny safe gap for devices with notches */
	padding-bottom: env(safe-area-inset-bottom);
  }

  /* ensure the modal itself isn't pushed down by margins */
  .modal {
    margin-top: 0;
  }
  .modal .content {
    padding-top: 0; /* keep header flush with the modal top */
  }

  /* make the checkbox/control area more touch-friendly */
  .assign-asset-controls input[type="checkbox"] {
    width: 20px;
    height: 20px;
  }

  /* slightly larger click targets for select/deselect buttons */
  #assignAssetsSelectAllAgents,
  #assignAssetsDeselectAllAgents,
  #assignAssetsSelectAllBuilders,
  #assignAssetsDeselectAllBuilders {
    padding: 8px 12px;
    min-height: 38px;
    border-radius: 8px;
  }
}



/* thumbnail for images */
.assign-asset-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e6eef8;
  display: block;
  background: #fff;
}


/* allow the meta column contents to shrink and wrap */
.assign-asset-meta {
  min-width: 0;     /* IMPORTANT — lets the 1fr/minmax column shrink */
}


.assign-asset-meta .title {
  white-space: normal;       /* allow wrapping */
  overflow-wrap: anywhere;   /* break extremely long words/urls */
  word-break: break-word;    /* fallback */
  display: block;
}

.assign-asset-meta .sub {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}


/* fixed-size cell for showing file size or keep empty for images */
.assign-asset-size {
  text-align: right;
  font-size: 0px;
  color: #6b7280;
}

/* controls column (checkbox & label) align to the right */
.assign-asset-controls {
  display:flex;
  align-items:center;
  justify-content:flex-end;
}

/* inline-flex label for better alignment of checkbox and text */
.assign-asset-controls label {
  display:inline-flex;
  gap:10px;
  align-items:center;
  cursor: pointer;
  font-size:13px;
  color:#374151;
}

/* ensure checkbox is consistently sized and vertically centered */
.assign-asset-controls input[type="checkbox"] {
  width:18px;
  height:18px;
  margin:0;
  transform: translateY(0); /* keep it centered */
}

/* attachment icon box should match image thumbnail size */
.assign-asset-thumb--icon {
  width:30px;
  height:30px;
  display:grid;
  place-items:center;
  border:1px solid #e6eef8;
  border-radius:8px;
  background:#fff;
}

/* group title spacing */
.assign-assets-right > div strong {
  display:block;
  margin-bottom:8px;
}




    /* Reset + base */
    *{box-sizing:border-box;margin:0;padding:0}
    :root{
      --bg:#f5f7fb;--card:#ffffff;--muted:#2f3236;--accent:#3C52D3;--vcfbtn:#3e53cf;--danger:#ef4444; --glass: rgba(255,255,255,0.6);
      --shadow: 0 6px 19px rgba(33,47,60,0.08);
      --radius:12px;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    }
	
	/* ---------------------------
   Force non-italic site-wide
   --------------------------- */

	/* 1) Base: ensure body and all descendants use normal font-style */
	html, body {
	  font-style: normal !important;
	}
	html * , body * {
	  font-style: normal !important;
	}

/* === Safe viewport shell (sticky header variant) === */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overscroll-behavior: none;
}

/* Outer shell that bounds the page between status bar and gesture bar */
.app-shell{
  height: 100dvh;
  padding-top: 0;
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  background: linear-gradient(190deg, rgba(60,82,211,0.18), #eef3fb);
}

/* Ensure shell pages use sticky + safe-area header instead of the older fixed one */
.app-shell .topbar{
  position: sticky;
  top: 0;
  padding-top: env(safe-area-inset-top);
  background: linear-gradient(190deg, #3C52D3, #EEF3FB);
  color: #fff;
}

/* Only the middle content scrolls */
.app-shell .main{
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;

  height: 100%;       /* ✅ ADD */
}

/* Keep bottom menu above the gesture bar */
.app-shell .bottom-menu{
  padding-bottom: env(safe-area-inset-bottom);
}


	/* 2) Catch placeholder text (browsers often render placeholders italic) */
	input::placeholder,
	textarea::placeholder,
	select::placeholder {
	  font-style: normal !important;
	}

	/* 3) Ensure form controls, headings and typical text elements are normal */
	input, textarea, select, button,
	p, h1, h2, h3, h4, h5, h6, span, div, label {
	  font-style: normal !important;
	}

	.modal .header h2 {
	  font-size: 21px;
	  font-weight: 650;
	}

	/* 4) Prevent <em> / <i> tags from forcing italics (use only if you do not need emphasis) */
	em, i {
	  font-style: normal !important;
	}

	/* 5) Keep icons (FontAwesome) unaffected visually — font-style has no effect on glyphs,
	   but this ensures icon elements don’t accidentally inherit italic */
	i.fa, .fa {
	  font-style: normal !important;
	}

	
html, body {
  height: 100%;
  background: linear-gradient(190deg, #3C52D3, #EEF3FB);
  color:#10203a;
}



    /* Layout */
.app {
  display:grid;
  grid-template-columns:280px 1fr;
  gap:20px;
  width:100%;
  max-width:100%;
  margin:0 auto;

  height: 100%;
  min-height: 0; /* ✅ ADD THIS (CRITICAL) */
}

/* ✅ Mobile styles (already working fine) */
@media (max-width: 880px) {
  .app {
    grid-template-columns: 1fr;
    padding: 2px;
  }
  /* You already have your .sidebar mobile overlay styles here */
}

/* ✅ Desktop/laptop fix (new addition) */
@media (min-width: 881px) {
  .app {
    align-items: start; /* keeps sidebar pinned to top of grid cell */
  }
  .sidebar {
    align-self: start; /* ensures sidebar starts at top, not centered */
  }
}




    /* Sidebar */
    .brand{display:flex;gap:12px;align-items:center;margin-bottom:19px}
    .logo{width:46px;height:46px;border-radius:10px;background:linear-gradient(165deg,var(--accent),#60a5fa);display:grid;place-items:center;color:white;font-weight:700}
    .brand h1{font-size:19px}
    .muted{color:var(--muted);font-size:16px}

    .nav{margin-top:19px}
    .nav a{display:block;padding:10px;border-radius:0px;color:#0f1724;text-decoration:none;font-weight:600;margin-bottom:6px}
    .nav a.active{background:linear-gradient(90deg, rgba(37,99,235,0.09), rgba(37,99,235,0.06));color:var(--accent)}

    .filter-group{margin-top:10px}
    .filter-group label{display:block;font-size:16px;color:var(--muted);margin-bottom:5px}
    .field {
	  display: block;
	  width: 100%;             /* fill parent width */
	  max-width: 100%;         /* prevent shrinking */
	  box-sizing: border-box;  /* padding included in width */
	  padding: 10px 12px;      /* more breathing room */
	  border: 1px solid #3282e6;
	  border-radius: 8px;
	  background: #fff;        /* solid background for readability */
	}
    .fieldDash {
	  display: block;
	  width: 100%;             /* fill parent width */
	  max-width: 100%;         /* prevent shrinking */
	  box-sizing: border-box;  /* padding included in width */
	  padding: 5px 5px;      /* more breathing room */
	  border: 1px solid #3282e6;
	  border-radius: 8px;
	  background: #fff;        /* solid background for readability */
	}
    /* Main area */

    .search{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
    .search input{padding:10px 12px;border-radius:10px;border:1px solid #3282e6;min-width:220px}
    .actions{display:flex;gap:8px}
    .btn{font-size:15px;padding:8px 8px;border-radius:10px;border:none;background:var(--accent);color:white;font-weight:500;cursor:pointer}
    .btn.secondary{font-size:15px;background:transparent;border:1px solid #dbeafe;color:var(--accent)}
	.btn.vcfbtn{font-size:15px;background:transparent;border:1px solid #dbeafe;color:var(--vcfbtn)}
	


    /* Stats */
    .stats{font-style: normal;display:flex;gap:10px;margin-bottom:0px;margin-top:0px;flex-wrap:wrap}
    .stat{text-align: center;flex:1;background:linear-gradient(190deg,var(--card),var(--glass));padding:0px;border-radius:10px;box-shadow:var(--shadow);min-width:190px}
    .stat h3{font-size:17px}
    .stat p{color:var(--muted);margin-top:0px}
	.stat.click { cursor: pointer; user-select: none; }
	.stat.click:focus { outline: 3px solid #facc15; border-radius: 8px; }


/* Keep stats table inside the viewport and split evenly */
.stats table {
  width: 100%;
  table-layout: fixed;      /* cells share width and wrap inside */
  border-collapse: separate;

}
.stats td { width: 50%; padding: 0; }  /* two cells per row */

/* styles.css */
.stats { display: none; }

    /* Property Grid */
    .grid {
	  display: grid;
	  grid-template-columns: repeat(2, 1fr); /* 👈 always 2 */
	  gap: 15px;
	  margin: 2px;
	}

    @media (max-width:1100px){.grid{grid-template-columns:repeat(2,1fr)}}
    @media (max-width:640px){.grid{grid-template-columns:1fr}}

    .card{background:var(--card);border-radius:12px;box-shadow:var(--shadow);overflow:hidden;border:1px solid rgba(17,23,42,0.03)}
    .media{height:190px;background:linear-gradient(165deg,#dbeafe,#bfdbfe);display:flex;align-items:end;padding:2px;color:#0f1724;font-weight:700}
    .card-body{padding:10px}
    .meta{padding:5px 1px;display:flex;justify-content:space-between;align-items:center}
	.title {
	  font-size: 21px;
	  font-weight: 550;
	  white-space: normal;       /* allow wrapping */
	  overflow-wrap: anywhere;   /* break long words if needed */
	  word-break: break-word;    /* legacy support */
	}
	.titlefiles {
	  font-size: 15px;
	  font-weight: 500;
	  white-space: normal;       /* allow wrapping */
	  overflow-wrap: anywhere;   /* break long words if needed */
	  word-break: break-word;    /* legacy support */
	}

    .sub{color:var(--muted);font-size:18px;margin-bottom:0px}
    .props{display:flex;gap:0px;margin-top:0px;color:var(--muted);font-size:19px;flex-wrap:wrap}
    .chip{background:#f1f8ff;padding:3px -17px 4px 2px;border-radius:999px;border:1px solid #e6f0ff}
	.ptype{font-size:19px;background:#D8ADFF;padding:2px 5px;border-radius:8px;font-weight:500;border:1px solid #e6f0ff}

    .card {
	  font-style: normal;
	  background: var(--card);
	  border-radius: 7px;
	  box-shadow: var(--shadow);
	  overflow: hidden;
	  border: 1px solid rgba(17,23,42,0.03);

	  display: flex;
	  flex-direction: column;
	}

	.card-body {
	font-style: normal;
	  padding: 10px;
	  flex: 1; /* fills available vertical space */
	}

.card-footer {
  display: flex;
  justify-content: center; /* horizontally center */
  align-items: center;     /* vertically center */
  padding: 8px 12px 8px 12px;
}
.card-footer .btn {
  margin: 0 auto; /* make sure button itself is centered */
}

	
	
/* 1) Make sure cards clip overflowing children (removes that pale gap) */
.card {
  position: relative; /* keep stacking context */
  overflow: hidden;   /* clip any overflowing content so rounded corners remain clean */
}

/* 2) Ensure long text wraps and doesn't create horizontal overflow */
.card .card-body,
.card .props,
.card .sub,
.printable {
  white-space: normal;          /* allow wrapping */
  overflow-wrap: anywhere;     /* break long words/URLs if necessary */
  word-break: break-word;      /* legacy support */
}

/* 3) Prevent 100%-width children from adding extra width when padding exists */
.card * {
  box-sizing: border-box;
}

/* 4) Add a small right padding so the scrollbar (if any) doesn't overlap the content */
.card .card-body {
  padding-right: 10px;
}

/* 5) Defensive: prevent the grid item from stretching beyond column width */
.grid > .card {
  min-width: 0; /* allows flex/grid children to shrink properly */
}

    .small{font-size:16px;color:var(--muted)}
    .pill{padding:1px 5px; border-radius:8px; font-weight:600; white-space: nowrap; flex: 0 0 auto;}
    .pill.public{font-size:17px; background:#a7f6d1;color:#065f46}
    .pill.available{font-size:17px; background:#a7f6d1;color:#065f46}
	.pill.fulfilled{font-size:17px; background:#D9F99D;color:#065f46}
    .pill.private{font-size:17px; background:#C8E3FF;color:#065f46}	
	.pill.sold{font-size:17px; background:#FFF4B8;color:#065f46}
    .pill.onhold{font-size:17px; background:#E5E7EB;color:#374151}
    .pill.closed{font-size:17px; background:#FFE0CC;color:#065f46}	
	.pill.property{font-size:17px; background:#C4C975;color:#065f46}
	.pill.requirement{font-size:17px; background:#C986DB;color:#065f46}



    /* Empty state */
    .empty{padding:40px;text-align:center;color:var(--muted)}

    /* Modal */
    .modal-backdrop{ position:fixed;  top: env(safe-area-inset-top);  bottom: env(safe-area-inset-bottom);  left: 0;  right: 0;background:rgba(2,6,23,0.5);display:none;place-items:center;padding:0px;z-index:60;}
    .modal .content{padding:5px}
    .modal .header{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
    .thumbs{display:flex;gap:5px;margin-top:5px;flex-wrap:wrap}
    .thumb{width:80px;height:60px;border-radius:8px;overflow:hidden;flex-shrink:0;position:relative}
    .thumb img{
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain; /* preserve aspect ratio, no cropping */
  margin: 0 auto;
}

/* ensure thumb is a positioned container */
.thumb {
  position: relative; /* required for absolute .remove */
}

/* improved remove button: reliable centering */
.thumb .remove {
  position: absolute;
  top: 0px;           /* adjust up/down if needed */
  right: 0px;         /* adjust left/right if needed */
  width: 19px;
  height: 19px;
  padding: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.65);
  color: #fff;
  display: flex;              /* most reliable centering */
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  user-select: none;
}

/* optional hover for nicer feedback */
.thumb .remove:hover {
  transform: scale(1.08);
  background: rgba(0,0,0,0.8);
}

/* tiny vertical nudge if it's still a hair off on your system */
/* .thumb .remove { transform: translateY(-1px); } */

/* download button: placed top-left so it doesn't overlap remove */
.thumb .download {
  position: absolute;
  top: 0px;
  left: 0px;
  width: 19px;
  height: 19px;
  padding: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.65);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  user-select: none;
}
.thumb .download:hover { transform: scale(1.08); background: rgba(0,0,0,0.8); }



    /* printable area helpers */
    .printable{padding:19px;background:#fff;color:#10203a}
    .printable .row{display:flex;gap:12px;margin-bottom:8px}
    .page-break{page-break-after:always}

    /* Utilities */
    .flex{display:flex;gap:8px;align-items:center}
 
    a.link{color:var(--accent);text-decoration:none;font-weight:700}
    footer{max-width:1400px;margin:19px auto;text-align:center;color:var(--muted);font-size:16px}
	


	/* Sidebar default */
	.sidebar {
	  background: var(--card);
	  border-radius: var(--radius);
	  box-shadow: var(--shadow);
	  padding: 5px 5px 5px 5px;;
	  height: calc(100dvh - 0px);
	  position: sticky;
	  top: 0px;
	  transition: transform 0.3s ease; /* slide effect */
	  display: flex;
	  flex-direction: column;
    /* NEW: keep content inside visible shell; avoid tucking under bars */
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);	  
	}
	/* Keep profile (photo/name/role) fixed at the top of the sidebar */
	.sidebar .brand{
	  position: sticky;
	  top: 5px;
	  background: var(--card);
	  z-index: 1;
	  padding-bottom: 5px 0px 5px 0px; /* keeps a clean edge above the scroller */
	}

	/* Make the area with buttons scrollable */
	.sidebar .nav{
	  flex: 1 1 auto;      /* take remaining height */
	  min-height: 0;       /* critical so overflow works in flex column */
	  overflow: auto;      /* <-- enables the scroll */
	  margin-top: 5px;
	  padding-right: 6px;  /* room for scrollbar */
	}

	/* Optional: nicer, slim scrollbar (WebKit browsers) */
	.sidebar .nav::-webkit-scrollbar{ width:8px; }
	.sidebar .nav::-webkit-scrollbar-thumb{ background:#dfe7f5; border-radius:0px; }

	/* Hidden state */
	.sidebar.hidden {
	  transform: translateX(-100%);
	}


/* On smaller screens: sidebar becomes a full-screen overlay */
@media (max-width: 880px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh; /* full height (safe-area aware) */
    width: 100vw;
    transform: translateX(-100%);
    z-index: 200;
    background-color: #fff;
    transition: transform 0.3s ease;

    /* NEW: keep content inside visible shell; avoid tucking under bars */
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .sidebar.show { transform: translateX(0); }
}


	.modal-backdrop { z-index: 9999; }

	.right {
	  width: 100%;              /* take full row width */
	  display: flex;
	  flex-direction: column;   /* stack label above input */
	  align-items: stretch;     /* let input stretch full width */
	}


	.topbar {
	  flex-wrap: wrap;
	}
	.search input {
	  flex: 1;
	  min-width: 190px;
	}
	.actions {
	  flex-wrap: wrap;
	}
  .search-bar { display: none; }
  .search-bar.active { display: inline-block; }
  
	@media (max-width: 640px) {
	  .modal {
		width: 100%;
		max-width: 100%;
		max-height: 100%;

	  }

	}
		

	/* Hide toggle button on desktop/laptop */
	.toggle-btn {
	  display: none;
	}

	@media (max-width: 880px) {
	  .toggle-btn {
		display: inline-flex; /* show on mobile/tablet */
		align-items: center;
		justify-content: center;
	  }
	}

	.sidebar .btn.secondary {
	  display: none; /* hide by default */
	}

	@media (max-width: 880px) {
	  .sidebar .btn.secondary {
		display: block;              /* show only on mobile/tablet */
		background-color: #CFE5E5;   /* light red background */
		color: #10203a;              /* dark red text for contrast */
		border: 1px solid #CFE5E5;   /* soft red border */
		  font-weight: 700;  /* slightly bold */
	  }

	}

	.greeting {
	  font-size: 17px;   /* increase size */
	  font-weight: 500;  /* slightly bold */
	  color: #0f1724;    /* darker color if you want */
	  padding: 0 8px;   /* top-bottom = 0, left-right = 12px */
	}

/* Top bar sits below the status bar, stays visible, and uses your palette */
.topbar{
  display:flex;
  gap:5px;
  align-items:center;
  justify-content:space-between;
  border-radius: 0 0 8px 8px;  


  /* NEW: keep icons readable on edge-to-edge phones */
  position: sticky;
  top: 0;
  z-index: 1000;
  padding-top: env(safe-area-inset-top);
  background: var(--accent);
  color: #fff;
}

.topbar {
  margin-bottom: 0px !important;
}


	.topbar {
	  transition: opacity 0.3s ease, transform 0.3s ease;
	}

	.topbar.hide-on-mobile {
	  opacity: 0;
	  transform: translateY(-20px);
	  pointer-events: none;
	  height: 0;
	  overflow: hidden;
	}


/* ---------- Sticky modal header (view + edit + profile) ---------- */

/* ---------- Sticky modal header (view + edit + profile) ---------- */

/* ensure modal uses column layout so header and content can be separated */



/* content area becomes the scrolling region */
.modal .content {
  /* remove top padding so header sits flush with modal top */
  padding: 0px 5px 40px 5px; /* top 0, right 12, bottom 12, left 12 */
  overflow: auto;
  flex: 1 1 auto;
}

/* header stays pinned to the top of the scrolling content with a visible background */
.modal .header {
  position: sticky;
  top: 0;
  z-index: 30;                       /* above scrolling content */
  background: linear-gradient(180deg, #ffffff, #ebf5fc); /* subtle background */
  padding: 6px 1px;
  margin: 0;                         /* remove previous margin-bottom gap */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  /* keep rounded top corners for modal but avoid extra visual gap */
  border-radius: 0px 0px 0 0;
  /* soft divider at header bottom for clear separation */
  box-shadow: 0 2px 6px rgba(2,6,23,0.04), 0 1px 0 rgba(0,0,0,0.04);
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

/* sticky footer (if used) */
.modal .footer {
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: var(--card);
  padding: 10px 12px;
  box-shadow: 0 -4px 12px rgba(2,6,23,0.04);
}

/* Lightbox styles — paste immediately after .no-image-placeholder rule */
.lightbox{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2,6,23,0.85);
  z-index: 11000;
  padding: 20px;
}
.lightbox img{
  max-width: 92%;
  max-height: 92%;
  transform-origin: center center;
  cursor: grab;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.08s linear;
}
.lb-controls{
  display:flex;
  gap:8px;
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:11001;
}
.lb-controls button {
  min-width: 44px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  font-size: 16px;
  cursor: pointer;
}
.lb-controls .btn.secondary { background: transparent; border: 1px solid rgba(255,255,255,0.12); color: #fff; }
.lb-controls .btn { background: rgba(255,255,255,0.06); color: #fff; border: 1px solid rgba(255,255,255,0.06); }

.hidden { display: none !important; }

#profilePhotoPreview {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  background: #f3f6fb;          /* light gray background */
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);    /* reuse your shadow style */
}

#profilePhotoImg {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  object-fit: contain;          /* preserve aspect ratio */
  display: none;                /* hidden until photo is uploaded */
}

/* Thumb label (bottom-left overlay) */
.thumb-label {
  position: absolute;
  left: 6px;
  bottom: 6px;
  background: rgba(0,0,0,0.45);
  color: #fff;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 12px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  z-index: 5; /* keep above image */
  user-select: none;
}

/* checkbox inside the label */
.thumb-checkbox {
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin: 0;
  appearance: none;            /* allow custom styling */
  -webkit-appearance: none;
  border: 1px solid rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.12);
  border-radius: 3px;
  display: inline-block;
  position: relative;
}

/* checkmark for custom checkbox (optional, basic) */
.thumb-checkbox:checked {
  background: #fff;
  border-color: rgba(0,0,0,0.2);
}
.thumb-checkbox:checked::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid rgba(0,0,0,0.8);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* text next to checkbox */
.thumb-label-text {
  font-size: 12px;
  line-height: 1;
}

/* Remove button (already exists but here's the overlay positioning consistent) */
.thumb .remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.65);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  user-select: none;
}

/* hover effect */
.thumb .remove:hover {
  transform: scale(1.06);
  background: rgba(0,0,0,0.85);
}


/* Clean, full-width vertical list for agents/builders */
/* ---- Row layout: stacked meta on left, Delete on right (vertically centered) ---- */
.list-item {
  display: flex !important;
  flex-direction: row !important;    /* keep in a row */
  align-items: center;               /* vertically center meta + actions */
  justify-content: space-between;
  gap: 5px;
  width: 100%;
  padding: 5px 5px;
  border: 1px solid #eef6ff;
  border-radius: 10px;
  margin-bottom: 5px;
  background: linear-gradient(180deg,#ffffff,#fbfdff);
  box-shadow: 0 1px 3px rgba(16,32,58,0.03);
  box-sizing: border-box;
  text-align: left;
}

/* left column: stacked name / mobile / details */
.list-item .meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;       /* take remaining space */
  min-width: 0;         /* allow truncation when needed */
  padding-right: 8px;
}

/* Name (top) */
.list-item .meta .name {
  font-weight: 700;
  font-size: 16px;
  color: #0f1724;
  line-height: 1.15;
  margin: 0;
  word-break: break-word;
}

/* Mobile (second line) */
.list-item .meta .mobile {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  word-break: break-word;
}

.list-item .meta .agentrerano {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  word-break: break-word;
}

/* Details (third line) */
.list-item .meta .details {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  white-space: normal;
  word-break: break-word;
}

/* right column: actions (Delete) - vertically centered and aligned right */
.list-item .actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  
  flex-shrink: 0;
  width: 130px;          /* ✅ FIXED COLUMN WIDTH */
}


/* Delete button style compact */
.list-item .actions .btn {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
  min-width: 70px;

}

/* Responsive: on very narrow screens keep action on right but allow wrapping if needed */
@media (max-width: 420px) {
  .list-item {
    gap: 5px;
    padding: 5px;
  }
  .list-item .actions .btn { min-width: 60px; padding: 6px 10px; }
  
  .stats table { border-spacing: 8px; }  /* shrink the gaps a bit */
  .stat { min-width: 0; padding: 2px 2px; }  /* allow cards to shrink instead of forcing overflow */

}



/* Defensive: ensure chips/selectors do not inherit list styles */
#agentsSelector .chip,
#buildersSelector .chip {
  border: 1px solid #e6edf6 !important;
  background: #fff !important;
}


/* selected chips */
.selected-chip {
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding:5px 10px;
  border-radius:15px;
  border:1px solid #e6edf6;
  background:linear-gradient(180deg, #ffffff, #ebf5fc);
  font-weight:600;
  font-size:13px;
  color:#0f1724;
}

.assign-list-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:7px;
  border-bottom:1px solid #f1f6fb;
}
.assign-list-row:last-child { border-bottom:0; }
.assign-list-row .name { font-weight:700; }
.assign-list-row .mobile { color:var(--muted); font-size:13px; }


.chips-row {
  display: flex;
  align-items: center;  /* ✅ vertically center button with chips */
  gap: 8px;             /* spacing between chips and button */
}

.chips-container {
  flex: 1;              /* let chips take full width */
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}


/* add this once in your page (put in your main CSS file if you prefer) */
.assign-modal-left { display:flex; flex-direction:column; gap:5px; }
.assign-list-scroll { flex:1; overflow:auto; border:1px solid #eef2f6; border-radius:8px; padding:6px; background:#fff; }
.assign-list-row { display:flex; justify-content:space-between; gap:10px; align-items:center; padding:7px; border-bottom:1px solid #f1f5f9; cursor:pointer; }
.assign-list-row:hover { background:#f8fafc; }
.assign-list-row .meta { display:flex; flex-direction:column; gap:4px; }
.assign-list-row.assign-selected { background:#eef6ff; border-left:4px solid #3b82f6; padding-left:8px; }
/* change the middle column to minmax(0, 1fr) so it can shrink and wrap */
.assign-asset-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 0px 70px; /* thumb | meta (shrinkable) | size | controls */
  gap: 12px;
  align-items: center;
  padding: 4px 4px;
  border-bottom: 1px solid #eef2f6;
}
.assign-asset-thumb { width:72px; height:72px; object-fit:cover; border-radius:6px; border:1px solid #eef2f6; }
.assign-assets-right { display:flex; flex-direction:column; gap:10px; padding:0px 0px 0px 0px; border-left:1px solid #eef2f6; }


/* =========================
   Mobile modal / scrollbar fixes
   ========================= */

@media (max-width: 720px) {
  .modal {
    max-width: calc(100% - 10px) !important; /* small gutter left/right */
    width: calc(100% - 10px) !important;
    margin: 0px auto !important;            /* tiny vertical gap */
    box-sizing: border-box;
    overflow: hidden;                        /* inner areas handle scrolling */
  }

  .modal .content {
    padding: 0px 5px 40px 5px !important; /* top 0, right 5px, bottom 5px, left 5px */
    width: 100% !important;
    box-sizing: border-box;
    overflow: visible; /* inner panes handle their own scrolling */
  }

  /* also ensure inline width on content doesn't break mobile */
  .content[style*="width"] {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 5px !important;
    padding-right: 5px !important;
    box-sizing: border-box;
  }

  /* Make the asset row grid friendly for narrow viewports:
     keep thumb + size + controls fixed-ish, allow middle column to shrink/wrap */
  .assign-asset-row {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr) 0px 70px; /* thumb | meta (shrinkable) | size | controls */
    gap: 12px;
    align-items: center;
    padding: 4px 4px;
    border-bottom: 1px solid #eef2f6;
  }



  /* Ensure the meta column can shrink and wrap properly */
  .assign-asset-meta {
    min-width: 0;    /* crucial: lets the middle column actually shrink inside the grid */
    overflow: hidden;
	padding: 0px 0px 0px 3px;
  }

  /* Allow filenames/titles/sub to wrap and break at underscores/long words */
  .assign-asset-meta .title {
    white-space: normal !important;
    overflow-wrap: anywhere !important; /* allows breaks at underscores/long labels */
    word-break: break-word !important;  /* legacy-friendly */
    hyphens: auto;
    display: block;
    line-height: 1.12;
    font-size: 14px; /* adjust if needed */
    margin-bottom: 6px;
  }

  .assign-asset-meta .sub {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    font-size: 10px;
    color: #6b7280;
  }

  /* Reserve explicit width for the size column so the "Visible" control sits consistently */
  .assign-asset-size {
    min-width: 64px;   /* keeps a gutter even when size is empty */
    max-width: 80px;
    text-align: right;
    font-size: 13px;
    color: #6b7280;
    padding-right: 6px;
    box-sizing: border-box;
  }

  /* Controls column should keep its place on the right */
  .assign-asset-controls {
    min-width: 88px;   /* same as grid column so layout stays stable */
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  /* give the backdrop a tiny safe-area top inset, avoid big padding */
  .modal-backdrop {
    align-items: start;
  }

  /* 3) Prevent inner children from causing horizontal overflow */
  .assign-assets-right,
  .assign-list-scroll,
  .assign-modal-body,
  .content,
  .modal {
    overflow-x: hidden !important;
  }

  /* 4) Reserve scrollbar gutter so content doesn't shift/produce a strange blank area */
  .assign-assets-right,
  .assign-list-scroll,
  .modal .content {
    scrollbar-gutter: stable both-edges;
    overflow-x: hidden !important;
  }

  /* 5) Keep sticky headers inside the .assign-assets-right scroll region */
  .assign-assets-right { position: relative; }
  .assign-assets-header,
  #assignAssetsHeaderAgents,
  #assignAssetsHeaderBuilders {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
  }
}


/* custom alert modal */
.custom-discard-backdrop,
.custom-alert-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: grid;
  place-items: center;
  z-index: 99999;
  padding: 20px;
}

.custom-alert {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(2,6,23,0.4);
  overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

.custom-alert-header {
  padding: 14px 16px;
  background: linear-gradient(90deg,#0ea5e9,#2563eb);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
}

.custom-alert-body {
  padding: 16px;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.45;
  max-height: 60vh;
  overflow: auto;
}

.custom-alert-footer {
  padding: 12px 16px;
  display:flex;
  justify-content: space-between;  /* pushes Yes left & Cancel right */
  align-items: center;
  width: 100%;
  background: #f8fafc;
}


.custom-alert button {
  background: #2563eb;
  color: #fff;
  border: 0;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.custom-alert button.secondary {
  background: transparent;
  color: #374151;
  border: 1px solid #e6eefb;
}

#loadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 99999;
}

.loader {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #3498db;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.manage-group {
  margin-top: 0px;
  text-align: center;
}
.manage-group-header {
  color: #2563eb;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 13px;
}
.manage-icons {
  display: flex;
  justify-content: center;
  gap: 15px;
}
.icon-btn {
  background: #f3f4f6;
  border: none;
  border-radius: 40%;
  padding: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.icon-btn:hover {
  background: #e0e7ff;
  transform: scale(1.1);
}
.icon-btn i {
  color: #2563eb;
  font-size: 18px;
}


/* Compact icon-only buttons (like call icon) */
.list-item .actions .btn.secondary {
  min-width: 38px;
  padding: 5px 5px;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 35%;
  background-color: #f5f7fb;
  border: 1px solid #dbe1ea;
  color: #2b7cff;
  transition: background 0.2s, color 0.2s;
}

.list-item .actions .btn.secondary:hover {
  background-color: #e8f1ff;
  color: #1b5dd0;
}


.manage-section-header {
  text-align: center;
  margin-bottom: 10px;
}

.manage-section-header h3 {
  margin: 10px 0 10px 0;
}

.manage-section-header input {
  width: 90%;
  padding: 10px 10px;
  border: 2px solid #3282e6;
  border-radius: 6px;
  text-align: center;
}

.greet-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px #fff inset;
  transition: background-color 0.3s ease;
  margin-right: 5px;
}

.status-online  { background-color: #16a34a; }  /* green */
.status-offline { background-color: #ef4444; }  /* red */
.status-unknown { background-color: #f59e0b; }  /* amber (boot/check) */


html.no-scroll, body.no-scroll {
  overflow: hidden;
  height: 100%;
  overscroll-behavior: none;
}


/* Universal hide helper used by viewProperty() */
.hidden {
  display: none !important; /* must beat any display:grid !important below */
}




/* =====================================================
   Agents / Builders / Customers — SAFE layout fix
   (NO HTML change, NO JS change)
   ===================================================== */

#rowAgents,
#rowBuilders,
#rowCustomers {
  display: flex;   /* ✅ NO !important */
  flex-direction: column;
  align-items: stretch;
  gap: 6px;

  margin-top: 10px;
  margin-bottom: 10px;

  background: #ffffff;
  border: 1px solid var(--border, #dfe3eb);
  border-radius: 8px;
  padding: 8px;

  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}


/* Label */
#rowAgents > strong,
#rowBuilders > strong,
#rowCustomers > strong {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-weight: 600;
}

/* Assigned list — full width, indented */
#viewAgentsList,
#viewBuildersList,
#viewCustomersList {
  display: flex !important;
  flex-direction: column;
  gap: 4px;
  padding-left: 12px;   /* ⬅️ controls arrow indent */
}






#pager {
  display: none;
  gap: 10px;
  align-items: center;
  justify-content: center; /* ✅ centers everything */
  padding: 5px;
  text-align: center;
}

/* === NEW: Today badge === */
.new-badge {
  display: inline-block;
  margin-left: 0px;
  padding: 2px 2px;
  font-size: 13px;
  font-weight: 600;
  color: #000;
  background-color: #5EF527;
  border-radius: 5px;
  line-height: 1;
  vertical-align: middle;
  animation: nb-blink 1s ease-in-out infinite;
}

/* Soft blink */
@keyframes nb-blink {
  0%   { opacity: 1;   }
  50%  { opacity: 0.55;}
  100% { opacity: 1;   }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .new-badge { animation: none; }
}


/* === Published On filter bar === */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;   /* ⬅ centers all child elements */
  gap: 10px;
  padding: 10px 10px 10px 10px;
  border-radius: 8px;
  margin: 0 auto;            /* ⬅ centers the entire section horizontally */
  text-align: center;        /* ⬅ ensures inner text (like labels) stays centered */
  width: fit-content;        /* ⬅ prevents stretching full width */
}


.filter-label {
  font-weight: 400;
  font-size: 15px;
  padding-right: 10px;
}

.filter-input {
  min-width: 150px;
  padding: 6px 8px;
  border: 1px solid #d4d8e1;
  border-radius: 6px;
  background: #fff;
}

.filter-custom {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-date {
  padding: 6px 8px;
  border: 1px solid #d4d8e1;
  border-radius: 6px;
  background: #fff;
}

/* Add bottom spacing between property info rows */
#viewBackdrop .row {
  margin-bottom: 1.5px; /* or use 1rem if you prefer larger spacing */
}

/* === Toolbar-style area search bar === */
.area-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  padding: 8px 10px;
  background: linear-gradient(180deg, #ffffff, #f5f7fb);
  border: 1px solid #e6edf6;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  margin-bottom: 10px;
  top: 56px; /* keeps it below your topbar */
  z-index: 500;
}

/* Smooth transition when it appears/disappears */
.area-toolbar {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Make the input fit nicely */
.area-toolbar .field {
  flex: 1;
  min-width: 200px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #d4d8e1;
  font-size: 15px;
}

/* Style the search button */
.area-toolbar .btn {
  padding: 10px 10px;
  font-size: 15px;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.area-toolbar .btn:hover {
  background: #1e4ed8;
}

/* Mobile tweaks */
@media (max-width: 640px) {
  .area-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    top: 48px;
  }
}

/* Unified search row styling */
#serverSearchBar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;  
  margin-bottom: 8px;
  border: 1px solid gold; /* added golden border */
}

#serverSearchBar .field {
  flex: 1;
  min-width: 200px;
}

#serverSearchBar .btn {
  padding: 8px 16px;
  border-radius: 8px;
}
/* === Fix: make the grid fill the viewport and let .main scroll === */
.app {
  height: 100%;     /* fill the .app-shell height */
  min-height: 0;    /* allow children to shrink for scrolling */
}

/* The scrolling region lives inside the grid's right column */
.app .main {
  min-height: 0;    /* override any earlier 80vh */
  overflow: auto;   /* this is the ONLY scroller for the page content */
  -webkit-overflow-scrolling: touch; /* smooth iOS scrolling */
}


/* ---- Sticky bottom ad slot ---- */
:root {
  --scope-bar-height: 60px;
  --ad-height: 55px;              /* tweak to your ad format later */
}

/* Make only the middle content scroll, but leave space for the ad bar */
.app-shell .main{
  /* keep your existing rules, then add: */
  padding-bottom: calc(var(--ad-height) + env(safe-area-inset-bottom) + 12px);
}





/* Small phones: give a touch more breathing room above 3-button nav bars */
@media (max-width: 420px){
  :root { --ad-height: 50px; }
}


/* ==============================
   CAPACITOR + MOBILE SAFE-AREA FIX
   ============================== */
@media (max-width: 880px) {
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    height: 100%;
    background: #000000 !important;   /* black base for nav bar */
  }


  /* Topbar adjustments */
  .topbar {
    background: linear-gradient(190deg, #3C52D3, #EEF3FB) !important; /* fully opaque now */
    margin-top: 0 !important;
    box-shadow: none !important; /* Remove faint separator line */
    padding-top: env(safe-area-inset-top, 0px); /* Handle iPhone notch safely */
  }

  /* Prevent parent shells from creating top gaps */
  .app-shell,
  .page-wrapper {
    margin-top: 0 !important;
    padding-top: 0 !important;
    background: linear-gradient(190deg, #3C52D3, #EEF3FB) !important; /* fully opaque now */
  }

  /* Improve visibility of menu (hamburger) button */
  .topbar .btn.secondary {
    color: #fff !important; /* White icon/text */
    border-color: rgba(255, 255, 255, 0.5) !important; /* Subtle border */
    border-width: 0.5px !important; /* Thinner edge */
  }

  /* Always show toggle button on mobile */
  .toggle-btn {
    display: inline-flex !important;
  }

  /* === NEW: Hamburger spacing + size (mobile-only) === */
  .topbar .toggle-btn {
    margin-left: 8px !important;      /* pull it away from the left edge */
    padding: 10px 15px !important;      /* bigger tap target */
    min-width: 50px;                    /* accessibility: ~44px hit area */
    min-height: 40px;
    align-items: center;
    justify-content: center;
  }
  .topbar .toggle-btn i.fa-bars {
    font-size: 22px !important;
    line-height: 1;
	font-weight: 700;
    transform: scaleX(1.3); 
    transform-origin: center;
  }
  
    .topbar .toggle-btn i.fa-bars {
    color: gold !important;
  }
}



/* Hide the entire content area during the very first frame */
.main.boot-hidden {
  visibility: hidden; /* keeps layout stable, no reflow jump */
}


.inline-counts .count-pill {
  font-size: 13px;
  color: #111827;
  background: rgba(255,255,255,0.06);
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.06);
}
.inline-counts .count-num {
  font-weight:600;
  min-width: 18px;
  display:inline-block;
  text-align:center;
}


.sidebar-version {
  font-size: 14px;
  opacity: .8;
  margin-top: 15px;
  text-align: center;
  width: 100%;
  display: block;
}



















/* ===== Capacitor download-overlay (append after existing .thumb rules) ===== */
.cap-download-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2,6,23,0.35);
  gap: 6px;
  transition: opacity 160ms ease;
  z-index: 30;
  opacity: 1;
}

.cap-download-overlay.hidden { opacity: 0; pointer-events: none; }

.cap-download-overlay .cap-download-btn {
  background: rgba(255,255,255,0.95);
  border-radius: 999px;
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 15px rgba(0,0,0,0.12);
  cursor: pointer;
  font-size: 20px;
  width: 60px;
  height: 60px;
}

.cap-download-overlay .cap-download-label {
  margin-top: 6px;
  font-size: 13px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* Minimal progress bar overlay */
.cap-progress-wrap {
  width: 70%;
  background: rgba(255,255,255,0.12);
  border-radius: 8px;
  overflow: hidden;
  height: 8px;
}
.cap-progress {
  height: 100%;
  width: 0%;
  transition: width 120ms linear;
  background: linear-gradient(90deg,#34D399,#3B82F6);
}

/* Attachment download control (inline pill) */
.cap-attach-download {
  display: inline-flex;
  gap:8px;
  align-items:center;
  padding:6px 10px;
  border-radius:8px;
  background:#0b60ff;
  color:#fff;
  cursor:pointer;
  font-size:14px;
}
.cap-attach-download[disabled] { opacity:0.6; pointer-events:none; }

/* ================================
   FULLSCREEN ATTACHMENT MODAL
   ================================ */

.attachment-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 2147483646;
}

/* Modal container */
.attachment-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  display: flex;
}

/* Floating close button (top-right) */
.attachment-close {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 12px);
  right: calc(env(safe-area-inset-right) + 12px);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 20px;
  line-height: 40px;
  cursor: pointer;
  z-index: 3;

  display: flex;
  align-items: center;
  justify-content: center;
}

/* Better touch target */
.attachment-close:active {
  transform: scale(0.94);
}

/* Content fills entire screen */
.attachment-content {
  flex: 1;
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Video & image fullscreen */
.attachment-content video,
.attachment-content img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* PDF safety */
.attachment-content canvas,
.attachment-content iframe {
  width: 100%;
  height: 100%;
}

/* Hide sticky ad when modal open */
body.attachment-open #adSticky {
  display: none !important;
}



#pagesContainer {
  touch-action: none;
}



/* Mobile-only: when searching, hide right panel */
@media (max-width: 768px) {
  .assign-search-active .assign-assets-right {
    display: none !important;
  }
}

.btn.edit-mode{
  background:#facc15;   /* medium yellow */
  border-color:#eab308;
  color:#111827;
}
.btn.edit-mode:hover{
  filter:brightness(0.95);
}


.modal-backdrop {
  align-items: stretch;
  padding: 0 !important;
}



.notes-mention-list{
  position:fixed;
  z-index:99999;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:10px;
  box-shadow:0 12px 30px rgba(0,0,0,0.12);
  padding:3px;
  min-width:240px;
  max-height:240px;
  overflow:auto;
}



/* reuse existing assign row look */
.notes-mention-list .assign-list-row{
  cursor:pointer;
}
.notes-mention-list .assign-list-row.active{
  background:#eef2ff;
}




/* Collapsible assets panel (Assign Agents/Builders/Customers) */
.assign-assets-panel{
  border: 1px solid #eef2f6;
  border-radius: 10px;
  background: #fff;
}

/* summary clickable header */
.assign-assets-summary{
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
}

/* remove default marker arrow */
.assign-assets-summary::-webkit-details-marker{
  display: none;
}

/* header alignment: title left, badge right */
.assign-assets-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* blue badge */
.expand-hint{
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e6f4ff;
  border: 1px solid #bfe3ff;
  color: #0b4b7a;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

/* ✅ Pure CSS toggle: expand vs collapse text */
.assign-assets-panel .hint-collapse{
  display: none;
}
.assign-assets-panel[open] .hint-expand{
  display: none;
}
.assign-assets-panel[open] .hint-collapse{
  display: inline;
}

/* ===== Server Search Bar Responsive Layout (phones) ===== */
@media (max-width: 720px) {

  /* Row 1: keyword full width */
  #serverSearchBar #keywordInput {
    flex: 0 0 100%;
    min-width: 0;
  }

  /* Row 2: category + date in the same row */
  #serverSearchBar #SearchCategory {
    flex: 1 1 60%;
    min-width: 160px;
    max-width: none !important;
  }

  #serverSearchBar #publishDateSelect {
    flex: 1 1 38%;
    min-width: 120px;
    max-width: none !important;
  }

  /* Row 3: button alone centered */
  #serverSearchBar #serverSearchBtn {
    flex: 0 0 100%;
    max-width: 240px;
    margin: 0 auto;
  }
}








/* ============================
   Favorites icon button (star)
   ============================ */
.fav-btn{
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  padding: 6px 8px;
  border-radius: 999px;
  color: rgba(0,0,0,0.35);
  transition: transform .15s ease, box-shadow .15s ease, color .15s ease, background .15s ease;
}
.fav-btn:hover{
  transform: scale(1.08);
  background: rgba(0,0,0,0.05);
}
.fav-btn.fav-on{
  color: #f59e0b; /* amber */
  box-shadow: 0 0 0 2px rgba(245,158,11,0.18), 0 0 18px rgba(245,158,11,0.30);
  background: rgba(245,158,11,0.10);
}

.favorites-grid {
  gap: 10px !important;
}


.btn.danger-outline{
  background: transparent !important;
  border: 1px solid #e53935 !important;
  color: #e53935 !important;
}

.btn.danger-outline i{
  color: #e53935 !important;
}

.btn.danger-outline:hover{
  background: rgba(229, 57, 53, 0.10) !important;
}

#globalFollowupsBackdrop .header{
  display:flex;
  flex-direction:column;      /* ✅ forces second row */
  align-items:stretch;
  gap:12px;
}

#globalFollowupsBackdrop .headerTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
}

#globalFollowupsBackdrop .filtersWrap{
  padding-top:2px;
  border-top:1px solid rgba(255,255,255,0.08);
}

#globalFollowupsBackdrop #globalFollowupFilters{
  display:flex;
  gap:6px;
  width:100%;
}

#globalFollowupsBackdrop #globalFollowupFilters .btn{
  flex:1;
  white-space:nowrap;
  padding:10px 8px;
  font-size:13px;
}

/* =========================================
   FAVORITES MODAL - EXACT LIKE FOLLOWUPS
   Fixes 10-15% blank bottom gap on mobile
========================================= */

/* Modal must occupy full screen height like followups */
#favoritesBackdrop .modal{
  height: 100% !important;
  max-height: 100dvh !important;
  overflow: hidden;               /* ONLY body scrolls */
  display: flex;
  flex-direction: column;
}

/* Content must be full-height flex column */
#favoritesBackdrop .content{
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

/* Header fixed/clean */
#favoritesBackdrop .header{
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* Title + Cancel row */
#favoritesBackdrop .headerTop{
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Body fills remaining height and scrolls */
#favoritesBackdrop .favorites-body{
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;

  background: linear-gradient(180deg, rgba(230,242,255,0.75), rgba(245,250,255,0.95));
  border-radius: 5px;
  border: 1px solid rgba(0,0,0,0.08);
  box-sizing: border-box;
}

.assignable-row{
  display:flex;
  align-items:center;
  justify-content:center;   /* center horizontally */

  gap:20px;                 /* space between text & checkbox */

  font-size:14px;
  font-weight:600;

  padding:10px 12px;
  border-radius:6px;

  border:1px solid #e5e7eb;
  background:#fafafa;
}

.assignable-row input[type="checkbox"]{
  transform: scale(1.15);
  cursor:pointer;
}


/* Toast container */
#toastContainer {
  position: fixed;
  left: 50%;
  bottom: 150px; /* adjust if your bottom nav is taller */
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: calc(100% - 70px);
  max-width: 420px;
}


.toast {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  transition: all .25s ease;
}


/* Success */
.toast-success {
  background: #e6f4ff;
  color: #0b5394;
  border-left: 10px solid #2e7d32;
}

/* Warning */
.toast-warning {
  background: #fff7e6;
  color: #b45309;
  border-left: 10px solid #f59e0b;
}

/* Error */
.toast-error {
  background: #fee2e2;
  color: #991b1b;
  border-left: 10px solid #dc2626;
}


/* ================================
   Follow-up upcoming red blink
   (Overlay-based, base color preserved)
   ================================ */

.followup-upcoming-blink {
  position: relative;
  overflow: hidden; /* ensures overlay stays inside card */
}

.followup-upcoming-blink::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(239, 68, 68, 0); /* red overlay */
  pointer-events: none;
  animation: followupRedOverlayBlink 1.2s ease-in-out infinite;
}

@keyframes followupRedOverlayBlink {
  0% {
    background: rgba(239, 68, 68, 0);
  }

  50% {
    background: rgba(239, 68, 68, 0.35);
  }

  100% {
    background: rgba(230, 68, 68, 0);
  }
}

#notesMentionList {
  position: fixed;
  z-index: 2147483647; /* above all modals */
}


/* ================================
   Follow-up Toggle Badge (Base)
   ================================ */

.followup-toggle-badge {
  position: absolute;

  min-width: 15px;
  height: 15px;
  padding: 0 3px;

  font-size: 11px;
  font-weight: 600;
  line-height: 1;

  border-radius: 999px;

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
  pointer-events: none; /* never block toggle clicks */
}


/* === Follow-up notification button (matches hamburger) === */
.topbar .followup-btn {
  padding: 10px 5px !important;
  min-width: 45px;
  min-height: 40px;
  margin-left: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;

}

/* Bell icon styling */
.topbar .followup-btn i.fa-bell {
  font-size: 20px !important;
  line-height: 1;
  font-weight: 600;
  color: gold !important;
  margin-Right: 10px;
}

/* 🔴 Overdue (TOP-RIGHT) */
.followup-toggle-badge--overdue {
  top: 2px;
  right: 2px;

  background: #ef4444; /* red */
  color: #fff;
}

/* 🟡 Upcoming (BOTTOM-RIGHT) */
.followup-toggle-badge--upcoming {
  bottom: 2px;
  right: 2px;

  background: #facc15; /* yellow */
  color: #000;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px; /* control spacing here */
  margin-top: 5px;
}

.topbar .followup-btn i.fa-user-plus {
  font-size: 18px !important;
  color: #22c55e !important; /* green */
  margin-right: 7px;
  margin-Right: 13px;
}

/* =========================================
   HALF-HEIGHT CENTERED MODALS
   (Modify Stage + Modify Followup)
   ========================================= */

#modifyAssigneeStageBackdrop,
#setReminderBackdrop,
#modifyFollowupBackdrop {
  align-items: center !important;     /* center vertically */
  padding: 0 !important;
}

#modifyFollowupBackdrop .modal {
  width: calc(100% - 20px) !important;
  max-width: 520px !important;

  height: 60vh !important;            /* 🔑 THIS is the fix */
  max-height: 60vh !important;

  margin: auto !important;
  border-radius: 12px !important;

  overflow: hidden !important;        /* inner content scrolls */
  display: flex;
  flex-direction: column;
}

#setReminderBackdrop .modal {
  width: calc(100% - 20px) !important;
  max-width: 520px !important;

  height: 70vh !important;            /* 🔑 THIS is the fix */
  max-height: 70vh !important;

  margin: auto !important;
  border-radius: 12px !important;

  overflow: hidden !important;        /* inner content scrolls */
  display: flex;
  flex-direction: column;
}


#modifyAssigneeStageBackdrop .modal{
  width: calc(100% - 20px) !important;
  max-width: 520px !important;

  height: 35vh !important;            /* 🔑 THIS is the fix */
  max-height: 35vh !important;

  margin: auto !important;
  border-radius: 12px !important;

  overflow: hidden !important;        /* inner content scrolls */
  display: flex;
  flex-direction: column;
}

/* content scrolls, header stays visible */
#modifyAssigneeStageBackdrop .modal .content,
#setReminderBackdrop .modal .content,
#modifyFollowupBackdrop .modal .content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

#modifyAssigneeStageBackdrop {
  z-index: 11000;
}










.custom-alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.custom-alert-header .alert-cancel {
  display: inline-block;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

/* ================================
   Scope Action Bar (Bottom-fixed)
   ================================ */

.scope-action-bar {
  position: fixed;
  left: 0;
  right: 0;

  /* ✅ MOVE ABOVE NATIVE ADMOB BANNER */
  bottom: calc(
    env(safe-area-inset-bottom) + var(--ad-height)
  );

  height: var(--scope-bar-height);
  box-sizing: border-box;

  display: flex;
  justify-content: space-around;
  align-items: center;

  padding: 5px 5px;
  background: #ffffff;
  border-top: 1px solid #e6eef8;

  z-index: 1200;
}


/* =====================================
   NO-ADS MODE: remove ad height spacing
   ===================================== */

body.no-ads .scope-action-bar {
  bottom: env(safe-area-inset-bottom);
}



/* icon buttons */
.scope-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: none;
  background: none;

  display: grid;
  place-items: center;

  font-size: 20px;
  color: #374151;
}

.scope-icon.active {
  background: #3C52D3;
  color: #ffffff;
}

/* auto-hide */
.scope-action-bar.hidden {
  transform: translateY(100%);
  transition: transform 0.25s ease;
}

/* ================================
   Scope Action Bar – colorful icons
   ================================ */

/* default icon size */
.scope-icon i {
  font-size: 20px;
}

/* My Properties – green */
#scopeMyProps i {
  color: #16a34a; /* green-600 */
}

/* My Requirements – indigo */
#scopeMyReqs i {
  color: #4f46e5; /* indigo-600 */
}

/* Assigned Properties – orange */
#scopeAssignedProps i {
  color: #ea580c; /* orange-600 */
}

/* Assigned Requirements – amber */
#scopeAssignedReqs i {
  color: #d97706; /* amber-600 */
}

/* All Properties – blue */
#scopeAllProps i {
  color: #2563eb; /* blue-600 */
}

/* All Requirements – purple */
#scopeAllReqs i {
  color: #7c3aed; /* violet-600 */
}

/* -------------------------------
   ACTIVE STATE (override colors)
   ------------------------------- */
.scope-icon.active {
  background: #3C52D3;
}

.scope-icon.active i {
  color: #ffffff !important;
}

/* optional soft background */
.scope-icon {
  background: rgba(60,82,211,0.06);
}

.scope-icon.active {
  background: #3C52D3;
}

.scope-icon span {
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}
/* Scope Action Bar: hidden until permissions applied */
#scopeActionBar {
  display: none;
}

.manage-contacts-menu{
  position: fixed;

  bottom: calc(
    env(safe-area-inset-bottom) +
    var(--ad-height) +
    var(--scope-bar-height) + 2px
  );

  left: 50%;
  transform: translateX(-50%);

  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);

  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;

  z-index: 9999;
  min-width: 150px;
}

body.no-ads .manage-contacts-menu{
  bottom: calc(
    env(safe-area-inset-bottom) +
    var(--scope-bar-height) + 8px
  );
}

.manage-contacts-menu button{
  display:flex;
  align-items:center;
  gap:14px;

  background:none;
  border:none;
  padding:10px 14px;
  text-align:left;
  cursor:pointer;
  font-size:14px;
  color:#333;

  border-radius:8px;
}

.manage-contacts-menu button i{
  color:#2f6fed;   /* same blue as sidebar */
  width:18px;
}

.manage-contacts-menu button:hover{
  background:#f2f6ff;
}

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

.scope-manage i{
  color:#2f6fed;   /* same blue tone used in sidebar */
}

.manage-count {
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
  opacity: 0.8;
}

@media (min-width: 881px) {

  #dashboardBackdrop .modal,
  #customerRequestsBackdrop .modal,
  #favoritesBackdrop .modal,
  #viewBackdrop .modal,
  #editBackdrop .modal,
  #notesBackdrop .modal,
  #assignAgentsBackdrop .modal,
  #assignBuildersBackdrop .modal,
  #profileBackdrop .modal,
  #globalFollowupsBackdrop .modal,
  
  #assignCustomersBackdrop .modal {
    
    height: 90vh;
    max-height: 90vh;
  }

}

/* Hide on desktop */
@media (min-width: 881px) {
  .scope-action-bar {
    display: none !important;
  }
}

/* Show on mobile */
@media (max-width: 880px) {
  .scope-action-bar {
    display: flex;
  }
}
.modal {
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* DESKTOP */
@media (min-width: 881px) {
  .modal {
    width: 800px;
    max-width: 90%;
    max-height: 90vh;
    margin: auto;
  }
}

/* MOBILE */
@media (max-width: 880px) {
  .modal {
    width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
  }
}

/* 🔔 Customer request highlight */
.cr-highlight {
  animation: crPulse 1s ease-in-out infinite;
  box-shadow: 0 0 0px rgba(34,197,94,0.7);
  border-radius: 10px;
}

@keyframes crPulse {
  0% {
    box-shadow: 0 0 0px rgba(34,197,94,0.7);
  }
  50% {
    box-shadow: 0 0 12px rgba(34,197,94,0.9);
  }
  100% {
    box-shadow: 0 0 0px rgba(34,197,94,0.7);
  }
}

/* Optional small NEW tag */
.cr-new-tag {
  position: absolute;
  top: -5px;
  left: -5px;
  background: #22c55e;
  color: #fff;
  font-size: 8px;
  padding: 2px 5px;
  border-radius: 6px;
  font-weight: 600;
}