/* Hamfist Studio client portal. Inherits the theme's fonts and text colour. */
.hfs-portal {
	--hfs-accent: #8b1e1e;
	--hfs-line: rgba(127, 127, 127, 0.28);
	--hfs-soft: rgba(127, 127, 127, 0.08);
	--hfs-muted: rgba(127, 127, 127, 0.95);
	--hfs-radius: 10px;
	max-width: 960px;
	margin: 0 auto;
	line-height: 1.5;
}
.hfs-portal *, .hfs-admin .hfs-card * { box-sizing: border-box; }

.hfs-card {
	border: 1px solid var(--hfs-line);
	border-radius: var(--hfs-radius);
	padding: 20px 22px;
	margin: 0 0 16px;
	background: var(--hfs-soft);
}
.hfs-card h2, .hfs-card h3 { margin: 0 0 12px; }
.hfs-card h3 { font-size: 1.1em; display: flex; align-items: center; gap: 10px; }
.hfs-step {
	display: inline-grid; place-items: center;
	width: 26px; height: 26px; border-radius: 50%;
	background: var(--hfs-accent); color: #fff; font-size: 0.85em; font-weight: 700;
}

/* Forms */
.hfs-portal label { display: block; font-weight: 600; font-size: 0.92em; margin-bottom: 4px; }
.hfs-portal input[type=text], .hfs-portal input[type=email], .hfs-portal input[type=tel],
.hfs-portal input[type=password], .hfs-portal textarea {
	width: 100%; padding: 10px 12px; border: 1px solid var(--hfs-line); border-radius: 8px;
	font: inherit; color: inherit; background: rgba(255, 255, 255, 0.04);
}
.hfs-portal input:focus, .hfs-portal textarea:focus { outline: 2px solid var(--hfs-accent); outline-offset: 1px; }
.hfs-portal input[disabled] { opacity: 0.6; }
.hfs-portal p { margin: 0 0 14px; }
.hfs-check label { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }
.hfs-check input { margin-top: 4px; }
.hfs-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.hfs-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.hfs-small { font-size: 0.86em; opacity: 0.78; display: inline-block; }
p.hfs-small, div.hfs-small { display: block; }
.hfs-empty { opacity: 0.7; font-style: italic; }

.hfs-btn {
	display: inline-block; padding: 10px 20px; border: 0; border-radius: 8px; cursor: pointer;
	background: var(--hfs-accent); color: #fff !important; font: inherit; font-weight: 600; text-decoration: none;
}
.hfs-btn:hover { filter: brightness(1.12); }
.hfs-btn[disabled] { opacity: 0.45; cursor: not-allowed; filter: none; }
.hfs-link { background: none; border: 0; padding: 0; color: var(--hfs-accent); text-decoration: underline; cursor: pointer; font: inherit; font-size: 0.9em; }

