/* Palette: reuses the exact sage-to-ink gradient already established in
   login_theme.css's background art (--wb-sage/-mid/-ink/-ink-dark below
   correspond to that SVG's own stop colors), rather than introducing a
   second, disconnected color scheme. Previously the whole customer portal
   ran on --wb-ink alone (#143631, the *darkest* stop — effectively black-
   green) for every heading/button/accent; the staff Desk theme's actual
   default is the much lighter #8aad9f sage, with dark ink reserved for
   text only. This shifts the portal's primary surfaces/accents toward
   that same lighter sage family and keeps the darkest tone for text,
   matching how the Desk theme already splits the two. */
/* Defined on :root (not just .wb-portal) so page-level rules like the body
   background and the portal nav bar -- both ancestors/siblings of .wb-portal
   rather than descendants -- can use these tokens too. */
:root {
	--wb-sage: #8aad9f;
	--wb-sage-mid: #6f9c8e;
	--wb-ink: #2a5850;
	--wb-ink-dark: #1c4a42;
	--wb-sage-tint: #f4f9f7;
	/* Same orange already used for links/accents elsewhere on this site
	   (login_theme.css) -- reused here as the dashboard's one "act now"
	   color rather than introducing a second accent hue. */
	--wb-orange: #d9660f;
	--wb-orange-tint: #fbeade;
	--wb-warning: #a8660f;
	--wb-warning-tint: #faeed9;
	--wb-success: #4a7c59;
	--wb-success-tint: #e8f2ea;
	--wb-border: #e4e0d5;
}

.wb-portal h2 {
	color: var(--wb-ink);
	font-weight: 600;
	margin-bottom: 4px;
}

.wb-card-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 20px;
}

.wb-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #ffffff;
	border: 1px solid #e5e5e5;
	border-left: 3px solid var(--wb-sage);
	border-radius: 8px;
	padding: 16px 18px;
}

.wb-doc-actions {
	display: flex;
	gap: 8px;
	align-items: center;
}

.wb-card-block {
	display: block;
	margin-top: 20px;
}

.wb-card-title {
	font-weight: 600;
	color: var(--wb-ink);
}

.wb-card-sub {
	color: #74808b;
	font-size: 13px;
	margin-top: 2px;
}

.wb-empty {
	margin-top: 24px;
	padding: 24px;
	text-align: center;
	color: #74808b;
	background: var(--wb-sage-tint);
	border-radius: 8px;
}

.wb-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	background: #f4f1ec;
	color: var(--wb-ink);
}

.wb-badge-active,
.wb-badge-completed,
.wb-badge-invoiced {
	background: #e1f5ee;
	color: #085041;
}

.wb-badge-quoted,
.wb-badge-upcoming {
	background: #faeeda;
	color: #633806;
}

.wb-badge-cancelled,
.wb-badge-terminated {
	background: #fcebeb;
	color: #791f1f;
}

.wb-badge-paid {
	background: #e1f5ee;
	color: #085041;
}

.wb-badge-unpaid,
.wb-badge-partly-paid {
	background: #faeeda;
	color: #633806;
}

.wb-badge-overdue {
	background: #fcebeb;
	color: #791f1f;
}

.wb-lease-meta {
	display: flex;
	gap: 28px;
	margin-top: 14px;
}

.wb-label {
	display: block;
	font-size: 12px;
	color: #74808b;
	margin-bottom: 4px;
}

.wb-lease-invoices {
	margin-top: 18px;
	padding-top: 14px;
	border-top: 1px solid #eee;
}

.wb-invoice-row {
	display: flex;
	justify-content: space-between;
	padding: 6px 0;
	font-size: 14px;
}

.wb-stat-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 12px;
	margin: 20px 0;
}

.wb-stat {
	background: var(--wb-sage-tint);
	border-radius: 8px;
	padding: 16px;
	text-align: center;
}

.wb-stat-link {
	display: block;
	text-decoration: none;
	transition: box-shadow 0.15s ease;
}

.wb-stat-link:hover {
	box-shadow: 0 2px 10px rgba(42, 88, 80, 0.16);
	text-decoration: none;
}

