/* TODO board — vizuálně navazuje na /admin (admin.css), ale bez jeho
   `* { overflow: hidden }`, které by rozbilo scrollování sloupců. */

:root {
	--todo-card: rgba(32, 32, 34, 0.92);
	--todo-card-hover: rgba(48, 48, 52, 0.95);
	--todo-border: rgba(255, 255, 255, 0.12);
	--todo-border-strong: rgba(255, 255, 255, 0.26);
	--todo-text: #e3e6ec;
	--todo-dim: #a8adb8;
	--todo-faint: #7c828e;
}

/* Pozn.: `[hidden] { display: none !important }` a spinner jsou v admin-common.css,
   které se načítá před tímhle souborem. */

body { overflow-x: hidden; }

/* ── Panely (převzato z admin.css, ať to vypadá stejně jako přihlášky) ────── */

.dashboard-container {
	background: linear-gradient(
		to bottom,
		rgba(20, 20, 20, 0.6) 0%,
		rgba(20, 20, 20, 0.85) 100%
	);
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
	padding: 2rem;
	margin-bottom: 1.5rem;
	border-radius: 0.5rem;
}

.todo-app {
	padding: 0.25rem 1rem 0;
	flex: 1 1 auto;
}

.todo-shell { padding: 1.5rem 1.5rem 1.25rem; }

.todo-header { margin-bottom: 1rem; }

/* ── Toolbar ─────────────────────────────────────────────────────────────── */

