:root,
[data-theme="dark"] {
	--bg: #0a0e14;
	--panel: #121822;
	--panel-2: #161d29;
	--panel-3: #1a2332;
	--text: #e8eef7;
	--muted: #8b9bb4;
	--accent: #4d9fff;
	--accent-dim: #2f6fc4;
	--accent-soft: rgba(77, 159, 255, 0.12);
	--err: #f07178;
	--ok: #7fd99a;
	--warn: #e6c07b;
	--border: #243044;
	--border-soft: #1c2535;
	--sidebar-w: 232px;
	--radius: 10px;
	--radius-sm: 7px;
	--shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
	--font: "Segoe UI", "Inter", system-ui, sans-serif;
	--sidebar-bg-top: #111722;
	--sidebar-bg-bot: #0d121a;
	--cal-on-bg: #1a2e22;
	--cal-now-bg: #1e3a5f;
	--cal-leave-bg: #3a2418;
	--badge-bg: rgba(77, 159, 255, 0.18);
	--badge-text: #c8ddff;
	--pill-bg: rgba(77, 159, 255, 0.2);
	--pill-text: #e8f1ff;
}
[data-theme="light"] {
	--bg: #e8edf5;
	--panel: #ffffff;
	--panel-2: #f4f7fb;
	--panel-3: #e9eef6;
	--text: #142033;
	--muted: #4a5d78;
	--accent: #1f5fbf;
	--accent-dim: #174a96;
	--accent-soft: rgba(31, 95, 191, 0.12);
	--err: #b3261e;
	--ok: #0f6b3a;
	--warn: #8a5a00;
	--border: #c5d0e0;
	--border-soft: #d8e0eb;
	--shadow: 0 10px 28px rgba(20, 32, 51, 0.1);
	--sidebar-bg-top: #f8fafc;
	--sidebar-bg-bot: #eef2f8;
	--cal-on-bg: #d9f0e3;
	--cal-now-bg: #d3e4fa;
	--cal-leave-bg: #f6e0d4;
	--badge-bg: #e4eaf3;
	--badge-text: #111827;
	--pill-bg: #e4eaf3;
	--pill-text: #111827;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
	margin: 0;
	font-family: var(--font);
	background: var(--bg);
	color: var(--text);
	font-size: 14px;
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--err); }
.mb { margin-bottom: 1rem; }
.mt { margin-top: 1rem; }

button, .nav-link { font: inherit; }
button {
	background: var(--accent);
	color: #fff;
	border: 0;
	padding: 0.48rem 0.95rem;
	border-radius: var(--radius-sm);
	cursor: pointer;
	font-weight: 600;
	transition: background 0.12s ease, border-color 0.12s ease, transform 0.08s ease;
}
button:hover { background: var(--accent-dim); }
button:active { transform: translateY(1px); }
button.ghost {
	background: transparent;
	border: 1px solid var(--border);
	color: var(--text);
	font-weight: 500;
}
button.ghost:hover {
	border-color: var(--muted);
	background: var(--accent-soft);
}
[data-theme="light"] button.ghost:hover {
	background: rgba(31, 95, 191, 0.08);
}
.login-logo-wrap,
.sidebar-logo-wrap {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #000;
	border-radius: 8px;
	padding: 0.35rem 0.5rem;
}
.login-logo-wrap { margin: 0 auto 0.85rem; }
.login-logo-wrap .brand-logo { display: block; height: 36px; width: auto; }
.sidebar-logo-wrap img { height: 26px; width: auto; display: block; }
.autosave-hint { font-size: 0.75rem; margin: 0.25rem 0 0.5rem; }
.editable-title {
	outline: none;
	border-radius: 6px;
	padding: 0.1rem 0.25rem;
	margin: 0 0 0.25rem;
}
.editable-title:focus {
	box-shadow: 0 0 0 2px var(--accent-soft);
	background: var(--panel-2);
}
button.sm {
	padding: 0.22rem 0.5rem;
	font-size: 0.78rem;
	font-weight: 500;
	min-height: 28px;
}
.btn-block { width: 100%; margin-top: 0.5rem; }

/* Login */
.login-shell {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	background:
		radial-gradient(ellipse 80% 50% at 50% -10%, #1a3058 0%, transparent 55%),
		var(--bg);
}
.login-card {
	width: 100%;
	max-width: 400px;
	padding: 2rem 1.85rem;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 14px;
	box-shadow: var(--shadow);
}
.login-card h1 { margin: 0 0 0.2rem; font-size: 1.4rem; letter-spacing: -0.02em; }
.login-card label { display: block; margin: 0.95rem 0; font-size: 0.88rem; color: var(--muted); }
.login-card input {
	display: block;
	width: 100%;
	margin-top: 0.35rem;
	padding: 0.62rem 0.75rem;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border);
	background: var(--bg);
	color: var(--text);
}
.login-card input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}
.brand-logo { display: block; max-width: 150px; margin: 0 auto 1.1rem; }
.login-google { margin-top: 1.1rem; text-align: center; }
.login-google a { color: var(--accent); text-decoration: none; }
.login-google a:hover { text-decoration: underline; }

