/* Shiffty Calendar — theme-agnostic, inherits typography from active WP theme */

.shiffty-app {
	--shiffty-radius: 8px;
	--shiffty-border: 1px solid color-mix(in srgb, currentColor 15%, transparent);
	--shiffty-muted: color-mix(in srgb, currentColor 55%, transparent);
	--shiffty-surface: color-mix(in srgb, currentColor 4%, transparent);
	font: inherit;
	color: inherit;
	max-width: 100%;
	margin: 1.5rem 0;
}

.shiffty-loading {
	padding: 2rem;
	text-align: center;
	color: var(--shiffty-muted);
}

.shiffty-hidden { display: none !important; }

/* Auth */
.shiffty-auth {
	max-width: 420px;
	margin: 0 auto;
	padding: 1.5rem;
	border: var(--shiffty-border);
	border-radius: var(--shiffty-radius);
	background: var(--shiffty-surface);
}

.shiffty-auth h2 {
	margin: 0 0 1rem;
	font-size: 1.35rem;
}

.shiffty-tabs {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 1rem;
}

.shiffty-tabs button {
	flex: 1;
	padding: 0.5rem 1rem;
	border: var(--shiffty-border);
	border-radius: var(--shiffty-radius);
	background: transparent;
	cursor: pointer;
	font: inherit;
}

.shiffty-tabs button.is-active {
	font-weight: 600;
	background: color-mix(in srgb, currentColor 8%, transparent);
}

.shiffty-field {
	margin-bottom: 0.85rem;
}

.shiffty-field label {
	display: block;
	margin-bottom: 0.25rem;
	font-size: 0.9rem;
}

.shiffty-field input,
.shiffty-field select,
.shiffty-field textarea {
	width: 100%;
	padding: 0.55rem 0.65rem;
	border: var(--shiffty-border);
	border-radius: var(--shiffty-radius);
	background: transparent;
	color: inherit;
	font: inherit;
	box-sizing: border-box;
}

.shiffty-field textarea { min-height: 80px; resize: vertical; }

.shiffty-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	padding: 0.55rem 1rem;
	border: var(--shiffty-border);
	border-radius: var(--shiffty-radius);
	background: color-mix(in srgb, currentColor 10%, transparent);
	color: inherit;
	font: inherit;
	cursor: pointer;
	text-decoration: none;
}

