/* Hours Calculator Pro — frontend styles. Everything is scoped under
   .hct-wrap so it never leaks into the surrounding theme. */

.hct-wrap {
	--hct-primary: #6d28d9;
	--hct-primary-2: #4f46e5;
	--hct-accent: #ec4899;
	--hct-teal: #0d9488;
	--hct-success: #16a34a;
	--hct-danger: #dc2626;
	--hct-warning: #d97706;
	--hct-bg: #f6f5fb;
	--hct-card: #ffffff;
	--hct-border: #e6e3f5;
	--hct-text: #211b3b;
	--hct-text-muted: #6b6584;
	--hct-radius: 18px;
	--hct-radius-sm: 12px;
	--hct-shadow: 0 10px 30px -12px rgba(76, 29, 149, 0.25);
	--hct-shadow-sm: 0 4px 14px -6px rgba(76, 29, 149, 0.18);
	--hct-gradient: linear-gradient(135deg, var(--hct-primary) 0%, var(--hct-primary-2) 45%, var(--hct-accent) 100%);

	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--hct-text);
	line-height: 1.5;
	max-width: 980px;
	margin: 0 auto;
}

.hct-wrap *,
.hct-wrap *::before,
.hct-wrap *::after {
	box-sizing: inherit;
}

.hct-wrap h2,
.hct-wrap h3 {
	margin: 0 0 6px;
	font-weight: 700;
	color: var(--hct-text);
}

.hct-wrap p {
	margin: 0 0 12px;
}

.hct-wrap label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--hct-text-muted);
	flex: 1;
}

