/* ============================================
   Zastupitelstvo Přepis - Main Stylesheet
   Clean, professional design for public admin
   ============================================ */

/* === Reset & Base === */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	font-size: 16px;
	-webkit-font-smoothing: antialiased;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	line-height: 1.6;
	color: #1f2937;
	background: #f3f4f6;
	min-height: 100vh;
}

/* === Colors === */
:root {
	--blue: #1a56db;
	--blue-light: #e8edfc;
	--green: #059669;
	--green-light: #d1fae5;
	--yellow: #d97706;
	--yellow-light: #fef3c7;
	--red: #dc2626;
	--red-light: #fee2e2;
	--purple: #7c3aed;
	--purple-light: #ede9fe;
	--gray-50: #f9fafb;
	--gray-100: #f3f4f6;
	--gray-200: #e5e7eb;
	--gray-300: #d1d5db;
	--gray-400: #9ca3af;
	--gray-500: #6b7280;
	--gray-600: #4b5563;
	--gray-700: #374151;
	--gray-800: #1f2937;
	--gray-900: #111827;
	--white: #ffffff;
	--shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
	--shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
	--shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
	--radius: 8px;
	--radius-lg: 12px;
}

/* === Layout === */
.navbar {
	background: var(--white);
	border-bottom: 1px solid var(--gray-200);
	padding: 0 2rem;
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: var(--shadow);
}

.navbar-inner {
	max-width: 1400px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 64px;
}

.navbar-brand {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--gray-900);
	text-decoration: none;
}

.navbar-brand svg {
	color: var(--blue);
}

.navbar-links {
	display: flex;
	gap: 0.25rem;
}

.nav-link {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 1rem;
	border-radius: var(--radius);
	color: var(--gray-600);
	text-decoration: none;
	font-size: 0.875rem;
	font-weight: 500;
	transition: all 0.15s;
}

.nav-link:hover {
	background: var(--gray-100);
	color: var(--gray-900);
}

.nav-link.active {
	background: var(--blue-light);
	color: var(--blue);
}

.main-content {
	max-width: 1400px;
	margin: 0 auto;
	padding: 2rem;
}

/* === Grid === */
.grid {
	display: grid;
}

.grid-cols-2 {
	grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
	grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
	grid-template-columns: 300px 1fr;
}

.col-span-1 {
	grid-column: span 1;
}

.col-span-2 {
	grid-column: span 2;
}

.col-span-3 {
	grid-column: span 1;
}

.gap-6 {
	gap: 1.5rem;
}

@media (max-width: 1024px) {

	.grid-cols-2,
	.grid-cols-3,
	.grid-cols-4 {
		grid-template-columns: 1fr;
	}

	.col-span-2,
	.col-span-3 {
		grid-column: span 1;
	}
}

/* === Page Header === */
.page-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	margin-bottom: 2rem;
}

.page-title {
	font-size: 1.75rem;
	font-weight: 700;
	color: var(--gray-900);
	line-height: 1.2;
}

.page-subtitle {
	color: var(--gray-500);
	margin-top: 0.25rem;
	font-size: 0.9rem;
}

/* === Cards === */
.card {
	background: var(--white);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow);
	border: 1px solid var(--gray-200);
	overflow: hidden;
}

.card-header {
	padding: 1rem 1.5rem;
	border-bottom: 1px solid var(--gray-100);
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.card-title {
	font-size: 1rem;
	font-weight: 600;
	color: var(--gray-800);
}

.card-body {
	padding: 1.5rem;
}

.card-footer {
	padding: 1rem 1.5rem;
	border-top: 1px solid var(--gray-100);
	background: var(--gray-50);
}

.card-actions {
	display: flex;
	gap: 0.5rem;
}

/* === Stats Grid === */
.stats-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1rem;
	margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
	.stats-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

.stat-card {
	background: var(--white);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow);
	padding: 1.25rem;
	display: flex;
	align-items: center;
	gap: 1rem;
	border: 1px solid var(--gray-200);
}

.stat-icon {
	width: 48px;
	height: 48px;
	border-radius: var(--radius);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.stat-icon svg {
	width: 24px;
	height: 24px;
	color: var(--white);
}

.stat-icon.bg-blue {
	background: var(--blue);
}

.stat-icon.bg-green {
	background: var(--green);
}

.stat-icon.bg-yellow {
	background: var(--yellow);
}

.stat-icon.bg-red {
	background: var(--red);
}

.stat-label {
	font-size: 0.8rem;
	color: var(--gray-500);
	font-weight: 500;
}

.stat-value {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--gray-900);
}

/* === Tables === */
.table-container {
	overflow-x: auto;
}

.table {
	width: 100%;
	border-collapse: collapse;
}

