/* LW Server Transfer Manager — frontend styles (dark mode) */

.lwstm {
	--lwstm-bg: #1a1f29; /* card surface */
	--lwstm-surface: #232a37; /* inputs, chips, table head */
	--lwstm-surface-2: #2a3240; /* hover */
	--lwstm-fg: #e6e9ef;
	--lwstm-muted: #98a2b3;
	--lwstm-border: #313a49;
	--lwstm-radius: 14px;
	--lwstm-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
	--lwstm-accent: #6366f1; /* button background */
	--lwstm-accent-text: #a5b4fc; /* accent text on dark */
	--lwstm-accent-fg: #ffffff;
	--lwstm-focus: rgba(129, 140, 248, 0.35);

	/* seat colours */
	--seat-white: #cbd5e1;
	--seat-blue: #3b82f6;
	--seat-purple: #8b5cf6;
	--seat-gold: #f59e0b;

	max-width: 1000px;
	margin: 0 auto;
	color: var(--lwstm-fg);
	font-size: 15px;
	line-height: 1.5;
}

.lwstm *,
.lwstm *::before,
.lwstm *::after {
	box-sizing: border-box;
}

/* The management view is data-dense; let it use more width. It renders as a
   list of applicant cards (not a table), so it is responsive by nature. */
.lwstm-management {
	max-width: 1280px;
}

/* Cards ------------------------------------------------------------------ */
.lwstm-card {
	background: var(--lwstm-bg);
	border: 1px solid var(--lwstm-border);
	border-radius: var(--lwstm-radius);
	box-shadow: var(--lwstm-shadow);
	padding: 28px;
	margin: 0 0 20px;
}

.lwstm-card h3 {
	margin: 0 0 18px;
	font-size: 1.5rem;
	line-height: 1.2;
	color: var(--lwstm-fg);
}

.lwstm-eyebrow {
	display: inline-block;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--lwstm-accent-text);
	margin-bottom: 6px;
}

.lwstm-closed {
	text-align: center;
	color: var(--lwstm-muted);
}

/* Banners ---------------------------------------------------------------- */
.lwstm-banner {
	border-radius: 10px;
	padding: 12px 16px;
	margin: 0 0 18px;
	font-weight: 600;
}

.lwstm-banner--success {
	background: rgba(16, 185, 129, 0.15);
	color: #6ee7b7;
	border: 1px solid rgba(16, 185, 129, 0.4);
}

.lwstm-banner--error {
	background: rgba(239, 68, 68, 0.15);
	color: #fca5a5;
	border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Seat legend / chips ---------------------------------------------------- */
.lwstm-seats-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 22px;
}

.lwstm-seat-chip {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 10px 14px;
	border-radius: 10px;
	border: 1px solid var(--lwstm-border);
	border-left: 5px solid var(--chip-color, var(--seat-white));
	background: var(--lwstm-surface);
	min-width: 150px;
	flex: 1 1 auto;
}

.lwstm-seat-chip--white {
	--chip-color: var(--seat-white);
}
.lwstm-seat-chip--blue {
	--chip-color: var(--seat-blue);
}
.lwstm-seat-chip--purple {
	--chip-color: var(--seat-purple);
}
.lwstm-seat-chip--gold {
	--chip-color: var(--seat-gold);
}

.lwstm-seat-name {
	font-weight: 700;
	font-size: 0.9rem;
}

.lwstm-seat-open {
	color: var(--lwstm-muted);
	font-size: 0.82rem;
	font-variant-numeric: tabular-nums;
}

/* Form ------------------------------------------------------------------- */
.lwstm-form {
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.lwstm-section {
	border: none;
	border-top: 1px solid var(--lwstm-border);
	margin: 0;
	padding: 20px 0 0;
	min-width: 0; /* allow grid children to shrink inside fieldset */
}

.lwstm-section:first-of-type {
	border-top: none;
	padding-top: 0;
}

.lwstm-section > legend {
	padding: 0;
	margin: 0 0 14px;
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--lwstm-accent-text);
}

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

.lwstm-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.lwstm-field--wide {
	grid-column: 1 / -1;
}

.lwstm-label {
	font-weight: 600;
	font-size: 0.85rem;
	color: var(--lwstm-fg);
}

.lwstm-label em {
	color: #f87171;
	font-style: normal;
}