.wb-stat-value {
	font-size: 28px;
	font-weight: 700;
	color: var(--wb-ink);
}

.wb-stat-label {
	font-size: 13px;
	color: #74808b;
	margin-top: 2px;
}

.wb-quick-links {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 12px;
	margin-top: 12px;
}

.wb-quick-link {
	flex-direction: column;
	align-items: flex-start;
	text-decoration: none;
	transition: box-shadow 0.15s ease;
}

.wb-quick-link:hover {
	box-shadow: 0 2px 10px rgba(42, 88, 80, 0.16);
	text-decoration: none;
}

/* Quick-link cards had no visual anchor beyond a title/subtitle pair —
   Tabler Icons (already vendored for Desk, see hooks.py) reused here so
   each destination reads at a glance instead of purely by its label. */
.wb-quick-link-icon {
	font-size: 26px;
	color: var(--wb-sage);
	margin-bottom: 10px;
}

/* --- Dashboard redesign (2026-08) ------------------------------------------
   "Next up" hero card: one clear next action above the stat row instead of
   three equal-weight numbers with no obvious first move. */
.wb-next-up {
	margin-top: 16px;
	background: #ffffff;
	border: 1px solid var(--wb-border);
	border-left: 4px solid var(--wb-orange);
	border-radius: 14px;
	box-shadow: 0 1px 2px rgba(28, 74, 66, 0.06), 0 6px 20px rgba(28, 74, 66, 0.05);
	padding: 18px 20px;
	display: flex;
	align-items: center;
	gap: 16px;
}

.wb-next-up-neutral {
	border-left-color: var(--wb-sage);
}

.wb-next-up-icon {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: var(--wb-orange-tint);
	color: var(--wb-orange);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	flex-shrink: 0;
}

.wb-next-up-icon.wb-next-up-icon-neutral {
	background: var(--wb-sage-tint);
	color: var(--wb-sage-mid);
}

.wb-next-up-body {
	flex: 1;
	min-width: 0;
}

.wb-next-up-label {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--wb-orange);
	font-weight: 700;
	margin: 0 0 3px;
}

.wb-next-up-label.wb-next-up-label-neutral {
	color: var(--wb-sage-mid);
}

.wb-next-up-title {
	font-size: 16px;
	font-weight: 600;
	margin: 0 0 2px;
	color: var(--wb-ink);
}

.wb-next-up-sub {
	font-size: 13px;
	color: #74808b;
	margin: 0;
}

/* Pills: state as color + shape, not just a number, so status reads at a
   glance in the properties row and activity timeline. */
.wb-pill {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 11px;
	font-weight: 700;
	padding: 3px 9px;
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.wb-pill-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
}

.wb-pill-success { background: var(--wb-success-tint); color: var(--wb-success); }
.wb-pill-success .wb-pill-dot { background: var(--wb-success); }
.wb-pill-warning { background: var(--wb-warning-tint); color: var(--wb-warning); }
.wb-pill-warning .wb-pill-dot { background: var(--wb-warning); }
.wb-pill-sage { background: var(--wb-sage-tint); color: var(--wb-sage-mid); }
.wb-pill-sage .wb-pill-dot { background: var(--wb-sage-mid); }

/* Property cards: photo-forward horizontal row instead of a plain list --
   these are homes people recognize by sight faster than by address text. */
.wb-prop-scroll {
	display: flex;
	gap: 14px;
	overflow-x: auto;
	padding-bottom: 6px;
	margin: 0 -2px;
}

.wb-prop-card {
	flex: 0 0 230px;
	border: 1px solid var(--wb-border);
	border-top: 3px solid var(--wb-sage);
	border-radius: 14px;
	overflow: hidden;
	background: #ffffff;
	box-shadow: 0 1px 2px rgba(28, 74, 66, 0.06), 0 6px 20px rgba(28, 74, 66, 0.05);
}

.wb-prop-card-success {
	border-top-color: var(--wb-success);
}