.table th {
	text-align: left;
	padding: 0.75rem 1.5rem;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--gray-500);
	background: var(--gray-50);
	border-bottom: 1px solid var(--gray-200);
}

.table td {
	padding: 1rem 1.5rem;
	border-bottom: 1px solid var(--gray-100);
	font-size: 0.875rem;
}

.table tbody tr:hover {
	background: var(--gray-50);
}

.table tbody tr:last-child td {
	border-bottom: none;
}

/* === Buttons === */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.625rem 1.25rem;
	border-radius: var(--radius);
	font-size: 0.875rem;
	font-weight: 600;
	border: 1px solid transparent;
	cursor: pointer;
	transition: all 0.15s;
	text-decoration: none;
	white-space: nowrap;
}

.btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.btn-primary {
	background: var(--blue);
	color: var(--white);
}

.btn-primary:hover:not(:disabled) {
	background: #1e40af;
}

.btn-danger {
	background: var(--red);
	color: var(--white);
}

.btn-danger:hover:not(:disabled) {
	background: #b91c1c;
}

.btn-ghost {
	background: transparent;
	color: var(--gray-600);
	border-color: var(--gray-200);
}

.btn-ghost:hover:not(:disabled) {
	background: var(--gray-100);
	color: var(--gray-800);
}

.btn-sm {
	padding: 0.375rem 0.75rem;
	font-size: 0.8rem;
}

.btn-lg {
	padding: 0.875rem 1.5rem;
	font-size: 1rem;
}

.btn-icon {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.25rem;
	font-size: 0.875rem;
	opacity: 0.6;
}

.btn-icon:hover {
	opacity: 1;
}

.btn-active {
	background: var(--blue-light);
	color: var(--blue);
	border-color: var(--blue);
}

.btn-group {
	display: flex;
	gap: 0.5rem;
	align-items: center;
}

.w-full {
	width: 100%;
}

/* === Badges === */
.badge {
	display: inline-flex;
	align-items: center;
	padding: 0.25rem 0.75rem;
	border-radius: 9999px;
	font-size: 0.75rem;
	font-weight: 600;
}

.badge-sm {
	padding: 0.125rem 0.5rem;
	font-size: 0.65rem;
}

.badge-blue {
	background: var(--blue-light);
	color: var(--blue);
}

.badge-green {
	background: var(--green-light);
	color: var(--green);
}

.badge-yellow {
	background: var(--yellow-light);
	color: var(--yellow);
}

.badge-red {
	background: var(--red-light);
	color: var(--red);
}

.badge-gray {
	background: var(--gray-100);
	color: var(--gray-500);
}

.badge-purple {
	background: var(--purple-light);
	color: var(--purple);
}

/* === Forms === */
.form-group {
	margin-bottom: 1rem;
}

.form-label {
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--gray-700);
	margin-bottom: 0.375rem;
}

.form-input {
	width: 100%;
	padding: 0.625rem 0.875rem;
	border: 1px solid var(--gray-300);
	border-radius: var(--radius);
	font-size: 0.875rem;
	color: var(--gray-800);
	background: var(--white);
	transition: border-color 0.15s;
}

.form-input:focus {
	outline: none;
	border-color: var(--blue);
	box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

.form-input-sm {
	padding: 0.375rem 0.625rem;
	font-size: 0.8rem;
}

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

.form-section-title {
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--gray-700);
	margin-bottom: 1rem;
}

.form-check {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.form-checkbox {
	width: 18px;
	height: 18px;
	accent-color: var(--blue);
}

.form-check-label {
	font-size: 0.875rem;
	color: var(--gray-700);
}

/* === Dropzone === */
.dropzone {
	border: 2px dashed var(--gray-300);
	border-radius: var(--radius-lg);
	padding: 3rem 2rem;
	text-align: center;
	cursor: pointer;
	transition: all 0.2s;
}

.dropzone:hover,
.dropzone-active {
	border-color: var(--blue);
	background: var(--blue-light);
}

.dropzone-has-file {
	border-style: solid;
	border-color: var(--green);
	background: var(--green-light);
}

.dropzone-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
}

.dropzone-icon {
	width: 48px;
	height: 48px;
	color: var(--gray-400);
}

.dropzone-text {
	font-weight: 600;
	color: var(--gray-700);
}

.dropzone-hint {
	font-size: 0.8rem;
	color: var(--gray-400);
}

.dropzone-file {
	display: flex;
	align-items: center;
	gap: 1rem;
	text-align: left;
}

/* === File List (multi-upload) === */
.file-list {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.file-list-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.4rem 0.6rem;
	background: var(--gray-50);
	border: 1px solid var(--gray-200);
	border-radius: var(--radius);
	font-size: 0.85rem;
}