/* Inputs / selects / textareas */
.lwstm-field input,
.lwstm-field select,
.lwstm-field textarea,
.lwstm-filters select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--lwstm-border);
	border-radius: 10px;
	background: var(--lwstm-surface);
	color: var(--lwstm-fg);
	font-size: 0.95rem;
	font-family: inherit;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.lwstm-field textarea {
	resize: vertical;
}

.lwstm-field input::placeholder,
.lwstm-field textarea::placeholder {
	color: var(--lwstm-muted);
	opacity: 0.8;
}

.lwstm-field input:focus,
.lwstm-field select:focus,
.lwstm-field textarea:focus,
.lwstm-filters select:focus,
.lwstm-assign-select:focus {
	outline: none;
	border-color: var(--lwstm-accent);
	box-shadow: 0 0 0 3px var(--lwstm-focus);
}

/* Custom dropdown arrow so selects stay legible on dark backgrounds */
.lwstm select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	padding-right: 34px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%2398a2b3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
}

.lwstm select option {
	color: #111;
}

.lwstm-submit-row {
	grid-column: 1 / -1;
}

/* Honeypot --------------------------------------------------------------- */
.lwstm-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Buttons ---------------------------------------------------------------- */
.lwstm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 11px 20px;
	border: none;
	border-radius: 10px;
	background: var(--lwstm-accent);
	color: var(--lwstm-accent-fg);
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.05s, filter 0.15s;
	text-decoration: none;
}

.lwstm-btn:hover {
	filter: brightness(1.12);
	color: var(--lwstm-accent-fg);
}

.lwstm-btn:active {
	transform: translateY(1px);
}

.lwstm-btn--sm {
	padding: 6px 12px;
	font-size: 0.82rem;
	border-radius: 8px;
}

.lwstm-btn--ok {
	background: #059669;
}
.lwstm-btn--danger {
	background: #dc2626;
}
.lwstm-btn--ghost {
	background: rgba(99, 102, 241, 0.18);
	color: var(--lwstm-accent-text);
}

/* Delete: muted outline, less prominent than the solid red Reject. */
.lwstm-btn--del {
	background: transparent;
	color: #f87171;
	border: 1px solid var(--lwstm-border);
}
.lwstm-btn--del:hover {
	background: rgba(239, 68, 68, 0.15);
	color: #fca5a5;
	filter: none;
}

/* Management toolbar ----------------------------------------------------- */
.lwstm-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.lwstm-toolbar-title {
	display: flex;
	align-items: center;
	gap: 12px;
}

.lwstm-toolbar-title h3 {
	margin: 0;
}

.lwstm-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.lwstm-filters select {
	width: auto;
	min-width: 140px;
	padding: 8px 34px 8px 10px;
	font-size: 0.85rem;
}

.lwstm-seats-legend--summary {
	margin-bottom: 20px;
}

/* Status pills ----------------------------------------------------------- */
.lwstm-status,
.lwstm-pill {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.lwstm-status--open,
.lwstm-pill--approved {
	background: rgba(34, 197, 94, 0.18);
	color: #86efac;
}
.lwstm-status--draft,
.lwstm-pill--pending {
	background: rgba(234, 179, 8, 0.18);
	color: #fde68a;
}
.lwstm-status--closed {
	background: rgba(148, 163, 184, 0.18);
	color: #cbd5e1;
}
.lwstm-status--archived,
.lwstm-pill--rejected {
	background: rgba(239, 68, 68, 0.18);
	color: #fca5a5;
}
.lwstm-pill--assigned {
	background: rgba(139, 92, 246, 0.22);
	color: #d8b4fe;
}

/* Seat badges ------------------------------------------------------------ */
.lwstm-seat-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 700;
	color: #fff;
	white-space: nowrap;
}

.lwstm-seat-badge--white {
	background: #64748b;
}
.lwstm-seat-badge--blue {
	background: var(--seat-blue);
}
.lwstm-seat-badge--purple {
	background: var(--seat-purple);
}
.lwstm-seat-badge--gold {
	background: var(--seat-gold);
	color: #4a2f00;
}

/* Statistics ------------------------------------------------------------- */
.lwstm-stats__head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.lwstm-stats__head h3 {
	margin: 0;
}

.lwstm-stats__legend {
	display: flex;
	gap: 16px;
	font-size: 0.78rem;
	color: var(--lwstm-muted);
}

.lwstm-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.lwstm-swatch {
	width: 12px;
	height: 12px;
	border-radius: 3px;
	display: inline-block;
}

.lwstm-swatch--confirmed {
	background: var(--lwstm-accent);
}

