/* Autofare Calendar - Front-end & admin styles */

.autofare-calendar-app {
	--af-morning: linear-gradient(180deg, #f2ecff 0%, #f8f5ff 100%);
	--af-morning-active: linear-gradient(180deg, #ede5ff 0%, #f8f5ff 100%);
	--af-afternoon: linear-gradient(180deg, #fff6ea 0%, #fffaf3 100%);
	--af-afternoon-active: linear-gradient(180deg, #fff0df 0%, #fffaf3 100%);
	--af-border: #efeafc;
	--af-text: #1d2140;
	--af-muted: #8c8fa8;
	--af-radius: 24px;
	--af-radius-sm: 16px;
	--af-shadow: 0 14px 40px rgba(124, 108, 255, 0.08);
	--af-card-bg: rgba(255, 255, 255, 0.9);
	font-family: inherit;
	color: var(--af-text);
	max-width: 100%;
	padding: 8px 0 0;
}

.autofare-calendar-app * {
	box-sizing: border-box;
}

.autofare-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 24px;
	flex-wrap: wrap;
}

.autofare-header-title {
	display: flex;
	align-items: center;
	gap: 14px;
}

.autofare-header-icon,
.autofare-summary-icon {
	width: 42px;
	height: 42px;
	border-radius: 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 1.1rem;
	box-shadow: 0 10px 20px rgba(124, 108, 255, 0.14);
}

.autofare-header-icon {
	background: linear-gradient(135deg, #6f56f7 0%, #8d7bff 100%);
	color: #fff;
}

.autofare-header h2 {
	margin: 0;
	font-size: 2rem;
	font-weight: 700;
	letter-spacing: -0.03em;
}

.autofare-nav {
	display: flex;
	gap: 8px;
	align-items: center;
}

.autofare-nav button,
.autofare-modal-actions button {
	border: 1px solid #efeaf8;
	background: #fff;
	color: var(--af-text);
	border-radius: 12px;
	padding: 10px 14px;
	cursor: pointer;
	font-size: 0.95rem;
	transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
	box-shadow: 0 8px 18px rgba(31, 32, 67, 0.05);
}

.autofare-nav button:hover,
.autofare-modal-actions button:hover {
	background: #f8f6ff;
	transform: translateY(-1px);
}

.autofare-nav button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.autofare-today-button {
	background: linear-gradient(135deg, #6f56f7 0%, #8d7bff 100%) !important;
	color: #fff !important;
	border: none !important;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding-inline: 16px !important;
}

.autofare-today-icon {
	font-size: 0.95rem;
}

.autofare-calendar-shell {
	background: var(--af-card-bg);
	border: 1px solid #f3eefc;
	border-radius: 28px;
	box-shadow: var(--af-shadow);
	padding: 16px;
	backdrop-filter: blur(8px);
}

.autofare-weekdays,
.autofare-grid {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 2px;
}

.autofare-weekdays {
	margin-bottom: 8px;
}

.autofare-weekday {
	text-align: center;
	font-size: 0.76rem;
	font-weight: 700;
	color: #2d3355;
	padding: 10px 0 12px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.autofare-weekday:first-child {
	color: #e56c87;
}

.autofare-calendar-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.autofare-day {
	border: 1px solid #f3eefc;
	border-radius: 14px;
	min-height: 104px;
	display: flex;
	flex-direction: column;
	background: rgba(255, 255, 255, 0.82);
	overflow: hidden;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.autofare-day.is-outside {
	opacity: 0.68;
}

.autofare-day.is-holiday {
	background: #f6b5b5;
	border-color: #ff8585;
}

.autofare-day.is-holiday .autofare-day-number {
	color: #fff;
}

.autofare-day.is-holiday .autofare-half,
.autofare-day.is-holiday .autofare-half.morning,
.autofare-day.is-holiday .autofare-half.afternoon,
.autofare-day.is-holiday .autofare-half.has-entry.morning,
.autofare-day.is-holiday .autofare-half.has-entry.afternoon {
	background: transparent;
	border-top-color: rgba(255, 255, 255, 0.18);
}

.autofare-day.is-holiday .autofare-half-profile {
	color: #fff;
}

.autofare-day.is-today {
	border-color: #6f56f7;
	box-shadow: 0 0 0 2px rgba(111, 86, 247, 0.35);
}

.autofare-day.is-today .autofare-day-number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	margin: 6px 8px 4px;
	padding: 0;
	border-radius: 50%;
	background: #6f56f7;
	color: #fff;
}

.autofare-day.is-today .autofare-day-number:hover {
	color: #fff;
	opacity: 0.92;
}

.autofare-day.is-today.is-holiday {
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #6f56f7;
}

.autofare-day.is-today.is-holiday .autofare-day-number {
	background: #fff;
	color: #ef4444;
}

.autofare-day-number {
	font-size: 0.8rem;
	font-weight: 700;
	padding: 8px 10px 4px;
	color: var(--af-muted);
	border: none;
	background: transparent;
	cursor: pointer;
	text-align: left;
	width: 100%;
}

.autofare-day-number:hover {
	color: #6f56f7;
}

.autofare-day.is-holiday .autofare-day-number:hover {
	color: #fff;
	opacity: 0.85;
}

.autofare-halves {
	display: flex;
	flex-direction: column;
	flex: 1;
}

.autofare-half {
	flex: 1;
	border: none;
	padding: 8px 8px;
	text-align: left;
	font-size: 0.72rem;
	line-height: 1.2;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 33px;
	transition: filter 0.15s ease, transform 0.15s ease;
	gap: 6px;
}

.autofare-half:focus {
	outline: 2px solid #2563eb;
	outline-offset: -2px;
}

.autofare-half:hover {
	filter: brightness(0.99);
}

.autofare-half.morning {
	background: var(--af-morning);
	border-top: 1px solid rgba(130, 118, 214, 0.08);
}

.autofare-half.afternoon {
	background: var(--af-afternoon);
	border-top: 1px solid rgba(243, 175, 122, 0.1);
}

.autofare-half.has-entry.morning {
	background: var(--af-morning-active);
}

.autofare-half.has-entry.afternoon {
	background: var(--af-afternoon-active);
}

.autofare-half-profile {
	font-weight: 600;
	word-break: break-word;
	font-size: 0.7rem;
	color: #7354e6;
}

.autofare-summary-card {
	margin-top: 16px;
	padding: 18px 20px;
	border: 1px solid #f3eefc;
	border-radius: 22px;
	background: rgba(255, 255, 255, 0.92);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
	box-shadow: var(--af-shadow);
}

.autofare-summary-card-side {
	display: flex;
	align-items: center;
	gap: 14px;
}

.autofare-summary-card-side-left {
	min-width: 240px;
}

.autofare-summary-card-side-right {
	flex: 1;
	justify-content: space-between;
	gap: 20px;
}

.autofare-summary-meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.autofare-summary-icon-total {
	background: linear-gradient(135deg, #f3ecff 0%, #ebe4ff 100%);
	color: #7c5cff;
}

.autofare-summary-icon-profile {
	background: linear-gradient(135deg, #fff3e7 0%, #ffe9d7 100%);
	color: #ef8f4d;
}

.autofare-total-label {
	font-size: 1rem;
	font-weight: 700;
	margin: 0;
}

.autofare-total-value {
	font-size: 2rem;
	font-weight: 700;
	color: #6f56f7;
	min-width: 120px;
	text-align: right;
}

.autofare-summary-subtitle {
	margin: 0;
	font-size: 0.88rem;
	color: var(--af-muted);
}

.autofare-summary-wave {
	flex: 1;
	min-height: 42px;
	border-radius: 18px;
	background:
		radial-gradient(circle at 85% 20%, rgba(131, 104, 255, 0.2) 0, rgba(131, 104, 255, 0.2) 18%, transparent 19%),
		linear-gradient(180deg, rgba(245, 240, 255, 0.2) 0%, rgba(245, 240, 255, 0.55) 100%);
	position: relative;
	overflow: hidden;
}

.autofare-summary-wave::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, transparent 0%, rgba(207, 192, 255, 0.25) 48%, rgba(187, 166, 255, 0.4) 100%);
	clip-path: polygon(0 70%, 20% 72%, 37% 63%, 52% 78%, 68% 44%, 82% 58%, 100% 18%, 100% 100%, 0 100%);
}

.autofare-fare-by-profile-title {
	margin: 0;
	font-size: 1rem;
	font-weight: 700;
	color: var(--af-text);
}

.autofare-fare-by-profile-list {
	list-style: none;
	margin: 0;
	padding: 0;
	width: 100%;
}

.autofare-fare-by-profile-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 18px;
	padding: 6px 0;
}

.autofare-fare-by-profile-details {
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 1;
}

.autofare-fare-by-profile-name {
	font-weight: 700;
	color: var(--af-text);
}

.autofare-fare-by-profile-name-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
}

.autofare-paid-toggle,
.autofare-holiday-toggle {
	border: 1px solid #e5e7eb;
	background: #fff;
	color: var(--af-text);
	border-radius: 999px;
	padding: 6px 12px;
	font-size: 0.78rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.autofare-paid-toggle:hover,
.autofare-holiday-toggle:hover {
	background: #f8f6ff;
}

.autofare-paid-toggle.is-paid,
.autofare-holiday-toggle.is-active {
	background: #ecfdf5;
	border-color: #86efac;
	color: #15803d;
}

.autofare-holiday-toggle {
	width: 100%;
	margin-bottom: 14px;
	border-radius: 10px;
}

.autofare-holiday-toggle.is-active {
	background: #fef2f2;
	border-color: #fca5a5;
	color: #b91c1c;
}

.autofare-fare-by-profile-item.is-paid .autofare-fare-by-profile-amount {
	background: #ecfdf5;
	border-color: #bbf7d0;
	color: #15803d;
}

.autofare-fare-by-profile-item.is-paid .autofare-fare-by-profile-bar {
	background: linear-gradient(90deg, #4ade80 0%, #86efac 100%);
}

.autofare-fare-by-profile-track {
	height: 6px;
	border-radius: 999px;
	background: #f7e3dc;
	overflow: hidden;
}

.autofare-fare-by-profile-bar {
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, #ff8b7f 0%, #ffb48f 100%);
}

.autofare-fare-by-profile-amount {
	font-weight: 700;
	color: #f08c4e;
	background: #fff5ef;
	border: 1px solid #ffe7d9;
	border-radius: 14px;
	padding: 10px 14px;
	min-width: 108px;
	text-align: right;
}

.autofare-loading,
.autofare-error {
	padding: 24px;
	text-align: center;
	color: var(--af-muted);
}

.autofare-error {
	color: #b91c1c;
}

/* Modal */
.autofare-modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	z-index: 100000;
}

.autofare-modal {
	background: #fff;
	border-radius: 12px;
	box-shadow: var(--af-shadow);
	width: 100%;
	max-width: 420px;
	padding: 20px;
}

.autofare-modal h3 {
	margin: 0 0 16px;
	font-size: 1.15rem;
}

.autofare-field {
	margin-bottom: 14px;
}

.autofare-field label {
	display: block;
	font-size: 0.85rem;
	font-weight: 600;
	margin-bottom: 6px;
}

.autofare-dropdown {
	position: relative;
	width: 100%;
}

.autofare-dropdown-toggle {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--af-border);
	border-radius: 6px;
	font-size: 0.95rem;
	background: #fff;
	color: var(--af-text);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	text-align: left;
	cursor: pointer;
}

.autofare-dropdown-toggle:focus {
	outline: 2px solid #2563eb;
	outline-offset: 1px;
}

.autofare-dropdown-label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.autofare-dropdown-arrow {
	color: var(--af-muted);
	font-size: 0.75rem;
	flex-shrink: 0;
}

.autofare-dropdown-menu {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid var(--af-border);
	border-radius: 8px;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
	padding: 6px;
	display: none;
	z-index: 2;
}

.autofare-dropdown.is-open .autofare-dropdown-menu {
	display: block;
}

.autofare-dropdown-item {
	width: 100%;
	border: none;
	background: transparent;
	border-radius: 6px;
	padding: 10px 12px;
	text-align: left;
	font-size: 0.95rem;
	color: var(--af-text);
	cursor: pointer;
}

.autofare-dropdown-item:hover,
.autofare-dropdown-item.is-selected {
	background: #eff6ff;
}

.autofare-modal-actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	flex-wrap: wrap;
	margin-top: 18px;
}

.autofare-modal-actions .primary {
	background: #2563eb;
	border-color: #2563eb;
	color: #fff;
}

.autofare-modal-actions .primary:hover {
	background: #1d4ed8;
}

.autofare-modal-actions .danger {
	background: #fef2f2;
	border-color: #fecaca;
	color: #b91c1c;
}

.autofare-modal-actions .danger:hover {
	background: #fee2e2;
}

/* Admin settings */
.autofare-admin-wrap .autofare-profiles-table,
.autofare-admin-wrap .autofare-rates-table {
	margin-top: 12px;
	max-width: 760px;
}

.autofare-admin-wrap .autofare-profiles-table input[type="text"],
.autofare-admin-wrap .autofare-rates-table input[type="number"] {
	width: 100%;
	max-width: 280px;
}

/* Responsive */
@media (max-width: 768px) {
	.autofare-header {
		gap: 16px;
	}

	.autofare-header h2 {
		font-size: 1.5rem;
	}

	.autofare-weekdays,
	.autofare-grid {
		min-width: 560px;
	}

	.autofare-day {
		min-height: 96px;
	}

	.autofare-half {
		font-size: 0.65rem;
		min-height: 34px;
		padding: 6px 4px;
	}

	.autofare-summary-card {
		flex-direction: column;
		align-items: stretch;
	}

	.autofare-summary-card-side-left,
	.autofare-summary-card-side-right {
		width: 100%;
		min-width: 0;
	}

	.autofare-total-value {
		text-align: left;
		font-size: 1.6rem;
	}
}

@media (max-width: 480px) {
	.autofare-calendar-shell {
		padding: 12px;
	}

	.autofare-header-icon,
	.autofare-summary-icon {
		width: 38px;
		height: 38px;
		border-radius: 12px;
	}

	.autofare-total-value {
		font-size: 1.15rem;
	}

	.autofare-today-button {
		width: 100%;
		justify-content: center;
	}
}
#site-header, .page-header {
	display: none;
}
#content {
	margin-top: 30px;
}