.hct-wrap input,
.hct-wrap select {
	font: inherit;
	font-size: 15px;
	color: var(--hct-text);
	background: #fbfaff;
	border: 1.5px solid var(--hct-border);
	border-radius: var(--hct-radius-sm);
	padding: 10px 12px;
	width: 100%;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.hct-wrap input:focus,
.hct-wrap select:focus {
	outline: none;
	border-color: var(--hct-primary-2);
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

.hct-input-prefix {
	display: flex;
	align-items: stretch;
	border: 1.5px solid var(--hct-border);
	border-radius: var(--hct-radius-sm);
	overflow: hidden;
	background: #fbfaff;
}
.hct-input-prefix span {
	display: flex;
	align-items: center;
	padding: 0 10px;
	background: var(--hct-border);
	font-weight: 700;
	color: var(--hct-primary);
}
.hct-input-prefix input {
	border: none;
	border-radius: 0;
	flex: 1;
}
.hct-input-prefix input:focus {
	box-shadow: none;
}

/* Buttons */
.hct-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	border: none;
	border-radius: 999px;
	padding: 11px 22px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
	text-decoration: none;
}
.hct-btn:active { transform: scale(0.97); }
.hct-btn--primary {
	background: var(--hct-gradient);
	color: #fff;
	box-shadow: var(--hct-shadow-sm);
}
.hct-btn--primary:hover { box-shadow: var(--hct-shadow); }
.hct-btn--secondary {
	background: #efeafd;
	color: var(--hct-primary);
}
.hct-btn--secondary:hover { background: #e3daf9; }
.hct-btn--block { width: 100%; margin-top: 4px; }
.hct-btn[disabled] { opacity: .6; cursor: default; }

.hct-link {
	background: none;
	border: none;
	color: var(--hct-primary-2);
	font-weight: 600;
	font-size: 13px;
	cursor: pointer;
	text-decoration: none;
	padding: 6px 4px;
}
.hct-link:hover { text-decoration: underline; }

/* Gate / auth */
.hct-gate {
	background: var(--hct-card);
	border-radius: var(--hct-radius);
	box-shadow: var(--hct-shadow);
	padding: 32px;
	max-width: 460px;
	margin: 24px auto;
	border: 1px solid var(--hct-border);
}
.hct-gate__header { text-align: center; margin-bottom: 20px; }
.hct-logo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 16px;
	background: var(--hct-gradient);
	font-size: 26px;
	margin-bottom: 10px;
}
.hct-gate__header p { color: var(--hct-text-muted); }
.hct-notice {
	background: #fff7ed;
	border: 1px solid #fed7aa;
	color: #9a3412;
	padding: 10px 14px;
	border-radius: var(--hct-radius-sm);
	font-size: 14px;
}

.hct-tabs {
	display: flex;
	gap: 4px;
	background: #f1eefb;
	border-radius: 999px;
	padding: 4px;
	margin-bottom: 18px;
}
.hct-tab {
	flex: 1;
	border: none;
	background: transparent;
	padding: 9px 10px;
	border-radius: 999px;
	font-weight: 700;
	font-size: 13px;
	color: var(--hct-text-muted);
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
	white-space: nowrap;
}
.hct-tab.is-active {
	background: #fff;
	color: var(--hct-primary);
	box-shadow: var(--hct-shadow-sm);
}

.hct-panel { display: none; flex-direction: column; gap: 12px; }
.hct-panel.is-active { display: flex; }
.hct-honeypot { position: absolute; left: -9999px; top: -9999px; }
.hct-help { font-size: 12px; color: var(--hct-text-muted); margin: -4px 0 0; }
.hct-form-msg { font-size: 13px; font-weight: 600; margin: 0; min-height: 18px; }
.hct-form-msg.is-error { color: var(--hct-danger); }
.hct-form-msg.is-success { color: var(--hct-success); }

/* App shell */
.hct-app { display: flex; flex-direction: column; gap: 20px; padding: 4px 0 40px; }

.hct-header {
	display: flex;
	align-items: center;
	gap: 14px;
	background: var(--hct-gradient);
	color: #fff;
	border-radius: var(--hct-radius);
	padding: 20px 24px;
	box-shadow: var(--hct-shadow);
}
.hct-avatar {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: rgba(255,255,255,0.22);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	font-weight: 800;
	flex-shrink: 0;
}
.hct-header__text { flex: 1; min-width: 0; }
.hct-header__text h2 { color: #fff; font-size: 19px; }
.hct-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .02em;
	text-transform: uppercase;
	padding: 3px 10px;
	border-radius: 999px;
	background: rgba(255,255,255,0.2);
}
.hct-header__actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.hct-header__actions .hct-link { color: #fff; opacity: .9; }
.hct-header__actions .hct-link:hover { opacity: 1; }

.hct-grid {
	display: grid;
	grid-template-columns: 1.3fr 1fr;
	gap: 20px;
}

.hct-card {
	background: var(--hct-card);
	border: 1px solid var(--hct-border);
	border-radius: var(--hct-radius);
	padding: 22px;
	box-shadow: var(--hct-shadow-sm);
}
.hct-card h3 { font-size: 15px; margin-bottom: 14px; }

.hct-field-row { display: flex; gap: 12px; margin-bottom: 14px; }
.hct-field-row--split > label { min-width: 0; }

.hct-live-preview {
	background: #f4f1fd;
	border: 1px dashed var(--hct-primary-2);
	border-radius: var(--hct-radius-sm);
	padding: 10px 12px;
	font-size: 13px;
	font-weight: 700;
	color: var(--hct-primary);
	margin-bottom: 12px;
	min-height: 18px;
}

/* Summary */
.hct-summary {
	background: var(--hct-card);
	border: 1px solid var(--hct-border);
	border-radius: var(--hct-radius);
	padding: 22px;
	box-shadow: var(--hct-shadow-sm);
}

.hct-tabs--period { max-width: 480px; }

.hct-stat-row {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 14px;
	margin: 18px 0;
}
.hct-stat {
	border-radius: var(--hct-radius-sm);
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.hct-stat--hours { background: linear-gradient(135deg, #ede9fe, #ddd6fe); }
.hct-stat--pay { background: linear-gradient(135deg, #fce7f3, #fbcfe8); }
.hct-stat--range { background: linear-gradient(135deg, #ccfbf1, #99f6e4); }
.hct-stat__label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--hct-text-muted); }
.hct-stat__value { font-size: 24px; font-weight: 800; color: var(--hct-text); }
.hct-stat__value--small { font-size: 13px; font-weight: 700; }

.hct-chart {
	display: flex;
	align-items: flex-end;
	gap: 6px;
	height: 110px;
	margin-bottom: 18px;
	padding: 0 2px;
}
.hct-chart__bar {
	flex: 1;
	min-width: 6px;
	border-radius: 6px 6px 2px 2px;
	background: var(--hct-gradient);
	position: relative;
	transition: height .25s ease;
}
.hct-chart__bar span {
	position: absolute;
	bottom: -20px;
	left: 50%;
	transform: translateX(-50%);
	font-size: 10px;
	color: var(--hct-text-muted);
	white-space: nowrap;
}

/* Entries list */
.hct-entries { display: flex; flex-direction: column; gap: 10px; }
.hct-loading, .hct-empty {
	text-align: center;
	color: var(--hct-text-muted);
	padding: 24px 0;
	font-size: 14px;
}

.hct-entry {
	display: grid;
	grid-template-columns: 90px 1fr 1fr 70px 90px auto;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border: 1px solid var(--hct-border);
	border-radius: var(--hct-radius-sm);
	background: #fbfaff;
}
.hct-entry__date { font-weight: 700; font-size: 13px; }
.hct-entry__time { font-size: 13px; color: var(--hct-text-muted); }
.hct-entry__break { font-size: 12px; color: var(--hct-text-muted); }
.hct-entry__hours {
	font-weight: 800;
	color: var(--hct-primary);
	background: #ede9fe;
	padding: 4px 10px;
	border-radius: 999px;
	text-align: center;
	font-size: 13px;
}
.hct-entry__note {
	grid-column: 1 / -1;
	font-size: 12.5px;
	color: var(--hct-text-muted);
	font-style: italic;
}
.hct-entry__actions { display: flex; gap: 6px; justify-content: flex-end; }

.hct-entry--edit {
	grid-template-columns: repeat(4, 1fr) auto;
	grid-template-areas: none;
	background: #f4f1fd;
	border-color: var(--hct-primary-2);
}
.hct-entry__editfield {
	font-size: 11px;
	font-weight: 700;
	color: var(--hct-text-muted);
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.hct-entry__editfield input { padding: 6px 8px; font-size: 13px; }
.hct-entry__editfield--note { grid-column: 1 / -1; }
.hct-icon-btn {
	border: none;
	background: #f1eefb;
	color: var(--hct-primary);
	width: 30px;
	height: 30px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 13px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.hct-icon-btn--danger { color: var(--hct-danger); background: #fee2e2; }
.hct-icon-btn:hover { filter: brightness(0.95); }

/* Toasts */
.hct-toast-container {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-width: 320px;
}
.hct-toast {
	background: #211b3b;
	color: #fff;
	padding: 12px 16px;
	border-radius: var(--hct-radius-sm);
	font-size: 13px;
	font-weight: 600;
	box-shadow: var(--hct-shadow);
	animation: hct-toast-in .2s ease;
}
.hct-toast--error { background: var(--hct-danger); }
.hct-toast--success { background: var(--hct-success); }
@keyframes hct-toast-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 860px) {
	.hct-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
	.hct-wrap { padding: 0 4px; }
	.hct-header { flex-wrap: wrap; }
	.hct-header__actions { flex-direction: row; align-items: center; }
	.hct-stat-row { grid-template-columns: 1fr; }
	.hct-field-row--split { flex-direction: column; }
	.hct-tabs--period { max-width: none; overflow-x: auto; }
	.hct-gate { padding: 22px; margin: 10px auto; }

	.hct-entry {
		grid-template-columns: 1fr auto;
		grid-template-areas:
			"date hours"
			"time time"
			"break actions"
			"note note";
		row-gap: 6px;
	}
	.hct-entry__date { grid-area: date; }
	.hct-entry__hours { grid-area: hours; justify-self: end; }
	.hct-entry__time { grid-area: time; }
	.hct-entry__break { grid-area: break; }
	.hct-entry__actions { grid-area: actions; }
	.hct-entry__note { grid-area: note; }

	.hct-entry--edit {
		grid-template-columns: 1fr 1fr;
		grid-template-areas: none;
	}
	.hct-entry__editfield--note { grid-column: 1 / -1; }
}

@media (max-width: 420px) {
	.hct-tab { padding: 8px 6px; font-size: 12px; }
	.hct-stat__value { font-size: 20px; }
}