/* App shell */
.app-shell {
	display: flex;
	min-height: 100vh;
	background: var(--bg);
}
.sidebar {
	width: var(--sidebar-w);
	flex-shrink: 0;
	background: linear-gradient(180deg, var(--sidebar-bg-top) 0%, var(--sidebar-bg-bot) 100%);
	border-right: 1px solid var(--border-soft);
	display: flex;
	flex-direction: column;
	padding: 0.75rem 0.6rem;
	position: sticky;
	top: 0;
	height: 100vh;
	transition: width 0.15s ease;
	overflow: hidden;
}
.sidebar-toggle {
	flex-shrink: 0;
	border: 1px solid var(--border-soft);
	background: transparent;
	color: inherit;
	border-radius: 6px;
	width: 28px;
	height: 28px;
	cursor: pointer;
	line-height: 1;
	padding: 0;
}
.sidebar-brand {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.4rem 0.5rem 0.65rem;
	border-bottom: 1px solid var(--border-soft);
}
.sidebar-brand img { height: 28px; width: auto; }
.sidebar-brand strong { font-size: 0.92rem; letter-spacing: -0.01em; }
html.sidebar-collapsed .sidebar { width: 56px; padding: 0.5rem 0.35rem; }
html.sidebar-collapsed .sidebar-brand-text,
html.sidebar-collapsed .sidebar-user,
html.sidebar-collapsed .sidebar-actions,
html.sidebar-collapsed .nav-group-label,
html.sidebar-collapsed .theme-toggle,
html.sidebar-collapsed .sidebar-logout { display: none !important; }
html.sidebar-collapsed .side-nav .nav-link {
	font-size: 0;
	padding: 0.55rem 0.25rem;
	text-align: center;
}
html.sidebar-collapsed .side-nav .nav-link::first-letter { font-size: 0.75rem; }
html.sidebar-collapsed .sidebar-brand { justify-content: center; gap: 0; border: 0; }
html.sidebar-collapsed .sidebar-brand img { display: none; }
.rich-body {
	line-height: 1.45;
	font-size: 0.92rem;
	padding: 0.5rem 0;
}
.rich-body p { margin: 0 0 0.6rem; }
.rich-body ul { margin: 0 0 0.6rem 1.2rem; }
.rich-body h1, .rich-body h2, .rich-body h3 { margin: 0.6rem 0 0.35rem; font-size: 1rem; }
.code-url { font-size: 0.75rem; word-break: break-all; }
.wysiwyg-wrap .ql-toolbar {
	border-radius: 6px 6px 0 0;
	border-color: var(--border);
	background: var(--panel-2);
}
.wysiwyg-wrap .ql-container {
	min-height: 120px;
	border-radius: 0 0 6px 6px;
	background: var(--panel);
	border-color: var(--border);
	color: var(--text);
}
.wysiwyg-wrap .ql-snow .ql-stroke { stroke: var(--text); }
.wysiwyg-wrap .ql-snow .ql-fill { fill: var(--text); }
.wysiwyg-wrap .ql-editor { color: var(--text); min-height: 100px; }
.sidebar-user {
	padding: 0.45rem 0.5rem 0.35rem;
}
.sidebar-user .badge {
	display: block;
	margin-top: 0;
	max-width: 100%;
	font-size: 0.68rem;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.badge {
	display: inline-block;
	margin-top: 0.25rem;
	padding: 0.12rem 0.5rem;
	border-radius: 999px;
	background: var(--badge-bg);
	border: 1px solid var(--border);
	font-size: 0.68rem;
	color: var(--badge-text);
	max-width: 160px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-weight: 600;
}
.side-nav { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 0.1rem; min-height: 0; }
.nav-link {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.52rem 0.75rem;
	border-radius: var(--radius-sm);
	color: var(--text);
	text-decoration: none;
	border: 1px solid transparent;
	transition: background 0.12s ease, color 0.12s ease;
	opacity: 0.85;
}
.nav-link:hover { background: var(--accent-soft); color: var(--text); opacity: 1; }
.nav-link.active {
	background: var(--accent-soft);
	border-color: rgba(77, 159, 255, 0.35);
	color: var(--text);
	font-weight: 600;
}
.nav-group { margin-top: 0.85rem; padding-top: 0.55rem; border-top: 1px solid var(--border-soft); }
.nav-group-label {
	display: block;
	padding: 0.3rem 0.75rem 0.45rem;
	font-size: 0.68rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #6d7d96;
	font-weight: 650;
}
.nav-group .nav-link { padding-left: 0.9rem; font-size: 0.9rem; }
.sidebar-logout {
	margin: 0;
	width: 100%;
}
.sidebar-foot {
	margin-top: auto;
	padding-top: 0.55rem;
	border-top: 1px solid var(--border-soft);
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}
.theme-toggle {
	display: flex;
	gap: 0.25rem;
}
.theme-toggle .theme-btn {
	flex: 1;
	font-size: 0.72rem;
	padding: 0.28rem 0.35rem;
}
.theme-toggle .theme-btn.active {
	background: var(--accent-soft);
	border-color: var(--accent);
	color: var(--text);
	font-weight: 650;
}
.page-bar-meta {
	margin: 0.15rem 0 0;
	font-size: 0.78rem;
}
.page-search {
	min-width: 0;
	max-width: 180px;
	flex: 1 1 120px;
}

.page {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-height: calc(100vh - 8px);
	overflow: auto;
}
.page.hidden { display: none !important; }
.page-body { flex: 1; overflow: auto; padding: 0.65rem 0.9rem 1rem; }
.main-col {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	overflow: auto;
	background: var(--bg);
}
#boardMain.hidden,
#pageBarTickets.hidden { display: none !important; }

.page-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.65rem;
	flex-wrap: wrap;
	padding: 0.45rem 0.9rem;
	border-bottom: 1px solid var(--border-soft);
	background: var(--panel);
	position: sticky;
	top: 0;
	z-index: 5;
}
.page-bar-dense { padding: 0.4rem 0.9rem; min-height: 0; }
.page-bar-main { flex: 1 1 160px; min-width: 0; }
.page-title { margin: 0; font-size: 1.05rem; font-weight: 700; letter-spacing: -0.02em; }
.page-sub { margin: 0.1rem 0 0; width: auto; font-size: 0.78rem; color: var(--muted); max-width: 52rem; }
.page-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.page-actions input, .page-actions select, .form-inline input, .form-inline select,
.card-form input, .card-form select, .card-form textarea {
	padding: 0.32rem 0.5rem;
	border-radius: 6px;
	border: 1px solid var(--border);
	background: var(--bg);
	color: var(--text);
	min-height: 30px;
	font-size: 0.86rem;
}
.page-actions input:focus, .page-actions select:focus,
.form-inline input:focus, .form-inline select:focus,
.card-form input:focus, .card-form select:focus, .card-form textarea:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}
.page-actions input[type="search"] { min-width: 200px; }
.input-days { width: 4.5rem !important; min-width: 0 !important; flex: 0 0 auto !important; }
.toolbar-meta {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.4rem;
	color: var(--muted);
	font-size: 0.78rem;
}

