/*
 * FORUM Booking components. Scoped under .fb; colours/fonts come from the child theme's
 * --forum-* tokens (see docs/INTEGRATION.md) with warm fallbacks.
 */
.fb {
	--fb-bg: var(--forum-color-surface, #fffaf3);
	--fb-panel: var(--forum-color-panel, #ffffff);
	--fb-text: var(--forum-color-text, #2b2118);
	--fb-muted: var(--forum-color-muted, #6b5d50);
	--fb-line: var(--forum-color-line, #e6d9c8);
	--fb-primary: var(--forum-color-primary, #9a3412);
	--fb-primary-text: var(--forum-color-on-primary, #ffffff);
	--fb-accent: var(--forum-color-accent, #c2410c);
	--fb-danger: #b91c1c;
	--fb-radius: 8px;
	font-family: var(--forum-font-body, 'Outfit', system-ui, sans-serif);
	font-size: 16px;
	line-height: 1.5;
	color: var(--fb-text);
	box-sizing: border-box;
}
.fb *, .fb *::before, .fb *::after { box-sizing: inherit; }
.fb-h1, .fb-h, .fb-h3 { font-family: var(--forum-font-heading, 'Geologica', system-ui, sans-serif); line-height: 1.25; margin: 0 0 .75rem; }
.fb-h1 { font-size: 2rem; }
.fb-h { font-size: 1.5rem; }
.fb-h3 { font-size: 1.2rem; }
.fb-help, .fb-muted { color: var(--fb-muted); font-size: .9rem; }
.fb-empty { color: var(--fb-muted); font-style: italic; }
.fb-pre { white-space: pre-wrap; margin: 0; font-family: inherit; }
.fb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.fb-hp { position: absolute; left: -9999px; }

/* Forms */
.fb-form fieldset { border: 1px solid var(--fb-line); border-radius: var(--fb-radius); padding: 1rem 1.25rem; margin: 0 0 1.25rem; background: var(--fb-panel); }
.fb-form legend { font-family: var(--forum-font-heading, 'Geologica', sans-serif); font-weight: 600; padding: 0 .4rem; }
.fb-field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; flex: 1 1 200px; min-width: 0; }
.fb select { max-width: 100%; text-overflow: ellipsis; }
.fb-field label, .fb-filters label, .fb-inline-form label { font-size: .95rem; font-weight: 600; }
.fb input[type=text], .fb input[type=email], .fb input[type=tel], .fb input[type=number], .fb input[type=date], .fb input[type=search], .fb input[type=password], .fb select, .fb textarea {
	font: inherit; font-size: 16px; padding: .55rem .7rem; border: 1px solid #b9a894; border-radius: 6px; background: #fff; color: var(--fb-text); width: 100%; min-height: 44px; box-sizing: border-box;
}
.fb :focus-visible { outline: 3px solid var(--fb-accent); outline-offset: 2px; }
.fb [aria-invalid=true] { border-color: var(--fb-danger); }
.fb-field-error { color: var(--fb-danger); font-size: .9rem; margin: 0; }
.fb-req { color: var(--fb-danger); }
.fb-opt { font-weight: 400; color: var(--fb-muted); }
.fb-row { display: flex; flex-wrap: wrap; gap: 0 1rem; }
.fb-check label { font-weight: 400; display: flex; gap: .5rem; align-items: flex-start; }
.fb-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .5rem; }
.fb-inline-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.fb-inline-form select { width: auto; }
.fb-inline { display: inline; }
form.is-busy button { opacity: .6; cursor: progress; }

/* Buttons */
.fb-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .5rem 1.1rem; border-radius: 6px; border: 1px solid var(--fb-primary); background: #fff; color: var(--fb-primary); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.fb-btn:hover { background: #fdf1e6; }
.fb-btn--primary { background: var(--fb-primary); color: var(--fb-primary-text); }
.fb-btn--primary:hover { background: var(--fb-accent); }
.fb-btn--danger { border-color: var(--fb-danger); color: var(--fb-danger); }
.fb-btn--small { min-height: 36px; padding: .3rem .8rem; font-size: .9rem; }
.fb-btn[aria-current] { background: var(--fb-primary); color: #fff; }
.fb-linkbtn { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; font-size: .85rem; }

/* Notices & badges */
.fb-notice { border-radius: var(--fb-radius); padding: .8rem 1rem; margin: 0 0 1rem; border: 1px solid; }
.fb-notice--error { background: #fef2f2; border-color: #fca5a5; color: #7f1d1d; }
.fb-notice--success { background: #f0fdf4; border-color: #86efac; color: #14532d; }
.fb-notice--info { background: #eff6ff; border-color: #93c5fd; color: #1e3a8a; }
.fb-badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .85rem; font-weight: 600; border: 1px solid; white-space: nowrap; }
.fb-badge--new { background: #eff6ff; color: #1e40af; border-color: #93c5fd; }
.fb-badge--under_review { background: #fefce8; color: #854d0e; border-color: #fde047; }
.fb-badge--tentative { background: #fff7ed; color: #9a3412; border-color: #fdba74; }
.fb-badge--confirmed { background: #f0fdf4; color: #166534; border-color: #86efac; }
.fb-badge--rejected, .fb-badge--cancelled { background: #f5f5f4; color: #57534e; border-color: #d6d3d1; }
.fb-badge--completed { background: #f5f3ff; color: #5b21b6; border-color: #c4b5fd; }
.fb-demo, .fb-tag { display: inline-block; font-size: .8rem; padding: .05rem .5rem; border-radius: 4px; background: #fef3c7; color: #78350f; border: 1px dashed #d97706; }

/* Summary lists */
.fb-summary { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: .4rem 1rem; margin: 0 0 1rem; }
.fb-summary dt { font-weight: 600; color: var(--fb-muted); }
.fb-summary dd { margin: 0; }
.fb-summary ul { margin: 0; padding-left: 1.1rem; }
.fb-estimate { background: var(--fb-panel); border: 1px solid var(--fb-line); border-radius: var(--fb-radius); padding: 1rem; margin-bottom: 1rem; }
.fb-estimate__amount { font-size: 1.2rem; margin: 0 0 .3rem; }
.fb-important { border-left: 4px solid var(--fb-accent); padding: .5rem .9rem; background: #fff7ed; }
.fb-ref { font-family: var(--forum-font-heading, 'Geologica', sans-serif); font-size: 2rem; font-weight: 700; letter-spacing: .05em; margin: 0; }

/* Calendars */
.fb-cal-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 1rem 0; }
.fb-cal-nav .fb-h { margin: 0; }
.fb-cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
.fb-cal th { font-size: .85rem; color: var(--fb-muted); padding: .3rem; }
.fb-cal td { border: 1px solid var(--fb-line); vertical-align: top; height: 92px; padding: .3rem; background: var(--fb-panel); font-size: .8rem; }
.fb-cal td.is-past { background: #f5f5f4; color: #a8a29e; }
.fb-cal td.is-today { outline: 2px solid var(--fb-accent); outline-offset: -2px; }
.fb-cal__pad { background: transparent !important; border: 0 !important; }
.fb-cal__num { display: block; font-weight: 700; font-size: .9rem; }
.fb-cal__busy { display: block; background: #fee2e2; color: #7f1d1d; border-radius: 4px; padding: .1rem .3rem; margin: .15rem 0; }
.fb-cal td.is-full { background: #fdf2f2; }
.fb-cal__full { display: block; background: #fee2e2; color: #7f1d1d; border-radius: 4px; padding: .1rem .3rem; margin: .15rem 0; font-weight: 600; }
.fb-cal__partial { display: block; font-weight: 600; color: #9a3412; margin-top: .15rem; }
.fb-cal__free { display: block; background: #ecfdf5; color: #14532d; border-radius: 4px; padding: .1rem .3rem; margin: .15rem 0; }
.fb-day-status { margin: .2rem 0 .6rem; padding: .6rem .8rem; border-radius: 6px; background: #ecfdf5; border: 1px solid #86efac; color: #14532d; }
.fb-day-status.is-full { background: #fef2f2; border-color: #fca5a5; color: #7f1d1d; }
.fb-day-status.is-idle { background: #f5f5f4; border-color: #e7e5e4; color: var(--fb-muted); }
.fb-cal__apply { display: inline-block; margin-top: .2rem; font-size: .8rem; }
.fb-ev { display: block; border-radius: 4px; padding: .15rem .3rem; margin: .15rem 0; text-decoration: none; color: inherit; border-left: 4px solid; font-size: .78rem; }
.fb-legend .fb-ev { display: inline-block; }
.fb-ev--confirmed { background: #dcfce7; border-color: #16a34a; }
.fb-ev--tentative { background: #ffedd5; border-color: #ea580c; }
.fb-ev--blackout { background: #e7e5e4; border-color: #44403c; }

/* Staff portal shell */
.fb-portal { background: var(--fb-bg); border: 1px solid var(--fb-line); border-radius: var(--fb-radius); width: 100%; }

/*
 * Staff dashboard page: full width with 5% side padding. Block themes (e.g. Twenty Twenty-Five)
 * cap content with "constrained" layout rules marked !important, so these override them on this page only.
 */
/* Block themes: post content is already .alignfull (edge to edge); just replace its padding and lift the width cap. */
body.fb-staff-page .wp-block-post-content {
	padding-left: 5% !important;
	padding-right: 5% !important;
}
body.fb-staff-page .wp-block-post-content > *,
body.fb-staff-page .entry-content > * {
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}
/* Classic themes (e.g. Hello Elementor): widen the outer content container only (inner .page-content keeps 0 padding). */
body.fb-staff-page .site-main:not(.wp-block-group) {
	max-width: none !important;
	width: 100% !important;
	padding-left: 5% !important;
	padding-right: 5% !important;
	box-sizing: border-box;
}
/* The portal has its own header; hide the theme's page title on this page. */
body.fb-staff-page .wp-block-post-title,
body.fb-staff-page .entry-title,
body.fb-staff-page .page-header { display: none !important; }
body.fb-staff-page main.wp-block-group { margin-top: var(--wp--preset--spacing--30, 1.5rem) !important; }
body.fb-staff-page .wp-block-post-content { padding-top: 0 !important; }.fb-topbar { display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem; border-bottom: 1px solid var(--fb-line); background: var(--fb-panel); border-radius: var(--fb-radius) var(--fb-radius) 0 0; }
.fb-brand { font-family: var(--forum-font-heading, 'Geologica', sans-serif); font-weight: 700; font-size: 1.1rem; margin-right: auto; }
.fb-user { font-size: .95rem; }
.fb-user__role { color: var(--fb-muted); }
.fb-navtoggle { display: none; }
.fb-shell { display: grid; grid-template-columns: 200px 1fr; min-height: 60vh; }
.fb-sidenav { border-right: 1px solid var(--fb-line); padding: 1rem .5rem; }
.fb-sidenav ul { list-style: none; margin: 0; padding: 0; }
.fb-sidenav a { display: block; padding: .6rem .8rem; border-radius: 6px; text-decoration: none; color: var(--fb-text); font-weight: 600; }
.fb-sidenav a:hover { background: #fdf1e6; }
.fb-sidenav a[aria-current] { background: var(--fb-primary); color: #fff; }
.fb-main { padding: 1.25rem 1.5rem; min-width: 0; }
.fb-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin-bottom: .5rem; }
.fb-stat { display: flex; flex-direction: column; padding: 1rem; background: var(--fb-panel); border: 1px solid var(--fb-line); border-radius: var(--fb-radius); text-decoration: none; color: inherit; }
.fb-stat__n { font-family: var(--forum-font-heading, 'Geologica', sans-serif); font-size: 2rem; font-weight: 700; }
.fb-stat__l { color: var(--fb-muted); font-size: .95rem; }
.fb-section, .fb-panel { margin: 1.5rem 0; }
.fb-panel { background: var(--fb-panel); border: 1px solid var(--fb-line); border-radius: var(--fb-radius); padding: 1rem 1.25rem; }
.fb-list { padding-left: 1.1rem; }
.fb-list li { margin: .35rem 0; }
.fb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 1rem; }
.fb-grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.fb-detail-head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.fb-detail-head .fb-h1 { margin: 0; }
.fb-actions-list { display: flex; flex-wrap: wrap; gap: .75rem; }
.fb-action-form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.fb-action-form input[type=text] { width: 220px; }
.fb-notes, .fb-history { padding-left: 1.1rem; }
.fb-notes li, .fb-history li { margin: .5rem 0; }
.fb-reschedule > summary { cursor: pointer; }
.fb-inline-h { display: inline; font-size: 1.25rem; }
.fb-row > .fb-check { flex: 1 1 200px; display: flex; gap: .5rem; align-items: center; margin-bottom: .9rem; }
.fb-copy { margin: -.5rem 0 1rem; display: flex; flex-direction: column; gap: .3rem; }
.fb-copy label { font-weight: 600; font-size: .9rem; }
.fb-btn--whatsapp { background: #25d366; border-color: #1da851; color: #073b1c; }
.fb-btn--whatsapp:hover { background: #1fbe5a; }
.fb-copy input { font-family: ui-monospace, monospace; font-size: .85rem !important; }
.fb-mail { border-top: 1px solid var(--fb-line); padding: .5rem 0; }
.fb-mail summary { cursor: pointer; }
.fb-filters { display: flex; flex-wrap: wrap; gap: 0 1rem; align-items: flex-end; background: var(--fb-panel); border: 1px solid var(--fb-line); border-radius: var(--fb-radius); padding: 1rem 1rem .2rem; margin-bottom: 1rem; }
.fb-filters .fb-field { flex: 1 1 160px; }
.fb-table-wrap { overflow-x: auto; }
.fb-table { width: 100%; border-collapse: collapse; background: var(--fb-panel); }
.fb-table th, .fb-table td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--fb-line); vertical-align: top; }
.fb-table th { font-size: .9rem; color: var(--fb-muted); }
.fb-pager { display: flex; gap: .4rem; margin-top: 1rem; flex-wrap: wrap; }
.fb-staff-login { max-width: 420px; margin: 2rem auto; }
.fb-staff-login form p { display: flex; flex-direction: column; gap: .3rem; }
.fb-staff-login .login-remember label { flex-direction: row; display: flex; gap: .4rem; }
.fb-staff-login input[type=submit] { min-height: 44px; padding: .5rem 1.1rem; border-radius: 6px; border: 0; background: var(--fb-primary); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.fb-venues { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.fb-card { background: var(--fb-panel); border: 1px solid var(--fb-line); border-radius: var(--fb-radius); padding: 1rem; }
.fb-card__img { width: 100%; height: auto; border-radius: 6px; }

@media (max-width: 782px) {
	.fb-navtoggle { display: inline-flex; min-height: 40px; padding: .3rem .8rem; border: 1px solid var(--fb-line); border-radius: 6px; background: #fff; font: inherit; }
	.fb-user__role { display: none; }
	.fb-shell { grid-template-columns: 1fr; }
	.fb-sidenav { display: none; border-right: 0; border-bottom: 1px solid var(--fb-line); }
	.fb-sidenav.is-open { display: block; }
	.fb-main { padding: 1rem; }
	.fb-h1 { font-size: 1.6rem; }
	/* Stacked cards instead of a wide table. */
	.fb-table thead { display: none; }
	.fb-table tr { display: block; border-bottom: 2px solid var(--fb-line); padding: .4rem 0; }
	.fb-table td { display: block; position: relative; border: 0; padding: .3rem .7rem .3rem calc(110px + 1.2rem); min-height: 1.8rem; }
	.fb-table td::before { content: attr(data-label); position: absolute; left: .7rem; top: .35rem; width: 110px; font-weight: 600; color: var(--fb-muted); font-size: .85rem; }
	.fb-table td .fb-inline, .fb-table td > .fb-btn { margin: 0 .3rem .3rem 0; }
	/* Calendars become a list of days. */
	.fb-cal thead { display: none; }
	.fb-cal, .fb-cal tbody, .fb-cal tr, .fb-cal td { display: block; width: 100%; height: auto; }
	.fb-cal__pad { display: none !important; }
	.fb-summary { grid-template-columns: 1fr; gap: 0; }
	.fb-summary dd { margin-bottom: .5rem; }
}