.lwstm-swatch--projected {
	background: rgba(99, 102, 241, 0.3);
}

.lwstm-kpis {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 14px;
	margin-bottom: 22px;
}

.lwstm-kpi {
	background: var(--lwstm-surface);
	border: 1px solid var(--lwstm-border);
	border-radius: 12px;
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.lwstm-kpi--confirmed {
	border-left: 4px solid var(--lwstm-accent);
}

.lwstm-kpi--projected {
	border-left: 4px solid rgba(99, 102, 241, 0.35);
}

.lwstm-kpi__label {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--lwstm-muted);
	font-weight: 700;
}

.lwstm-kpi__value {
	font-size: 1.7rem;
	font-weight: 800;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

.lwstm-kpi__value .lwstm-unit {
	font-size: 0.9rem;
	font-weight: 600;
}

.lwstm-kpi__sub {
	font-size: 0.8rem;
	color: var(--lwstm-muted);
}

.lwstm-bars {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.lwstm-bar-row {
	display: grid;
	grid-template-columns: minmax(70px, 130px) 1fr minmax(90px, auto);
	align-items: center;
	gap: 12px;
}

.lwstm-bar-label {
	font-weight: 700;
	font-size: 0.85rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.lwstm-bar-track {
	background: var(--lwstm-surface);
	border-radius: 999px;
	height: 16px;
	overflow: hidden;
}

.lwstm-bar-proj {
	background: rgba(99, 102, 241, 0.3);
	height: 100%;
	border-radius: 999px;
	min-width: 3px;
}

.lwstm-bar-conf {
	background: var(--lwstm-accent);
	height: 100%;
	border-radius: 999px;
}

.lwstm-bar-value {
	font-size: 0.82rem;
	text-align: right;
	color: var(--lwstm-muted);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.lwstm-bar-value strong {
	color: var(--lwstm-fg);
}

/* Applicant cards -------------------------------------------------------- */
.lwstm-count {
	color: var(--lwstm-muted);
	font-size: 0.82rem;
	margin: 0 0 12px;
}

.lwstm-app-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.lwstm-app-card {
	background: var(--lwstm-bg);
	border: 1px solid var(--lwstm-border);
	border-radius: var(--lwstm-radius);
	padding: 16px 18px;
}

.lwstm-app-card__head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
	flex-wrap: wrap;
}

.lwstm-app-card__id strong {
	display: block;
	font-size: 1.05rem;
	line-height: 1.2;
}

.lwstm-app-card__badges {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	align-items: center;
}

.lwstm-app-card__facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 12px 20px;
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid var(--lwstm-border);
}

.lwstm-fact {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.lwstm-fact__label {
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--lwstm-muted);
}

.lwstm-fact__value {
	font-size: 0.92rem;
	word-break: break-word;
}

.lwstm-app-card__actions {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	align-items: center;
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid var(--lwstm-border);
}

.lwstm-empty {
	padding: 28px;
	text-align: center;
	color: var(--lwstm-muted);
}

.lwstm-subline {
	display: block;
	font-size: 0.72rem;
	font-weight: 400;
	color: var(--lwstm-muted);
	margin-top: 2px;
}

.lwstm-unit {
	color: var(--lwstm-muted);
	font-size: 0.72rem;
}

/* Row actions ------------------------------------------------------------ */
.lwstm-row-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.lwstm-mini {
	display: inline;
	margin: 0;
}

.lwstm-assign {
	display: inline-flex;
	gap: 4px;
	align-items: center;
	margin: 0;
}

.lwstm-assign-select {
	padding: 6px 28px 6px 8px;
	border: 1px solid var(--lwstm-border);
	border-radius: 8px;
	font-size: 0.8rem;
	max-width: 140px;
	background-color: var(--lwstm-surface);
	color: var(--lwstm-fg);
}

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

	.lwstm-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.lwstm-filters {
		width: 100%;
	}

	.lwstm-filters select {
		flex: 1 1 45%;
		min-width: 0;
	}

	/* Stat bars: label + value on one line, bar spans full width below. */
	.lwstm-bar-row {
		grid-template-columns: 1fr auto;
		grid-template-areas:
			"label value"
			"track track";
		gap: 6px 12px;
	}
	.lwstm-bar-label {
		grid-area: label;
	}
	.lwstm-bar-value {
		grid-area: value;
	}
	.lwstm-bar-track {
		grid-area: track;
	}
}