.layout { display: flex; flex: 1; min-height: 0; }
.board-wrap { flex: 1; padding: 0.65rem 0.9rem; overflow: auto; }
.detail {
	width: min(400px, 40vw);
	border-left: 1px solid var(--border-soft);
	background: var(--panel);
	padding: 0.75rem 0.85rem 1.25rem;
	overflow: auto;
}
.detail h2 { margin: 0.2rem 0 0.15rem; font-size: 1rem; line-height: 1.3; }
.detail h3 {
	margin: 0.85rem 0 0.4rem;
	font-size: 0.68rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--muted);
	font-weight: 700;
}
.detail-close-row { display: flex; justify-content: flex-end; margin-bottom: 0.15rem; }

.table-wrap {
	background: var(--panel);
	border: 1px solid var(--border-soft);
	border-radius: 8px;
	overflow: auto;
	flex: 1;
	min-height: 0;
}
.table-wrap-fill { flex: 1; max-height: none; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
	text-align: left;
	padding: 0.42rem 0.55rem;
	border-bottom: 1px solid var(--border-soft);
	font-size: 0.84rem;
	vertical-align: middle;
}
.data-table-dense th, .data-table-dense td {
	padding: 0.32rem 0.5rem;
	font-size: 0.82rem;
}
.data-table th {
	color: var(--muted);
	font-weight: 650;
	font-size: 0.68rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	background: var(--panel-2);
	position: sticky;
	top: 0;
	z-index: 1;
}
.data-table tbody tr { cursor: pointer; transition: background 0.1s ease; }
.data-table tbody tr:hover { background: rgba(77, 159, 255, 0.06); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .actions-cell { white-space: nowrap; text-align: right; }
.data-table .actions-cell button { margin-left: 0.25rem; }

.pill {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.12rem 0.5rem;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 650;
	border: 1px solid transparent;
	white-space: nowrap;
}
.pill-muted { background: var(--panel-3); color: var(--muted); border-color: var(--border); }
.pill-ok { background: rgba(127, 217, 154, 0.12); color: var(--ok); border-color: rgba(127, 217, 154, 0.25); }
.pill-warn { background: rgba(230, 192, 123, 0.12); color: var(--warn); border-color: rgba(230, 192, 123, 0.28); }
.pill-err { background: rgba(240, 113, 120, 0.12); color: var(--err); border-color: rgba(240, 113, 120, 0.28); }
.pill-info { background: var(--pill-bg); color: var(--pill-text); border-color: var(--border); }
[data-theme="dark"] .pill-muted { background: #1c2535; }
[data-theme="light"] .pill-ok { background: #d9f0e3; color: #0a3d22; border-color: #a8d4b8; }
[data-theme="light"] .pill-warn { background: #f6e8c8; color: #5c3d00; border-color: #e0c888; }
[data-theme="light"] .pill-err { background: #f8d4d6; color: #7a1518; border-color: #e8a0a4; }

.empty-state {
	text-align: center;
	padding: 2.75rem 1.5rem;
	color: var(--muted);
	border: 1px dashed var(--border);
	border-radius: var(--radius);
	background: rgba(18, 24, 34, 0.45);
}
.empty-state strong { display: block; color: var(--text); margin-bottom: 0.35rem; font-size: 1rem; }

.view-toggle {
	display: inline-flex;
	padding: 0.15rem;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 8px;
	margin-bottom: 0;
	gap: 0.1rem;
}
.view-toggle-inline { margin: 0; }
.view-toggle button {
	margin: 0;
	opacity: 1;
	background: transparent;
	color: var(--muted);
	font-weight: 500;
	padding: 0.3rem 0.45rem;
	min-height: 30px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.view-toggle button.active {
	background: var(--accent-soft);
	color: #fff;
	border: 1px solid rgba(77, 159, 255, 0.3);
}
.form-stack {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 0.55rem;
}
.form-stack label {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	font-size: 0.78rem;
	color: var(--muted);
}
.form-stack input, .form-stack select {
	min-height: 30px;
	padding: 0.32rem 0.5rem;
	border-radius: 6px;
	border: 1px solid var(--border);
	background: var(--bg);
	color: var(--text);
}
.site-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.site-link:hover { text-decoration: underline; }

.kanban { display: flex; gap: 0.85rem; overflow-x: auto; align-items: flex-start; padding-bottom: 0.5rem; }
.kanban-col {
	min-width: 240px;
	background: var(--panel);
	border: 1px solid var(--border-soft);
	border-radius: var(--radius);
	padding: 0.65rem;
}
.kanban-col h4 { margin: 0 0 0.55rem; font-size: 0.78rem; color: var(--muted); letter-spacing: 0.03em; }
.kanban-empty { margin: 0.35rem 0 0.5rem; padding: 0.65rem; font-size: 0.8rem; }
.kanban-empty strong { display: block; margin-bottom: 0.2rem; }
.impact-chips-wrap { margin: 0.65rem 0 0.25rem; }
.impact-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; }
.impact-chips label {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.25rem 0.55rem;
	border: 1px solid var(--border);
	border-radius: 999px;
	font-size: 0.78rem;
	background: var(--panel-3);
	cursor: pointer;
}
.impact-chips label input { margin: 0; }
.card {
	background: var(--panel-3);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 0.65rem 0.7rem;
	margin-bottom: 0.5rem;
	cursor: grab;
}
.card:hover { border-color: rgba(77, 159, 255, 0.35); }
.card.dragging { opacity: 0.5; }

pre, .token-box {
	white-space: pre-wrap;
	word-break: break-all;
	background: #0c1118;
	padding: 0.85rem;
	border-radius: var(--radius-sm);
	font-size: 0.8rem;
	border: 1px solid var(--border);
}
.token-box { min-height: 2rem; margin-top: 0.55rem; }

.timeline .cmt {
	border-left: 3px solid var(--border);
	padding: 0.55rem 0.8rem;
	margin-bottom: 0.55rem;
	background: #0e141d;
	border-radius: 0 8px 8px 0;
}
.timeline .cmt.internal { border-left-color: var(--warn); }
.status-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem;
	align-items: flex-end;
	margin: 0.85rem 0;
}
.status-row label { display: flex; flex-direction: column; font-size: 0.82rem; gap: 0.28rem; color: var(--muted); }
.status-row select {
	padding: 0.42rem 0.5rem;
	background: var(--bg);
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	min-height: 36px;
}
.inline { display: flex; align-items: center; gap: 0.4rem; margin: 0.5rem 0; font-size: 0.85rem; }
textarea, #assigneeSelect, #watcherSelect {
	width: 100%;
	margin: 0.5rem 0;
	padding: 0.55rem 0.65rem;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border);
	background: var(--bg);
	color: var(--text);
}

.card-form {
	background: var(--panel);
	border: 1px solid var(--border-soft);
	border-radius: 8px;
	padding: 0.65rem 0.75rem;
	margin-bottom: 0.55rem;
}
.card-form h3 { margin: 0 0 0.45rem; font-size: 0.85rem; letter-spacing: -0.01em; }
.card-form-dense { padding: 0.55rem 0.65rem; }
.form-inline {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	align-items: center;
}
.form-inline > * { flex: 1 1 120px; }
.form-inline button { flex: 0 0 auto; }
.form-inline label.inline { flex: 0 0 auto; margin: 0; white-space: nowrap; font-size: 0.8rem; }

/* Config panels: table fills remaining viewport */
.config-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
	padding-top: 0.45rem;
}
.cfg-panel {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
	gap: 0.4rem;
}
.cfg-panel.hidden { display: none !important; }
.cfg-toolbar {
	display: flex;
	gap: 0.4rem;
	align-items: center;
	flex-wrap: wrap;
	flex: 0 0 auto;
}
.cfg-search {
	flex: 1 1 180px;
	max-width: 280px;
	min-height: 30px;
	padding: 0.32rem 0.5rem;
	border-radius: 6px;
	border: 1px solid var(--border);
	background: var(--bg);
	color: var(--text);
	font-size: 0.86rem;
}
.cfg-hint { margin: 0 0 0.5rem; font-size: 0.82rem; }
#pageConfig.page {
	min-height: 0;
	height: 100%;
	overflow: hidden;
}
#pageConfig .page-body {
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
#pageConfig .table-wrap-fill {
	flex: 1 1 auto;
	min-height: 200px;
	max-height: calc(100vh - 110px);
}
.cards-2 {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 1rem;
	margin-bottom: 1rem;
}
.split-tables {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 1.25rem;
}
.split-tables h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }

.roles-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.roles-table th, .roles-table td {
	border: 1px solid var(--border);
	padding: 0.45rem 0.55rem;
	text-align: center;
}
.roles-table th:first-child, .roles-table td:first-child { text-align: left; }
.roles-table .ok { color: var(--ok); }
.roles-table .no { color: var(--muted); }

.claim-badge {
	display: inline-block;
	padding: 0.1rem 0.45rem;
	border-radius: 4px;
	background: var(--badge-bg);
	color: var(--badge-text);
	font-size: 0.75rem;
	font-weight: 600;
}
.claim-free { color: var(--ok); font-size: 0.8rem; }
[data-theme="light"] .claim-badge {
	background: #fff3d6;
	color: #6b4e00;
	border: 1px solid #e6c97a;
}

.workbench {
	display: flex;
	flex: 1;
	min-height: 0;
}
.work-epics {
	width: 300px;
	flex-shrink: 0;
	border-right: 1px solid var(--border-soft);
	background: var(--panel);
	padding: 0.9rem;
	overflow: auto;
}
.work-main {
	flex: 1;
	min-width: 0;
	padding: 1.15rem 1.4rem 2rem;
	overflow: auto;
}
.work-empty {
	padding: 3rem 2rem;
	text-align: center;
	color: var(--muted);
	border: 1px dashed var(--border);
	border-radius: var(--radius);
	margin-top: 1rem;
}
.epic-list { list-style: none; margin: 0.75rem 0 0; padding: 0; }
.epic-list li {
	padding: 0.65rem 0.7rem;
	border-radius: var(--radius-sm);
	border: 1px solid transparent;
	cursor: pointer;
	margin-bottom: 0.3rem;
	transition: background 0.1s ease, border-color 0.1s ease;
}
.epic-list li:hover { background: rgba(255, 255, 255, 0.04); }
.epic-list li.active {
	background: var(--accent-soft);
	border-color: rgba(77, 159, 255, 0.35);
}
.epic-list .el-code { font-size: 0.7rem; color: var(--muted); letter-spacing: 0.02em; }
.epic-list .el-title { font-weight: 650; font-size: 0.92rem; margin-top: 0.1rem; }
.epic-list .el-meta { font-size: 0.74rem; color: var(--muted); margin-top: 0.2rem; }
.work-epic-head {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	align-items: flex-start;
	margin-bottom: 0.85rem;
}
.work-epic-head h2 { margin: 0.25rem 0; font-size: 1.3rem; letter-spacing: -0.02em; }
.code-pill {
	display: inline-block;
	font-size: 0.74rem;
	padding: 0.12rem 0.5rem;
	border-radius: 999px;
	background: var(--pill-bg);
	color: var(--pill-text);
	border: 1px solid var(--border);
	font-weight: 600;
}
.work-summary { color: var(--muted); margin: 0 0 1rem; }
.work-stories { display: flex; flex-direction: column; gap: 0.85rem; }
.story-card {
	background: var(--panel);
	border: 1px solid var(--border-soft);
	border-radius: var(--radius);
	padding: 0.95rem 1.05rem;
}
.story-card-head {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	align-items: center;
	margin-bottom: 0.55rem;
}
.story-card h3 { margin: 0; font-size: 1rem; }
.story-card .tickets-mini { margin-top: 0.55rem; }
.story-card .tickets-mini td { font-size: 0.85rem; }
.card-form.compact { padding: 0.85rem; margin-bottom: 0.55rem; }
.card-form.compact h3 { margin-bottom: 0.45rem; }
.client-link { color: var(--accent); text-decoration: none; font-weight: 560; }
.client-link:hover { text-decoration: underline; }