.file-list-item:hover {
	background: var(--gray-100);
}

.file-list-order {
	font-weight: 700;
	color: var(--blue);
	min-width: 1.5rem;
	text-align: right;
}

.file-list-info {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.file-list-name {
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.file-list-size {
	color: var(--gray-400);
	font-size: 0.8rem;
	white-space: nowrap;
}

/* === Progress === */
.progress-bar {
	width: 100%;
	height: 8px;
	background: var(--gray-200);
	border-radius: 999px;
	overflow: hidden;
}

.progress-lg {
	height: 12px;
}

.progress-sm {
	height: 4px;
}

.progress-fill {
	height: 100%;
	border-radius: 999px;
	background: var(--blue);
	transition: width 0.5s ease;
}

.progress-fill.bg-green {
	background: var(--green);
}

.progress-fill.bg-red {
	background: var(--red);
}

.progress-fill.bg-blue {
	background: var(--blue);
}

.progress-fill.bg-gray {
	background: var(--gray-400);
}

/* === Pipeline Steps === */
.pipeline-steps {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.pipeline-step {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	padding: 1rem 0;
	position: relative;
}

.pipeline-step:not(:last-child)::after {
	content: '';
	position: absolute;
	left: 19px;
	top: 48px;
	bottom: -8px;
	width: 2px;
	background: var(--gray-200);
}

.pipeline-step.step-completed:not(:last-child)::after {
	background: var(--green);
}

.step-indicator {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	font-size: 0.875rem;
	font-weight: 600;
}

.step-pending .step-indicator {
	background: var(--gray-100);
	color: var(--gray-400);
	border: 2px solid var(--gray-200);
}

.step-active .step-indicator {
	background: var(--blue-light);
	color: var(--blue);
	border: 2px solid var(--blue);
}

.step-completed .step-indicator {
	background: var(--green);
	color: var(--white);
}

.step-completed .step-indicator svg {
	stroke: var(--white);
}

.step-spinner {
	width: 20px;
	height: 20px;
	border: 2px solid var(--blue-light);
	border-top: 2px solid var(--blue);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.step-title {
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--gray-800);
}

.step-description {
	font-size: 0.8rem;
	color: var(--gray-500);
}

.step-pending .step-title,
.step-pending .step-description {
	color: var(--gray-400);
}

/* === Transcript === */
.transcript-body {
	max-height: 70vh;
	overflow-y: auto;
	padding: 1rem 1.5rem;
}

.transcript-segment {
	display: grid;
	grid-template-columns: 80px 160px 1fr;
	gap: 0.75rem;
	padding: 0.75rem 0;
	border-bottom: 1px solid var(--gray-100);
	align-items: baseline;
}

.transcript-segment.merge-mode {
	grid-template-columns: 30px 80px 160px 1fr;
}

.transcript-segment:last-child {
	border-bottom: none;
}

.segment-highlighted {
	background: var(--yellow-light);
	margin: 0 -1.5rem;
	padding: 0.75rem 1.5rem;
	border-radius: var(--radius);
}

.segment-timestamp {
	font-family: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace;
	font-size: 0.75rem;
	color: var(--gray-400);
	padding-top: 0.15rem;
}

.segment-speaker {
	padding-left: 0.75rem;
}

.speaker-tag {
	font-size: 0.8rem;
	font-weight: 600;
	padding: 0.1rem 0.4rem;
	border-radius: 4px;
	transition: background-color 0.15s ease;
}

.speaker-tag:hover {
	background-color: rgba(0, 0, 0, 0.08);
}

.segment-text {
	font-size: 0.9rem;
	line-height: 1.6;
	color: var(--gray-800);
	border-radius: 4px;
	padding: 2px 4px;
	transition: background 0.15s, box-shadow 0.15s;
}

.segment-text[contenteditable="true"]:hover {
	background: rgba(26, 86, 219, 0.04);
}

.segment-text[contenteditable="true"]:focus {
	outline: none;
	background: rgba(26, 86, 219, 0.06);
	box-shadow: 0 0 0 2px rgba(26, 86, 219, 0.3);
}

/* === Speaker Sidebar === */
.speaker-item {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	cursor: pointer;
	border-bottom: 1px solid var(--gray-100);
	transition: background 0.15s;
}

.speaker-item:hover {
	background: var(--gray-50);
}

.speaker-item.speaker-active {
	background: var(--blue-light);
}

.speaker-avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--white);
	font-weight: 700;
	font-size: 0.875rem;
	flex-shrink: 0;
}

.speaker-info {
	flex: 1;
	min-width: 0;
}

.speaker-name-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.speaker-name {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--gray-800);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* === Job card === */
.job-card {
	padding: 0.75rem;
	border: 1px solid var(--gray-200);
	border-radius: var(--radius);
	margin-bottom: 0.5rem;
	cursor: pointer;
	transition: all 0.15s;
}

.job-card:hover {
	border-color: var(--blue);
	box-shadow: var(--shadow);
}

.job-status {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.25rem;
}

/* === Detail Grid === */
.detail-grid {
	display: grid;
	grid-template-columns: 140px 1fr;
	gap: 0.5rem 1rem;
}

.detail-grid dt {
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--gray-500);
}