.toolbar {
	display: flex;
	gap: 8px;
	align-items: center;
	justify-content: flex-end;
	flex-wrap: wrap;
}
.toolbar .form-control {
	width: auto;
	min-width: 135px;
	background: rgba(0, 0, 0, 0.3);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 10px;
	color: #fff;
}
.toolbar .form-control:focus {
	background: rgba(0, 0, 0, 0.5);
	border-color: #666;
	box-shadow: none;
	color: #fff;
}
.toolbar .form-control::placeholder { color: var(--todo-faint); }
.toolbar select.form-control option { background: #1a1a1a; color: var(--todo-text); }

.progress-wrap { display: flex; align-items: center; gap: 10px; }
.progress-track {
	width: 150px; height: 6px;
	background: rgba(0, 0, 0, 0.5);
	border-radius: 99px;
	overflow: hidden;
}
.progress-fill { height: 100%; width: 0; background: #28a745; transition: width .3s ease; }
.progress-label { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.status-dot {
	width: 9px; height: 9px;
	border-radius: 50%;
	background: var(--todo-faint);
	transition: background .2s;
	flex: none;
}
.status-dot.saving { background: #d4934f; }
.status-dot.saved { background: #28a745; }
.status-dot.error { background: #dc3545; }

/* ── Board ───────────────────────────────────────────────────────────────── */

/* Pevná výška odvozená od viewportu je spolehlivější než flex řetěz přes
   Bootstrap kontejnery — sloupce pak scrollují uvnitř, stránka ne. */
.board {
	display: flex;
	gap: 10px;
	align-items: stretch;
	overflow-x: auto;
	overflow-y: hidden;
	height: calc(100vh - 320px);
	min-height: 420px;
	padding-bottom: 6px;
}

.todo-column {
	flex: 1 1 0;
	min-width: 235px;
	display: flex;
	flex-direction: column;
	background: rgba(20, 20, 20, 0.45);
	border: 1px solid var(--todo-border);
	border-radius: 8px;
	overflow: hidden;
}
.todo-column.drag-over { border-color: #a1edf8; }

.todo-column-head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 9px 11px;
	border-bottom: 1px solid var(--todo-border);
	background: rgba(0, 0, 0, 0.25);
	flex: none;
}
.todo-column-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.todo-column-title {
	font-weight: 600;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: #dbdbdb;
}
.todo-column-count {
	margin-left: auto;
	font-size: 11px;
	color: var(--todo-dim);
	background: rgba(0, 0, 0, 0.45);
	padding: 1px 7px;
	border-radius: 99px;
	font-variant-numeric: tabular-nums;
}
.todo-column-add {
	background: none; border: none; color: var(--todo-faint);
	cursor: pointer; font-size: 17px; line-height: 1; padding: 0 2px;
}
.todo-column-add:hover { color: #a1edf8; }

.todo-column-body {
	overflow-y: auto;
	padding: 7px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 1 1 auto;
	min-height: 0;
}

.todo-column-empty {
	color: var(--todo-faint);
	font-size: 12px;
	text-align: center;
	padding: 16px 8px;
	border: 1px dashed var(--todo-border);
	border-radius: 6px;
}

/* ── Karty ───────────────────────────────────────────────────────────────── */

.todo-card {
	background: var(--todo-card);
	border: 1px solid var(--todo-border);
	border-left: 3px solid var(--cat, var(--todo-border-strong));
	border-radius: 6px;
	padding: 8px 10px;
	cursor: grab;
	display: flex;
	flex-direction: column;
	gap: 5px;
	color: var(--todo-text);
	flex: none;
}
.todo-card:hover {
	background: var(--todo-card-hover);
	border-color: var(--todo-border-strong);
	border-left-color: var(--cat, var(--todo-border-strong));
}
.todo-card.dragging { opacity: .4; }
.todo-card.drop-before { box-shadow: 0 -3px 0 -1px #a1edf8; }
.todo-card.drop-after { box-shadow: 0 3px 0 -1px #a1edf8; }

.todo-card-title { font-size: 13px; line-height: 1.4; font-weight: 500; }
.todo-card.done .todo-card-title { color: var(--todo-dim); text-decoration: line-through; }

.todo-card-notes {
	font-size: 11.5px;
	color: var(--todo-dim);
	line-height: 1.45;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.todo-card-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }

.todo-chip {
	font-size: 10.5px;
	padding: 1px 6px;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.4);
	color: var(--todo-dim);
	white-space: nowrap;
	border: 1px solid transparent;
}
.todo-chip-cat {
	color: var(--cat);
	border-color: color-mix(in srgb, var(--cat) 40%, transparent);
	background: color-mix(in srgb, var(--cat) 14%, transparent);
}
.todo-chip-prio { color: #dc3545; border-color: rgba(220, 53, 69, .5); background: rgba(220, 53, 69, .12); }
.todo-chip-res { font-family: ui-monospace, Consolas, monospace; font-size: 10px; }
.todo-chip-dep { color: #d98c4a; border-color: rgba(217, 140, 74, .45); background: rgba(217, 140, 74, .12); }
.todo-chip-link { color: #a1edf8; }

.todo-card-deps { font-size: 11px; color: var(--todo-faint); line-height: 1.4; }
.todo-card-deps .dep-done { text-decoration: line-through; color: #28a745; }

/* ── Modal (styl z admin.css) ────────────────────────────────────────────── */

.todo-modal.modal-content {
	background-color: #1a1a1a !important;
	border: 1px solid #444 !important;
	border-radius: 18px !important;
	box-shadow: 0 0 25px rgba(0, 0, 0, 0.75) !important;
	color: #f0f0f0 !important;
}

.todo-modal .modal-header,
.todo-modal .modal-footer {
	border: none !important;
	background-color: transparent !important;
	padding: 1.25rem 1.75rem !important;
	flex: none;
}
.todo-modal .modal-title { font-weight: 600; color: #e0e0e0; }

/* Bootstrap 4.1.3 nemá .modal-dialog-scrollable (přišlo až ve 4.3), takže
   scrollování těla řešíme ručně — jinak se dlouhý detail usekne pod okrajem. */
.todo-modal .modal-body {
	max-height: calc(100vh - 230px);
	overflow-y: auto;
	padding: 0 1.75rem;
}

.modal-backdrop { background-color: #000 !important; }
.modal-backdrop.show { opacity: .8 !important; }

.todo-modal .form-control {
	background-color: #2a2a2a !important;
	border: 1px solid #444 !important;
	border-radius: 10px !important;
	color: #f0f0f0 !important;
}
.todo-modal .form-control:focus {
	border-color: #666 !important;
	box-shadow: none !important;
}
.todo-modal .form-control::placeholder { color: var(--todo-faint); }

/* Detail bez práva upravovat — pole zůstávají čitelná, ale je vidět, že jsou zamčená. */
.todo-modal .form-control:disabled {
	background-color: #232323 !important;
	border-color: #383838 !important;
	color: var(--todo-dim) !important;
	cursor: default;
}
.dep-list input:disabled { cursor: default; }
.dep-list label:has(input:disabled) { cursor: default; color: var(--todo-dim); }
.todo-modal label {
	font-weight: 600;
	font-size: 0.8rem;
	color: #e0e0e0;
	margin-bottom: 0.35rem;
}
.todo-modal select.form-control option { background: #1a1a1a; color: var(--todo-text); }
.todo-modal .close { opacity: .7; text-shadow: none; }
.todo-modal .close:hover { opacity: 1; }

.dep-list, .blocks-list {
	max-height: 165px;
	overflow-y: auto;
	border: 1px solid #444;
	border-radius: 10px;
	padding: 4px;
	background-color: #2a2a2a;
}
.dep-list label {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 6px;
	margin: 0;
	border-radius: 4px;
	cursor: pointer;
	font-size: 12.5px;
	font-weight: 400;
	color: var(--todo-text);
	text-transform: none;
	letter-spacing: 0;
}
.dep-list label:hover { background: rgba(255, 255, 255, 0.07); }
.dep-list .dep-col { margin-left: auto; font-size: 10.5px; color: var(--todo-faint); white-space: nowrap; }
.blocks-list div { padding: 4px 6px; font-size: 12.5px; color: var(--todo-dim); }

/* ── Tlačítka (z admin.css, aby fungovala i mimo /admin) ─────────────────── */

.btn-table-info, .btn-table-success, .btn-table-danger {
	display: inline-block;
	padding: 6px 12px;
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s ease-in-out;
	margin-left: 4px;
	background-color: rgba(20, 20, 20, 0.5);
	text-decoration: none;
}
.btn-table-info { color: #cdf8ff !important; border: 1px solid #a1edf8; }
.btn-table-info:hover { background-color: #2994a5 !important; border: 1px solid #c8eff5; color: #fff !important; text-decoration: none; }
.btn-table-success { color: #28a745 !important; border: 1px solid #28a745; }
.btn-table-success:hover { background-color: #1f8336 !important; color: #fff !important; text-decoration: none; }
.btn-table-danger { color: #dc3545 !important; border: 1px solid #dc3545; }
.btn-table-danger:hover { background-color: #a8212f !important; color: #fff !important; text-decoration: none; }

/* ── Scrollbary (stejné jako v tabulce přihlášek) ────────────────────────── */

.board, .todo-column-body, .dep-list, .blocks-list, .todo-modal .modal-body {
	scrollbar-width: thin;
	scrollbar-color: #444 #1a1a1a;
}
.board::-webkit-scrollbar,
.todo-column-body::-webkit-scrollbar,
.dep-list::-webkit-scrollbar,
.blocks-list::-webkit-scrollbar,
.todo-modal .modal-body::-webkit-scrollbar { width: 8px; height: 8px; }

.board::-webkit-scrollbar-track,
.todo-column-body::-webkit-scrollbar-track,
.dep-list::-webkit-scrollbar-track,
.blocks-list::-webkit-scrollbar-track,
.todo-modal .modal-body::-webkit-scrollbar-track { background: #1a1a1a; border-radius: 10px; }

.board::-webkit-scrollbar-thumb,
.todo-column-body::-webkit-scrollbar-thumb,
.dep-list::-webkit-scrollbar-thumb,
.blocks-list::-webkit-scrollbar-thumb,
.todo-modal .modal-body::-webkit-scrollbar-thumb { background: #444; border-radius: 10px; }

.board::-webkit-scrollbar-thumb:hover,
.todo-column-body::-webkit-scrollbar-thumb:hover,
.dep-list::-webkit-scrollbar-thumb:hover,
.blocks-list::-webkit-scrollbar-thumb:hover,
.todo-modal .modal-body::-webkit-scrollbar-thumb:hover { background: #555; }

/* ── Toast ───────────────────────────────────────────────────────────────── */

.todo-toast {
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	background: #1a1a1a;
	border: 1px solid #444;
	color: var(--todo-text);
	border-radius: 10px;
	padding: 9px 16px;
	font-size: 13px;
	box-shadow: 0 0 25px rgba(0, 0, 0, .75);
	z-index: 2000;
}
.todo-toast.error { border-color: #dc3545; color: #ff8f99; }

@media (max-width: 991px) {
	.toolbar { justify-content: flex-start; margin-top: 12px; }
	.board {
		flex-direction: column;
		overflow-y: auto;
		overflow-x: hidden;
		height: auto;
		max-height: none;
	}
	.todo-column { min-height: 0; }
	.todo-column-body { max-height: 60vh; }
	.todo-modal .modal-body { max-height: calc(100vh - 190px); }
}