.dash-hero {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.25rem;
	align-items: baseline;
	margin-bottom: 1.1rem;
}
.dash-kpis {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
	gap: 0.65rem;
	margin-bottom: 1.15rem;
}
.kpi {
	background: var(--panel);
	border: 1px solid var(--border-soft);
	border-radius: var(--radius);
	padding: 0.85rem 0.95rem;
}
.kpi .kpi-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.kpi .kpi-value { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.03em; margin-top: 0.2rem; }
.kpi.danger .kpi-value { color: var(--err); }
.dash-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 1rem;
}
.dash-card {
	background: var(--panel);
	border: 1px solid var(--border-soft);
	border-radius: var(--radius);
	padding: 1.05rem 1.1rem;
	min-height: 120px;
}
.dash-card h3 {
	margin: 0 0 0.75rem;
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.045em;
	color: var(--muted);
}
.dash-card .dash-links { margin: 0.75rem 0 0; font-size: 0.88rem; }
.dash-stats { list-style: none; margin: 0; padding: 0; }
.dash-stats li {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.4rem 0;
	border-bottom: 1px solid var(--border-soft);
}
.dash-stats li:last-child { border-bottom: 0; }
.data-table tbody tr.empty-row,
.data-table tbody tr.empty-row:hover { cursor: default; background: transparent; }
.data-table tbody tr.empty-row td { padding: 0; border: 0; }
.data-table .empty-state { border: 0; border-radius: 0; background: transparent; }
.site-list { list-style: none; margin: 0; padding: 0; }
.site-list li {
	padding: 0.45rem 0;
	border-bottom: 1px solid var(--border-soft);
	font-size: 0.9rem;
}
.site-list li:last-child { border-bottom: 0; }