.detail-grid dd {
	font-size: 0.85rem;
	color: var(--gray-800);
}

/* === Dropdown === */
.dropdown {
	position: relative;
	display: inline-block;
}

.dropdown-menu {
	position: absolute;
	right: 0;
	top: 100%;
	margin-top: 0.5rem;
	background: var(--white);
	border: 1px solid var(--gray-200);
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
	min-width: 200px;
	z-index: 100;
	overflow: hidden;
}

.dropdown-item {
	display: block;
	width: 100%;
	padding: 0.625rem 1rem;
	text-align: left;
	font-size: 0.875rem;
	color: var(--gray-700);
	border: none;
	background: none;
	cursor: pointer;
	transition: background 0.1s;
}

.dropdown-item:hover {
	background: var(--gray-100);
}

/* === Modal === */
.modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 200;
}

.modal {
	background: var(--white);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
	width: 100%;
	max-width: 480px;
}

.modal-card {
	background: var(--white);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
	width: 100%;
	max-width: 480px;
}

.modal-header {
	padding: 1.25rem 1.5rem;
	border-bottom: 1px solid var(--gray-200);
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.modal-header h3 {
	font-size: 1.1rem;
	font-weight: 600;
}

.modal-body {
	padding: 1.5rem;
}

.modal-footer {
	padding: 1rem 1.5rem;
	border-top: 1px solid var(--gray-200);
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	background: var(--gray-50);
	border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* === Alert === */
.alert {
	padding: 1rem 1.25rem;
	border-radius: var(--radius);
	font-size: 0.875rem;
}

.alert-error {
	background: var(--red-light);
	color: var(--red);
	border: 1px solid #fecaca;
}

/* === Toast === */
.toast-container {
	position: fixed;
	top: 80px;
	right: 1.5rem;
	z-index: 300;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.toast {
	padding: 0.75rem 1.25rem;
	border-radius: var(--radius);
	font-size: 0.875rem;
	font-weight: 500;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-width: 300px;
	box-shadow: var(--shadow-lg);
}

.toast-success {
	background: var(--green);
	color: var(--white);
}

.toast-error {
	background: var(--red);
	color: var(--white);
}

.toast-info {
	background: var(--blue);
	color: var(--white);
}

.toast-close {
	background: none;
	border: none;
	color: inherit;
	cursor: pointer;
	font-size: 1.25rem;
	opacity: 0.7;
}

.toast-close:hover {
	opacity: 1;
}

/* === Pagination === */
.pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
}

/* === Utilities === */
.hidden {
	display: none;
}

.text-center {
	text-align: center;
}

.text-muted {
	color: var(--gray-500);
}

.text-sm {
	font-size: 0.875rem;
}

.text-xs {
	font-size: 0.75rem;
}

.text-blue {
	color: var(--blue);
}

.text-red {
	color: var(--red);
}

.font-medium {
	font-weight: 500;
}

.font-bold {
	font-weight: 700;
}

.mt-1 {
	margin-top: 0.25rem;
}

.mt-2 {
	margin-top: 0.5rem;
}

.mt-3 {
	margin-top: 0.75rem;
}

.mt-4 {
	margin-top: 1rem;
}

.mb-1 {
	margin-bottom: 0.25rem;
}

.mb-4 {
	margin-bottom: 1rem;
}

.mb-6 {
	margin-bottom: 1.5rem;
}

.ml-1 {
	margin-left: 0.25rem;
}

.my-4 {
	margin-top: 1rem;
	margin-bottom: 1rem;
}

.py-8 {
	padding-top: 2rem;
	padding-bottom: 2rem;
}

.p-0 {
	padding: 0;
}

.p-3 {
	padding: 0.75rem;
}

.inline-block {
	display: inline-block;
}

.rounded {
	border-radius: var(--radius);
}

.bg-gray-50 {
	background: var(--gray-50);
}

.link {
	color: var(--blue);
	text-decoration: none;
	font-weight: 500;
}

.link:hover {
	text-decoration: underline;
}

hr {
	border: none;
	border-top: 1px solid var(--gray-200);
}

.flex {
	display: flex;
}

.items-center {
	align-items: center;
}

.justify-between {
	justify-content: space-between;
}