.shiffty-btn:hover { background: color-mix(in srgb, currentColor 16%, transparent); }
.shiffty-btn--primary { font-weight: 600; }
.shiffty-btn--danger { border-color: #dc2626; color: #dc2626; }
.shiffty-btn--sm { padding: 0.35rem 0.65rem; font-size: 0.875rem; }

.shiffty-message {
	padding: 0.65rem 0.85rem;
	margin-bottom: 1rem;
	border-radius: var(--shiffty-radius);
	font-size: 0.9rem;
}

.shiffty-message--error {
	background: color-mix(in srgb, #dc2626 12%, transparent);
	border: 1px solid color-mix(in srgb, #dc2626 35%, transparent);
}

.shiffty-message--success {
	background: color-mix(in srgb, #16a34a 12%, transparent);
	border: 1px solid color-mix(in srgb, #16a34a 35%, transparent);
}

/* Toolbar */
.shiffty-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1rem;
	padding-bottom: 0.75rem;
	border-bottom: var(--shiffty-border);
}

.shiffty-toolbar-left,
.shiffty-toolbar-right {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.shiffty-toolbar select { min-width: 140px; padding: 0.4rem 0.55rem; font: inherit; }

.shiffty-user-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: center;
	font-size: 0.9rem;
}

.shiffty-allowance {
	padding: 0.35rem 0.65rem;
	border-radius: var(--shiffty-radius);
	background: var(--shiffty-surface);
	border: var(--shiffty-border);
	font-size: 0.85rem;
}

.shiffty-nav-tabs {
	display: flex;
	gap: 0.25rem;
}

.shiffty-nav-tabs button {
	padding: 0.45rem 0.85rem;
	border: none;
	border-bottom: 2px solid transparent;
	background: none;
	cursor: pointer;
	font: inherit;
	color: var(--shiffty-muted);
}

.shiffty-nav-tabs button.is-active {
	color: inherit;
	border-bottom-color: currentColor;
	font-weight: 600;
}

/* Calendar */
.shiffty-calendar-wrap {
	border: var(--shiffty-border);
	border-radius: var(--shiffty-radius);
	padding: 0.75rem;
	background: var(--shiffty-surface);
}

.shiffty-app .fc {
	font: inherit;
}

.shiffty-app .fc-toolbar-title {
	font-size: 1.15rem !important;
}

.shiffty-app .fc-button {
	font: inherit !important;
	padding: 0.35rem 0.65rem !important;
}

.shiffty-app .fc-event {
	cursor: pointer;
	font-size: 0.8rem;
	border-radius: 3px;
}

.shiffty-app .fc-daygrid-day,
.shiffty-app .fc-timegrid-col {
	cursor: pointer;
}

/* Day context menu */
.shiffty-context-menu {
	position: fixed;
	z-index: 100001;
	min-width: 220px;
	max-width: 280px;
	padding: 0;
	border: var(--shiffty-border);
	border-radius: var(--shiffty-radius);
	background: Canvas;
	color: CanvasText;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
	overflow: hidden;
}

.shiffty-context-menu__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.65rem 0.85rem;
	border-bottom: var(--shiffty-border);
	background: color-mix(in srgb, currentColor 6%, transparent);
	font-size: 0.9rem;
}

.shiffty-context-menu__date {
	font-size: 0.8rem;
	color: var(--shiffty-muted);
	font-weight: normal;
}

.shiffty-context-menu__empty {
	margin: 0;
	padding: 0.75rem 0.85rem;
	font-size: 0.85rem;
	color: var(--shiffty-muted);
	font-style: italic;
}

.shiffty-context-menu__hint {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem;
	padding: 0.5rem 0.65rem;
	border-top: var(--shiffty-border);
	font-size: 0.75rem;
	color: var(--shiffty-muted);
}

.shiffty-accordion {
	padding: 0.25rem 0;
	max-height: 280px;
	overflow-y: auto;
}

.shiffty-accordion__item {
	border-bottom: var(--shiffty-border);
}

.shiffty-accordion__item:last-child {
	border-bottom: none;
}

.shiffty-accordion__toggle {
	display: flex;
	align-items: center;
	width: 100%;
	padding: 0.55rem 0.85rem;
	border: none;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 0.9rem;
	text-align: left;
	cursor: pointer;
}

.shiffty-accordion__toggle::before {
	content: '▸';
	display: inline-block;
	width: 1em;
	margin-right: 0.35rem;
	transition: transform 0.15s ease;
}

.shiffty-accordion__toggle.is-open::before {
	transform: rotate(90deg);
}

.shiffty-accordion__toggle:hover,
.shiffty-accordion__action:hover {
	background: color-mix(in srgb, currentColor 6%, transparent);
}

.shiffty-accordion__panel {
	padding: 0 0 0.35rem;
}

.shiffty-accordion__action {
	display: block;
	width: 100%;
	padding: 0.45rem 0.85rem 0.45rem 2rem;
	border: none;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 0.875rem;
	text-align: left;
	cursor: pointer;
}

.shiffty-accordion__action--muted {
	padding-left: 0.85rem;
	font-size: 0.8rem;
	color: var(--shiffty-muted);
}

/* Panels */
.shiffty-panel {
	border: var(--shiffty-border);
	border-radius: var(--shiffty-radius);
	padding: 1rem;
	background: var(--shiffty-surface);
}

.shiffty-panel h3 {
	margin: 0 0 0.75rem;
	font-size: 1.1rem;
}

.shiffty-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}

.shiffty-table th,
.shiffty-table td {
	padding: 0.55rem 0.65rem;
	text-align: left;
	border-bottom: var(--shiffty-border);
}

.shiffty-badge {
	display: inline-block;
	padding: 0.15rem 0.45rem;
	border-radius: 4px;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
}

.shiffty-badge--pending { background: #fef3c7; color: #92400e; }
.shiffty-badge--approved { background: #dcfce7; color: #166534; }
.shiffty-badge--rejected { background: #fee2e2; color: #991b1b; }

/* Modal */
.shiffty-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000;
	padding: 1rem;
}

.shiffty-modal {
	width: 100%;
	max-width: 480px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 1.25rem;
	border-radius: var(--shiffty-radius);
	background: Canvas;
	color: CanvasText;
	border: var(--shiffty-border);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.shiffty-modal h3 { margin: 0 0 1rem; }

.shiffty-modal-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: flex-end;
	margin-top: 1rem;
}

.shiffty-grid-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.65rem;
}

.shiffty-checkbox label {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	font-size: 0.9rem;
	cursor: pointer;
}

.shiffty-manage-section {
	margin-bottom: 1.5rem;
}

.shiffty-manage-section:last-child { margin-bottom: 0; }

/* Manage tile grid */
.shiffty-manage-wrap {
	margin-top: 0.25rem;
}

.shiffty-manage-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 1rem;
	align-items: start;
}

.shiffty-manage-tile {
	display: flex;
	flex-direction: column;
	min-height: 100%;
	border: var(--shiffty-border);
	border-radius: var(--shiffty-radius);
	background: var(--shiffty-surface);
	overflow: hidden;
}

.shiffty-manage-tile__title {
	margin: 0;
	padding: 0.85rem 1rem;
	font-size: 1rem;
	font-weight: 600;
	border-bottom: var(--shiffty-border);
	background: color-mix(in srgb, currentColor 6%, transparent);
}

.shiffty-manage-tile__body {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
	padding: 1rem;
	flex: 1;
}

.shiffty-manage-tile__lead {
	margin: 0;
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--shiffty-muted);
}

.shiffty-manage-list {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.9rem;
}

.shiffty-modal--wide {
	max-width: 560px;
}

.shiffty-quickfill-preview {
	margin: 0;
	font-size: 0.9rem;
	color: var(--shiffty-muted);
}

.shiffty-manage-list li {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
	padding: 0.4rem 0;
	border-bottom: var(--shiffty-border);
}

.shiffty-manage-list li:last-child {
	border-bottom: none;
}

.shiffty-manage-list__empty {
	color: var(--shiffty-muted);
	font-style: italic;
	border-bottom: none !important;
}

.shiffty-manage-form {
	margin-top: auto;
	padding-top: 0.5rem;
	border-top: var(--shiffty-border);
}

.shiffty-color-swatch {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 3px;
	flex-shrink: 0;
	border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
}

.shiffty-color-input {
	width: 48px !important;
	height: 36px;
	padding: 2px !important;
	cursor: pointer;
}

.shiffty-staff-roster {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.9rem;
}

.shiffty-staff-roster li {
	padding: 0.4rem 0;
	border-bottom: var(--shiffty-border);
}

.shiffty-staff-roster li:last-child {
	border-bottom: none;
}

.shiffty-dept-checkboxes {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
}

.shiffty-dept-checkboxes .shiffty-checkbox {
	display: inline-flex;
	align-items: center;
	margin: 0;
}

@media (max-width: 640px) {
	.shiffty-toolbar { flex-direction: column; align-items: stretch; }
	.shiffty-grid-2 { grid-template-columns: 1fr; }
	.shiffty-manage-grid { grid-template-columns: 1fr; }
	.shiffty-app .fc-header-toolbar { flex-wrap: wrap; gap: 0.5rem; }
}