/* Notices */
.hfs-notice { padding: 12px 16px; border-radius: 8px; margin: 0 0 16px; border-left: 4px solid; }
.hfs-notice-success { border-color: #2e7d32; background: rgba(46, 125, 50, 0.1); }
.hfs-notice-error { border-color: #c62828; background: rgba(198, 40, 40, 0.1); }

/* Auth */
.hfs-auth { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; align-items: start; }

/* Dashboard */
.hfs-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.hfs-head h2 { margin: 0; }
.hfs-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0 0 12px; border-bottom: 1px solid var(--hfs-line); }
.hfs-tabs a {
	padding: 7px 14px; border-radius: 999px; text-decoration: none; color: inherit;
	border: 1px solid var(--hfs-line); font-size: 0.95em;
}
.hfs-tabs a.is-active { background: var(--hfs-accent); border-color: var(--hfs-accent); color: #fff; }
.hfs-badge {
	display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px;
	background: #c62828; color: #fff; font-size: 0.78em; font-weight: 700; text-align: center; line-height: 20px;
}
.hfs-tabs a.is-active .hfs-badge { background: #fff; color: var(--hfs-accent); }

/* Calendar */
.hfs-cal-wrap { display: grid; grid-template-columns: minmax(260px, 1.2fr) 1fr; gap: 20px; }
.hfs-cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.hfs-cal-head strong { font-size: 1.05em; }
.hfs-cal-head button {
	background: none; border: 1px solid var(--hfs-line); border-radius: 6px; width: 34px; height: 34px;
	cursor: pointer; color: inherit; font-size: 1.1em;
}
.hfs-cal-head button[disabled] { opacity: 0.3; cursor: default; }
.hfs-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.hfs-cal-dow { font-size: 0.75em; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.65; padding: 4px 0; }
.hfs-cal-day {
	aspect-ratio: 1; border-radius: 8px; border: 1px solid transparent; background: none;
	font: inherit; color: inherit; opacity: 0.35; cursor: default; padding: 0;
}
.hfs-cal-day.is-open { opacity: 1; cursor: pointer; border-color: var(--hfs-line); font-weight: 600; }
.hfs-cal-day.is-open:hover { border-color: var(--hfs-accent); }
.hfs-cal-day.is-selected { background: var(--hfs-accent); color: #fff; border-color: var(--hfs-accent); }
.hfs-times h4 { margin: 0 0 10px; font-size: 1em; }
.hfs-time-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.hfs-time {
	padding: 8px 6px; border: 1px solid var(--hfs-line); border-radius: 8px; background: none;
	font: inherit; color: inherit; cursor: pointer;
}
.hfs-time:hover { border-color: var(--hfs-accent); }
.hfs-time.is-selected { background: var(--hfs-accent); border-color: var(--hfs-accent); color: #fff; }
.hfs-selected { margin: 14px 0 0; padding: 10px 14px; border-radius: 8px; background: rgba(46, 125, 50, 0.1); font-weight: 600; }

/* Appointments */
.hfs-appt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.hfs-pill {
	white-space: nowrap; font-size: 0.8em; font-weight: 600; padding: 3px 10px; border-radius: 999px;
	border: 1px solid var(--hfs-line);
}
.hfs-status-confirmed .hfs-pill { background: #2e7d32; border-color: #2e7d32; color: #fff; }
.hfs-status-waiting-for-approval .hfs-pill { background: #f2b33d; border-color: #f2b33d; color: #2b2100; }
.hfs-status-declined, .hfs-status-cancelled { opacity: 0.7; }
.hfs-pills { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.hfs-portal .hfs-pill-minor, .hfs-pill-minor { background: #fdecc8; border-color: #d69a1d; color: #5a3d00; }
.hfs-note-minor { border-left-color: #d69a1d; background: rgba(214, 154, 29, 0.12); }
.hfs-guardian { padding: 10px 12px; border-radius: 8px; background: rgba(214, 154, 29, 0.12); }
.hfs-guardian[hidden] { display: none; }
.hfs-note { border-left: 3px solid var(--hfs-accent); padding: 8px 12px; margin: 0 0 12px; background: var(--hfs-soft); border-radius: 0 6px 6px 0; }

/* Messages */
.hfs-thread { display: flex; flex-direction: column; gap: 10px; max-height: 460px; overflow-y: auto; padding: 4px 2px 12px; margin-bottom: 12px; }
.hfs-msg { max-width: 80%; }
.hfs-msg-mine { align-self: flex-end; text-align: right; }
.hfs-msg-meta { font-size: 0.78em; opacity: 0.7; margin-bottom: 2px; }
.hfs-msg-body { display: inline-block; text-align: left; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--hfs-line); background: rgba(255, 255, 255, 0.05); word-wrap: break-word; }
.hfs-msg-mine .hfs-msg-body { background: var(--hfs-accent); border-color: var(--hfs-accent); color: #fff; }
.hfs-reply { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 8px; }
.hfs-reply textarea { flex: 1; }

/* Photos */
.hfs-upload { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.hfs-upload label { width: 100%; margin: 0; }
.hfs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.hfs-tile { margin: 0; border: 1px solid var(--hfs-line); border-radius: 8px; overflow: hidden; }
.hfs-tile a { display: block; aspect-ratio: 1; background: var(--hfs-soft); }
.hfs-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hfs-file-icon { display: grid; place-items: center; height: 100%; font-weight: 700; letter-spacing: 0.05em; opacity: 0.7; }
.hfs-tile figcaption { display: flex; justify-content: space-between; gap: 6px; padding: 6px 8px; font-size: 0.78em; }
.hfs-tile figcaption form { margin: 0; }

/* Email history */
.hfs-email { border-top: 1px solid var(--hfs-line); padding: 8px 0; }
.hfs-email summary { display: flex; justify-content: space-between; gap: 12px; cursor: pointer; }
.hfs-email summary time { opacity: 0.65; font-size: 0.85em; white-space: nowrap; }
.hfs-email-body { padding: 10px 0 4px; font-size: 0.94em; }
.hfs-docs { margin: 0; padding-left: 20px; }

/* ---------- Owner screens (shared by the website dashboard and WP Admin) ---------- */
.hfs-portal input[type=date], .hfs-portal input[type=time], .hfs-portal input[type=number],
.hfs-portal input[type=search], .hfs-portal select {
	padding: 9px 10px; border: 1px solid var(--hfs-line); border-radius: 8px;
	font: inherit; color: inherit; background: rgba(255, 255, 255, 0.04); max-width: 100%;
}
.hfs-portal input[type=number] { width: 120px; }
.hfs-portal select { min-width: 90px; }
.hfs-btn-ghost { background: transparent; color: var(--hfs-accent) !important; box-shadow: inset 0 0 0 1.5px var(--hfs-accent); }
.hfs-btn-ghost:hover { background: rgba(127, 127, 127, 0.1); filter: none; }

.hfs-glance { display: grid; grid-template-columns: 1fr 1fr 2.2fr; gap: 10px; margin: 6px 0 16px; }
.hfs-stat {
	display: flex; flex-direction: column; justify-content: center; gap: 2px;
	padding: 14px 16px; border-radius: var(--hfs-radius); border: 1px solid var(--hfs-line);
	background: var(--hfs-soft); color: inherit; text-decoration: none;
}
.hfs-stat strong { font-size: 1.8em; line-height: 1.1; }
.hfs-stat.is-hot { border-color: var(--hfs-accent); box-shadow: inset 4px 0 0 var(--hfs-accent); }
.hfs-stat.is-hot strong { color: var(--hfs-accent); }
.hfs-stat-label { font-size: 0.78em; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.7; font-weight: 700; }
.hfs-today-item { font-weight: 600; }
.hfs-owner-head .hfs-small a { color: inherit; }
.hfs-screen-title { margin: 0 0 14px; font-size: 1.25em; }
.hfs-subnav { display: flex; gap: 6px; flex-wrap: wrap; }
.hfs-subnav a { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--hfs-line); text-decoration: none; color: inherit; font-size: 0.9em; }
.hfs-subnav a.is-active { border-color: var(--hfs-accent); color: var(--hfs-accent); font-weight: 600; }

.hfs-actions { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; border-top: 1px solid var(--hfs-line); padding-top: 14px; }
.hfs-actions h4, .hfs-owner-screen h4 { margin: 0 0 10px; }
.hfs-admin-form textarea { width: 100%; margin: 10px 0; }
.hfs-fields { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.hfs-portal .hfs-inline, .hfs-inline { display: inline-flex; gap: 6px; align-items: center; margin: 0 10px 8px 0; font-weight: 600; }
.hfs-portal .hfs-inline input[type=checkbox] { width: auto; }
.hfs-more { border-top: 1px solid var(--hfs-line); padding: 10px 0; }
.hfs-more summary { cursor: pointer; font-weight: 600; }
.hfs-more form { margin-top: 10px; }
.hfs-columns { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
.hfs-mini-appt { padding: 8px 0; border-bottom: 1px solid var(--hfs-line); }
.hfs-fail { color: #c62828; }
.hfs-contact { margin: -6px 0 14px; }
.hfs-search { display: flex; gap: 8px; margin: 0 0 14px; }
.hfs-search input[type=search] { flex: 1; max-width: 360px; }
.hfs-portal .hfs-table { width: 100%; border-collapse: collapse; }
.hfs-portal .hfs-table th, .hfs-portal .hfs-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--hfs-line); }
.hfs-portal .hfs-table th { font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.7; }
.hfs-portal .hfs-reply textarea { width: 100%; }

/* Month calendar */
.hfs-cal-nav { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.hfs-cal-nav h2 { margin: 0; min-width: 170px; text-align: center; font-size: 1.2em; }
.hfs-cal-nav .hfs-btn { padding: 6px 14px; }
.hfs-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.hfs-dow { font-weight: 700; text-align: center; padding: 6px 0; font-size: 0.8em; text-transform: uppercase; opacity: 0.7; }
.hfs-day { border: 1px solid var(--hfs-line); border-radius: 6px; min-height: 96px; padding: 5px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hfs-day-out { border: 0; }
.hfs-day-closed { background: repeating-linear-gradient(45deg, rgba(127,127,127,.06), rgba(127,127,127,.06) 6px, rgba(127,127,127,.14) 6px, rgba(127,127,127,.14) 12px); }
.hfs-day-today { outline: 2px solid var(--hfs-accent); }
.hfs-day-num { font-weight: 700; font-size: 12px; opacity: 0.7; }
.hfs-ev { display: block; font-size: 12px; line-height: 1.3; padding: 3px 5px; border-radius: 4px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.hfs-ev-approved { background: var(--hfs-accent); color: #fff !important; }
.hfs-ev-approved:hover { filter: brightness(1.15); }
.hfs-ev-pending { background: #fcf0d4; color: #5a4300 !important; border: 1px dashed #c99a1f; }
.hfs-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; }
.hfs-key-ok { background: var(--hfs-accent); }
.hfs-key-pending { background: #fcf0d4; border: 1px dashed #c99a1f; }
.hfs-key-closed { background: rgba(127,127,127,.2); }

/* Simple settings */
.hfs-hours-grid { display: grid; gap: 6px; margin: 0 0 16px; }
.hfs-hours-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 6px 0; border-bottom: 1px solid var(--hfs-line); }
.hfs-portal .hfs-day-toggle { display: flex; align-items: center; gap: 8px; width: 140px; margin: 0; }
.hfs-hours-row:has(input[type=checkbox]:not(:checked)) .hfs-hours-times { opacity: 0.35; }
.hfs-doc-rows { list-style: none; margin: 0 0 14px; padding: 0; }
.hfs-doc-rows li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--hfs-line); }
.hfs-doc-rows form { margin: 0; }

@media (max-width: 720px) {
	.hfs-auth, .hfs-cal-wrap, .hfs-row, .hfs-columns, .hfs-actions { grid-template-columns: 1fr; }
	.hfs-glance { grid-template-columns: 1fr 1fr; }
	.hfs-stat-wide { grid-column: 1 / -1; }
	.hfs-hide-sm { display: none; }
	.hfs-day { min-height: 54px; padding: 3px; }
	.hfs-ev { font-size: 0; padding: 0; height: 6px; border-radius: 3px; }
	.hfs-card { padding: 16px; }
	.hfs-msg { max-width: 92%; }
	.hfs-reply { flex-direction: column; align-items: stretch; }
}
