/* ToDoDone design system · shared by installer and all application modules. */
:root {
	--color-ink: #202735;
	--color-muted: #7b8695;
	--color-primary: #293d5b;
	--color-primary-hover: #3b587e;
	--color-sidebar: #192334;
	--color-sidebar-active: #354157;
	--color-surface: #fff;
	--color-background: #f5f6f8;
	--color-border: #e5e8ee;
	--color-link: #315c9e;
	--color-focus: #aac1e4;
	--radius-card: 12px;
	--radius-control: 7px;
	--space-unit: 4px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
	font-size: 14px;
	color: var(--color-ink);
	background: var(--color-background);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 29px; margin: 0; letter-spacing: -.7px; }
h2 { font-size: 17px; margin: 0 0 20px; }
.eyebrow { color: var(--color-muted); text-transform: uppercase; font-size: 10px; letter-spacing: 1.4px; font-weight: 700; margin: 0 0 9px; }
.muted { color: var(--color-muted); }
.app-icon { width: 20px; height: 20px; display: inline-block; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand-logo { width: 42px; height: 42px; display: block; flex: 0 0 auto; border-radius: 10px; }

/* App shell */
.app { display: grid; grid-template-columns: 245px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--color-sidebar); color: #fff; display: flex; flex-direction: column; min-height: 100vh; padding: 27px 17px; }
.brand { display: flex; gap: 12px; align-items: center; padding: 3px 12px 36px; color: #fff; font-size: 19px; font-weight: 700; line-height: 1.05; }
.brand:hover { text-decoration: none; }
.brand small { display: inline-block; font-size: 9px; font-weight: 600; letter-spacing: 1px; color: #9eafca; white-space: nowrap; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 9px; color: #c9d1dc; }
.sidebar nav a:hover, .sidebar nav a.active { color: #fff; background: var(--color-sidebar-active); text-decoration: none; }
.sidebar nav .app-icon { width: 21px; height: 21px; }
.sidebar-bottom { margin-top: auto; padding: 28px 12px 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 12px; color: #bbc7d9; }
.content { padding: 42px clamp(18px, 4.5vw, 75px); width: 100%; min-width: 0; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 29px; }
.version { font-size: 11px; color: #8b95a2; }

/* Cards, dashboard and tables */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; margin-bottom: 22px; }
.stat, .panel { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-card); box-shadow: 0 3px 15px rgba(22, 32, 46, .025); }
.stat { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.stat span { color: var(--color-muted); font-size: 12px; }
.stat strong { font-size: 30px; font-weight: 650; letter-spacing: -1.3px; }
.stat small { font-size: 10px; color: var(--color-muted); }
.panel { padding: 25px; margin-bottom: 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.section-head h2 { margin: 0; }
.table-wrap { width: 100%; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 580px; text-align: left; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #89929f; font-weight: 700; }
th, td { padding: 13px 12px; border-bottom: 1px solid #edf0f4; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td { color: #535d6b; font-size: 13px; }
td strong { color: #263247; font-weight: 600; }
.tag { display: inline-block; border-radius: 6px; padding: 5px 9px; background: #eff3f8; color: #4f6078; font-size: 11px; }

/* Forms and actions */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: #525e6c; font-weight: 600; }
label.wide, .form-grid .wide { grid-column: 1 / -1; }
input, select, textarea { display: block; width: 100%; border: 1px solid #d8dee7; border-radius: var(--radius-control); padding: 10px 12px; font: inherit; color: #263247; background: #fff; min-width: 0; }
textarea { resize: vertical; }
button { cursor: pointer; border: 0; border-radius: var(--radius-control); padding: 10px 17px; color: #fff; font: inherit; font-weight: 600; background: var(--color-primary); }
button:hover { background: var(--color-primary-hover); }
button:disabled { opacity: .5; cursor: not-allowed; }
.button-small { padding: 8px 10px; font-size: 11px; }
.button-quiet { display: inline-flex; align-items: center; gap: 7px; background: transparent; border: 1px solid #58667d; font-size: 11px; padding: 7px 9px; }
.button-quiet .app-icon { width: 15px; height: 15px; }
.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form select { min-width: 100px; padding: 7px; font-size: 12px; }
.inline-settings { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.inline-settings label { flex: 1 1 220px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.notice, .alert { padding: 14px 17px; border-radius: 8px; margin: 0 0 20px; font-size: 13px; }
.notice { color: #235b3f; background: #e9f7ef; }
.alert { color: #8c3434; background: #fcecec; }

/* Login and web installer */
.login-wrap, .setup-wrap { min-height: 100vh; display: grid; place-items: center; padding: 28px 14px; }
.login { width: min(420px, 100%); padding: 37px; }
.login h1 { margin: 17px 0 8px; }
.login p { margin-bottom: 24px; }
.login form { display: grid; gap: 18px; }
.login button { width: 100%; }
.login-logo { width: 54px; height: 54px; }
.setup { width: min(760px, 100%); }
.setup-title { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.setup .form-grid h2 { margin: 15px 0 0; padding-bottom: 10px; border-bottom: 1px solid var(--color-border); }

/* Shared expandable settings panels */
.accordion { padding: 0; overflow: hidden; }
.accordion > summary { display: flex; gap: 12px; align-items: center; padding: 22px 25px; font-weight: 650; cursor: pointer; list-style: none; font-size: 17px; }
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary::after { content: '⌄'; margin-left: auto; color: #708099; font-size: 21px; }
.accordion[open] > summary::after { transform: rotate(180deg); }
.accordion[open] > summary { border-bottom: 1px solid #edf0f4; margin-bottom: 22px; }
.accordion > .form-grid, .accordion > form, .accordion > p, .accordion > .table-wrap, .accordion > h2 { margin-left: 25px; margin-right: 25px; }
.accordion > .form-grid, .accordion > form { margin-bottom: 25px; }
.accordion > .table-wrap, .accordion > p { margin-bottom: 22px; }

/* Interaction preferences */
button, input, select, textarea, .sidebar nav a { transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* Shared appearance editor: no module-specific control overrides. */
.settings-list { margin: 0 25px 25px; display: grid; }
.settings-row { display: flex; align-items: end; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--color-border); }
.settings-row:last-child { border-bottom: 0; }
.appearance-form { display: flex; align-items: end; gap: 10px; flex: 1 1 auto; min-width: 0; }
.appearance-form label { flex: 1; min-width: 0; }
.settings-caption { color: var(--color-muted); font-size: 11px; }
.icon-preview { width: 25px; height: 25px; margin: 0 8px 7px 0; }
.button-secondary { color: var(--color-ink); background: var(--color-background); border: 1px solid var(--color-border); }
.button-secondary:hover { background: var(--color-border); }
.reset-form { flex: 0 0 auto; }

/* Shared horizontal settings navigation and full-width settings content. */
.settings-tabs { display: flex; align-items: stretch; flex-wrap: wrap; gap: 5px; width: 100%; margin-bottom: 20px; padding: 5px; border: 1px solid var(--color-border); border-radius: var(--radius-card); background: var(--color-surface); }
.settings-tab { display: inline-flex; align-items: center; gap: 8px; padding: 12px 15px; border-radius: var(--radius-control); color: var(--color-muted); font-weight: 600; white-space: nowrap; }
.settings-tab:hover { color: var(--color-primary); background: var(--color-background); text-decoration: none; }
.settings-tab.active { color: #fff; background: var(--color-primary); }
.settings-tab .app-icon { width: 17px; height: 17px; }
.settings-panel { width: 100%; }
.settings-panel h2 { margin: 0 0 20px; padding-bottom: 17px; border-bottom: 1px solid var(--color-border); }
.settings-panel h3 { font-size: 14px; margin: 20px 0 16px; }
.settings-panel .settings-list { margin: 0; }
.settings-panel .settings-row { width: 100%; }
.settings-panel .table-wrap { margin-top: 20px; }
.settings-panel > p { margin: 0 0 20px; }
.settings-panel > p:last-child { margin-bottom: 0; }
.settings-panel > form { margin-bottom: 20px; }
.settings-panel > form:last-child { margin-bottom: 0; }