.wb-prop-photo {
	height: 120px;
	width: 100%;
	background: var(--wb-sage-tint) center/cover no-repeat;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--wb-sage);
	font-size: 26px;
}

.wb-prop-body {
	padding: 12px 14px 14px;
}

.wb-prop-title {
	font-weight: 600;
	font-size: 14px;
	margin: 0 0 2px;
	color: var(--wb-ink);
}

.wb-prop-addr {
	font-size: 12px;
	color: #74808b;
	margin: 0 0 10px;
}

/* Activity timeline: a connected rail of dots reads as "things happening
   over time" much faster than a flat list of unrelated rows. */
.wb-timeline {
	display: flex;
	flex-direction: column;
}

.wb-tl-item {
	display: flex;
	gap: 14px;
}

.wb-tl-rail {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 20px;
	flex-shrink: 0;
}

.wb-tl-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	margin-top: 5px;
	flex-shrink: 0;
	background: var(--tl-color, var(--wb-sage-mid));
}

.wb-tl-line {
	width: 1px;
	flex: 1;
	background: var(--wb-border);
	margin-top: 4px;
	min-height: 22px;
}

.wb-tl-item:last-child .wb-tl-line {
	display: none;
}

.wb-tl-card {
	flex: 1;
	background: #ffffff;
	border: 1px solid var(--wb-border);
	border-left: 3px solid var(--tl-color, var(--wb-sage-mid));
	border-radius: 12px;
	padding: 13px 15px;
	margin-bottom: 14px;
}

.wb-tl-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.wb-tl-title {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--wb-ink);
}

.wb-tl-meta {
	font-size: 12px;
	color: #74808b;
	margin-top: 3px;
}

/* Dashboard two-column layout: main column + a narrower sidebar for quick
   actions and recent documents. */
.wb-dashboard-grid {
	display: grid;
	grid-template-columns: 1fr 280px;
	gap: 28px;
	align-items: start;
	margin-top: 8px;
}

.wb-side-card {
	background: #ffffff;
	border: 1px solid var(--wb-border);
	border-radius: 14px;
	padding: 16px;
	margin-bottom: 16px;
}

.wb-side-card h3 {
	font-size: 12.5px;
	margin: 0 0 12px;
	color: #74808b;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-weight: 700;
}

.wb-quick-action {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 4px;
	border-bottom: 1px solid var(--wb-border);
	font-size: 13.5px;
	font-weight: 600;
	color: var(--wb-ink);
	cursor: pointer;
	text-decoration: none;
}

.wb-quick-action:last-child {
	border-bottom: none;
}

.wb-quick-action:hover {
	color: var(--wb-ink-dark);
	text-decoration: none;
}

.wb-qa-icon {
	width: 30px;
	height: 30px;
	border-radius: 8px;
	background: var(--wb-sage-tint);
	color: var(--wb-sage-mid);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 15px;
	flex-shrink: 0;
}

.wb-doc-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 0;
	border-bottom: 1px solid var(--wb-border);
	gap: 10px;
}

.wb-doc-row:last-child {
	border-bottom: none;
}

.wb-doc-row-name {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--wb-ink);
}

.wb-doc-row-meta {
	font-size: 11px;
	color: #98a29c;
}

.wb-doc-row-link {
	font-size: 11.5px;
	color: var(--wb-sage-mid);
	font-weight: 700;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	flex-shrink: 0;
}

/* Small clickable photo thumbnails on the Service Jobs page -- tenant-
   submitted maintenance photos (upload_maintenance_photo, rbac.py) and any
   staff-attached job photos, opened via the same View/Download flow every
   other document uses. */