.horario-stack {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding: 1rem 1.15rem 2rem;
}
.horario-panel { width: 100%; }
.horario-cal-panel {
	background: var(--panel);
	border: 1px solid var(--border-soft);
	border-radius: var(--radius);
	padding: 0.75rem;
	overflow: auto;
}
.horario-days {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
	gap: 0.4rem 1.25rem;
	margin: 0.75rem 0;
}
.horario-day-row {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	flex-wrap: nowrap;
	min-width: 0;
}
.horario-day-row .inline {
	flex: 0 0 auto;
	margin: 0;
	min-width: 3.25rem;
	white-space: nowrap;
}
.horario-day-row input[type="time"] {
	width: 6.5rem;
	min-width: 6.5rem;
	flex: 0 0 auto;
}
.horario-day-row .muted {
	flex: 0 0 auto;
}
.horario-leave-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-bottom: 0.5rem;
}
.horario-leave-head h3 { margin: 0; }
.leave-list { list-style: none; margin: 0.5rem 0 0; padding: 0; font-size: 0.85rem; }
.leave-list li { padding: 0.35rem 0; border-bottom: 1px solid var(--border-soft); }
.horario-cal th, .horario-cal td { text-align: center; font-size: 0.8rem; }
.horario-cal th:first-child, .horario-cal td:first-child { text-align: left; }
.cal-on { background: var(--cal-on-bg); color: var(--ok); }
.cal-now { background: var(--cal-now-bg); color: var(--accent); font-weight: 600; }
.cal-leave { background: var(--cal-leave-bg); color: var(--warn); }
.cal-off { color: var(--muted); }
.horario-month-wrap { padding: 0.25rem; }
.horario-month-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 0.35rem;
}
.horario-month-dow {
	text-align: center;
	font-size: 0.72rem;
	color: var(--muted);
	padding: 0.25rem;
	font-weight: 600;
}
.horario-month-day {
	min-height: 72px;
	border: 1px solid var(--border-soft);
	border-radius: var(--radius-sm);
	padding: 0.35rem 0.4rem;
	background: var(--panel-2);
	cursor: pointer;
	text-align: left;
}
.horario-month-day:hover { border-color: var(--accent); }
.horario-month-day.out-month { opacity: 0.4; }
.horario-month-day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.horario-month-day .md-num { font-weight: 700; font-size: 0.88rem; }
.horario-month-day .md-meta { font-size: 0.7rem; color: var(--muted); margin-top: 0.25rem; line-height: 1.35; }
.cfg-subhead { margin: 1.1rem 0 0.45rem; font-size: 0.95rem; }

.dash-edit { margin-bottom: 1rem; }
.dash-edit h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }

@media (max-width: 900px) {
	.app-shell { flex-direction: column; }
	.sidebar {
		width: 100%;
		height: auto;
		position: relative;
		flex-direction: column;
		padding: 0.55rem;
	}
	.sidebar-brand { border-bottom: 0; padding-bottom: 0.25rem; }
	.sidebar-foot { margin-top: 0.5rem; border-top: 1px solid var(--border-soft); }
	.side-nav {
		flex-direction: row;
		flex-wrap: wrap;
		max-height: none;
		gap: 0.25rem;
		padding: 0.25rem 0;
	}
	.nav-group-label {
		width: 100%;
		margin-top: 0.35rem;
		display: block;
	}
	.nav-group { border: 0; margin: 0; padding: 0; }
	.sidebar-logout { width: 100%; }
	.workbench { flex-direction: column; }
	.work-epics { width: 100%; max-height: 240px; border-right: 0; border-bottom: 1px solid var(--border); }
	.detail { width: 100%; max-height: 50vh; border-left: 0; border-top: 1px solid var(--border); }
	.layout { flex-direction: column; }
	.sidebar-actions { flex-direction: row; width: 100%; }
	.btn-create { flex: 1; }
	.horario-month-grid { gap: 0.25rem; }
	.horario-month-day { min-height: 56px; }
}