.wb-job-photos {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.wb-job-thumb-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.wb-job-thumb {
	width: 56px;
	height: 56px;
	border-radius: 8px;
	border: 1px solid var(--wb-border);
	background-color: var(--wb-sage-tint);
	background-size: cover;
	background-position: center;
	padding: 0;
	cursor: pointer;
}

.wb-job-thumb-date {
	font-size: 11px;
	color: #98a29c;
}

/* Shared section-header style for any grouped list of documents/photos --
   used identically on the Documents page's category groups and here, so a
   group of files reads the same way no matter which portal page it's on. */
.wb-doc-group-label {
	font-size: 15px;
	font-weight: 600;
	color: var(--wb-ink);
	margin-bottom: 10px;
}

.wb-doc-group-label .wb-doc-group-count {
	color: #98a29c;
	font-weight: 400;
}

/* Expandable "Details" section on Service Job / Invoice cards -- notes
   text and itemized line items that don't need to be visible by default
   but are one click away rather than requiring a separate detail page. */
.wb-job-notes {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid var(--wb-border);
	font-size: 13.5px;
	color: var(--wb-ink);
	white-space: pre-wrap;
}

.wb-line-items {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid var(--wb-border);
}

.wb-line-item-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 4px 0;
	font-size: 13px;
}

.wb-line-item-desc {
	color: var(--wb-ink);
}

.wb-line-item-amount {
	color: #74808b;
	flex-shrink: 0;
	font-variant-numeric: tabular-nums;
}

/* Filter chips on list pages (Service Jobs, Invoices) -- pure client-side
   show/hide against a server-computed data-filter-group, no reload. */
.wb-filter-chips {
	display: flex;
	gap: 8px;
	margin: 18px 0 4px;
	flex-wrap: wrap;
}

.wb-filter-chip {
	background: #ffffff;
	border: 1px solid var(--wb-border);
	border-radius: 999px;
	padding: 6px 16px;
	font-size: 13px;
	font-weight: 600;
	color: var(--wb-ink);
	cursor: pointer;
}

.wb-filter-chip-active {
	background: var(--wb-ink);
	border-color: var(--wb-ink);
	color: #ffffff;
}

/* Form styling for the two customer-submitted-form pages (get-quote,
   maintenance-request) — scoped to .wb-portal so it never leaks into
   Desk or any other Bootstrap-using page on the site. */
.wb-portal label {
	font-size: 12px;
	font-weight: 600;
	color: #74808b;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.wb-portal .form-control {
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	padding: 8px 12px;
	/* >=16px stops iOS Safari auto-zooming the page on input focus — a
	   smaller inherited size here would otherwise trigger that on every
	   phone visit. */
	font-size: 16px;
}

.wb-portal .form-control:focus {
	border-color: var(--wb-ink);
	box-shadow: 0 0 0 3px rgba(42, 88, 80, 0.16);
	outline: none;
}

.wb-portal .btn-primary {
	background: var(--wb-ink);
	border-color: var(--wb-ink);
	border-radius: 8px;
	padding: 8px 20px;
	font-weight: 600;
}

.wb-portal .btn-primary:hover,
.wb-portal .btn-primary:focus {
	background: var(--wb-ink-dark);
	border-color: var(--wb-ink-dark);
}

/* --- Page background (2026-08) ---------------------------------------------
   The whole viewport, not just individual cards -- a plain white page made
   every white card blend into it with no depth. A subtle sage tint behind
   white cards gives the portal a warmer, less flat feel without resorting
   to gradients. */
body:has(.wb-portal) {
	background: var(--wb-sage-tint);
}

/* Same precedent as the login page (login_theme.css's
   body[data-path="login"] .web-footer rule) -- the stock "Powered by
   ERPNext" footer doesn't belong on a branded customer portal page. */
body:has(.wb-portal) .web-footer {
	display: none;
}

/* --- Portal section nav ----------------------------------------------------
   The stock website navbar had no page-to-page navigation at all beyond the
   hamburger's account dropdown. Portal pages now set
   context.top_bar_items = get_portal_top_bar_items() (rbac.py) so Frappe's
   own navbar_items.html renders Dashboard/Properties/Service Jobs/
   Documents/Invoices as real nav-items INSIDE the same navbar row as the
   logo (the stock top_bar_items mechanism, normally unused since Website
   Settings has none configured) -- not a second bar of our own, and it
   automatically folds into the existing mobile hamburger collapse since
   top_bar_items renders inside the same .navbar-collapse. This just
   restyles those stock .nav-link elements to fit the brand. */