/* —— Create modals / perfil / denser epics (Fase B) —— */
.sidebar-actions {
	display: flex;
	flex-direction: row;
	gap: 0.35rem;
	padding: 0.35rem 0.5rem 0.55rem;
	border-bottom: 1px solid var(--border-soft);
}
.btn-create {
	flex: 1;
	font-size: 0.78rem;
	padding: 0.32rem 0.45rem;
	border-radius: var(--radius-sm);
	font-weight: 600;
}
.btn-create.ghost {
	background: transparent;
	border: 1px solid var(--border);
	color: var(--text);
}
.work-epics { width: 280px; padding: 0.65rem 0.55rem; flex-shrink: 0; transition: width 0.18s ease; overflow: hidden; }
.work-epics-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 0.35rem 0.35rem;
	gap: 0.35rem;
}
.work-epics-count { font-size: 0.72rem; color: var(--muted); }
.work-epics-toggle { min-width: 1.6rem; padding: 0.1rem 0.35rem; font-size: 1rem; line-height: 1; }
.workbench.epics-collapsed .work-epics {
	width: 42px;
	padding: 0.45rem 0.2rem;
}
.workbench.epics-collapsed .work-epics-count,
.workbench.epics-collapsed .epic-list,
.workbench.epics-collapsed .work-list-empty { display: none; }
.workbench.epics-collapsed .work-epics-toggle { transform: rotate(180deg); }
.workbench.epics-focus .work-epics { display: none; }
.breadcrumb {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.35rem 0.5rem;
	margin: 0.35rem 0 0.75rem;
	font-size: 0.85rem;
}
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .bc-sep { color: var(--muted); }
.breadcrumb #epicShowListBtn { margin-left: auto; }
.inline-edit {
	max-width: 100%;
	font-size: 0.78rem;
	padding: 0.15rem 0.3rem;
	border-radius: 6px;
	border: 1px solid var(--border);
	background: var(--panel-2);
	color: var(--text);
}
.inline-edit:focus { outline: 1px solid var(--accent); }
.data-table td.cell-inline { cursor: default; }
.nav-bell {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	margin-top: 0.35rem;
	padding: 0.2rem 0.45rem;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: var(--panel-2);
	color: var(--text);
	text-decoration: none;
	font-size: 0.75rem;
	position: relative;
}
.nav-bell-count {
	min-width: 1.1rem;
	padding: 0 0.28rem;
	border-radius: 999px;
	background: var(--accent);
	color: #fff;
	font-weight: 700;
	font-size: 0.68rem;
	text-align: center;
}
.avisos-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.avisos-list li {
	background: var(--panel);
	border: 1px solid var(--border-soft);
	border-radius: var(--radius-sm);
	padding: 0.7rem 0.85rem;
	cursor: pointer;
}
.avisos-list li.unread { border-color: var(--accent); background: var(--accent-soft); }
.avisos-list .av-title { font-weight: 650; }
.avisos-list .av-body { font-size: 0.85rem; color: var(--muted); margin-top: 0.2rem; }
.avisos-list .av-meta { font-size: 0.72rem; color: var(--muted); margin-top: 0.35rem; }
.editable-title { outline: none; }
.editable-title:focus { box-shadow: inset 0 -2px 0 var(--accent); }
.epic-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem 0.65rem;
	margin: 0.35rem 0 0.75rem;
}
.epic-stat {
	display: inline-flex;
	align-items: baseline;
	gap: 0.3rem;
	padding: 0.28rem 0.65rem;
	border-radius: 999px;
	border: 1px solid var(--border);
	background: var(--panel-2);
	font-size: 0.78rem;
	color: var(--muted);
}
.epic-stat strong { color: var(--text); font-size: 0.95rem; }
.epic-stat.st-open { background: rgba(77, 159, 255, 0.12); border-color: rgba(77, 159, 255, 0.35); }
.epic-stat.st-test { background: rgba(230, 192, 123, 0.16); border-color: rgba(230, 192, 123, 0.4); }
.epic-stat.st-done { background: rgba(127, 217, 154, 0.14); border-color: rgba(127, 217, 154, 0.35); }
[data-theme="light"] .epic-stat.st-open { background: #d3e4fa; border-color: #9bbce8; color: #14325c; }
[data-theme="light"] .epic-stat.st-test { background: #f6e8c8; border-color: #e0c888; color: #5c3d00; }
[data-theme="light"] .epic-stat.st-done { background: #d9f0e3; border-color: #a8d4b8; color: #0a3d22; }
.status-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	max-width: 100%;
}
.status-dot {
	width: 0.55rem;
	height: 0.55rem;
	border-radius: 50%;
	flex-shrink: 0;
	background: var(--muted);
}
.status-chip.st-open .status-dot,
.status-chip.st-progress .status-dot { background: #4d9fff; }
.status-chip.st-test .status-dot { background: #e6c07b; }
.status-chip.st-done .status-dot { background: #7fd99a; }
.status-chip.st-bad .status-dot { background: #f07178; }
.status-chip.st-wait .status-dot { background: #c9a0ff; }
.status-chip .inline-edit,
.status-chip .status-label {
	border-color: transparent;
	background: transparent;
	font-weight: 600;
}
.status-chip.st-open .inline-edit,
.status-chip.st-progress .inline-edit,
.status-chip.st-open .status-label,
.status-chip.st-progress .status-label { color: #9ec5ff; }
.status-chip.st-test .inline-edit,
.status-chip.st-test .status-label { color: #e6c07b; }
.status-chip.st-done .inline-edit,
.status-chip.st-done .status-label { color: #7fd99a; }
.status-chip.st-bad .inline-edit,
.status-chip.st-bad .status-label { color: #f07178; }
.status-chip.st-wait .inline-edit,
.status-chip.st-wait .status-label { color: #c9a0ff; }
[data-theme="light"] .status-chip.st-open .inline-edit,
[data-theme="light"] .status-chip.st-progress .inline-edit,
[data-theme="light"] .status-chip.st-open .status-label,
[data-theme="light"] .status-chip.st-progress .status-label { color: #174a96; }
[data-theme="light"] .status-chip.st-test .inline-edit,
[data-theme="light"] .status-chip.st-test .status-label { color: #5c3d00; }
[data-theme="light"] .status-chip.st-done .inline-edit,
[data-theme="light"] .status-chip.st-done .status-label { color: #0a3d22; }
[data-theme="light"] .status-chip.st-bad .inline-edit,
[data-theme="light"] .status-chip.st-bad .status-label { color: #7a1518; }
[data-theme="light"] .status-chip.st-wait .inline-edit,
[data-theme="light"] .status-chip.st-wait .status-label { color: #5a2d8a; }
.status-chip .inline-edit { padding-left: 0; }
.work-list-empty {
	text-align: center;
	padding: 1.25rem 0.75rem;
	border: 1px dashed var(--border);
	border-radius: var(--radius-sm);
	margin: 0.5rem 0.25rem;
}
.work-empty {
	padding: 2.5rem 1.5rem;
	text-align: center;
	color: var(--muted);
	border: 1px dashed var(--border);
	border-radius: var(--radius);
	margin-top: 0.75rem;
}
.work-empty strong { display: block; color: var(--text); margin-bottom: 0.35rem; font-size: 1.05rem; }
.work-empty .muted { margin: 0 0 1rem; }
.story-create-bar { margin-bottom: 0.75rem; }
.epic-list li { padding: 0.55rem 0.6rem; }
.epic-list .el-title {
	font-weight: 650;
	font-size: 0.88rem;
	margin-top: 0.08rem;
	line-height: 1.35;
	white-space: normal;
	word-break: break-word;
}
.page-body-narrow { max-width: 520px; padding: 1.15rem 1.4rem 2rem; }

.modal-backdrop {
	position: fixed;
	inset: 0;
	z-index: 80;
	background: rgba(6, 10, 18, 0.72);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 4vh 1rem 2rem;
	overflow: auto;
}
.modal-backdrop.hidden { display: none; }
.modal-card {
	width: 100%;
	max-width: 480px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
.modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.85rem 1rem;
	border-bottom: 1px solid var(--border-soft);
}
.modal-head h2 { margin: 0; font-size: 1.05rem; letter-spacing: -0.02em; }
.modal-x { font-size: 1.25rem; line-height: 1; padding: 0.15rem 0.45rem; }
.modal-body {
	padding: 0.95rem 1rem 0.5rem;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
}
.modal-body label {
	display: flex;
	flex-direction: column;
	gap: 0.28rem;
	font-size: 0.8rem;
	color: var(--muted);
}
.modal-body input,
.modal-body select,
.modal-body textarea {
	font-size: 0.9rem;
}
.modal-body select[multiple] { min-height: 6.5rem; }
.modal-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.75rem 1rem 0.95rem;
	border-top: 1px solid var(--border-soft);
	flex-wrap: wrap;
}
.modal-foot-actions { display: flex; gap: 0.45rem; }
.modal-hint { font-size: 0.72rem; }

.toast-host {
	position: fixed;
	bottom: 1.25rem;
	right: 1.25rem;
	z-index: 90;
	display: flex;
	flex-direction: column;
	gap: 0.45rem;
	pointer-events: none;
}
.toast {
	pointer-events: auto;
	background: #1a2436;
	border: 1px solid rgba(77, 159, 255, 0.35);
	color: var(--text);
	padding: 0.65rem 0.95rem;
	border-radius: var(--radius-sm);
	font-size: 0.88rem;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
	max-width: 320px;
}
.toast.toast-ok { border-color: rgba(90, 200, 140, 0.45); }
.toast.toast-err { border-color: rgba(220, 100, 100, 0.5); }