/* The site navbar itself is dark ink green (desk_theme.css), so these need
   light text, not the ink color used everywhere else in this file. */
body:has(.wb-portal) .navbar .navbar-nav.mr-auto .nav-link {
	color: rgba(255, 255, 255, 0.85);
	font-weight: 600;
	font-size: 14px;
}

body:has(.wb-portal) .navbar .navbar-nav.mr-auto .nav-link:hover {
	color: var(--wb-orange);
}

/* --- Site branding on portal pages ---------------------------------------
   The stock website navbar (frappe/templates/includes/navbar/navbar.html)
   renders Website Settings' banner_image with no size constraint of its
   own — logo.png is a wide 1024x243 lockup meant to sit at a deliberate,
   noticeable size, not shrink to whatever a generic nav bar happens to
   default to. Scoped to .wb-portal pages only; the login page hides this
   navbar entirely and sizes its own copy separately in login_theme.css. */
body:has(.wb-portal) .navbar-brand img {
	max-height: 52px;
	width: auto;
}

/* --- Bigger top bar (2026-08-03) -------------------------------------------
   User's own ask: the desktop navbar felt small relative to the rest of the
   page. Bootstrap's default navbar sizes itself purely from its content's
   own line-height with no deliberate vertical padding, so the whole strip
   read as thin no matter how big the logo/avatar inside it were on their
   own — needs real padding on the bar itself, not just bigger contents. */
body:has(.wb-portal) .navbar {
	padding-top: 18px;
	padding-bottom: 18px;
}

body:has(.wb-portal) .navbar-brand img {
	max-height: 68px;
}

body:has(.wb-portal) .navbar .avatar,
body:has(.wb-portal) .navbar .user-image-wrapper .avatar {
	width: 40px;
	height: 40px;
	line-height: 40px;
	font-size: 16px;
}

/* --- Mobile ---------------------------------------------------------------
   No breakpoints existed anywhere in this file before — auto-fit grids
   happen to collapse reasonably on their own, but spacing, touch targets,
   and heading sizes were all still tuned for desktop only. */
@media (max-width: 640px) {
	.wb-portal {
		padding-left: 12px !important;
		padding-right: 12px !important;
	}

	/* The bigger desktop navbar padding/avatar above would otherwise make
	   an already-tight mobile header even more cramped alongside the
	   hamburger toggle — keep mobile at the original, smaller sizing. */
	body:has(.wb-portal) .navbar {
		padding-top: 8px;
		padding-bottom: 8px;
	}

	body:has(.wb-portal) .navbar .avatar,
	body:has(.wb-portal) .navbar .user-image-wrapper .avatar {
		width: 30px;
		height: 30px;
		line-height: 30px;
		font-size: 13px;
	}

	.wb-portal h2 {
		font-size: 22px;
	}

	.wb-card {
		padding: 14px;
	}

	.wb-stat-row,
	.wb-quick-links {
		grid-template-columns: 1fr;
	}

	.wb-stat-value {
		font-size: 24px;
	}

	.wb-lease-meta {
		flex-wrap: wrap;
		gap: 16px;
	}

	/* Comfortable tap target height (44px is the standard minimum) on
	   every link/button a customer actually taps on a phone. */
	.wb-quick-link,
	.wb-portal .btn-primary {
		min-height: 44px;
	}

	body:has(.wb-portal) .navbar-brand img {
		max-height: 40px;
	}

	.wb-dashboard-grid {
		grid-template-columns: 1fr;
	}

	.wb-next-up {
		flex-wrap: wrap;
	}

	.wb-next-up .btn {
		width: 100%;
	}

	.wb-prop-card {
		flex-basis: 200px;
	}
}

/* --- Dedicated full-page chat route (/assistant) ---------------------------
   Shown only for the brief window before the ChangAI widget itself mounts
   inside it and covers this with its own full-page panel (see
   changai_brand.js's IS_ASSISTANT_PAGE handling) — kept minimal on purpose,
   this is a loading state, not a real page. */
.wb-assistant-page {
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--wb-sage-tint);
	color: var(--wb-ink);
	font-size: 15px;
}
