:root {
  --navy-950: #06152e;
  --navy-900: #0a2146;
  --navy-800: #0b2f63;
  --navy-700: #15447d;
  --slate-950: #0f172a;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --white: #fff;
  --danger: #dc2626;
  --success: #15803d;
  --warning: #ca8a04;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--slate-950);
  background: #edf2f7;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; min-height: 100vh; background: #edf2f7; color: var(--slate-950); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
input, select, textarea {
  width: 100%; border: 1px solid var(--slate-300); border-radius: 9px; padding: .68rem .78rem; background: #fff; color: var(--slate-950);
}
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(21, 68, 125, .18); border-color: var(--navy-700); }
textarea { resize: vertical; }
label { display: grid; gap: .4rem; color: var(--slate-700); font-weight: 650; font-size: .9rem; }
small { color: var(--slate-600); }

.topbar { position: sticky; top: 0; z-index: 50; min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem 1.4rem; background: var(--navy-950); color: #fff; box-shadow: 0 4px 16px rgba(6, 21, 46, .25); }
.topbar-brand { display: flex; align-items: center; gap: .8rem; }
.topbar-brand img { width: 130px; height: 42px; object-fit: contain; background: #fff; border-radius: 7px; }
.topbar-brand span { display: grid; line-height: 1.1; }
.topbar-brand small { color: #cbd5e1; margin-top: .25rem; }
.topnav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.topnav a, .link-button { color: #e2e8f0; border: 0; background: transparent; padding: .65rem .8rem; border-radius: 8px; }
.topnav a:hover, .link-button:hover { background: rgba(255,255,255,.1); color: #fff; }
.inline-form { display: inline; margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid #b9c5d3; border-radius: 9px; background: #fff; color: var(--navy-900); padding: .62rem .88rem; font-weight: 750; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.btn:hover { border-color: var(--navy-700); background: #f8fafc; }
.btn-primary { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.btn-primary:hover { background: var(--navy-700); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-small { padding: .42rem .62rem; font-size: .78rem; }
.btn-wide { width: 100%; padding: .8rem 1rem; }
.icon-btn { display: inline-grid; place-items: center; min-width: 32px; height: 32px; border: 1px solid var(--slate-300); border-radius: 8px; background: #fff; color: var(--navy-900); font-weight: 900; }
.icon-btn:hover { border-color: var(--navy-700); }
.icon-btn.danger { color: var(--danger); }
.button-row { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }

.flash-stack { position: fixed; right: 1rem; top: 78px; z-index: 100; width: min(420px, calc(100vw - 2rem)); display: grid; gap: .6rem; }
.flash { padding: .85rem 1rem; border-radius: 10px; background: #fff; border-left: 5px solid var(--navy-700); box-shadow: var(--shadow); }
.flash-success { border-color: var(--success); }
.flash-danger { border-color: var(--danger); }
.flash-warning { border-color: var(--warning); }
.toast-stack { position: fixed; right: 1rem; bottom: 1rem; z-index: 200; display: grid; gap: .6rem; width: min(420px, calc(100vw - 2rem)); }
.toast { padding: .85rem 1rem; border-radius: 10px; color: #fff; background: var(--navy-900); box-shadow: 0 14px 35px rgba(15,23,42,.22); animation: toast-in .2s ease-out; }
.toast-danger { background: #991b1b; }
.toast-warning { background: #92400e; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

.auth-page { background: radial-gradient(circle at 20% 10%, #1f4f89 0, var(--navy-950) 52%, #030b18 100%); }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 2rem; }
.auth-card { width: min(440px, 100%); background: rgba(255,255,255,.98); border-radius: 18px; padding: 2rem; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.auth-card-wide { width: min(760px, 100%); }
.auth-brand { text-align: center; margin-bottom: 1.5rem; }
.auth-brand img { width: min(250px, 80%); height: 75px; object-fit: contain; }
.auth-brand h1 { margin: 1rem 0 .35rem; color: var(--navy-950); }
.auth-brand p { margin: 0; color: var(--slate-600); }
.auth-card form { display: grid; gap: 1rem; }
.check-line { display: flex; align-items: center; gap: .55rem; }
.check-line input { width: auto; }
.field-error { color: var(--danger); font-weight: 650; }

.page-container { width: min(1500px, calc(100% - 2rem)); margin: 1.5rem auto 3rem; }
.page-container.narrow { max-width: 720px; }
.panel { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.panel h1, .panel h2 { color: var(--navy-950); }
.form-stack { display: grid; gap: 1rem; }
.form-grid { display: grid; gap: 1rem; }
.form-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full-width { grid-column: 1 / -1; }
.error-page { min-height: 70vh; display: grid; place-content: center; justify-items: center; text-align: center; }
.error-page h1 { font-size: 5rem; margin: 0; color: var(--navy-900); }

.dashboard-shell { width: 100%; min-height: 100vh; background: #f8fafc; }
.dashboard-header { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1rem 1.5rem; background: #fff; border-bottom: 1px solid var(--slate-200); }
.dashboard-header h1 { margin: 0; color: var(--navy-950); font-size: clamp(1.5rem, 2.1vw, 2.25rem); letter-spacing: -.025em; }
.dashboard-header p { margin: .25rem 0 0; color: var(--slate-600); font-weight: 650; }
.dashboard-brand { display: flex; align-items: center; gap: .8rem; text-align: right; }
.dashboard-brand img { width: clamp(150px, 15vw, 250px); height: 64px; object-fit: contain; }
.dashboard-brand span { display: grid; }
.dashboard-brand strong { color: var(--navy-950); }
.dashboard-brand small { margin-top: .2rem; }
.dashboard-toolbar { position: sticky; top: 68px; z-index: 35; display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; background: rgba(241,245,249,.96); border-bottom: 1px solid var(--slate-200); backdrop-filter: blur(10px); }
.dashboard-toolbar > div { display: flex; gap: .5rem; flex-wrap: wrap; }
.tile-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: dense; grid-auto-rows: 64px; gap: 12px; padding: 12px; align-items: stretch; }
.dashboard-tile { position: relative; grid-column: span min(var(--tile-span), 12); grid-row: span var(--tile-rows); min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #fff; border: 1px solid #c8d2df; border-radius: 10px; overflow: hidden; box-shadow: 0 3px 12px rgba(15,23,42,.06); }
.tile-header { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .48rem .75rem; background: linear-gradient(180deg, var(--navy-900), var(--navy-950)); color: #fff; }
.tile-header h2 { margin: 0; min-width: 0; font-size: .9rem; line-height: 1.05; text-transform: uppercase; letter-spacing: .025em; text-align: center; white-space: nowrap; transform-origin: center; flex: 1; }
.tile-body { position: relative; min-height: 0; flex: 1; overflow: hidden; }
.tile-fit-content { position: absolute; inset: 0 auto auto 0; width: 100%; min-width: 0; transform-origin: top left; will-change: transform; contain: layout style; }
.tile-fit-content .table-scroll { height: auto; overflow: visible; }
.tile-subheader { min-height: 48px; padding: .55rem .7rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; background: #f8fafc; border-bottom: 1px solid var(--slate-200); }
.tile-subheader > div:first-child { display: grid; }
.tile-subheader small { margin-top: .1rem; font-size: .74rem; }
.dashboard-footer { padding: .45rem 1rem; background: var(--navy-950); color: #fff; text-align: center; font-weight: 750; letter-spacing: .05em; }

.table-scroll { min-width: 0; overflow: visible; height: auto; }
table { border-collapse: collapse; width: 100%; }
.task-table { font-size: .82rem; }
.task-table th { position: sticky; top: 0; z-index: 2; padding: .48rem .55rem; background: #eef2f7; color: var(--navy-950); border-bottom: 1px solid #bac7d6; text-align: left; white-space: nowrap; }
.task-table td { padding: .45rem .55rem; border: 1px solid rgba(100,116,139,.26); vertical-align: middle; background: color-mix(in srgb, var(--row-color) 16%, white); }
.task-table tr.priority-high { --row-color: #ef4444; }
.task-table tr.priority-medium { --row-color: #fbbf24; }
.task-table tr.priority-low { --row-color: #84cc16; }
.task-table tr:hover td { background: color-mix(in srgb, var(--row-color) 24%, white); }
.task-table tr.is-completed td { --row-color: #94a3b8; color: #64748b; background: #e5e7eb; }
.task-table tr.is-completed td:not(.row-actions) { text-decoration: line-through; }
.task-table td small { display: block; margin-top: .15rem; color: inherit; opacity: .82; }
.task-table input[type="checkbox"] { width: 18px; height: 18px; }
.done-col, .done-cell, .select-col { width: 64px; text-align: center !important; }
.actions-col { width: 150px; }
.row-actions { display: flex; gap: .3rem; align-items: center; white-space: nowrap; }
.priority-badge { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; padding: .25rem .52rem; background: color-mix(in srgb, var(--priority-color) 18%, white); border: 1px solid color-mix(in srgb, var(--priority-color) 65%, #475569); font-weight: 800; color: #172033; }
.priority-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--priority-color); }
.empty-row td { padding: 1.4rem; text-align: center; color: var(--slate-500); background: #fff !important; }

.workflow-grid { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 8px; padding: 8px; min-width: 1080px; height: 100%; }
.workflow-step { display: flex; flex-direction: column; border: 1px solid #aebccc; border-radius: 7px; overflow: hidden; background: #fff; }
.workflow-step h3 { margin: 0; padding: .45rem .5rem; background: var(--navy-900); color: #fff; text-transform: uppercase; font-size: .72rem; text-align: center; }
.workflow-step ul { flex: 1; margin: .5rem .55rem; padding-left: 1.05rem; font-size: .75rem; }
.workflow-step footer { padding: .42rem .5rem; border-top: 1px solid var(--slate-300); font-size: .7rem; }
.responsibility-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .75rem; padding: .75rem; align-content: start; }
.responsibility-list section, .responsibility-card { min-width: 0; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: .7rem; align-items: start; padding: .8rem; border: 1px solid var(--slate-200); border-radius: 10px; background: linear-gradient(180deg, #ffffff, #f8fafc); box-shadow: 0 1px 3px rgba(15, 23, 42, .04); }
.responsibility-content { min-width: 0; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--navy-800); color: #fff; font-weight: 900; }
.responsibility-list h3 { margin: 0; font-size: .92rem; line-height: 1.2; overflow-wrap: anywhere; }
.responsibility-list small { display: block; margin-top: .12rem; line-height: 1.25; }
.responsibility-list ul, .responsibility-items { margin: .45rem 0 0; padding-left: 1.05rem; font-size: .76rem; line-height: 1.35; }
.responsibility-list li + li, .responsibility-items li + li { margin-top: .16rem; }
@media (min-width: 1300px) {
  .responsibility-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .responsibility-list { grid-template-columns: 1fr; padding: .55rem; gap: .55rem; }
}
.info-table { font-size: .78rem; }
.info-table th { padding: .48rem; background: #eef2f7; color: var(--navy-950); text-align: left; border: 1px solid var(--slate-300); }
.info-table td { padding: .48rem; border: 1px solid var(--slate-300); }
.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .4rem; }
.status-running { background: #65a30d; }
.status-waiting { background: #f59e0b; }
.status-stopped { background: #dc2626; }
.schedule-list section { display: grid; grid-template-columns: 120px 1fr; border-bottom: 1px solid var(--slate-300); }
.schedule-list time { padding: .8rem; color: var(--navy-800); font-weight: 900; border-right: 1px solid var(--slate-300); }
.schedule-list section > div { padding: .7rem; }
.schedule-list h3 { margin: 0; font-size: .85rem; text-transform: uppercase; color: var(--navy-800); }
.schedule-list ul { margin: .35rem 0 0; padding-left: 1.1rem; font-size: .78rem; }
.handover-board { height: 100%; display: grid; grid-template-columns: 1fr 80px 1fr; gap: .7rem; align-items: center; padding: 1rem; }
.handover-board section { display: grid; gap: .45rem; background: #f8fafc; border: 1px solid var(--slate-300); border-radius: 9px; padding: .8rem; }
.handover-board h3 { margin: 0 0 .3rem; font-size: .8rem; text-transform: uppercase; color: var(--navy-900); }
.handover-board label { display: flex; align-items: center; gap: .4rem; font-size: .78rem; }
.handover-board input { width: auto; }
.handover-icon { font-size: 3.2rem; text-align: center; color: var(--navy-800); }
.rule-list { list-style: none; margin: 0; padding: .7rem; display: grid; gap: .55rem; }
.rule-list li { display: grid; grid-template-columns: 28px 1fr; align-items: start; gap: .45rem; font-size: .82rem; }
.rule-list li span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--navy-800); color: #fff; font-weight: 900; }
.escalation-list li span { background: var(--danger); }
.callout { margin: .5rem .7rem .8rem; padding: .65rem; border-radius: 8px; text-align: center; font-weight: 900; text-transform: uppercase; }
.danger-callout { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
.priority-legend { padding: .8rem; display: grid; gap: .65rem; }
.priority-legend > div { display: grid; grid-template-columns: 90px 1fr; align-items: center; border-radius: 7px; overflow: hidden; border: 1px solid var(--slate-300); }
.priority-legend strong { padding: .65rem; color: #fff; text-align: center; }
.priority-legend span { padding: .65rem; font-weight: 800; }
.legend-high strong { background: #c4161c; }
.legend-high { background: #fee2e2; }
.legend-medium strong { background: #eab308; color: #111827; }
.legend-medium { background: #fef9c3; }
.legend-low strong { background: #65a30d; }
.legend-low { background: #ecfccb; }
.priority-legend small { padding: .6rem; border: 1px solid var(--slate-300); text-align: center; text-transform: uppercase; font-weight: 800; }

.layout-controls { display: flex; align-items: center; color: #fff; }
.move-hint { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 1px solid rgba(255,255,255,.55); border-radius: 7px; font-size: 1rem; font-weight: 900; }
.tile-resize-handle { position: absolute; right: 3px; bottom: 3px; z-index: 25; width: 25px; height: 25px; padding: 0; border: 0; border-radius: 4px; background: transparent; cursor: nwse-resize; touch-action: none; }
.tile-resize-handle::before { content: ""; position: absolute; right: 3px; bottom: 3px; width: 14px; height: 14px; background: repeating-linear-gradient(135deg, transparent 0 3px, #0ea5e9 3px 5px); clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.layout-mode .dashboard-tile { order: initial !important; outline: 2px dashed #38bdf8; cursor: default; }
.layout-mode .dashboard-tile.is-dragging { opacity: .5; }
.layout-mode .dashboard-tile.is-resizing { outline-color: #0284c7; box-shadow: 0 0 0 4px rgba(14,165,233,.18); }
.layout-mode .tile-header { cursor: move; user-select: none; }
.layout-mode .tile-resize-handle:not([hidden]) { display: block; }
body.is-resizing-tile { cursor: nwse-resize !important; user-select: none; }

.modal { width: min(760px, calc(100vw - 2rem)); border: 0; border-radius: 14px; padding: 0; box-shadow: 0 30px 100px rgba(0,0,0,.35); }
.modal::backdrop { background: rgba(2,8,23,.68); backdrop-filter: blur(3px); }
.modal form > header, .modal form > footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; }
.modal form > header { background: var(--navy-950); color: #fff; }
.modal form > header h2 { margin: 0; }
.modal form > footer { border-top: 1px solid var(--slate-200); justify-content: flex-end; }
.modal .form-grid { padding: 1.2rem; }

.tv-mode { background: #fff; overflow-x: hidden; }
.tv-mode .dashboard-shell { min-height: 100vh; }
.tv-mode .dashboard-header { min-height: 80px; padding: .65rem 1rem; }
.tv-mode .dashboard-header h1 { font-size: clamp(1.7rem, 2.2vw, 2.7rem); }
.tv-mode .tile-grid { width: 100%; padding: 8px; gap: 8px; grid-auto-rows: 78px; }
.tv-mode .tile-header { min-height: 40px; }
.tv-mode .tile-header h2 { font-size: clamp(.82rem, .95vw, 1.1rem); }
.tv-mode .task-table { font-size: clamp(.82rem, .92vw, 1.08rem); }
.tv-mode .task-table th, .tv-mode .task-table td { padding: .52rem .62rem; }
.tv-mode .priority-badge { font-size: .9em; }
.tv-mode .dashboard-footer { font-size: .95rem; }

.admin-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.admin-sidebar { background: #fff; border-right: 1px solid var(--slate-200); padding: 1rem; }
.admin-sidebar h2 { margin: .3rem .6rem 1rem; color: var(--navy-950); }
.admin-sidebar nav { display: grid; gap: .25rem; }
.admin-sidebar a { padding: .68rem .75rem; border-radius: 8px; color: var(--slate-700); font-weight: 700; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: #eaf1fa; color: var(--navy-900); }
.admin-content { min-width: 0; padding: 1.4rem; }
.admin-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.admin-heading h1 { margin: 0; color: var(--navy-950); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.stat-card { padding: 1.2rem; background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-card strong { display: block; color: var(--navy-900); font-size: 2rem; }
.data-table { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.data-table th { padding: .7rem; background: var(--navy-900); color: #fff; text-align: left; }
.data-table td { padding: .68rem; border-bottom: 1px solid var(--slate-200); vertical-align: top; }
.data-table tr:hover td { background: #f8fafc; }
.badge { display: inline-flex; padding: .22rem .48rem; border-radius: 999px; font-size: .75rem; font-weight: 800; background: #e2e8f0; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-inactive { background: #fee2e2; color: #991b1b; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.master-card { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.master-card h2 { margin-top: 0; color: var(--navy-950); }
.inline-edit { display: grid; grid-template-columns: 1.5fr 1fr 80px auto auto; gap: .45rem; align-items: end; padding: .55rem 0; border-bottom: 1px solid var(--slate-200); }
.inline-edit:last-child { border-bottom: 0; }
.inline-edit label { font-size: .7rem; }
.inline-edit input, .inline-edit select { padding: .48rem; }
.code-area { min-height: 420px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }
.audit-value { max-width: 420px; max-height: 90px; overflow: auto; white-space: pre-wrap; font-size: .72rem; color: var(--slate-600); }

@media (max-width: 1000px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .dashboard-toolbar { top: 108px; }
  .dashboard-header { align-items: flex-start; }
  .dashboard-brand span { display: none; }
  .dashboard-page .tile-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .dashboard-page .dashboard-tile { grid-column: span min(var(--tile-span), 12); }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { border-right: 0; border-bottom: 1px solid var(--slate-200); }
  .admin-sidebar nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .topbar-brand span { display: none; }
  .topnav { font-size: .84rem; }
  .dashboard-header { padding: .8rem; }
  .dashboard-brand img { width: 130px; }
  .dashboard-toolbar { position: static; flex-direction: column; }
  .dashboard-page .tile-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: 56px; gap: 6px; padding: 6px; }
  .dashboard-page .dashboard-tile { min-height: 0; margin: 0; grid-column: span min(var(--tile-span), 12); }
  .form-grid.two-columns, .admin-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .handover-board { grid-template-columns: 1fr; }
  .handover-icon { transform: rotate(90deg); }
  .stat-grid { grid-template-columns: 1fr; }
  .admin-sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inline-edit { grid-template-columns: 1fr; }
}
@media print {
  .topbar, .dashboard-toolbar, .layout-controls, .row-actions, .actions-col, .select-col { display: none !important; }
  .dashboard-tile { break-inside: avoid; box-shadow: none; }
}

/* Version 2.0 – Mandantenkontext */
.tenant-badge { display:inline-flex; align-items:center; padding:.35rem .65rem; border-radius:999px; background:#e2e8f0; color:#0f172a; font-size:.8rem; font-weight:700; }
.tenant-switchbar { display:flex; flex-wrap:wrap; gap:.4rem; align-items:center; padding:.55rem 1.25rem; background:#f8fafc; border-bottom:1px solid #dbe4ee; }
.tenant-switchbar > span { font-size:.8rem; font-weight:700; color:#475569; margin-right:.25rem; }
.tenant-switch { border:1px solid #cbd5e1; background:white; padding:.3rem .55rem; border-radius:999px; cursor:pointer; font-size:.78rem; }
.tenant-switch.active { background:#0b2a55; color:white; border-color:#0b2a55; }
.sidebar-tenant { margin:-.4rem 0 1rem; color:#64748b; font-size:.85rem; }
.standalone-admin { max-width:1000px; margin:2rem auto; padding:0 1rem; }
.button-row { display:flex; gap:.4rem; align-items:center; flex-wrap:wrap; }
.priority-legend > div strong { background: var(--legend-color, #64748b); }


/* Version 2.1 – freie Kachelskalierung ohne interne Scrollbereiche */
.dashboard-page .dashboard-tile,
.dashboard-page .tile-body,
.dashboard-page .tile-fit-content,
.dashboard-page .table-scroll { scrollbar-width: none; }
.dashboard-page .tile-body::-webkit-scrollbar,
.dashboard-page .tile-fit-content::-webkit-scrollbar,
.dashboard-page .table-scroll::-webkit-scrollbar { display: none; }
.dashboard-page .tile-body,
.dashboard-page .table-scroll { overflow: hidden; }
.dashboard-page .tile-fit-content .table-scroll { overflow: visible; }

/* CNC-LOGO-FIX-2.3.1
   Mandantenlogos vollständig und ohne Verzerrung darstellen. */
img[src*="/uploads/"],
img[src*="/static/uploads/"] {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
}

/* Version 2.5 – responsive Aufgabenansicht für Aufgaben-User */
.task-user-page { min-height: 100vh; background: #eef2f7; }
.task-user-shell { width: min(1440px, 100%); margin: 0 auto; padding: clamp(.75rem, 2vw, 1.5rem); }
.task-user-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; padding: clamp(1rem, 2.2vw, 1.5rem); background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); box-shadow: var(--shadow); }
.task-user-heading h1 { margin: .1rem 0 .35rem; color: var(--navy-950); font-size: clamp(1.55rem, 4vw, 2.35rem); }
.task-user-heading p { margin: 0; color: var(--slate-600); max-width: 760px; }
.task-user-kicker { color: var(--navy-800) !important; font-size: .8rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.task-user-summary { flex: 0 0 auto; min-width: 96px; padding: .7rem .9rem; border-radius: 12px; background: var(--navy-950); color: #fff; text-align: center; }
.task-user-summary strong { display: block; font-size: 1.8rem; line-height: 1; }
.task-user-summary span { display: block; margin-top: .25rem; font-size: .78rem; }
.task-user-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: clamp(.7rem, 1.5vw, 1rem); }
.task-user-card { --task-color: #64748b; display: flex; min-width: 0; min-height: 285px; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid var(--slate-200); border-top: 6px solid var(--task-color); border-radius: var(--radius); box-shadow: var(--shadow); }
.task-user-card.priority-high { --task-color: #ef4444; }
.task-user-card.priority-medium { --task-color: #eab308; }
.task-user-card.priority-low { --task-color: #65a30d; }
.task-user-card.is-completed { --task-color: #94a3b8; background: #f8fafc; }
.task-user-card > header { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .8rem 1rem; border-bottom: 1px solid var(--slate-200); }
.task-status { display: inline-flex; align-items: center; min-height: 28px; padding: .25rem .55rem; border-radius: 999px; background: #e2e8f0; color: #475569; font-size: .72rem; font-weight: 900; }
.task-status-own { background: #dbeafe; color: #1d4ed8; }
.task-status-completed { background: #dcfce7; color: #166534; }
.task-user-card-body { flex: 1; padding: 1rem; }
.task-user-number { margin-bottom: .35rem; color: var(--navy-800); font-size: .78rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; overflow-wrap: anywhere; }
.task-user-card h2 { margin: 0 0 .9rem; color: var(--navy-950); font-size: clamp(1.05rem, 2.5vw, 1.3rem); line-height: 1.3; overflow-wrap: anywhere; }
.task-user-details { display: grid; gap: .55rem; margin: 0; }
.task-user-details > div { display: grid; grid-template-columns: minmax(92px, .75fr) minmax(0, 1.6fr); gap: .6rem; align-items: start; }
.task-user-details dt { color: var(--slate-600); font-size: .74rem; font-weight: 800; }
.task-user-details dd { min-width: 0; margin: 0; color: var(--slate-800); font-size: .85rem; font-weight: 700; overflow-wrap: anywhere; }
.task-user-details .task-user-notes { grid-template-columns: 1fr; gap: .2rem; margin-top: .2rem; padding: .65rem; border-radius: 8px; background: #f1f5f9; }
.task-user-card > footer { min-height: 66px; display: flex; align-items: center; padding: .75rem 1rem; border-top: 1px solid var(--slate-200); }
.task-complete-button { width: 100%; min-height: 46px; font-size: .92rem; }
.task-completed-text, .task-readonly-text { color: var(--slate-600); font-size: .8rem; font-weight: 700; }
.task-user-empty { grid-column: 1 / -1; padding: 2.5rem 1rem; background: #fff; border: 1px dashed var(--slate-300); border-radius: var(--radius); text-align: center; }
.task-user-empty strong { display: block; color: var(--navy-950); font-size: 1.15rem; }
.task-user-empty p { margin: .35rem 0 0; color: var(--slate-600); }
@media (max-width: 700px) {
  .task-user-shell { padding: .55rem; }
  .task-user-heading { flex-direction: column; }
  .task-user-summary { width: 100%; }
  .task-user-card { min-height: 0; }
  .task-user-details > div { grid-template-columns: 1fr; gap: .12rem; }
  .task-user-card > header, .task-user-card-body, .task-user-card > footer { padding-left: .8rem; padding-right: .8rem; }
}
@media (min-width: 1600px) {
  .task-user-shell { width: min(1680px, 100%); }
  .task-user-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Version 2.6 – Chef-Kommunikation, Rückfragen und regelgebundene Eskalationen */
.escalation-overview { display: flex; align-items: center; gap: .85rem; margin: 0 1rem 1rem; padding: .85rem 1rem; border: 2px solid #dc2626; border-radius: 12px; background: #fff1f2; color: #7f1d1d; box-shadow: 0 8px 24px rgba(220, 38, 38, .14); }
.escalation-overview-icon { display: grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; border-radius: 50%; background: #dc2626; color: #fff; font-size: 1.25rem; font-weight: 950; }
.escalation-overview strong, .escalation-overview small { display: block; }
.escalation-overview small { margin-top: .15rem; color: #991b1b; }
.task-table tr.has-escalation > td { background: #fff1f2 !important; box-shadow: inset 0 1px 0 #fecdd3, inset 0 -1px 0 #fecdd3; }
.task-table tr.has-escalation > td:first-child { border-left: 5px solid #dc2626; }
.task-table tr.escalation-acknowledged > td { background: #fff7ed !important; box-shadow: inset 0 1px 0 #fed7aa, inset 0 -1px 0 #fed7aa; }
.task-table tr.escalation-acknowledged > td:first-child { border-left-color: #ea580c; }
.task-escalation-inline { display: block; margin-top: .45rem; padding: .4rem .5rem; border-radius: 7px; background: #dc2626; color: #fff; font-size: .68rem; line-height: 1.25; }
.task-escalation-inline small { display: block; margin-top: .15rem; color: #fff; font-size: .66rem; font-weight: 600; }
.escalation-acknowledged .task-escalation-inline { background: #ea580c; }
.btn-escalation { border-color: #dc2626 !important; background: #dc2626 !important; color: #fff !important; }
.btn-warning { border-color: #ea580c; background: #fff7ed; color: #9a3412; }
.btn-warning:hover { background: #ffedd5; }
.task-user-card.has-escalation { border: 3px solid #dc2626; border-top-width: 8px; background: linear-gradient(180deg, #fff1f2 0, #fff 34%); box-shadow: 0 14px 35px rgba(220, 38, 38, .22); }
.task-user-card.escalation-acknowledged { border-color: #ea580c; background: linear-gradient(180deg, #fff7ed 0, #fff 34%); box-shadow: 0 14px 35px rgba(234, 88, 12, .18); }
.task-escalation-alert { display: grid; gap: .2rem; margin: -.2rem 0 .8rem; padding: .65rem .75rem; border-radius: 9px; background: #dc2626; color: #fff; }
.escalation-acknowledged .task-escalation-alert { background: #ea580c; }
.task-escalation-alert strong { font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.task-escalation-alert span { font-size: .75rem; line-height: 1.35; }
.task-user-footer-actions { display: grid; width: 100%; gap: .55rem; }
.task-user-footer-actions .btn { width: 100%; min-height: 44px; white-space: normal; }

.task-communication-modal {
  width: min(920px, calc(100vw - 1rem));
  max-width: 920px;
  max-height: calc(100dvh - 1rem);
  overflow: hidden;
  padding: 0;
}
.task-communication-modal [hidden] { display: none !important; }
html.has-task-communication-dialog { overflow: hidden; }
.task-communication-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: min(900px, calc(100dvh - 1rem));
  max-height: calc(100dvh - 1rem);
  min-height: 0;
  overflow: hidden;
  background: #fff;
}
.task-communication-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: var(--navy-950);
  color: #fff;
}
.task-communication-heading-block { min-width: 0; }
.task-communication-kicker { margin: 0; color: #bfdbfe; font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.task-communication-task-number { margin: .3rem 0 0; color: #e2e8f0; font-size: .76rem; font-weight: 800; }
.task-communication-title-wrap { margin-top: .1rem; }
.task-communication-header h2 {
  margin: 0;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.task-communication-header h2.is-collapsed {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.task-communication-header h2.is-expanded { display: block; }
.task-communication-expand {
  margin-top: .25rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #bfdbfe;
  font: inherit;
  font-size: .75rem;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.task-communication-close { flex: 0 0 auto; }
.task-communication-status { display: inline-flex; margin: .55rem 0 0; padding: .22rem .5rem; border-radius: 999px; background: #e2e8f0; color: #334155; font-size: .72rem; font-weight: 900; }
.task-communication-status[data-status="open"] { background: #dc2626; color: #fff; }
.task-communication-status[data-status="acknowledged"] { background: #ea580c; color: #fff; }
.task-communication-status[data-status="resolved"] { background: #dcfce7; color: #166534; }
.task-communication-status[data-status="cancelled"] { background: #e2e8f0; color: #475569; }
.task-communication-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem 1.2rem calc(1rem + env(safe-area-inset-bottom));
  background: #f8fafc;
  scroll-padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}
.task-current-escalation {
  margin-bottom: 1rem;
  padding: .9rem;
  border: 1px solid #fecaca;
  border-left: 5px solid #dc2626;
  border-radius: 12px;
  background: #fff1f2;
  color: #7f1d1d;
}
.task-current-escalation-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.task-current-escalation-heading > div { display: grid; gap: .15rem; }
.task-current-escalation-heading > span { flex: 0 0 auto; color: #991b1b; font-size: .7rem; }
.task-current-escalation-eyebrow { font-size: .68rem; font-weight: 950; letter-spacing: .06em; text-transform: uppercase; }
.task-current-escalation p { margin: .65rem 0 0; line-height: 1.45; overflow-wrap: anywhere; }
.task-current-escalation details { margin-top: .45rem; }
.task-current-escalation summary { color: #991b1b; font-size: .75rem; font-weight: 900; cursor: pointer; }
.task-current-escalation details p { padding-top: .2rem; white-space: pre-wrap; }
.task-communication-thread { min-height: 120px; padding: 0; background: transparent; }
.task-communication-empty { display: grid; place-items: center; align-content: center; min-height: 150px; gap: .3rem; padding: 1rem; border: 1px dashed var(--slate-300); border-radius: 12px; background: #fff; color: var(--slate-600); text-align: center; }
.task-message { margin-bottom: .7rem; padding: .75rem .85rem; border: 1px solid var(--slate-200); border-left: 5px solid #64748b; border-radius: 10px; background: #fff; box-shadow: 0 3px 10px rgba(15, 23, 42, .05); }
.task-message:last-child { margin-bottom: 0; }
.task-message-question { border-left-color: #2563eb; }
.task-message-escalation { border-color: #fecaca; border-left-color: #dc2626; background: #fff1f2; }
.task-message-escalation_acknowledged { border-color: #fed7aa; border-left-color: #ea580c; background: #fff7ed; }
.task-message-escalation_resolved { border-color: #bbf7d0; border-left-color: #16a34a; background: #f0fdf4; }
.task-message-escalation_cancelled { border-color: #cbd5e1; border-left-color: #64748b; background: #f8fafc; }
.task-message header { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; }
.task-message header strong { color: var(--navy-950); }
.task-message time { margin-left: auto; color: var(--slate-600); font-size: .7rem; }
.task-message-kind { display: inline-flex; padding: .16rem .42rem; border-radius: 999px; background: #e2e8f0; color: #334155; font-size: .66rem; font-weight: 900; }
.task-message p { margin: .55rem 0 0; color: var(--slate-800); line-height: 1.45; overflow-wrap: anywhere; }
.task-message-rule { margin-top: .55rem; padding: .45rem .55rem; border-radius: 7px; background: rgba(220, 38, 38, .09); color: #991b1b; font-size: .75rem; }
.task-communication-compose {
  display: grid;
  gap: .8rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  background: #fff;
}
.task-communication-compose label { display: grid; gap: .35rem; color: var(--slate-700); font-size: .78rem; font-weight: 800; }
.task-communication-compose textarea, .task-communication-compose select { width: 100%; }
.task-user-communication-choice { display: grid; gap: .8rem; }
.task-user-communication-choice h3, .task-communication-form-header h3 { margin: 0; color: var(--navy-950); font-size: 1rem; }
.task-user-communication-choice p, .task-communication-form-header p, .task-cancel-escalation-panel p { margin: .2rem 0 0; color: var(--slate-600); font-size: .78rem; line-height: 1.45; }
.task-user-communication-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.task-user-communication-buttons .btn { min-height: 46px; }
.task-user-communication-form { display: grid; gap: .8rem; }
.task-communication-form-header { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.task-communication-submit-row { display: flex; justify-content: flex-end; padding-top: .1rem; }
.task-communication-submit-row .btn { min-height: 46px; }
.task-cancel-escalation-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .8rem;
  padding: .85rem;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fff1f2;
}
.task-cancel-escalation-panel strong { color: #991b1b; }
.task-cancel-escalation-panel .btn { min-height: 44px; }
.task-communication-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; }
.task-communication-footer { display: flex; justify-content: flex-end; margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--slate-200); }
.admin-info-callout { padding: .8rem .9rem; border-left: 5px solid #2563eb; border-radius: 8px; background: #eff6ff; color: #1e3a8a; }
.admin-info-callout p { margin: .25rem 0 0; font-size: .82rem; line-height: 1.45; }

@media (max-width: 700px) {
  .escalation-overview { margin: .55rem; align-items: flex-start; }
  .task-communication-modal {
    width: 100vw;
    max-width: 100vw;
    height: var(--task-communication-viewport-height, 100dvh);
    max-height: var(--task-communication-viewport-height, 100dvh);
    margin: 0;
    border-radius: 0;
  }
  .task-communication-shell {
    height: var(--task-communication-viewport-height, 100dvh);
    max-height: var(--task-communication-viewport-height, 100dvh);
  }
  .task-communication-header { gap: .7rem; padding: calc(.8rem + env(safe-area-inset-top)) .75rem .8rem; }
  .task-communication-header h2 { font-size: 1rem; -webkit-line-clamp: 2; }
  .task-communication-body { padding: .75rem .75rem calc(.9rem + env(safe-area-inset-bottom)); }
  .task-current-escalation-heading { display: grid; }
  .task-current-escalation-heading > span { justify-self: start; }
  .task-communication-empty { min-height: 120px; }
  .task-message header { align-items: flex-start; }
  .task-message time { width: 100%; margin-left: 0; }
  .task-user-communication-buttons, .task-communication-actions { display: grid; grid-template-columns: 1fr; }
  .task-user-communication-buttons .btn, .task-communication-actions .btn, .task-communication-submit-row .btn { width: 100%; min-height: 48px; }
  .task-communication-submit-row { display: grid; grid-template-columns: 1fr; }
  .task-cancel-escalation-panel { grid-template-columns: 1fr; }
  .task-cancel-escalation-panel .btn { width: 100%; min-height: 48px; }
  .task-communication-form-header { display: grid; }
  .task-communication-form-header .btn { justify-self: start; }
  .task-communication-compose textarea { min-height: 132px; }
}

@media print {
  .escalation-overview, [data-task-communication], .task-communication-modal { display: none !important; }
}

/* CNC-RBAC-AND-COSMETICS-2.7 START */
.inline-edit { grid-template-columns: minmax(180px, 1.5fr) minmax(120px, 1fr) 80px auto auto 38px; }
.masterdata-delete-button { width: 34px; height: 34px; padding: 0; justify-self: end; align-self: end; font-size: 1.15rem; line-height: 1; }
.permission-editor { border-top: 1px solid var(--slate-200); padding-top: 1rem; }
.permission-editor-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.permission-editor-heading h2 { margin: 0 0 .25rem; }
.permission-editor-heading p { margin: 0; color: var(--slate-600); }
.permission-group { border: 1px solid var(--slate-200); border-radius: 12px; padding: .85rem; margin: 0 0 .85rem; }
.permission-group legend { padding: 0 .4rem; font-weight: 800; color: var(--navy-950); }
.permission-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: .55rem; }
.permission-item { display: flex; gap: .65rem; align-items: flex-start; border: 1px solid var(--slate-200); border-radius: 10px; padding: .7rem; background: #fff; cursor: pointer; }
.permission-item input { margin-top: .2rem; }
.permission-item span { display: grid; gap: .15rem; }
.permission-item small { color: var(--slate-600); }
.permission-item.is-inherited { background: var(--slate-100); cursor: default; }
.permission-item.is-inherited small { color: #166534; }
.communication-kind-choice { border: 0; padding: 0; margin: 0; }
.communication-kind-choice legend { font-weight: 800; margin-bottom: .55rem; }
.communication-kind-option { display: flex; gap: .7rem; align-items: flex-start; border: 1px solid var(--slate-200); border-radius: 10px; padding: .75rem; margin-bottom: .55rem; cursor: pointer; }
.communication-kind-option:has(input:checked) { border-color: var(--navy-700); background: #eff6ff; box-shadow: 0 0 0 2px rgba(30, 64, 175, .08); }
.communication-kind-escalation:has(input:checked) { border-color: #dc2626; background: #fff1f2; }
.communication-kind-option span { display: grid; gap: .15rem; }
.communication-kind-option small { color: var(--slate-600); }
.role-card-system { border-left: 4px solid var(--navy-700); }
.role-card-custom { border-left: 4px solid #16a34a; }
@media (max-width: 700px) {
  .inline-edit { grid-template-columns: 1fr; }
  .masterdata-delete-button { justify-self: end; }
  .permission-editor-heading { flex-direction: column; }
}
/* CNC-RBAC-AND-COSMETICS-2.7 END */

/* Version 2.8 – öffentliche Rechtsseiten und geschützte Vertragsunterlagen */
a:focus-visible, button:focus-visible {
  outline: 3px solid #38bdf8;
  outline-offset: 3px;
}
.auth-page { display: flex; min-height: 100vh; flex-direction: column; }
.auth-page .auth-shell { min-height: auto; flex: 1; }
.login-privacy-note { margin: 1.2rem 0 0; color: var(--slate-600); font-size: .78rem; line-height: 1.55; text-align: center; }
.login-privacy-note a { color: var(--navy-700); font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.public-legal-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .65rem 1.25rem; padding: 1rem max(1rem, env(safe-area-inset-right)) calc(1rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); background: rgba(3, 11, 24, .82); color: #dbeafe; border-top: 1px solid rgba(255,255,255,.16); }
.public-legal-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem 1rem; }
.public-legal-footer a { padding: .3rem .15rem; text-decoration: underline; text-decoration-color: rgba(219,234,254,.45); text-underline-offset: 3px; }
.public-legal-footer a:hover { color: #fff; text-decoration-color: #fff; }
.public-legal-footer small { color: #94a3b8; }
.legal-public-page { display: flex; min-height: 100vh; flex-direction: column; background: #edf2f7; }
.legal-public-page .legal-shell { flex: 1; }
.legal-shell { width: min(1120px, calc(100% - 2rem)); margin: 1.5rem auto 3rem; }
.legal-shell-centered { display: grid; place-items: center; min-height: calc(100vh - 90px); }
.legal-card { background: #fff; border: 1px solid var(--slate-200); border-radius: var(--radius); padding: clamp(1rem, 3vw, 2.4rem); box-shadow: var(--shadow); }
.legal-card-admin { max-width: 1050px; }
.legal-document-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--slate-200); }
.legal-document-header h1 { margin: .15rem 0 .45rem; color: var(--navy-950); font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.12; }
.legal-document-header p { margin: 0; color: var(--slate-600); line-height: 1.55; }
.legal-eyebrow { color: var(--navy-700) !important; font-size: .72rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.legal-document-version { font-size: .82rem; }
.legal-status { display: inline-flex; flex: 0 0 auto; align-items: center; border-radius: 999px; padding: .35rem .62rem; font-size: .72rem; font-weight: 900; }
.legal-status-draft { border: 1px solid #f59e0b; background: #fffbeb; color: #92400e; }
.legal-status-published { border: 1px solid #22c55e; background: #f0fdf4; color: #166534; }
.legal-warning { margin: 1.25rem 0; padding: 1rem 1.1rem; border: 1px solid #fbbf24; border-left-width: 6px; border-radius: 10px; background: #fffbeb; color: #78350f; }
.legal-warning h2 { margin: 0 0 .35rem; color: #78350f; font-size: 1rem; }
.legal-warning p { margin: 0; line-height: 1.55; }
.legal-document-actions { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1.25rem 0; }
.legal-toc { margin: 1.5rem 0; padding: 1rem 1.15rem; border-radius: 10px; background: var(--slate-100); }
.legal-toc h2 { margin: 0 0 .65rem; font-size: 1rem; color: var(--navy-950); }
.legal-toc ol { margin: 0; padding-left: 1.2rem; columns: 2 280px; column-gap: 2rem; }
.legal-toc li { break-inside: avoid; margin: 0 0 .35rem; }
.legal-toc a { color: var(--navy-700); text-decoration: underline; text-underline-offset: 2px; }
.legal-document { max-width: 78ch; margin: 0 auto; color: #1e293b; font-size: clamp(.94rem, 1.5vw, 1rem); line-height: 1.72; overflow-wrap: anywhere; }
.legal-document-body h2 { scroll-margin-top: 90px; margin: 2rem 0 .75rem; padding-top: .4rem; color: var(--navy-950); font-size: 1.45rem; line-height: 1.25; border-top: 1px solid var(--slate-200); }
.legal-document-body h3 { scroll-margin-top: 90px; margin: 1.4rem 0 .5rem; color: var(--navy-800); font-size: 1.08rem; }
.legal-document-body p { margin: .65rem 0; }
.legal-document-subtitle { margin-top: 0 !important; color: var(--slate-600); font-weight: 750; }
.legal-document-meta { padding: .55rem .7rem; border-radius: 8px; background: var(--slate-100); font-weight: 750; }
.legal-list { margin: .5rem 0 1rem; padding-left: 1.5rem; }
.legal-list li { margin: .28rem 0; padding-left: .15rem; }
.legal-page-marker { color: var(--slate-500); font-size: .76rem; font-style: italic; }
.legal-placeholder { padding: .05rem .2rem; border-radius: 4px; background: #fee2e2; color: #991b1b; font-weight: 850; }
.legal-review-note { color: #991b1b; }
.legal-open-points { margin-top: 2rem; padding: 1.15rem; border: 1px solid #fecaca; border-radius: 10px; background: #fff7f7; }
.legal-open-points h2 { margin-top: 0; color: #991b1b; }
.legal-open-points li { margin: .35rem 0; }
.legal-unavailable { max-width: 720px; text-align: center; }
.legal-unavailable h1 { color: var(--navy-950); }
.legal-unavailable p { color: var(--slate-600); line-height: 1.65; }
.legal-unavailable .legal-document-actions { justify-content: center; }
.legal-document-list { display: grid; gap: .85rem; margin: 1.3rem 0; }
.legal-document-list article { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .8rem; padding: 1rem; border: 1px solid var(--slate-200); border-radius: 10px; }
.legal-document-list h2 { margin: 0; color: var(--navy-950); font-size: 1.05rem; }
.legal-document-list p { margin: .2rem 0 0; color: var(--slate-600); font-size: .8rem; }
.legal-disabled-link { color: var(--slate-500); font-size: .78rem; font-weight: 750; }
.legal-admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 1rem; margin-top: 1.2rem; }
.legal-admin-card { display: grid; gap: 1rem; padding: 1rem; border: 1px solid var(--slate-200); border-radius: 12px; background: #fff; }
.legal-admin-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .7rem; }
.legal-admin-card h2 { margin: 0; color: var(--navy-950); }
.legal-admin-card p { margin: .2rem 0 0; color: var(--slate-600); font-size: .8rem; }
.legal-admin-card dl { display: grid; gap: .45rem; margin: 0; }
.legal-admin-card dl div { display: grid; grid-template-columns: 100px 1fr; gap: .5rem; }
.legal-admin-card dt { color: var(--slate-600); font-size: .78rem; font-weight: 750; }
.legal-admin-card dd { margin: 0; font-size: .82rem; }
@media (max-width: 700px) {
  .auth-shell { padding: 1rem; }
  .auth-card { padding: 1.25rem; }
  .public-legal-footer { align-items: stretch; flex-direction: column; text-align: center; }
  .public-legal-footer nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .public-legal-footer a { min-height: 44px; display: grid; place-items: center; }
  .legal-shell { width: min(100% - 1rem, 1120px); margin: .5rem auto 1.5rem; }
  .legal-card { border-radius: 10px; padding: 1rem; }
  .legal-document-header { flex-direction: column; }
  .legal-document-actions .btn { width: 100%; min-height: 44px; }
  .legal-toc ol { columns: 1; }
  .legal-document-list article { grid-template-columns: 1fr; align-items: start; }
  .legal-admin-card-heading { flex-direction: column; }
}
@media print {
  .no-print, .public-legal-footer, .topbar, .tenant-switchbar, .admin-sidebar, .flash-stack { display: none !important; }
  body, .legal-public-page { background: #fff !important; }
  .admin-shell { display: block; }
  .admin-content { padding: 0 !important; }
  .legal-shell, .legal-card, .legal-card-admin { width: 100%; max-width: none; margin: 0; padding: 0; border: 0; box-shadow: none; }
  .legal-warning { break-inside: avoid; }
  .legal-document { max-width: none; font-size: 10.5pt; }
  .legal-document-body h2, .legal-document-body h3 { break-after: avoid; }
  .legal-document-body p, .legal-list { orphans: 3; widows: 3; }
  a { text-decoration: none !important; }
}

/* Version 2.9 – Demo-Mandanten und mandantenbezogene Firmenrollen */
.demo-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .35rem .7rem;
  padding: .55rem 1rem;
  border-bottom: 1px solid #f59e0b;
  background: #fffbeb;
  color: #78350f;
  font-size: .82rem;
}
.demo-banner strong { text-transform: uppercase; letter-spacing: .05em; }
.demo-banner-expired, .demo-banner-purge_due { border-color: #dc2626; background: #fff1f2; color: #991b1b; }
.demo-banner-scheduled { border-color: #2563eb; background: #eff6ff; color: #1e3a8a; }
.badge-demo { border: 1px solid #f59e0b; background: #fffbeb; color: #92400e; }
.badge-warning { border: 1px solid #fb923c; background: #fff7ed; color: #9a3412; }
.form-section-heading { margin-top: .4rem; padding-top: 1rem; border-top: 1px solid var(--slate-200); }
.form-section-heading h2 { margin: 0 0 .25rem; color: var(--navy-950); font-size: 1.08rem; }
.form-section-heading p { margin: 0; color: var(--slate-600); font-size: .8rem; line-height: 1.45; }
@media (max-width: 700px) {
  .demo-banner { align-items: flex-start; justify-content: flex-start; }
}

/* Version 3.0 – sicherer Mandantendatentransfer */
.notice { margin: 0 0 1rem; padding: .9rem 1rem; border: 1px solid var(--slate-300); border-radius: 10px; background: #fff; }
.notice-warning { border-color: #facc15; background: #fefce8; color: #713f12; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }

/* Version 3.1 – Mehrmandanten-Zugriffe */
.form-card select[multiple] {
    width: 100%;
    min-height: 12rem;
    padding: .55rem;
}

/* Version 3.2 – Icon-Navigation und internes Nachrichtensystem */
.ui-icon { width: 1.45rem; height: 1.45rem; display: block; }
.topbar {
  min-height: 76px;
  padding: .7rem clamp(.8rem, 2vw, 1.5rem);
  background: linear-gradient(135deg, #041229 0%, var(--navy-950) 55%, #0b2f63 140%);
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 10px 28px rgba(3, 11, 24, .24);
}
.topbar-brand { min-width: 0; gap: .85rem; }
.topbar-logo-frame {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 142px;
  height: 48px;
  overflow: hidden;
  padding: .28rem .45rem;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.topbar-brand img { width: 100%; height: 100%; border-radius: 0; background: transparent; }
.topbar-brand-copy { min-width: 0; display: grid; line-height: 1.08; }
.topbar-brand-copy strong { max-width: 290px; overflow: hidden; color: #fff; font-size: .98rem; text-overflow: ellipsis; white-space: nowrap; }
.topbar-brand-copy small { max-width: 290px; overflow: hidden; color: #b8c8dd; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: .8rem; }
.topnav { display: flex; align-items: center; flex-wrap: nowrap; gap: .38rem; }
.topnav .nav-action {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 13px;
  background: rgba(255,255,255,.055);
  color: #dbeafe;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.topnav .nav-action:hover,
.topnav .nav-action:focus-visible {
  z-index: 3;
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.32);
  background: rgba(255,255,255,.14);
  color: #fff;
  box-shadow: 0 8px 18px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.12);
  outline: none;
}
.topnav .nav-action.is-active {
  border-color: rgba(147,197,253,.75);
  background: linear-gradient(145deg, rgba(37,99,235,.9), rgba(21,68,125,.92));
  color: #fff;
  box-shadow: 0 7px 18px rgba(29,78,216,.28), inset 0 1px 0 rgba(255,255,255,.2);
}
.topnav .nav-action::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + .62rem);
  left: 50%;
  z-index: 100;
  transform: translate(-50%, -4px);
  pointer-events: none;
  opacity: 0;
  padding: .38rem .55rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 7px;
  background: #020817;
  color: #fff;
  box-shadow: 0 8px 22px rgba(0,0,0,.3);
  font-size: .73rem;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  transition: opacity .15s ease .35s, transform .15s ease .35s;
}
.topnav .nav-action:hover::after,
.topnav .nav-action:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.nav-form { display: inline-flex; }
.nav-form input[type="hidden"] { display: none; }
.topnav .nav-logout { font: inherit; }
.topnav .nav-logout:hover,
.topnav .nav-logout:focus-visible { border-color: rgba(248,113,113,.55); background: rgba(220,38,38,.2); color: #fecaca; }
.nav-notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid var(--navy-950);
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: .68rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 3px 8px rgba(0,0,0,.28);
}
.nav-notification-badge.is-hidden { display: none; }
.topbar .tenant-badge {
  max-width: min(34vw, 310px);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.92);
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.messages-page { max-width: 1240px; }
.messages-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: clamp(1.1rem, 2.3vw, 1.65rem);
  border: 1px solid #d7e0eb;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fff 0%, #f7faff 72%, #eaf2ff 100%);
  box-shadow: var(--shadow);
}
.messages-heading.compact { align-items: center; }
.messages-heading h1 { margin: .12rem 0 .35rem; color: var(--navy-950); font-size: clamp(1.65rem, 3vw, 2.35rem); }
.messages-heading p { max-width: 760px; margin: 0; color: var(--slate-600); line-height: 1.5; }
.messages-eyebrow { color: var(--navy-700) !important; font-size: .75rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.messages-filter {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, .7fr)) minmax(230px, 1.4fr) auto;
  align-items: end;
  gap: .8rem;
  margin-bottom: 1rem;
  padding: 1rem;
}
.messages-search { min-width: 0; }
.messages-filter-actions { display: flex; gap: .45rem; }
.messages-list { display: grid; gap: .72rem; }
.message-ticket-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  overflow: hidden;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(15,23,42,.055);
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.message-ticket-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: transparent;
}
.message-ticket-card:hover,
.message-ticket-card:focus-visible { transform: translateY(-2px); border-color: #9fb6d3; box-shadow: 0 12px 28px rgba(15,23,42,.1); outline: none; }
.message-ticket-card.is-unread { border-color: #8cb4eb; background: linear-gradient(90deg, #f0f7ff, #fff 34%); }
.message-ticket-card.is-unread::before { background: #2563eb; }
.message-ticket-main { min-width: 0; }
.message-ticket-main h2 { margin: .45rem 0 .3rem; overflow: hidden; color: var(--navy-950); font-size: 1.05rem; text-overflow: ellipsis; white-space: nowrap; }
.message-ticket-main p { margin: 0; overflow: hidden; color: var(--slate-600); font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.message-ticket-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.support-category,
.support-status,
.support-unread-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: .2rem .48rem;
  border-radius: 999px;
  font-size: .69rem;
  font-weight: 900;
}
.support-category-bug { background: #fff1f2; color: #be123c; }
.support-category-improvement { background: #fefce8; color: #854d0e; }
.support-status-open { background: #dbeafe; color: #1d4ed8; }
.support-status-in_progress { background: #ffedd5; color: #9a3412; }
.support-status-resolved { background: #dcfce7; color: #166534; }
.support-unread-label { background: #2563eb; color: #fff; }
.message-ticket-time { min-width: 82px; display: grid; justify-items: end; color: var(--slate-600); font-size: .72rem; }
.message-ticket-time strong { color: var(--navy-900); font-size: .95rem; }
.message-ticket-time small { margin-top: .18rem; }
.messages-empty { text-align: center; }
.messages-empty strong { display: block; color: var(--navy-950); font-size: 1.08rem; }
.messages-empty p { margin: .35rem 0 0; color: var(--slate-600); }
.support-context-note { padding: .75rem .85rem; border: 1px solid #bfdbfe; border-radius: 9px; background: #eff6ff; color: #1e3a8a; }
.support-form textarea,
.support-reply-panel textarea { line-height: 1.55; }
.message-detail-heading { align-items: center; }
.message-detail-heading h1 { overflow-wrap: anywhere; }
.support-status-panel { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.support-status-panel > div { display: grid; gap: .18rem; }
.support-status-form { display: flex; align-items: center; gap: .55rem; }
.support-status-form select { min-width: 180px; }
.support-thread { display: grid; gap: .8rem; margin: 1rem 0; }
.support-message {
  width: min(820px, 92%);
  padding: 1rem 1.05rem;
  border: 1px solid var(--slate-200);
  border-radius: 14px 14px 14px 4px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(15,23,42,.06);
}
.support-message.from-support { border-color: #b7cff0; background: #f3f8ff; }
.support-message.is-own { justify-self: end; border-radius: 14px 14px 4px 14px; background: #edf7ff; }
.support-message header { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .6rem; padding-bottom: .55rem; border-bottom: 1px solid rgba(148,163,184,.28); }
.support-message header strong { color: var(--navy-950); }
.support-message header span { color: var(--navy-700); font-size: .73rem; font-weight: 800; }
.support-message header time { margin-left: auto; color: var(--slate-500); font-size: .72rem; }
.support-message-body { padding-top: .72rem; color: #1e293b; line-height: 1.62; overflow-wrap: anywhere; white-space: pre-wrap; }
.support-reply-panel { margin-top: 1rem; }
.support-reply-panel h2 { margin-top: 0; }

@media (max-width: 1000px) {
  .topbar { align-items: center; flex-direction: row; }
  .topbar-brand-copy { display: none; }
  .topbar-actions { flex: 1; }
  .messages-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .messages-filter-actions { align-self: end; }
}
@media (max-width: 760px) {
  .topbar { gap: .5rem; padding: .48rem .55rem; }
  .topbar-logo-frame { display: grid !important; width: 96px; height: 42px; padding: .2rem .3rem; }
  .topbar-brand-copy { display: none !important; }
  .topbar-actions { min-width: 0; gap: .3rem; overflow: hidden; }
  .topbar .tenant-badge { display: none; }
  .topnav { width: 100%; justify-content: flex-end; gap: .26rem; overflow-x: auto; padding: .15rem 0; scrollbar-width: none; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav .nav-action { width: 40px; height: 40px; border-radius: 11px; }
  .topnav .nav-action::after { display: none; }
  .ui-icon { width: 1.28rem; height: 1.28rem; }
  .messages-heading,
  .message-detail-heading,
  .support-status-panel { align-items: stretch; flex-direction: column; }
  .messages-heading .btn { width: 100%; }
  .messages-filter { grid-template-columns: 1fr; }
  .messages-filter-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .message-ticket-card { grid-template-columns: minmax(0, 1fr); gap: .55rem; }
  .message-ticket-time { grid-template-columns: auto auto auto; justify-content: start; justify-items: start; gap: .35rem; }
  .message-ticket-main h2,
  .message-ticket-main p { white-space: normal; }
  .support-status-form { align-items: stretch; flex-direction: column; }
  .support-status-form select { min-width: 0; }
  .support-message { width: 100%; }
  .support-message header time { width: 100%; margin-left: 0; }
}

/* Version 3.2 Revision 3 – symbolische Dashboard-Aktionsleiste */
.dashboard-page .dashboard-toolbar { top: 76px; align-items: center; }
.dashboard-toolbar-group { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.dashboard-toolbar .toolbar-action {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #b9c5d3;
  border-radius: 13px;
  background: rgba(255,255,255,.96);
  color: var(--navy-900);
  box-shadow: 0 2px 7px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.75);
  transition: transform .16s ease, background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.dashboard-toolbar .toolbar-action[hidden] { display: none !important; }
.dashboard-toolbar .toolbar-action:hover,
.dashboard-toolbar .toolbar-action:focus-visible {
  z-index: 4;
  transform: translateY(-2px);
  border-color: var(--navy-700);
  background: #fff;
  color: var(--navy-700);
  box-shadow: 0 8px 18px rgba(15,23,42,.14), inset 0 1px 0 #fff;
  outline: none;
}
.dashboard-toolbar .toolbar-action-primary {
  border-color: var(--navy-800);
  background: linear-gradient(145deg, var(--navy-700), var(--navy-900));
  color: #fff;
  box-shadow: 0 6px 16px rgba(11,47,99,.24), inset 0 1px 0 rgba(255,255,255,.18);
}
.dashboard-toolbar .toolbar-action-primary:hover,
.dashboard-toolbar .toolbar-action-primary:focus-visible {
  border-color: var(--navy-700);
  background: linear-gradient(145deg, #1d5b9f, var(--navy-800));
  color: #fff;
}
.dashboard-toolbar .toolbar-action.is-active {
  border-color: #38bdf8;
  background: #e0f2fe;
  color: #075985;
  box-shadow: 0 0 0 3px rgba(56,189,248,.18), 0 6px 16px rgba(15,23,42,.1);
}
.dashboard-toolbar .toolbar-action-save { color: #166534; }
.dashboard-toolbar .toolbar-action-save:hover,
.dashboard-toolbar .toolbar-action-save:focus-visible { border-color: #16a34a; background: #f0fdf4; color: #166534; }
.dashboard-toolbar .toolbar-action-reset { color: #9a3412; }
.dashboard-toolbar .toolbar-action-reset:hover,
.dashboard-toolbar .toolbar-action-reset:focus-visible { border-color: #ea580c; background: #fff7ed; color: #9a3412; }
.dashboard-toolbar .toolbar-action:disabled { cursor: wait; opacity: .62; transform: none; }
.dashboard-toolbar .toolbar-action.is-loading .ui-icon { animation: toolbar-icon-pulse .8s ease-in-out infinite alternate; }
@keyframes toolbar-icon-pulse { to { opacity: .35; transform: scale(.86); } }
.dashboard-toolbar .toolbar-action::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + .58rem);
  left: 50%;
  z-index: 120;
  transform: translate(-50%, -4px);
  pointer-events: none;
  opacity: 0;
  padding: .4rem .58rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 7px;
  background: #020817;
  color: #fff;
  box-shadow: 0 8px 22px rgba(0,0,0,.26);
  font-size: .73rem;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  transition: opacity .15s ease .35s, transform .15s ease .35s;
}
.dashboard-toolbar .toolbar-action:hover::after,
.dashboard-toolbar .toolbar-action:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.dashboard-toolbar .toolbar-action > span { display: inline-grid; place-items: center; }
.dashboard-toolbar .toolbar-action > span[hidden] { display: none !important; }

@media (max-width: 700px) {
  .dashboard-page .dashboard-toolbar { top: auto; }
  .dashboard-toolbar .toolbar-action { width: 42px; height: 42px; border-radius: 12px; }
  .dashboard-toolbar .toolbar-action::after { display: none; }
}

/* Version 3.2 Revision 7 – gezielte und direkt sichtbare Maschinenstatus-Pflege */
.machine-status-panel { min-width: 0; }
.machine-status-edit-button { position: relative; flex: 0 0 auto; display: inline-grid; width: 34px; height: 34px; place-items: center; border: 1px solid #9fb0c4; border-radius: 9px; background: #fff; color: var(--navy-900); box-shadow: 0 1px 2px rgba(15,23,42,.06); }
.machine-status-edit-button:hover { border-color: var(--navy-700); background: #eff6ff; }
.machine-status-edit-button .ui-icon { width: 18px; height: 18px; }
.machine-status-table td { vertical-align: middle; }
.machine-status-pill { display: inline-flex; align-items: center; min-height: 26px; padding: .2rem .55rem; border-radius: 999px; white-space: nowrap; font-weight: 800; }
.machine-status-running { background: #ecfccb; color: #3f6212; }
.machine-status-waiting { background: #fef3c7; color: #92400e; }
.machine-status-stopped { background: #fee2e2; color: #991b1b; }
.machine-status-pill .status-dot { margin-right: .35rem; }
.machine-blocker { display: inline-flex; align-items: center; min-height: 24px; padding: .18rem .48rem; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.machine-blocker-clear { background: #dcfce7; color: #166534; }
.machine-blocker-active { background: #fee2e2; color: #991b1b; }
.machine-status-empty { display: grid; justify-items: center; gap: .25rem; padding: 1.5rem; text-align: center; }
.machine-status-empty small { max-width: 520px; }
.machine-status-modal { width: min(1080px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); }
.machine-status-modal > form { display: flex; max-height: calc(100vh - 2rem); flex-direction: column; }
.machine-status-modal form > header > div { min-width: 0; }
.machine-status-modal form > header small { display: block; margin-top: .2rem; color: #cbd5e1; }
.machine-status-editor-intro { display: grid; gap: .18rem; padding: .8rem 1.2rem; border-bottom: 1px solid var(--slate-200); background: #eff6ff; color: var(--navy-950); }
.machine-status-editor-intro span { color: var(--slate-600); font-size: .82rem; }
.machine-status-selection-bar { display: grid; grid-template-columns: minmax(240px, 1fr) auto auto auto; gap: .65rem; align-items: end; padding: .85rem 1.2rem; border-bottom: 1px solid var(--slate-200); background: #fff; }
.machine-status-picker { min-width: 0; }
.machine-status-selection-count { align-self: center; white-space: nowrap; color: var(--slate-600); font-size: .8rem; }
.machine-status-selection-count strong { color: var(--navy-900); font-size: 1rem; }
.machine-status-editor { min-height: 170px; display: grid; align-content: start; gap: .85rem; padding: 1rem 1.2rem; overflow: auto; background: #f8fafc; }
.machine-status-editor-row { overflow: visible; border: 1px solid var(--slate-300); border-radius: 12px; background: #fff; box-shadow: 0 3px 10px rgba(15,23,42,.06); }
.machine-status-editor-row > header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem .85rem; border-bottom: 1px solid var(--slate-200); background: linear-gradient(180deg, #fff, #f8fafc); border-radius: 12px 12px 0 0; }
.machine-status-row-title { min-width: 0; display: flex; align-items: center; gap: .65rem; }
.machine-status-row-title > div { min-width: 0; display: grid; }
.machine-status-row-title strong { color: var(--navy-950); overflow-wrap: anywhere; }
.machine-status-row-title small { font-size: .7rem; }
.machine-status-editor-number { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--navy-900); color: #fff; font-size: .75rem; font-weight: 900; }
.machine-status-remove-button { flex: 0 0 auto; border: 1px solid #fecaca; border-radius: 8px; padding: .42rem .62rem; background: #fff1f2; color: #b91c1c; font-size: .76rem; font-weight: 800; }
.machine-status-remove-button:hover { background: #fee2e2; border-color: #fca5a5; }
.machine-status-editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; padding: .9rem; }
.machine-status-editor-fields > label, .machine-status-editor-fields > div { min-width: 0; }
.machine-status-editor-fields input[type="text"], .machine-status-editor-fields textarea { min-height: 42px; padding: .58rem .68rem; }
.machine-status-editor-fields textarea { min-height: 72px; resize: vertical; }
.machine-status-status-field { grid-column: 1 / -1; min-width: 0; margin: 0; padding: 0; border: 0; }
.machine-status-status-field legend { margin-bottom: .42rem; color: var(--slate-700); font-size: .78rem; font-weight: 800; }
.machine-status-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
.machine-status-option { position: relative; display: block; min-width: 0; cursor: pointer; }
.machine-status-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.machine-status-option > span { display: flex; min-height: 44px; align-items: center; justify-content: center; gap: .45rem; padding: .55rem .7rem; border: 2px solid var(--slate-300); border-radius: 10px; background: #fff; color: var(--slate-700); font-size: .82rem; font-weight: 850; text-align: center; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.machine-status-option:hover > span { border-color: #94a3b8; background: #f8fafc; }
.machine-status-option input:focus-visible + span { outline: 3px solid rgba(21,68,125,.2); outline-offset: 2px; }
.machine-status-option-running input:checked + span { border-color: #65a30d; background: #ecfccb; color: #3f6212; box-shadow: inset 0 0 0 1px #65a30d; }
.machine-status-option-waiting input:checked + span { border-color: #d97706; background: #fef3c7; color: #92400e; box-shadow: inset 0 0 0 1px #d97706; }
.machine-status-option-stopped input:checked + span { border-color: #dc2626; background: #fee2e2; color: #991b1b; box-shadow: inset 0 0 0 1px #dc2626; }
.machine-status-blocker-group { display: grid; align-content: start; gap: .5rem; }
.machine-status-blocker-toggle { display: flex; grid-template-columns: none; align-items: center; gap: .5rem; min-height: 42px; padding: .55rem .7rem; border: 1px solid var(--slate-300); border-radius: 9px; background: #fff7ed; color: #9a3412; cursor: pointer; }
.machine-status-blocker-toggle input { width: 18px; height: 18px; flex: 0 0 auto; }
.machine-status-blocker-detail.is-disabled { opacity: .52; }
.machine-status-editor-empty { display: grid; justify-items: center; gap: .25rem; padding: 2rem 1rem; border: 2px dashed var(--slate-300); border-radius: 12px; background: #fff; text-align: center; }
.machine-status-editor-empty[hidden] { display: none; }
.tile-header-actions { display: flex; flex: 0 0 auto; align-items: center; gap: .35rem; }
.tile-header .machine-status-edit-button { width: 28px; height: 28px; border-color: rgba(255,255,255,.55); background: rgba(255,255,255,.08); color: #fff; box-shadow: none; }
.tile-header .machine-status-edit-button:hover { border-color: #fff; background: rgba(255,255,255,.18); }
.machine-status-hint { padding: .35rem .65rem; border-bottom: 1px solid var(--slate-200); background: #eff6ff; color: var(--slate-600); font-size: .68rem; }
.machine-status-hint strong { color: var(--navy-900); }
@media (max-width: 820px) {
  .machine-status-selection-bar { grid-template-columns: 1fr 1fr; }
  .machine-status-picker { grid-column: 1 / -1; }
  .machine-status-selection-count { justify-self: end; }
}
@media (max-width: 650px) {
  .machine-status-modal { width: calc(100vw - 1rem); max-height: calc(100vh - 1rem); }
  .machine-status-modal > form { max-height: calc(100vh - 1rem); }
  .machine-status-editor { padding: .65rem; }
  .machine-status-selection-bar { grid-template-columns: 1fr; padding: .7rem; }
  .machine-status-picker { grid-column: auto; }
  .machine-status-selection-count { justify-self: start; }
  .machine-status-editor-fields { grid-template-columns: 1fr; padding: .7rem; }
  .machine-status-status-field { grid-column: auto; }
  .machine-status-options { grid-template-columns: 1fr; }
  .machine-status-editor-row > header { align-items: flex-start; }
}

/* Version 3.2 Revision 8 – Verantwortliche aus Stammdaten und Benutzerkonten */
.machine-status-editor-fields select[data-machine-status-responsible] { min-height: 42px; padding: .58rem .68rem; background: #fff; }
.machine-status-editor-fields label > small { margin-top: -.12rem; font-size: .68rem; font-weight: 600; }

/* Version 3.2 Revision 10 – automatische Maschinenbelegung */
.machine-occupancy-panel { padding: .55rem; }
.machine-occupancy-summary { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .5rem; }
.machine-occupancy-summary > span { display: inline-flex; align-items: center; gap: .25rem; padding: .28rem .55rem; border-radius: 999px; background: #e2e8f0; font-size: .72rem; font-weight: 800; }
.machine-occupancy-summary small { margin-left: auto; font-size: .68rem; }
.machine-occupancy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .45rem; }
.machine-occupancy-card { min-width: 0; padding: .52rem .58rem; border: 1px solid var(--slate-200); border-left-width: 5px; border-radius: 9px; background: #fff; }
.machine-occupancy-card > header { display: flex; align-items: center; justify-content: space-between; gap: .45rem; }
.machine-occupancy-card > header strong { min-width: 0; overflow-wrap: anywhere; font-size: .82rem; }
.machine-occupancy-free { border-left-color: #16a34a; background: #f0fdf4; }
.machine-occupancy-occupied { border-left-color: #dc2626; background: #fff7f7; }
.machine-occupancy-pill { flex: 0 0 auto; padding: .2rem .45rem; border-radius: 999px; background: #dcfce7; color: #166534; font-size: .66rem; font-weight: 900; text-transform: uppercase; }
.machine-occupancy-occupied .machine-occupancy-pill, .machine-occupancy-pill-occupied { background: #fee2e2; color: #991b1b; }
.machine-current-tasks, .machine-free-hint { display: grid; gap: .12rem; margin-top: .35rem; font-size: .68rem; }
.machine-current-tasks > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.machine-free-hint { color: #166534; font-weight: 750; }
.machine-occupancy-details { display: grid; gap: .16rem; margin: .38rem 0 0; padding-top: .35rem; border-top: 1px solid rgba(100,116,139,.18); font-size: .65rem; }
.machine-occupancy-details > div { display: grid; grid-template-columns: 78px minmax(0,1fr); gap: .3rem; }
.machine-occupancy-details dt { color: var(--slate-600); font-weight: 800; }
.machine-occupancy-details dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.machine-occupancy-blocker { color: #991b1b; }
.machine-auto-visible { display: block; margin-top: .35rem; color: #92400e; font-size: .61rem; }
.machine-editor-task-list { display: flex; gap: .35rem; flex-wrap: wrap; padding: .5rem .75rem; background: #f8fafc; border-bottom: 1px solid var(--slate-200); }
.machine-editor-task-list span { padding: .25rem .45rem; border-radius: 999px; background: #e2e8f0; font-size: .7rem; font-weight: 700; }
.master-card-help { margin: 0 0 .8rem; padding: .65rem .75rem; border-radius: 8px; background: #eff6ff; color: #1e3a8a; font-size: .8rem; }
.machine-masterdata-row { grid-template-columns: minmax(180px,1.4fr) minmax(150px,1fr) 80px minmax(220px,1.3fr) auto; }
.machine-masterdata-toggles { display: grid; gap: .25rem; align-content: center; }
@media (max-width: 900px) {
  .machine-masterdata-row { grid-template-columns: 1fr; }
  .machine-occupancy-summary small { width: 100%; margin-left: 0; }
}
.machine-status-editor-details > summary { display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding: .68rem .8rem; cursor: pointer; list-style: none; }
.machine-status-editor-details > summary::-webkit-details-marker { display: none; }
.machine-status-editor-details > summary::after { content: "⌄"; color: var(--slate-600); font-weight: 900; transition: transform .15s ease; }
.machine-status-editor-details[open] > summary::after { transform: rotate(180deg); }
.machine-status-editor-details[open] > summary { border-bottom: 1px solid var(--slate-200); background: #f8fafc; }

/* Version 3.2 Revision 12 – Verantwortliche automatisch aus Tagesaufgaben */
.machine-responsible-source { display: block; margin-top: .08rem; color: #991b1b; font-size: .58rem; font-weight: 800; }
.machine-status-auto-responsible { display: grid; align-content: start; gap: .22rem; min-width: 0; padding: .65rem .72rem; border: 1px solid #bfdbfe; border-radius: 9px; background: #eff6ff; }
.machine-status-auto-responsible > span { color: var(--slate-700); font-size: .78rem; font-weight: 800; }
.machine-status-auto-responsible > strong { color: var(--navy-950); font-size: .95rem; overflow-wrap: anywhere; }
.machine-status-auto-responsible > small { color: #1e40af; font-size: .68rem; line-height: 1.3; }

/* Version 3.2 Revision 13 – Stammdaten-Gesamtspeicherung und Benutzer-Shortcut */
.masterdata-heading { align-items: center; }
.masterdata-heading .btn { flex: 0 0 auto; }
.master-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.master-card-heading h2 { margin-bottom: .2rem; }
.master-card-heading p { margin: 0 0 .8rem; color: var(--slate-600); font-size: .82rem; }
.masterdata-list { display: grid; gap: 0; }
.masterdata-row, .masterdata-add-row { display: grid; align-items: end; gap: .5rem; padding: .7rem 0; border-bottom: 1px solid var(--slate-200); }
.masterdata-add-row { margin-top: .45rem; padding: .8rem; border: 1px dashed var(--slate-300); border-radius: 10px; background: #f8fafc; }
.employee-masterdata-row { grid-template-columns: minmax(135px,1fr) minmax(135px,1fr) minmax(150px,1fr) 80px minmax(110px,.7fr) minmax(220px,auto); }
.area-masterdata-row { grid-template-columns: minmax(180px,1fr) 80px minmax(110px,.65fr) auto; }
.priority-masterdata-row { grid-template-columns: minmax(160px,1.2fr) minmax(120px,.8fr) 80px 90px minmax(110px,.65fr) auto; }
.masterdata-row-actions { display: flex; align-items: end; justify-content: flex-end; gap: .4rem; flex-wrap: wrap; min-width: 0; }
.autosave-toggle { position: relative; min-height: 42px; align-content: center; }
.autosave-toggle small { position: absolute; left: 24px; top: calc(100% - 4px); color: var(--success); font-size: .62rem; white-space: nowrap; }
.masterdata-delete-form { align-self: end; }
.initial-password-field { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .5rem; align-items: center; }
.initial-password-field input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 800; letter-spacing: .02em; }
.user-prefill-callout { margin-bottom: 1rem; }
@media (max-width: 1100px) {
  .employee-masterdata-row, .machine-masterdata-row, .priority-masterdata-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .masterdata-row-actions, .machine-masterdata-toggles { grid-column: 1 / -1; justify-content: flex-start; }
  .area-masterdata-row { grid-template-columns: minmax(0,1fr) 90px; }
}
@media (max-width: 700px) {
  .masterdata-heading { align-items: stretch; }
  .masterdata-heading .btn { width: 100%; }
  .employee-masterdata-row, .area-masterdata-row, .machine-masterdata-row, .priority-masterdata-row { grid-template-columns: 1fr; }
  .masterdata-row-actions, .machine-masterdata-toggles { grid-column: auto; }
  .initial-password-field { grid-template-columns: 1fr; }
}

/* Version 3.2 Revision 16 – blockierte Maschinen sind nicht verfügbar */
.machine-occupancy-blocked {
  border-left-color: #7f1d1d;
  border-color: #fecaca;
  border-left-width: 5px;
  background: linear-gradient(180deg, #fff1f2, #ffffff);
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, .05);
}
.machine-occupancy-blocked .machine-occupancy-pill,
.machine-occupancy-pill-blocked {
  background: #991b1b;
  color: #fff;
}
.machine-blocked-hint {
  display: grid;
  margin-top: .35rem;
  padding: .32rem .45rem;
  border-radius: 7px;
  background: #fee2e2;
  color: #991b1b;
  font-size: .68rem;
  font-weight: 850;
}
.machine-summary-free { background: #dcfce7 !important; color: #166534; }
.machine-summary-occupied { background: #fef3c7 !important; color: #92400e; }
.machine-summary-blocked { background: #fee2e2 !important; color: #991b1b; }
.machine-status-editor-blocked { border-color: #fca5a5; }
.machine-status-editor-blocked > summary { background: #fff1f2; }
#task-machine option[data-machine-blocked] { color: #991b1b; }

/* Version 3.2 Revision 17 – LEITIO Produktbranding und getrennte Mandantenidentität */
:root {
  --leitio-navy-950: #031d3d;
  --leitio-navy-900: #062e61;
  --leitio-navy-800: #083b78;
  --leitio-navy-700: #0b4b8f;
  --leitio-cyan-700: #078d9e;
  --leitio-cyan-600: #08a5b5;
  --leitio-cyan-500: #13b8c5;
  --leitio-cyan-100: #dff8fa;
  --leitio-surface: #f4f8fb;
  --navy-950: var(--leitio-navy-950);
  --navy-900: var(--leitio-navy-900);
  --navy-800: var(--leitio-navy-800);
  --navy-700: var(--leitio-navy-700);
  --shadow: 0 14px 38px rgba(3, 29, 61, .09);
  --radius: 16px;
  background: var(--leitio-surface);
}

body { background: var(--leitio-surface); }
::selection { background: rgba(8, 165, 181, .24); color: var(--leitio-navy-950); }
input, select, textarea { border-color: #c8d6e4; border-radius: 10px; }
input:focus, select:focus, textarea:focus {
  outline: 3px solid rgba(8, 165, 181, .18);
  border-color: var(--leitio-cyan-600);
  box-shadow: 0 0 0 1px rgba(8, 165, 181, .08);
}

.btn { border-radius: 10px; transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  border-color: var(--leitio-navy-800);
  background: linear-gradient(135deg, var(--leitio-navy-800), var(--leitio-navy-900));
  box-shadow: 0 7px 18px rgba(6, 46, 97, .18);
}
.btn-primary:hover, .btn-primary:focus-visible {
  border-color: var(--leitio-cyan-700);
  background: linear-gradient(135deg, var(--leitio-cyan-700), var(--leitio-cyan-600));
  box-shadow: 0 9px 22px rgba(8, 165, 181, .24);
}

.topbar {
  min-height: 78px;
  align-items: center;
  flex-direction: row;
  padding: .65rem clamp(.75rem, 1.8vw, 1.45rem);
  background: linear-gradient(112deg, var(--leitio-navy-950) 0%, var(--leitio-navy-900) 62%, #073d70 100%);
  border-bottom: 3px solid var(--leitio-cyan-600);
  box-shadow: 0 12px 32px rgba(3, 29, 61, .24);
}
.topbar-identities { min-width: 0; display: flex; align-items: center; gap: .8rem; }
.product-brand, .tenant-brand { min-width: 0; display: flex; align-items: center; color: #fff; }
.product-brand { gap: .58rem; flex: 0 0 auto; }
.product-brand-mark { width: 50px; height: 48px; object-fit: contain; filter: drop-shadow(0 5px 10px rgba(0,0,0,.18)); }
.product-brand-copy, .tenant-brand-copy { min-width: 0; display: grid; line-height: 1.08; }
.product-brand-copy strong { color: #fff; font-size: 1.15rem; letter-spacing: .13em; }
.product-brand-copy small { margin-top: .22rem; color: #8fe6ec; font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.brand-separator { width: 1px; height: 42px; flex: 0 0 auto; background: linear-gradient(transparent, rgba(255,255,255,.35), transparent); }
.tenant-brand { gap: .65rem; }
.tenant-logo-frame {
  width: 112px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  padding: .3rem .42rem;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.16);
}
.tenant-logo-frame img { width: 100%; height: 100%; display: block; object-fit: contain; object-position: center; }
.tenant-brand-copy strong { max-width: 250px; overflow: hidden; color: #fff; font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.tenant-brand-copy small { margin-top: .2rem; color: #b9cce0; font-size: .72rem; }
.topbar-actions { margin-left: auto; }
.topnav .nav-action { border-radius: 12px; }
.topnav .nav-action.is-active {
  border-color: rgba(143, 230, 236, .78);
  background: linear-gradient(145deg, var(--leitio-cyan-700), var(--leitio-cyan-600));
  box-shadow: 0 8px 20px rgba(8, 165, 181, .28), inset 0 1px 0 rgba(255,255,255,.24);
}
.topbar .tenant-badge { border-color: rgba(143,230,236,.42); background: rgba(255,255,255,.96); color: var(--leitio-navy-900); }
.tenant-switchbar { background: #eef7fa; border-bottom-color: #c9e8eb; }
.tenant-switch.active { border-color: var(--leitio-cyan-700); background: var(--leitio-cyan-700); }

.auth-page {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 14% 16%, rgba(19,184,197,.27), transparent 27%),
    radial-gradient(circle at 88% 78%, rgba(8,75,143,.4), transparent 31%),
    linear-gradient(135deg, #02152e 0%, var(--leitio-navy-950) 38%, var(--leitio-navy-900) 100%);
}
.auth-page::before, .auth-page::after {
  content: "";
  position: fixed;
  pointer-events: none;
  border: 1px solid rgba(143,230,236,.14);
  border-radius: 28px;
  transform: rotate(35deg);
}
.auth-page::before { width: 300px; height: 300px; left: -150px; top: 9%; box-shadow: 110px 110px 0 rgba(8,165,181,.04), 220px 220px 0 rgba(8,165,181,.025); }
.auth-page::after { width: 420px; height: 420px; right: -260px; bottom: -160px; }
.auth-shell { position: relative; z-index: 1; min-height: calc(100vh - 64px); flex: 1; padding: clamp(1.2rem, 4vw, 3rem); }
.auth-card {
  position: relative;
  width: min(480px, 100%);
  overflow: hidden;
  padding: clamp(1.45rem, 4vw, 2.25rem);
  border: 1px solid rgba(255,255,255,.72);
  border-top: 5px solid var(--leitio-cyan-600);
  border-radius: 22px;
  background: rgba(255,255,255,.985);
  box-shadow: 0 34px 95px rgba(0,0,0,.38);
}
.auth-card::after { content: ""; position: absolute; inset: 0 0 auto; height: 100px; pointer-events: none; background: linear-gradient(180deg, rgba(223,248,250,.5), transparent); }
.auth-card > * { position: relative; z-index: 1; }
.auth-card-wide { width: min(820px, 100%); }
.auth-brand { margin-bottom: 1.6rem; }
.auth-product-logo { width: min(360px, 96%); height: auto !important; max-height: 112px; object-fit: contain; }
.auth-product-logo-compact { width: min(300px, 90%); max-height: 96px; }
.auth-product-kicker { display: inline-flex; margin-top: .85rem; color: var(--leitio-cyan-700); font-size: .7rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.auth-brand h1 { margin: .65rem 0 .35rem; color: var(--leitio-navy-950); font-size: clamp(1.65rem, 4vw, 2.15rem); letter-spacing: -.025em; }
.auth-brand p { max-width: 46ch; margin: 0 auto; line-height: 1.55; }
.auth-card form { gap: .9rem; }
.auth-card label { color: #27425f; }
.auth-card .btn-wide { min-height: 48px; margin-top: .2rem; }
.login-privacy-note { margin: 1.25rem 0 0; padding-top: 1rem; border-top: 1px solid #dce7ef; color: var(--slate-600); font-size: .75rem; line-height: 1.5; text-align: center; }
.login-privacy-note a { color: var(--leitio-cyan-700); font-weight: 800; text-decoration: underline; text-underline-offset: 2px; }
.auth-page .public-legal-footer { position: relative; z-index: 1; background: rgba(1, 15, 33, .78); border-top-color: rgba(143,230,236,.18); }

.panel, .stat-card, .master-card, .data-table, .messages-heading, .message-ticket-card, .legal-card {
  border-color: #d5e1eb;
  box-shadow: var(--shadow);
}
.panel, .stat-card, .master-card, .legal-card { border-radius: var(--radius); }

.dashboard-shell { background: #f4f8fb; }
.dashboard-header {
  position: relative;
  min-height: 104px;
  overflow: hidden;
  padding: 1rem clamp(1rem, 2vw, 1.65rem);
  border-bottom: 1px solid #cbdbe7;
  background: linear-gradient(120deg, #fff 0%, #f8fcfd 67%, #e8f7f8 100%);
}
.dashboard-header::after { content: ""; position: absolute; right: -30px; bottom: -70px; width: 230px; height: 180px; border: 20px solid rgba(8,165,181,.055); border-radius: 50%; }
.dashboard-header > * { position: relative; z-index: 1; }
.dashboard-header h1 { color: var(--leitio-navy-950); }
.dashboard-header p { color: #567087; }
.dashboard-branding { display: flex; align-items: center; gap: 1rem; }
.dashboard-brand { padding-right: 1rem; border-right: 1px solid #cbdbe7; }
.dashboard-brand img { width: clamp(130px, 13vw, 215px); height: 60px; }
.dashboard-product-signature { display: grid; grid-template-columns: 32px auto; align-items: center; column-gap: .4rem; min-width: 118px; }
.dashboard-product-signature small { grid-column: 1 / -1; margin-bottom: .12rem; color: var(--slate-500); font-size: .58rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.dashboard-product-signature img { width: 32px; height: 32px; object-fit: contain; }
.dashboard-product-signature strong { color: var(--leitio-navy-900); font-size: .82rem; letter-spacing: .11em; }
.dashboard-toolbar { top: 78px; background: rgba(240,247,250,.94); border-bottom-color: #ccdde8; }
.toolbar-action-primary, .toolbar-action.is-active { border-color: var(--leitio-cyan-700) !important; background: var(--leitio-cyan-700) !important; }
.dashboard-tile { border-color: #c7d7e3; border-radius: 12px; box-shadow: 0 5px 17px rgba(3,29,61,.07); }
.tile-header {
  border-bottom: 3px solid var(--leitio-cyan-600);
  background: linear-gradient(110deg, var(--leitio-navy-900), var(--leitio-navy-950));
}
.tile-subheader { background: #f6fafc; }
.dashboard-footer { display: flex; align-items: center; justify-content: center; gap: .8rem 1.4rem; flex-wrap: wrap; padding: .55rem 1rem; background: linear-gradient(110deg, var(--leitio-navy-950), var(--leitio-navy-900)); border-top: 3px solid var(--leitio-cyan-600); }
.dashboard-footer-product { color: #87dde4; font-size: .67rem; letter-spacing: .08em; text-transform: uppercase; }

.admin-sidebar { border-right-color: #d0dde7; background: linear-gradient(180deg, #fff, #f7fbfc); }
.admin-sidebar-brand { display: flex; align-items: center; gap: .55rem; margin: .15rem .35rem 1rem; padding: .7rem; border-bottom: 1px solid #d4e3eb; }
.admin-sidebar-brand img { width: 38px; height: 38px; object-fit: contain; }
.admin-sidebar-brand span { display: grid; line-height: 1.05; }
.admin-sidebar-brand strong { color: var(--leitio-navy-900); letter-spacing: .12em; }
.admin-sidebar-brand small { margin-top: .25rem; color: var(--leitio-cyan-700); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.admin-sidebar a { border-radius: 9px; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: var(--leitio-cyan-100); color: var(--leitio-navy-900); box-shadow: inset 3px 0 0 var(--leitio-cyan-600); }
.sidebar-tenant { margin: -.25rem .6rem .9rem; padding: .55rem .65rem; border-radius: 9px; background: #eef5f8; }
.settings-separation-note { margin: -.25rem 0 1rem; padding: .7rem .8rem; border-left: 4px solid var(--leitio-cyan-600); border-radius: 8px; background: var(--leitio-cyan-100); color: #285469; font-size: .8rem; line-height: 1.45; }
.data-table th, .modal form > header { background: linear-gradient(110deg, var(--leitio-navy-900), var(--leitio-navy-950)); }

.public-legal-footer { background: var(--leitio-navy-950); border-top: 2px solid var(--leitio-cyan-600); }
.public-legal-footer a:hover { color: #8fe6ec; }
.public-legal-footer small { color: #9fb7ca; }
.legal-eyebrow, .messages-eyebrow, .task-user-kicker { color: var(--leitio-cyan-700) !important; }

.error-page::before { content: "LEITIO"; color: var(--leitio-cyan-700); font-size: .72rem; font-weight: 900; letter-spacing: .16em; }
.error-page h1 { color: var(--leitio-navy-900); }

@media (max-width: 1160px) {
  .topbar { flex-wrap: wrap; }
  .topbar-identities { flex: 1 1 520px; }
  .topbar-actions { flex: 1 1 auto; }
  .dashboard-toolbar { top: 78px; }
}
@media (max-width: 820px) {
  .topbar { align-items: center; flex-direction: row; }
  .product-brand-copy small, .tenant-brand-copy small { display: none; }
  .tenant-brand-copy strong { max-width: 150px; }
  .tenant-logo-frame { width: 76px; }
  .topbar .tenant-badge { display: none; }
  .dashboard-header { align-items: flex-start; }
  .dashboard-branding { width: 100%; justify-content: space-between; }
  .dashboard-brand { text-align: left; }
}
@media (max-width: 620px) {
  .topbar { gap: .55rem; padding: .55rem; }
  .topbar-identities { gap: .45rem; }
  .product-brand-mark { width: 40px; height: 40px; }
  .product-brand-copy { display: none; }
  .brand-separator { height: 34px; }
  .tenant-logo-frame { width: 64px; height: 40px; }
  .tenant-brand-copy { display: none; }
  .topbar-actions { width: 100%; justify-content: center; }
  .topnav { width: 100%; justify-content: center; gap: .25rem; }
  .topnav .nav-action { width: 40px; height: 40px; }
  .dashboard-toolbar { position: static; }
  .dashboard-branding { align-items: flex-end; gap: .5rem; }
  .dashboard-brand { padding-right: .55rem; }
  .dashboard-brand img { width: 125px; height: 50px; }
  .dashboard-brand span { display: none; }
  .dashboard-product-signature { grid-template-columns: 26px auto; min-width: 92px; }
  .dashboard-product-signature img { width: 26px; height: 26px; }
  .dashboard-product-signature strong { font-size: .7rem; }
  .dashboard-footer { align-items: flex-start; flex-direction: column; }
}
.product-brand-mark {
  padding: .25rem;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
}


/* Version 3.2 Revision 18 – LEITIO Interior Theme Refinement */
:root {
  --leitio-semantic-high: #c66b6b;
  --leitio-semantic-high-soft: #fbefef;
  --leitio-semantic-medium: #c59d3b;
  --leitio-semantic-medium-soft: #fcf6e6;
  --leitio-semantic-low: #5f9477;
  --leitio-semantic-low-soft: #edf6f1;
  --leitio-neutral-soft: #f7fbfd;
}

.task-table th {
  background: #f4f8fb;
  border-bottom-color: #d7e2ec;
  color: var(--leitio-navy-950);
}
.task-table td {
  background: #fff;
  border-color: rgba(123, 145, 167, .22);
  transition: background .15s ease, box-shadow .15s ease;
}
.task-table tr.priority-high { --row-color: var(--leitio-semantic-high); --row-soft: var(--leitio-semantic-high-soft); }
.task-table tr.priority-medium { --row-color: var(--leitio-semantic-medium); --row-soft: var(--leitio-semantic-medium-soft); }
.task-table tr.priority-low { --row-color: var(--leitio-semantic-low); --row-soft: var(--leitio-semantic-low-soft); }
.task-table tr.priority-high td,
.task-table tr.priority-medium td,
.task-table tr.priority-low td {
  background: linear-gradient(90deg, color-mix(in srgb, var(--row-soft) 54%, white), white 34%);
}
.task-table tr.priority-high td:first-child,
.task-table tr.priority-medium td:first-child,
.task-table tr.priority-low td:first-child {
  box-shadow: inset 4px 0 0 var(--row-color);
}
.task-table tr:hover td {
  background: linear-gradient(90deg, color-mix(in srgb, #e9f7fa 72%, white), white 38%);
}
.task-table tr.is-completed td {
  box-shadow: none;
  background: #eef3f7;
}
.task-table tr.empty-row td {
  background: #fff;
}
.priority-badge {
  padding: .28rem .62rem;
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--priority-color) 14%, white), color-mix(in srgb, var(--priority-color) 9%, white));
  border: 1px solid color-mix(in srgb, var(--priority-color) 38%, #b4c4d3);
  color: #1b2b3d;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}
.priority-badge::before {
  width: 7px;
  height: 7px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--priority-color) 16%, transparent);
}

.priority-legend {
  padding: .9rem;
  gap: .55rem;
  background: linear-gradient(180deg, #fbfdfe, #f6fafc);
}
.priority-legend > div {
  grid-template-columns: auto 1fr;
  gap: .7rem;
  align-items: center;
  border-radius: 10px;
  border: 1px solid #d7e2ec;
  border-left: 4px solid var(--legend-color, #64748b);
  background: #fff;
  box-shadow: 0 4px 14px rgba(3, 29, 61, .05);
}
.priority-legend strong {
  margin: .55rem 0 .55rem .7rem;
  padding: .42rem .72rem;
  border-radius: 999px;
  background: var(--legend-color, #64748b);
  color: #fff;
  text-align: center;
  font-size: .73rem;
  letter-spacing: .04em;
}
.priority-legend span {
  padding: .75rem .8rem .75rem 0;
  color: var(--slate-700);
  font-weight: 750;
}
.priority-legend small {
  padding: .65rem;
  border: 1px dashed #cfdce7;
  border-radius: 9px;
  background: #fff;
  color: #5b7186;
}
.legend-medium strong { color: #fff; }

.escalation-overview {
  border-color: #d88a8a;
  background: linear-gradient(135deg, #fff7f7, #fff1f2);
  color: #7f3030;
  box-shadow: 0 10px 24px rgba(160, 71, 71, .10);
}
.escalation-overview-icon {
  background: #c66b6b;
  box-shadow: 0 8px 18px rgba(198, 107, 107, .22);
}
.escalation-overview small { color: #955555; }
.task-table tr.has-escalation > td {
  background: linear-gradient(90deg, #fff6f6, #fffafa) !important;
  box-shadow: inset 0 1px 0 #f1c9c9, inset 0 -1px 0 #f1c9c9;
}
.task-table tr.has-escalation > td:first-child { border-left: 5px solid #c66b6b; }
.task-table tr.escalation-acknowledged > td {
  background: linear-gradient(90deg, #fffaf0, #fffdf8) !important;
  box-shadow: inset 0 1px 0 #efd8a7, inset 0 -1px 0 #efd8a7;
}
.task-table tr.escalation-acknowledged > td:first-child { border-left-color: #c59d3b; }
.task-escalation-inline {
  background: linear-gradient(135deg, #c66b6b, #b85757);
  box-shadow: 0 6px 14px rgba(184, 87, 87, .16);
}

.rule-list li span {
  background: linear-gradient(135deg, var(--leitio-navy-800), var(--leitio-navy-900));
}
.escalation-list li span {
  background: linear-gradient(135deg, #c66b6b, #b85757);
}
.danger-callout {
  background: #fff5f5;
  border-color: #e6b5b5;
  color: #9a4f4f;
}

.machine-occupancy-summary > span {
  background: #fff;
  border: 1px solid #d6e1ea;
  box-shadow: 0 2px 8px rgba(3, 29, 61, .05);
}
.machine-summary-free {
  background: var(--leitio-semantic-low-soft) !important;
  color: #2f5b47;
  border-color: color-mix(in srgb, var(--leitio-semantic-low) 38%, #d2dce5) !important;
}
.machine-summary-occupied {
  background: var(--leitio-semantic-medium-soft) !important;
  color: #7a5f1b;
  border-color: color-mix(in srgb, var(--leitio-semantic-medium) 42%, #d2dce5) !important;
}
.machine-summary-blocked {
  background: var(--leitio-semantic-high-soft) !important;
  color: #8c4747;
  border-color: color-mix(in srgb, var(--leitio-semantic-high) 42%, #d2dce5) !important;
}
.machine-occupancy-grid {
  gap: .6rem;
}
.machine-occupancy-card {
  border-width: 1px 1px 1px 5px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(3, 29, 61, .06);
}
.machine-occupancy-card > header strong {
  color: var(--leitio-navy-950);
}
.machine-occupancy-free {
  border-left-color: var(--leitio-semantic-low);
  background: linear-gradient(135deg, #fff 0%, var(--leitio-semantic-low-soft) 100%);
}
.machine-occupancy-occupied {
  border-left-color: var(--leitio-semantic-medium);
  background: linear-gradient(135deg, #fff 0%, var(--leitio-semantic-medium-soft) 100%);
}
.machine-occupancy-blocked {
  border-left-color: var(--leitio-semantic-high);
  border-color: #ead1d1;
  background: linear-gradient(135deg, #fff 0%, var(--leitio-semantic-high-soft) 100%);
  box-shadow: 0 5px 16px rgba(148, 79, 79, .08);
}
.machine-occupancy-pill {
  border: 1px solid color-mix(in srgb, var(--leitio-semantic-low) 26%, #d7e2eb);
  background: var(--leitio-semantic-low-soft);
  color: #2f5b47;
}
.machine-occupancy-occupied .machine-occupancy-pill,
.machine-occupancy-pill-occupied {
  border-color: color-mix(in srgb, var(--leitio-semantic-medium) 32%, #d7e2eb);
  background: var(--leitio-semantic-medium-soft);
  color: #7a5f1b;
}
.machine-occupancy-blocked .machine-occupancy-pill,
.machine-occupancy-pill-blocked {
  border-color: color-mix(in srgb, var(--leitio-semantic-high) 32%, #d7e2eb);
  background: var(--leitio-semantic-high-soft);
  color: #8c4747;
}
.machine-current-tasks > span,
.machine-editor-task-list span {
  background: rgba(255,255,255,.84);
  border: 1px solid #dde6ee;
}
.machine-free-hint {
  color: #356549;
}
.machine-blocked-hint {
  background: rgba(255,255,255,.72);
  color: #8c4747;
}
.machine-occupancy-blocker {
  color: #8c4747;
}
.machine-status-editor-intro {
  background: linear-gradient(180deg, #f6fbfd, #eef8fa);
}
.machine-status-option-running input:checked + span {
  border-color: var(--leitio-semantic-low);
  background: var(--leitio-semantic-low-soft);
  color: #2f5b47;
  box-shadow: inset 0 0 0 1px var(--leitio-semantic-low);
}
.machine-status-option-waiting input:checked + span {
  border-color: var(--leitio-semantic-medium);
  background: var(--leitio-semantic-medium-soft);
  color: #7a5f1b;
  box-shadow: inset 0 0 0 1px var(--leitio-semantic-medium);
}
.machine-status-option-stopped input:checked + span {
  border-color: var(--leitio-semantic-high);
  background: var(--leitio-semantic-high-soft);
  color: #8c4747;
  box-shadow: inset 0 0 0 1px var(--leitio-semantic-high);
}
.machine-status-blocker-toggle {
  background: #fff8f4;
  color: #a05d36;
}
.machine-status-editor-blocked {
  border-color: #e8c4c4;
}
.machine-status-editor-blocked > summary {
  background: linear-gradient(180deg, #fff7f7, #fff1f2);
}

.task-user-card.priority-high { --task-color: var(--leitio-semantic-high); }
.task-user-card.priority-medium { --task-color: var(--leitio-semantic-medium); }
.task-user-card.priority-low { --task-color: var(--leitio-semantic-low); }
.task-user-card {
  box-shadow: 0 10px 26px rgba(3, 29, 61, .07);
}
.task-user-card > header {
  background: linear-gradient(180deg, rgba(248,251,253,.95), #fff);
}
.task-status-own {
  background: #e8f7fa;
  color: #176577;
}
.task-status-completed {
  background: var(--leitio-semantic-low-soft);
  color: #2f5b47;
}

/* Version 3.2 Revision 19 – optionale Zusatzmodule, Schichten und Abwesenheiten */
.workforce-page { max-width: 1580px; }
.workforce-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.2rem;
  padding: 1.3rem 1.45rem;
  border: 1px solid #d3e0e9;
  border-radius: 18px;
  background: linear-gradient(120deg, #fff 0%, #f7fbfd 68%, #e9f8fa 100%);
  box-shadow: var(--shadow);
}
.workforce-heading h1 { margin: .2rem 0 .35rem; color: var(--leitio-navy-950); }
.workforce-heading p { max-width: 820px; margin: 0; color: var(--slate-600); line-height: 1.5; }
.workforce-kicker { color: var(--leitio-cyan-700); font-size: .7rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.workforce-feature-status { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.feature-state { padding: .42rem .68rem; border: 1px solid #d5e1e9; border-radius: 999px; background: #f3f6f8; color: #66798c; font-size: .72rem; font-weight: 850; }
.feature-state.is-enabled { border-color: #9ddce2; background: var(--leitio-cyan-100); color: #176577; }
.workforce-section { margin-top: 1.25rem; }
.workforce-section-heading { margin-bottom: .75rem; }
.workforce-section-heading > div { display: flex; align-items: center; gap: .75rem; }
.workforce-section-heading h2 { margin: 0; color: var(--leitio-navy-950); }
.workforce-section-heading p { margin: .18rem 0 0; color: var(--slate-600); }
.section-number { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 50%; background: linear-gradient(145deg, var(--leitio-cyan-700), var(--leitio-cyan-600)); color: #fff; font-weight: 900; box-shadow: 0 7px 16px rgba(8,165,181,.2); }
.workforce-grid { display: grid; gap: 1rem; }
.workforce-grid-form-list { grid-template-columns: minmax(320px, .72fr) minmax(480px, 1.55fr); align-items: start; }
.workforce-form h3, .workforce-list-panel h3 { margin: 0 0 .9rem; color: var(--leitio-navy-950); }
.workforce-form select[multiple] { min-height: 150px; padding: .4rem; }
.workforce-form select[multiple] option { padding: .35rem .45rem; border-radius: 6px; }
.workforce-list-panel { min-width: 0; }
.workforce-card-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .7rem; }
.workforce-card { min-width: 0; overflow: hidden; border: 1px solid #d6e2eb; border-left: 4px solid var(--leitio-cyan-600); border-radius: 12px; background: linear-gradient(145deg, #fff, #f8fbfd); box-shadow: 0 5px 16px rgba(3,29,61,.055); }
.workforce-card.is-muted { opacity: .68; filter: saturate(.65); }
.workforce-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: .7rem; padding: .75rem .8rem; border-bottom: 1px solid #e1e9ef; }
.workforce-card > header > div { min-width: 0; display: grid; }
.workforce-card > header strong { color: var(--leitio-navy-950); overflow-wrap: anywhere; }
.workforce-card > header small { margin-top: .18rem; }
.workforce-card dl { display: grid; gap: .45rem; margin: 0; padding: .75rem .8rem; }
.workforce-card dl > div { display: grid; grid-template-columns: 86px minmax(0,1fr); gap: .5rem; }
.workforce-card dl > div.full { grid-template-columns: 1fr; gap: .15rem; }
.workforce-card dt { color: var(--slate-600); font-size: .72rem; font-weight: 800; }
.workforce-card dd { min-width: 0; margin: 0; color: var(--slate-800); font-size: .78rem; font-weight: 700; overflow-wrap: anywhere; }
.workforce-card > footer { display: flex; justify-content: flex-end; gap: .4rem; padding: .65rem .8rem; border-top: 1px solid #e1e9ef; background: rgba(247,251,253,.8); }
.absence-card { border-left-color: var(--leitio-semantic-medium, #c59d3b); }
.workforce-empty { grid-column: 1 / -1; padding: 1.4rem; border: 2px dashed #d4e0e9; border-radius: 12px; color: var(--slate-600); text-align: center; }
.workforce-table td small { display: block; margin-top: .14rem; }
.workforce-privacy-callout { margin: -.1rem 0 .8rem; padding: .7rem .85rem; border: 1px solid #ecd8a7; border-left: 4px solid var(--leitio-semantic-medium, #c59d3b); border-radius: 10px; background: #fffaf0; color: #745a21; font-size: .8rem; line-height: 1.45; }
.feature-admin-note { margin-bottom: 1rem; padding: .8rem .95rem; border-left: 4px solid var(--leitio-cyan-600); border-radius: 10px; background: var(--leitio-cyan-100); color: #285469; line-height: 1.45; }
.feature-admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.feature-admin-card { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; gap: .8rem; align-items: center; padding: 1.1rem; border: 1px solid #d3e0e9; border-radius: 16px; background: #fff; box-shadow: var(--shadow); cursor: pointer; }
.feature-admin-card:hover { border-color: #9ed5dc; transform: translateY(-1px); }
.feature-admin-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 13px; background: linear-gradient(145deg, var(--leitio-navy-800), var(--leitio-navy-900)); color: #fff; font-size: 1.1rem; font-weight: 950; }
.feature-admin-copy { min-width: 0; display: grid; }
.feature-admin-copy strong { color: var(--leitio-navy-950); }
.feature-admin-copy small { margin-top: .25rem; line-height: 1.4; }
.feature-toggle { display: grid; justify-items: center; gap: .3rem; }
.feature-toggle input { width: 22px; height: 22px; accent-color: var(--leitio-cyan-700); }
.feature-toggle span { color: var(--slate-600); font-size: .68rem; font-weight: 800; }
.feature-admin-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
@media (max-width: 1050px) {
  .workforce-grid-form-list { grid-template-columns: 1fr; }
  .feature-admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .workforce-heading { flex-direction: column; }
  .workforce-feature-status { justify-content: flex-start; }
  .workforce-card-list { grid-template-columns: 1fr; }
  .feature-admin-card { grid-template-columns: 42px minmax(0,1fr); }
  .feature-toggle { grid-column: 1 / -1; grid-template-columns: auto auto; justify-content: start; align-items: center; }
}

/* Version 3.2 Revision 20 – priorisierte Vertretungsregelung */
.substitution-chain-list { gap: .8rem; }
.substitution-chain-card { border-left: 4px solid var(--leitio-cyan-600); }
.substitution-members { display: grid; gap: .45rem; margin: 0; padding: .75rem; list-style: none; counter-reset: none; }
.substitution-members li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: .55rem; align-items: center; padding: .55rem .65rem; border: 1px solid #d8e3ec; border-radius: 10px; background: #f8fbfd; }
.substitution-priority { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--leitio-cyan-700), var(--leitio-cyan-600)); color: #fff; font-size: .72rem; font-weight: 900; }
.substitution-pool-table td { min-width: 150px; }
.substitution-pool-table td:first-child { min-width: 220px; }
.pool-attempt { display: block; margin: .18rem 0; padding: .28rem .42rem; border-radius: 7px; background: #fff4f4; color: #8e4f4f; font-size: .7rem; line-height: 1.3; }
.pool-attempt.is-available { background: #eef7f2; color: #35614a; }
.pool-assignment-form { display: grid; gap: .4rem; margin-bottom: .45rem; }
.pool-assignment-form select { min-width: 210px; padding: .46rem .55rem; font-size: .78rem; }
.absence-card dl .full { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .substitution-members li { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .pool-assignment-form select { min-width: 0; }
}

.task-substitution-open { display: inline-flex; margin-top: .35rem; padding: .22rem .48rem; border: 1px solid #d5b768; border-radius: 999px; background: #fcf6e6; color: #775b17; font-size: .65rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.task-status-substitution { background: #fcf6e6; color: #775b17; border: 1px solid #e0c87f; }

/* Version 3.2 Revision 21 – fortlaufende Aufgaben und Schichtübergaben */
.task-continuous-badge,
.task-handover-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: .34rem;
  margin-right: .3rem;
  padding: .2rem .48rem;
  border-radius: 999px;
  font-size: .64rem;
  font-weight: 900;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.task-continuous-badge {
  border: 1px solid #9edce3;
  background: #e8f7fa;
  color: #176577;
}
.task-handover-badge.is-pending {
  border: 1px solid #d5b768;
  background: #fcf6e6;
  color: #775b17;
}
.task-handover-badge.is-open {
  border: 1px solid #e0b4b4;
  background: #fbefef;
  color: #8c4b4b;
}
.task-handover-badge.is-prepared {
  border: 1px solid #b9cedd;
  background: #f0f6fa;
  color: #385c73;
}
.handover-icon-btn { color: var(--leitio-cyan-700); font-weight: 950; }
.task-user-status-group { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.task-handover-summary {
  margin-top: .85rem;
  overflow: hidden;
  border: 1px solid #c8dbe7;
  border-left: 4px solid var(--leitio-cyan-600);
  border-radius: 12px;
  background: linear-gradient(145deg, #fff, #f6fbfd);
}
.task-handover-summary.is-pending { border-left-color: var(--leitio-semantic-medium, #c59d3b); }
.task-handover-summary > header {
  display: flex;
  justify-content: space-between;
  gap: .7rem;
  align-items: flex-start;
  padding: .7rem .8rem;
  border-bottom: 1px solid #dbe6ed;
  background: rgba(247,251,253,.9);
}
.task-handover-summary > header > div { display: grid; gap: .12rem; }
.task-handover-summary > header strong { color: var(--leitio-navy-950); }
.task-handover-summary > header span { padding: .2rem .42rem; border-radius: 999px; background: #fcf6e6; color: #775b17; font-size: .66rem; font-weight: 850; }
.task-handover-summary dl { display: grid; gap: .5rem; margin: 0; padding: .75rem .8rem; }
.task-handover-summary dl > div { display: grid; gap: .13rem; }
.task-handover-summary dt { color: var(--slate-600); font-size: .68rem; font-weight: 850; text-transform: uppercase; letter-spacing: .035em; }
.task-handover-summary dd { margin: 0; color: var(--slate-800); white-space: pre-wrap; overflow-wrap: anywhere; }
.task-handover-summary .is-blocker { padding: .5rem; border-radius: 8px; background: #fbefef; color: #8c4b4b; }
.task-handover-modal { width: min(760px, calc(100vw - 2rem)); }
.task-handover-modal textarea { resize: vertical; min-height: 80px; }
.task-handover-confirm-button { box-shadow: 0 8px 18px rgba(197,157,59,.18); }
.handover-pending-card { border-left-color: var(--leitio-semantic-medium, #c59d3b); }
.handover-pending-card .handover-blocker { padding: .5rem; border-radius: 8px; background: #fbefef; }
.handover-pool-table td { min-width: 170px; vertical-align: top; }
.handover-pool-table td:first-child { min-width: 220px; }
.workforce-handover-section .pool-attempt { max-width: 520px; }
@media (max-width: 720px) {
  .task-handover-summary > header { flex-direction: column; }
  .task-handover-modal { width: calc(100vw - 1rem); }
}

/* Version 3.2 Revision 22 – Firmenübersicht und Benutzer-Profilbilder */
.user-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  overflow: hidden; border-radius: 999px; background: linear-gradient(145deg, #0b4f8a, #079bb5);
  color: #fff; font-weight: 900; letter-spacing: .02em; box-shadow: 0 0 0 2px rgba(255,255,255,.85);
}
.user-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.user-avatar-xs { width: 24px; height: 24px; font-size: .62rem; }
.user-avatar-sm { width: 36px; height: 36px; font-size: .72rem; }
.user-avatar-md { width: 44px; height: 44px; font-size: .82rem; }
.user-avatar-nav { width: 38px; height: 38px; font-size: .72rem; box-shadow: 0 0 0 2px rgba(6,46,97,.12); }
.user-avatar-xl { width: 104px; height: 104px; font-size: 1.65rem; box-shadow: 0 0 0 5px rgba(8,157,181,.12); }
.nav-profile-action { width: 46px; padding: 0; border-radius: 999px; }
.nav-profile-action .user-avatar { transition: transform .18s ease, box-shadow .18s ease; }
.nav-profile-action:hover .user-avatar, .nav-profile-action.is-active .user-avatar { transform: translateY(-1px); box-shadow: 0 0 0 3px rgba(8,157,181,.26); }
.task-assignee-with-avatar { display: inline-flex; align-items: center; gap: .45rem; }
.support-message-author { display: grid !important; grid-template-columns: auto 1fr auto; align-items: center; gap: .65rem; }
.support-message-author > div { display: grid; gap: .08rem; }
.support-message-author time { align-self: start; }

.company-overview-page { background: #eef4f8; }
.company-overview-shell { width: min(1500px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(1rem, 2.3vw, 2rem) 0 3rem; }
.overview-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.2rem; margin-bottom: 1.1rem; }
.overview-header h1 { margin: .1rem 0 .25rem; color: var(--navy-950); font-size: clamp(1.8rem, 3vw, 2.65rem); }
.overview-header p { margin: 0; color: var(--slate-600); }
.overview-eyebrow { margin: 0 !important; color: var(--leitio-cyan-700) !important; font-size: .76rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.overview-period-form { display: grid; grid-template-columns: auto minmax(150px, 190px); align-items: center; gap: .65rem; padding: .6rem .7rem .6rem .9rem; background: #fff; border: 1px solid #d9e5ee; border-radius: 14px; box-shadow: 0 8px 25px rgba(7, 37, 70, .06); }
.overview-period-form label { color: var(--slate-600); font-size: .78rem; font-weight: 800; }
.overview-period-form select { margin: 0; min-height: 40px; border: 0; background: #f2f7fa; font-weight: 800; }
.overview-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; }
.overview-card { grid-column: span 4; min-width: 0; padding: 1.25rem; background: rgba(255,255,255,.96); border: 1px solid #dce7ef; border-radius: 18px; box-shadow: 0 12px 34px rgba(8, 39, 74, .07); }
.overview-card > header { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; color: #123f73; font-size: .8rem; font-weight: 900; letter-spacing: .045em; text-transform: uppercase; }
.overview-card > header a, .overview-card > a { color: #1463ba; font-size: .78rem; font-weight: 850; text-decoration: none; text-transform: none; letter-spacing: 0; }
.overview-card > header a:hover, .overview-card > a:hover { text-decoration: underline; }
.overview-card-tasks { grid-column: span 4; }
.overview-task-summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.overview-task-summary > div:first-child strong { display: block; color: var(--navy-950); font-size: 2.55rem; line-height: 1; }
.overview-task-summary > div:first-child span { color: var(--slate-600); font-size: .8rem; }
.overview-progress { --progress: 0; width: 104px; height: 104px; display: grid; place-content: center; position: relative; border-radius: 50%; background: conic-gradient(#079db6 calc(var(--progress) * 1%), #e5eef3 0); }
.overview-progress::before { content: ''; position: absolute; inset: 10px; border-radius: inherit; background: #fff; }
.overview-progress span, .overview-progress small { position: relative; z-index: 1; text-align: center; }
.overview-progress span { color: var(--navy-950); font-size: 1.3rem; font-weight: 900; }
.overview-progress small { color: var(--slate-500); font-size: .68rem; }
.overview-priority-mini { display: flex; gap: .75rem 1rem; flex-wrap: wrap; margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid #e5edf3; }
.overview-priority-mini span { display: inline-flex; align-items: center; gap: .35rem; color: var(--slate-700); font-size: .76rem; font-weight: 750; }
.overview-priority-mini i, .overview-priority-list i { width: 9px; height: 9px; display: inline-block; border-radius: 50%; }
.overview-priority-list i.is-high, .overview-priority-mini .is-high i { background-color: var(--leitio-semantic-high); }
.overview-priority-list i.is-medium, .overview-priority-mini .is-medium i { background-color: var(--leitio-semantic-medium); }
.overview-priority-list i.is-low, .overview-priority-mini .is-low i { background-color: var(--leitio-semantic-low); }
.overview-priority-mini span.is-high, .overview-priority-mini span.is-medium, .overview-priority-mini span.is-low { background: transparent; }
.overview-priority-list, .overview-resource-list { display: grid; }
.overview-priority-list > div, .overview-resource-list > div { display: flex; justify-content: space-between; gap: .8rem; padding: .8rem 0; border-bottom: 1px solid #e6edf3; }
.overview-priority-list > div:last-child, .overview-resource-list > div:last-child { border-bottom: 0; }
.overview-priority-list span, .overview-resource-list span { display: inline-flex; align-items: center; gap: .55rem; color: var(--slate-700); font-weight: 750; }
.overview-priority-list strong, .overview-resource-list strong { color: var(--navy-950); }
.overview-card-alerts .overview-big-number { color: var(--navy-950); }
.overview-big-number { display: block; margin: .1rem 0; font-size: 2.8rem; line-height: 1; }
.overview-card-alerts p, .overview-card-module p { margin: .4rem 0 .9rem; color: var(--slate-600); }
.overview-warning { display: block; margin: .65rem 0; padding: .55rem .65rem; background: #fff3f1; border-left: 3px solid var(--leitio-semantic-high); border-radius: 7px; color: #8d3f43; font-size: .76rem; font-weight: 750; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; }
.status-dot.is-free { background: var(--leitio-semantic-low); }
.status-dot.is-occupied { background: var(--leitio-semantic-medium); }
.status-dot.is-blocked { background: var(--leitio-semantic-high); }
.overview-card-team, .overview-card-messages { grid-column: span 6; }
.overview-team-list, .overview-message-list { display: grid; gap: .8rem; }
.overview-team-row { display: grid; grid-template-columns: auto minmax(0,1fr); gap: .65rem; align-items: center; }
.overview-team-row > div { min-width: 0; display: grid; grid-template-columns: 1fr auto; gap: .12rem .5rem; }
.overview-team-row strong { overflow: hidden; color: var(--navy-950); font-size: .84rem; text-overflow: ellipsis; white-space: nowrap; }
.overview-team-row span { color: var(--slate-500); font-size: .72rem; }
.overview-team-row i { grid-column: 1 / -1; height: 5px; overflow: hidden; border-radius: 999px; background: #e5edf3; }
.overview-team-row i b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #176cc5, #079db6); }
.overview-message-list a { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .65rem; padding: .45rem 0; color: inherit; text-decoration: none; border-bottom: 1px solid #e6edf3; }
.overview-message-list a:last-child { border-bottom: 0; }
.overview-message-list a > span:nth-child(2) { min-width: 0; display: grid; }
.overview-message-list strong { color: var(--navy-950); font-size: .82rem; }
.overview-message-list small { overflow: hidden; color: var(--slate-500); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.overview-message-list time { color: var(--slate-500); font-size: .7rem; }
.overview-empty { margin: .5rem 0; color: var(--slate-500); }
.overview-card-module { grid-column: span 6; }
.overview-shift-names { display: flex; flex-wrap: wrap; gap: .4rem; }
.overview-shift-names span { padding: .4rem .55rem; border-radius: 8px; background: #eef7f9; color: #184e66; font-size: .72rem; font-weight: 750; }
.overview-module-metrics { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .8rem; }
.overview-module-metrics > div { padding: .9rem; border-radius: 12px; background: #f2f7fa; }
.overview-module-metrics strong { display: block; color: var(--navy-950); font-size: 2rem; }
.overview-module-metrics span { color: var(--slate-600); font-size: .75rem; }

.profile-page { width: min(1050px, calc(100% - 2rem)); }
.profile-heading { display: flex; align-items: center; gap: 1.3rem; margin-bottom: 1rem; padding: 1.35rem; border: 1px solid #dce7ef; border-radius: 18px; background: #fff; box-shadow: 0 12px 34px rgba(8,39,74,.07); }
.profile-heading h1 { margin: .15rem 0 .25rem; color: var(--navy-950); }
.profile-heading p { margin: 0; color: var(--slate-600); }
.profile-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 1rem; }
.profile-image-panel, .profile-account-panel { display: grid; align-content: start; gap: 1rem; }
.profile-image-panel h2, .profile-account-panel h2 { margin: 0 0 .35rem; }
.profile-image-panel p { margin: 0; color: var(--slate-600); }
.profile-upload-form input[type=file] { padding: .7rem; background: #f5f8fa; }
.profile-account-list { display: grid; margin: 0; }
.profile-account-list > div { display: grid; grid-template-columns: 120px 1fr; gap: .8rem; padding: .75rem 0; border-bottom: 1px solid #e5edf3; }
.profile-account-list dt { color: var(--slate-500); font-size: .76rem; font-weight: 800; }
.profile-account-list dd { margin: 0; color: var(--navy-950); font-weight: 750; overflow-wrap: anywhere; }

@media (max-width: 1050px) {
  .overview-card { grid-column: span 6; }
  .overview-card-team, .overview-card-messages, .overview-card-module { grid-column: span 6; }
}
@media (max-width: 720px) {
  .company-overview-shell { width: min(100% - 1rem, 1500px); }
  .overview-header { align-items: stretch; flex-direction: column; }
  .overview-period-form { grid-template-columns: 1fr; }
  .overview-grid { grid-template-columns: 1fr; }
  .overview-card, .overview-card-tasks, .overview-card-team, .overview-card-messages, .overview-card-module { grid-column: 1; }
  .overview-task-summary { align-items: flex-start; }
  .overview-progress { width: 88px; height: 88px; }
  .profile-heading { align-items: flex-start; flex-direction: column; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-account-list > div { grid-template-columns: 1fr; gap: .2rem; }
  .support-message-author { grid-template-columns: auto 1fr; }
  .support-message-author time { grid-column: 2; }
}

/* Version 3.2 Revision 23 – Auftragswarteschlangen und automatischer nächster Schritt */
.machine-next-order dd { display: grid; gap: .12rem; }
.machine-next-order dd > strong { color: var(--navy-950); }
.machine-next-order dd > span { color: var(--slate-700); font-size: .78rem; }
.machine-next-order dd > small { color: #0f766e; font-size: .68rem; font-weight: 800; }
.machine-queue-link { display: inline-flex; align-items: center; gap: .3rem; margin-top: .55rem; color: #075985; font-size: .72rem; font-weight: 850; text-decoration: none; }
.machine-queue-link:hover { text-decoration: underline; }
.machine-status-auto-next { display: grid; align-content: start; gap: .2rem; min-width: 0; padding: .65rem .72rem; border: 1px solid #99f6e4; border-radius: 9px; background: #f0fdfa; }
.machine-status-auto-next > span { color: #0f766e; font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.machine-status-auto-next > strong { color: var(--navy-950); overflow-wrap: anywhere; }
.machine-status-auto-next > small { color: var(--slate-700); line-height: 1.35; }

.queue-admin-heading { align-items: center; }
.queue-admin-summary { display: grid; justify-items: center; min-width: 108px; padding: .8rem 1rem; border: 1px solid #bae6fd; border-radius: 14px; background: #f0f9ff; }
.queue-admin-summary strong { color: #075985; font-size: 1.65rem; }
.queue-admin-summary span { color: var(--slate-600); font-size: .72rem; font-weight: 750; }
.queue-help-card { display: grid; gap: .28rem; margin-bottom: 1rem; padding: .9rem 1rem; border: 1px solid #99f6e4; border-radius: 14px; background: #f0fdfa; }
.queue-help-card strong { color: #115e59; }
.queue-help-card span { color: var(--slate-700); line-height: 1.45; }
.task-queue-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 1rem; align-items: start; }
.task-queue-card { overflow: hidden; border: 1px solid var(--slate-200); border-radius: 16px; background: #fff; box-shadow: 0 10px 30px rgba(15, 23, 42, .06); }
.task-queue-card > header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.05rem; border-bottom: 1px solid var(--slate-200); background: linear-gradient(135deg, #fff, #f8fbff); }
.task-queue-card > header h2 { margin: .08rem 0; color: var(--navy-950); font-size: 1.15rem; }
.task-queue-card > header small { color: var(--slate-600); }
.task-queue-type { color: #0891b2; font-size: .67rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.task-queue-count { display: grid; place-items: center; min-width: 38px; height: 38px; border-radius: 999px; background: #0f9db5; color: white; font-weight: 900; }
.task-queue-inactive { padding: .55rem 1rem; border-bottom: 1px solid #fed7aa; background: #fff7ed; color: #9a3412; font-size: .75rem; font-weight: 700; }
.task-queue-list { display: grid; gap: .55rem; margin: 0; padding: .8rem; list-style: none; }
.task-queue-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .72rem; border: 1px solid var(--slate-200); border-radius: 12px; background: #fbfdff; transition: border-color .15s ease, box-shadow .15s ease, opacity .15s ease; }
.task-queue-item[draggable="true"] { cursor: grab; }
.task-queue-item[draggable="true"]:active { cursor: grabbing; }
.task-queue-item.is-dragging { opacity: .55; border-color: #0891b2; box-shadow: 0 8px 24px rgba(8, 145, 178, .16); }
.task-queue-position { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; background: #e0f2fe; color: #075985; font-weight: 900; }
.task-queue-copy { display: grid; gap: .18rem; min-width: 0; }
.task-queue-copy > span { color: var(--slate-700); overflow-wrap: anywhere; }
.task-queue-copy > small { color: var(--slate-500); }
.task-queue-title { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.queue-current-badge, .queue-next-badge { display: inline-flex; align-items: center; min-height: 22px; padding: .15rem .5rem; border-radius: 999px; font-size: .65rem; font-weight: 900; }
.queue-current-badge { background: #dcfce7; color: #166534; }
.queue-next-badge { background: #fef3c7; color: #92400e; }
.task-queue-actions { display: flex; align-items: center; gap: .25rem; }
.task-queue-drag { color: var(--slate-400); font-weight: 900; letter-spacing: -.2em; }
.task-queue-card > footer { display: flex; align-items: center; justify-content: space-between; gap: .7rem; padding: .75rem .9rem; border-top: 1px solid var(--slate-200); background: #f8fafc; }
.task-queue-card > footer span { color: var(--slate-600); font-size: .72rem; font-weight: 700; }
.task-queue-empty { padding: 1rem; border: 1px dashed var(--slate-300); border-radius: 10px; color: var(--slate-500); text-align: center; }
@media (max-width: 680px) {
  .task-queue-item { grid-template-columns: 34px minmax(0, 1fr); }
  .task-queue-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .queue-admin-summary { justify-self: start; }
}


/* Version 3.2 Revision 23 Fix 1 – Passwortsichtbarkeit in der Anmeldung */
.password-field {
  display: grid;
  gap: .4rem;
}
.password-input-group {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  align-items: stretch;
}
.password-input-group .password-input {
  min-width: 0;
  border-radius: 9px 0 0 9px;
  border-right: 0;
}
.password-visibility-toggle {
  display: inline-grid;
  place-items: center;
  min-width: 46px;
  min-height: 44px;
  padding: 0;
  color: var(--leitio-navy-700, #174c7d);
  background: #f3f8fb;
  border: 1px solid var(--slate-300, #cbd5e1);
  border-radius: 0 9px 9px 0;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.password-visibility-toggle:hover {
  color: var(--leitio-cyan-700, #087f8c);
  background: #eaf7f8;
  border-color: rgba(8, 165, 181, .55);
}
.password-visibility-toggle:focus-visible {
  position: relative;
  z-index: 2;
  outline: 3px solid rgba(8, 165, 181, .24);
  outline-offset: 1px;
  box-shadow: 0 0 0 1px var(--leitio-cyan-600, #08a5b5);
}
.password-eye {
  width: 21px;
  height: 21px;
}
.password-eye-hidden { display: none; }
.password-visibility-toggle.is-password-visible .password-eye-visible { display: none; }
.password-visibility-toggle.is-password-visible .password-eye-hidden { display: block; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* LEITIO 3.3 – Firmenkontext, Aufgabenfilter und Human-in-the-Loop */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.tenant-context-bar {
  position: relative;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  padding: .45rem 1rem;
  border-bottom: 1px solid #c9e8eb;
  background: #eef7fa;
}
.tenant-context-label { color: #27445f; font-size: .8rem; font-weight: 700; }
.tenant-context-control { position: relative; min-width: min(360px, calc(100vw - 9rem)); }
.tenant-context-trigger {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .55rem;
  padding: .48rem .72rem;
  border: 1px solid #b9d7e0;
  border-radius: 10px;
  background: #fff;
  color: #082f5d;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(6, 46, 97, .06);
}
.tenant-context-trigger svg { width: 18px; height: 18px; color: var(--leitio-cyan-700); }
.tenant-context-trigger > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-context-chevron { font-size: 1rem; transition: transform .16s ease; }
.tenant-context-bar.is-open .tenant-context-chevron { transform: rotate(180deg); }
.tenant-context-trigger:hover { border-color: var(--leitio-cyan-700); }
.tenant-context-trigger:focus-visible { outline: 3px solid rgba(4, 157, 182, .25); outline-offset: 2px; }
.tenant-context-menu {
  position: absolute;
  top: calc(100% + .45rem);
  left: 0;
  width: min(440px, calc(100vw - 2rem));
  max-height: min(560px, calc(100vh - 9rem));
  padding: .75rem;
  overflow: hidden;
  border: 1px solid #cbdce5;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(6, 46, 97, .2);
}
.tenant-context-menu-header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .15rem .15rem .6rem; }
.tenant-context-menu-header strong { color: #082f5d; font-size: .92rem; }
.tenant-context-menu-header small, .tenant-context-hint { color: #64748b; font-size: .72rem; }
.tenant-context-search input {
  width: 100%;
  padding: .62rem .72rem;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: #f8fafc;
  font: inherit;
  font-size: .82rem;
}
.tenant-context-search input:focus { border-color: var(--leitio-cyan-700); outline: 3px solid rgba(4, 157, 182, .15); }
.tenant-context-hint { margin: .4rem .15rem .55rem; }
.tenant-context-options { max-height: min(390px, calc(100vh - 16rem)); overflow-y: auto; padding-right: .15rem; }
.tenant-context-options form + form { margin-top: .28rem; }
.tenant-context-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .62rem .72rem;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #153553;
  font: inherit;
  font-size: .82rem;
  text-align: left;
  cursor: pointer;
}
.tenant-context-option:hover, .tenant-context-option:focus-visible { border-color: #b8dfe5; background: #eef9fb; outline: none; }
.tenant-context-option.active { border-color: #8bd0da; background: #e2f7fa; color: #00677a; font-weight: 800; }
.tenant-context-option small { color: #087f91; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; }
.tenant-context-empty { margin: .5rem 0 0; padding: .9rem; border-radius: 9px; background: #f8fafc; color: #64748b; font-size: .8rem; text-align: center; }

.dashboard-task-filters {
  display: grid;
  grid-template-columns: minmax(150px, .9fr) minmax(220px, 1.35fr) minmax(130px, .75fr) minmax(170px, 1fr) auto;
  gap: .65rem;
  align-items: end;
  margin: .75rem 0;
  padding: .75rem;
  border: 1px solid #d8e6ee;
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 5px 18px rgba(6, 46, 97, .06);
}
.dashboard-task-filter-heading { grid-column: 1 / -1; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.dashboard-task-filter-heading strong { color: #082f5d; font-size: .88rem; }
.dashboard-task-filter-heading span { color: #64748b; font-size: .72rem; }
.dashboard-task-filters label { display: grid; gap: .28rem; color: #34516d; font-size: .7rem; font-weight: 700; }
.dashboard-task-filters select, .dashboard-task-filters input {
  min-width: 0;
  width: 100%;
  padding: .48rem .55rem;
  border: 1px solid #cbd8e2;
  border-radius: 8px;
  background: #fff;
  color: #102f4f;
  font: inherit;
  font-size: .78rem;
}
.dashboard-task-filters select:focus, .dashboard-task-filters input:focus { border-color: var(--leitio-cyan-700); outline: 3px solid rgba(4, 157, 182, .14); }
.dashboard-task-filter-reset { white-space: nowrap; }
.filter-empty-row td { padding: 1.1rem !important; color: #64748b; text-align: center; font-style: italic; }

.overview-team-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: .34rem .4rem;
  margin: 0 -.4rem;
  border-radius: 9px;
  color: inherit;
  text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}
.overview-team-row:hover { background: #eef8fb; transform: translateX(2px); }
.overview-team-row:focus-visible { outline: 3px solid rgba(4, 157, 182, .22); outline-offset: 1px; }
.overview-team-row-arrow { color: #0b86a0 !important; font-size: .9rem !important; font-weight: 800; }
.overview-review-summary { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .7rem; }
.overview-review-summary strong { color: #082f5d; font-size: 1.9rem; line-height: 1; }
.overview-review-summary span { color: #64748b; font-size: .76rem; }
.overview-review-list { display: grid; gap: .35rem; }
.overview-review-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .55rem; align-items: center; padding: .45rem; border: 1px solid #e4ebf0; border-radius: 9px; background: #fbfdfe; }
.overview-review-check { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: #e8f7ee; color: #15803d; font-size: .75rem; font-weight: 900; }
.overview-review-row > div { min-width: 0; display: grid; gap: .1rem; }
.overview-review-row strong { overflow: hidden; color: #123653; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.overview-review-row small { overflow: hidden; color: #64748b; font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.overview-review-reactivate { padding: .35rem .5rem; border: 1px solid #8ecfd8; border-radius: 7px; background: #effbfc; color: #006c7d; font: inherit; font-size: .68rem; font-weight: 800; cursor: pointer; }
.overview-review-reactivate:hover { background: #dff5f8; }

.task-overview-shell { width: min(1280px, calc(100% - 2rem)); margin: 1.25rem auto 3rem; }
.task-overview-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.25rem; margin-bottom: 1rem; }
.task-overview-header h1 { margin: .15rem 0 .25rem; color: #082f5d; font-size: clamp(1.45rem, 2.2vw, 2.05rem); }
.task-overview-header p { margin: 0; color: #60758a; }
.task-filter-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .75rem;
  align-items: end;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid #d6e5ed;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 25px rgba(6, 46, 97, .07);
}
.task-filter-panel label { display: grid; gap: .32rem; color: #34516d; font-size: .73rem; font-weight: 800; }
.task-filter-panel select, .task-filter-panel input { width: 100%; min-width: 0; padding: .58rem .65rem; border: 1px solid #cbd8e2; border-radius: 8px; background: #fff; font: inherit; font-size: .8rem; }
.task-filter-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: .55rem; }
.task-overview-list, .completed-review-list { display: grid; gap: .75rem; }
.task-overview-card, .completed-review-card { overflow: hidden; border: 1px solid #d8e4eb; border-radius: 13px; background: #fff; box-shadow: 0 5px 16px rgba(6, 46, 97, .05); }
.task-overview-card { border-left: 4px solid var(--priority-color, #94a3b8); }
.task-overview-card.priority-high { border-left-color: #dc2626; }
.task-overview-card.priority-medium { border-left-color: #eab308; }
.task-overview-card.priority-low { border-left-color: #65a30d; }
.task-overview-card > header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .65rem .85rem; border-bottom: 1px solid #edf1f4; background: #fbfdfe; }
.task-overview-card > header time { color: #64748b; font-size: .72rem; }
.task-overview-card-main { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr); gap: 1.2rem; padding: .85rem; }
.task-overview-card-main > div > strong { color: #087b91; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
.task-overview-card-main h2 { margin: .18rem 0 .3rem; color: #102f4f; font-size: 1rem; }
.task-overview-card-main p { margin: 0; color: #566f84; font-size: .78rem; white-space: pre-line; }
.task-overview-card dl, .completed-review-card dl { display: grid; gap: .4rem; margin: 0; }
.task-overview-card dl div, .completed-review-card dl div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: .55rem; align-items: center; }
.task-overview-card dt, .completed-review-card dt { color: #64748b; font-size: .68rem; font-weight: 700; }
.task-overview-card dd, .completed-review-card dd { display: flex; align-items: center; gap: .35rem; margin: 0; color: #173957; font-size: .76rem; font-weight: 700; }
.task-overview-escalation { padding: .55rem .85rem; background: #fff1f2; color: #b42318; font-size: .72rem; font-weight: 800; }
.task-overview-empty { padding: 2.4rem 1rem; border: 1px dashed #c8d7e1; border-radius: 13px; background: #f9fbfc; color: #64748b; text-align: center; }
.task-overview-empty strong { display: block; color: #21415e; }
.task-overview-empty p { margin: .3rem 0 0; }

.completed-review-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .85rem; align-items: center; padding: .9rem; }
.completed-review-state { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #e9f8ef; color: #15803d; font-size: 1rem; font-weight: 900; }
.completed-review-content { min-width: 0; }
.completed-review-content > header { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.completed-review-content > header > div { display: flex; gap: .5rem; align-items: center; }
.completed-review-content > header > div > strong { color: #087b91; font-size: .72rem; text-transform: uppercase; }
.completed-review-content > header time { color: #64748b; font-size: .7rem; }
.completed-review-content h2 { margin: .25rem 0; color: #102f4f; font-size: .95rem; }
.completed-review-content > p { margin: 0 0 .55rem; color: #566f84; font-size: .76rem; }
.completed-review-content dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.completed-review-content dl div { display: block; }
.completed-review-content dd { margin-top: .12rem; }
.completed-review-action { align-self: stretch; display: flex; align-items: center; padding-left: .85rem; border-left: 1px solid #e5edf2; }
.settings-toggle-row { display: flex !important; align-items: flex-start; gap: .65rem; padding: .75rem; border: 1px solid #dbe7ed; border-radius: 10px; background: #f8fbfc; }
.settings-toggle-row input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: .08rem; }
.settings-toggle-row span { display: grid; gap: .2rem; }
.settings-toggle-row small { color: #64748b; font-weight: 400; line-height: 1.4; }

@media (max-width: 980px) {
  .dashboard-task-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-task-filter-heading { grid-column: 1 / -1; }
  .task-filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-overview-card-main { grid-template-columns: 1fr; }
  .completed-review-content dl { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .tenant-context-bar { align-items: stretch; flex-direction: column; gap: .3rem; padding: .45rem .7rem; }
  .tenant-context-control { min-width: 0; width: 100%; }
  .tenant-context-menu { position: fixed; top: 5rem; left: .7rem; right: .7rem; width: auto; }
  .dashboard-task-filters, .task-filter-panel { grid-template-columns: 1fr; }
  .dashboard-task-filter-heading { align-items: flex-start; flex-direction: column; gap: .2rem; }
  .task-overview-shell { width: min(100% - 1rem, 1280px); margin-top: .75rem; }
  .task-overview-header { align-items: flex-start; flex-direction: column; }
  .task-overview-card dl div { grid-template-columns: 1fr; gap: .1rem; }
  .completed-review-card { grid-template-columns: auto minmax(0, 1fr); }
  .completed-review-action { grid-column: 1 / -1; padding: .7rem 0 0; border-top: 1px solid #e5edf2; border-left: 0; }
  .overview-review-row { grid-template-columns: auto minmax(0,1fr); }
  .overview-review-row form { grid-column: 2; }
}

@media print {
  .tenant-context-bar, .dashboard-task-filters, .task-filter-panel, .completed-review-action { display: none !important; }
}

/* LEITIO 3.3.1 Revision 1 Fix 4 – responsive Übersicht für Aufgaben-User */
.task-user-overview-page { overflow-x: hidden; }
.task-user-overview-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 1rem auto 2rem;
  min-width: 0;
}
.task-user-overview-header {
  padding: 1rem 1.15rem;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--navy-950), var(--navy-700));
  color: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .16);
  overflow: hidden;
}
.task-user-overview-identity {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-width: 0;
}
.task-user-overview-avatar-link {
  display: inline-flex;
  flex: 0 0 auto;
  border-radius: 999px;
  text-decoration: none;
}
.task-user-overview-avatar-link:focus-visible {
  outline: 3px solid #67e8f9;
  outline-offset: 4px;
}
.task-user-overview-avatar-link .user-avatar {
  width: 52px;
  height: 52px;
  font-size: .9rem;
  box-shadow: 0 0 0 3px rgba(255,255,255,.82);
}
.task-user-overview-welcome { min-width: 0; }
.task-user-overview-welcome p,
.task-user-overview-welcome h1,
.task-user-overview-welcome span { margin: 0; }
.task-user-overview-welcome p {
  color: #a5f3fc;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.task-user-overview-welcome h1 {
  margin: .12rem 0;
  font-size: clamp(1.2rem, 3vw, 1.75rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.task-user-overview-welcome span {
  display: block;
  color: #dbeafe;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.task-user-overview-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin: 1rem 0;
  min-width: 0;
}
.task-user-overview-action {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .7rem;
  min-width: 0;
  min-height: 82px;
  padding: .8rem;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  background: #fff;
  color: var(--navy-950);
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(15, 23, 42, .06);
}
.task-user-overview-action:hover { transform: translateY(-1px); border-color: #67e8f9; }
.task-user-overview-action:focus-visible { outline: 3px solid rgba(8,157,181,.35); outline-offset: 2px; }
.task-user-overview-action div { display: grid; gap: .16rem; min-width: 0; }
.task-user-overview-action strong { line-height: 1.2; overflow-wrap: anywhere; }
.task-user-overview-action small { color: var(--slate-600); line-height: 1.25; overflow-wrap: anywhere; }
.task-user-action-icon,
.task-user-message-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 12px;
  background: #e0f2fe;
  color: var(--navy-800);
  font-weight: 900;
}
.task-user-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  min-width: 0;
}
.task-user-overview-panel { min-width: 0; overflow: hidden; }
.task-user-overview-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
}
.task-user-overview-panel > header > div { min-width: 0; }
.task-user-overview-panel h2,
.task-user-overview-panel p { margin: 0; }
.task-user-overview-panel h2 { line-height: 1.15; overflow-wrap: anywhere; }
.task-user-overview-panel p {
  color: var(--slate-500);
  font-size: .7rem;
  font-weight: 900;
  text-transform: uppercase;
}
.task-user-overview-panel > header > a { flex: 0 0 auto; }
.task-user-overview-list { display: grid; gap: .5rem; min-width: 0; }
.task-user-overview-list > a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .65rem;
  min-width: 0;
  padding: .7rem;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
}
.task-user-overview-list > a div { display: grid; gap: .15rem; min-width: 0; }
.task-user-overview-list strong,
.task-user-overview-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-user-overview-list small { color: var(--slate-600); }
.task-user-overview-empty { padding: 1rem; color: var(--slate-600); text-align: center; }
.priority-dot { width: 10px; height: 32px; border-radius: 999px; background: #f59e0b; }
.priority-dot.priority-high { background: #dc2626; }
.priority-dot.priority-low { background: #65a30d; }

@media (max-width: 900px) {
  .task-user-overview-shell { width: min(100% - 1.5rem, 760px); }
  .task-user-overview-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-user-overview-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .task-user-overview-shell { width: calc(100% - 1rem); margin: .5rem auto 1.25rem; }
  .task-user-overview-header { padding: .85rem; border-radius: 15px; }
  .task-user-overview-identity { align-items: center; gap: .7rem; }
  .task-user-overview-avatar-link .user-avatar { width: 44px; height: 44px; font-size: .78rem; }
  .task-user-overview-welcome h1 { font-size: 1.18rem; }
  .task-user-overview-welcome span { font-size: .82rem; }
  .task-user-overview-actions { grid-template-columns: 1fr; gap: .6rem; margin: .75rem 0; }
  .task-user-overview-action { min-height: 70px; padding: .7rem .75rem; }
  .task-user-action-icon, .task-user-message-avatar { width: 38px; height: 38px; flex-basis: 38px; border-radius: 10px; }
  .task-user-overview-panel { padding: .85rem; }
  .task-user-overview-panel > header { align-items: center; }
  .task-user-overview-panel h2 { font-size: 1.18rem; }
  .task-user-overview-list > a { padding: .65rem; }
}

@media (max-width: 380px) {
  .task-user-overview-welcome span { display: none; }
  .task-user-overview-panel > header { align-items: flex-start; flex-direction: column; gap: .3rem; }
}
.task-user-read-state, .task-read-receipt { display: inline-flex; align-items: center; gap: .25rem; width: fit-content; padding: .2rem .48rem; border-radius: 999px; font-size: .68rem; font-weight: 900; }
.task-user-read-state.is-unread, .task-read-receipt.is-unread { background: #f1f5f9; color: #64748b; }
.task-user-read-state.is-read, .task-read-receipt.is-read { background: #dcfce7; color: #166534; }
.task-user-read-state { margin-bottom: .55rem; }

/* LEITIO 3.3.2 – manuelle Aufgabenweitergaben */
.task-reassignment-dialog { width: min(94vw, 620px); }
.task-reassignment-dialog .notice { margin: 0; }
.overview-handoff-list,
.task-handoff-history-list { display: grid; gap: .65rem; }
.overview-handoff-row,
.task-handoff-history-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: start;
  padding: .75rem 0;
  border-bottom: 1px solid var(--slate-200);
}
.overview-handoff-row:last-child,
.task-handoff-history-row:last-child { border-bottom: 0; }
.overview-handoff-row time,
.task-handoff-history-time { color: var(--slate-500); font-size: .78rem; white-space: nowrap; }
.overview-handoff-row > div,
.task-handoff-history-main { min-width: 0; display: grid; gap: .15rem; }
.overview-handoff-row strong,
.task-handoff-history-main strong { overflow-wrap: anywhere; }
.overview-handoff-row span,
.overview-handoff-row small,
.task-handoff-history-main span,
.task-handoff-history-main small { color: var(--slate-600); }
.overview-handoff-delete {
  border: 0;
  background: transparent;
  color: #b91c1c;
  font-size: 1.35rem;
  cursor: pointer;
  line-height: 1;
  padding: .2rem .35rem;
}
.task-handoff-history-time { display: grid; gap: .1rem; }
.task-handoff-history-time strong { color: var(--navy-900); }
@media (max-width: 640px) {
  .overview-handoff-row,
  .task-handoff-history-row { grid-template-columns: minmax(0, 1fr) auto; }
  .overview-handoff-row time,
  .task-handoff-history-time { grid-column: 1 / -1; }
}
.support-message-actions { display: flex; justify-content: flex-end; margin-top: .65rem; padding-top: .5rem; border-top: 1px solid rgba(148, 163, 184, .25); }

/* LEITIO 3.3.3: Fortschritt der heutigen Aufgaben in der TV-Ansicht. */
.tv-progress-subheader { align-items: center; flex-wrap: wrap; }
.tv-completion-progress { min-width: min(420px, 100%); display: grid; grid-template-columns: auto minmax(140px, 1fr) auto; align-items: center; gap: .75rem; padding: .45rem .65rem; border: 1px solid #b9dce5; border-radius: 12px; background: #fff; box-shadow: 0 6px 18px rgba(6, 45, 86, .08); }
.tv-completion-copy { display: grid; line-height: 1.15; }
.tv-completion-copy span { color: var(--slate-600); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.tv-completion-copy strong { color: var(--navy-950); font-size: .9rem; }
.tv-completion-bar { height: 12px; overflow: hidden; border-radius: 999px; background: #dfeaf0; }
.tv-completion-bar > span { display: block; width: var(--tv-progress); height: 100%; border-radius: inherit; background: linear-gradient(90deg, #079db6, #17b89f); transition: width .35s ease; }
.tv-completion-progress > b { min-width: 3.4rem; color: var(--navy-950); font-size: 1.25rem; text-align: right; }
@media (max-width: 760px) {
  .tv-completion-progress { min-width: 100%; grid-template-columns: 1fr auto; }
  .tv-completion-bar { grid-column: 1 / -1; grid-row: 2; }
}

/* LEITIO 3.3.3: motivierendes Feedback nach eigener Aufgabenerledigung. */
.task-completion-feedback-dialog { width: min(92vw, 520px); max-width: 520px; padding: 0; border: 0; border-radius: 24px; overflow: visible; background: transparent; }
.task-completion-feedback-dialog::backdrop { background: rgba(3, 20, 45, .72); backdrop-filter: blur(4px); }
.task-completion-feedback-card { position: relative; overflow: hidden; display: grid; justify-items: center; gap: .7rem; padding: clamp(1.5rem, 6vw, 2.5rem); border: 1px solid rgba(255,255,255,.65); border-radius: 24px; background: linear-gradient(145deg, #ffffff, #eefbfc); box-shadow: 0 26px 70px rgba(3, 31, 67, .34); text-align: center; }
.task-completion-feedback-icon { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, #079db6, #17b89f); color: #fff; font-size: 2.5rem; font-weight: 900; box-shadow: 0 14px 32px rgba(7,157,182,.28); }
.task-completion-feedback-kicker { margin: 0; color: #087e92; font-size: .76rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.task-completion-feedback-card h2 { margin: 0; color: var(--navy-950); font-size: clamp(1.55rem, 6vw, 2.15rem); }
.task-completion-feedback-card > p:not(.task-completion-feedback-kicker) { margin: 0; color: var(--slate-600); font-size: 1rem; line-height: 1.5; }
.task-completion-feedback-progress { width: 100%; height: 12px; margin-top: .35rem; overflow: hidden; border-radius: 999px; background: #dfeaf0; }
.task-completion-feedback-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #079db6, #17b89f); transition: width .45s ease; }
.task-completion-feedback-percent { color: var(--navy-800); font-size: .88rem; }
.task-completion-feedback-card .btn { width: 100%; margin-top: .25rem; }
.task-completion-confetti { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.task-completion-confetti i { position: absolute; top: -12%; width: 9px; height: 18px; border-radius: 3px; background: #079db6; }
.task-completion-confetti i:nth-child(1) { left: 8%; transform: rotate(18deg); }
.task-completion-confetti i:nth-child(2) { left: 21%; background: #fbbf24; transform: rotate(-24deg); }
.task-completion-confetti i:nth-child(3) { left: 35%; background: #17b89f; transform: rotate(38deg); }
.task-completion-confetti i:nth-child(4) { left: 48%; background: #ef4444; transform: rotate(-12deg); }
.task-completion-confetti i:nth-child(5) { left: 61%; background: #8b5cf6; transform: rotate(26deg); }
.task-completion-confetti i:nth-child(6) { left: 73%; background: #f59e0b; transform: rotate(-36deg); }
.task-completion-confetti i:nth-child(7) { left: 85%; background: #06b6d4; transform: rotate(14deg); }
.task-completion-confetti i:nth-child(8) { left: 94%; background: #84cc16; transform: rotate(-20deg); }
.task-completion-feedback-dialog.has-celebration .task-completion-confetti { opacity: 1; }
.task-completion-feedback-dialog.has-celebration .task-completion-confetti i { animation: task-completion-confetti-fall 1.8s ease-out infinite; animation-delay: calc(var(--delay, 0) * 1s); }
.task-completion-feedback-dialog.has-celebration .task-completion-confetti i:nth-child(2) { animation-delay: .12s; }
.task-completion-feedback-dialog.has-celebration .task-completion-confetti i:nth-child(3) { animation-delay: .24s; }
.task-completion-feedback-dialog.has-celebration .task-completion-confetti i:nth-child(4) { animation-delay: .36s; }
.task-completion-feedback-dialog.has-celebration .task-completion-confetti i:nth-child(5) { animation-delay: .48s; }
.task-completion-feedback-dialog.has-celebration .task-completion-confetti i:nth-child(6) { animation-delay: .6s; }
.task-completion-feedback-dialog.has-celebration .task-completion-confetti i:nth-child(7) { animation-delay: .72s; }
.task-completion-feedback-dialog.has-celebration .task-completion-confetti i:nth-child(8) { animation-delay: .84s; }
.task-completion-feedback-dialog.is-all-done .task-completion-feedback-icon { animation: task-completion-pulse .9s ease-out both; }
@keyframes task-completion-confetti-fall { 0% { translate: 0 -10px; opacity: 0; } 15% { opacity: 1; } 100% { translate: 0 560px; rotate: 220deg; opacity: 0; } }
@keyframes task-completion-pulse { 0% { scale: .7; } 55% { scale: 1.12; } 100% { scale: 1; } }
@media (prefers-reduced-motion: reduce) {
  .task-completion-feedback-dialog.has-celebration .task-completion-confetti i,
  .task-completion-feedback-dialog.is-all-done .task-completion-feedback-icon { animation: none; }
}

/* LEITIO 3.3.4 Revision 1 Fix 2 – vollständige Headerlogos und unverdeckte Navigationstitel */
.topbar {
  z-index: 120;
  overflow: visible;
}
.topbar-identities,
.topbar-actions,
.topnav {
  overflow: visible;
}
.topbar-identities { min-height: 54px; }
.tenant-logo-frame {
  width: 132px;
  height: 52px;
  min-width: 0;
  overflow: hidden;
  padding: .22rem .38rem;
  line-height: 0;
}
.tenant-logo-frame .tenant-logo-image {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
}
.topnav .nav-action::after {
  z-index: 300;
  top: calc(100% + .38rem);
}
.tenant-context-bar { z-index: 90; }

@media (max-width: 1160px) {
  .topbar-actions,
  .topnav { overflow: visible; }
}

@media (max-width: 820px) {
  .tenant-logo-frame { width: 88px; height: 44px; padding: .2rem .3rem; }
}

@media (max-width: 760px) {
  .topbar-actions { overflow: hidden; }
  .topnav { overflow-x: auto; overflow-y: hidden; }
}

@media (max-width: 620px) {
  .tenant-logo-frame { width: 72px; height: 42px; padding: .18rem .25rem; }
}


/* LEITIO 3.3.4 Revision 1 Fix 3 – natürliche Headerlogo-Breite und Konto-Zuordnungen */
.tenant-brand { flex: 0 1 auto; }
.tenant-logo-frame {
  width: auto;
  min-width: 54px;
  max-width: min(260px, 26vw);
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  overflow: visible;
  padding: .22rem .48rem;
}
.tenant-logo-frame .tenant-logo-image {
  display: block;
  width: auto !important;
  height: 100% !important;
  max-width: min(244px, 24vw) !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  flex: 0 1 auto;
}

.user-account-admin-page { max-width: 1180px; }
.user-account-summary dl {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .8rem;
  margin: 0;
}
.user-account-summary dl > div {
  min-width: 0;
  padding: .75rem;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  background: #f8fafc;
}
.user-account-summary dt { color: var(--slate-500); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.user-account-summary dd { margin: .25rem 0 0; overflow-wrap: anywhere; color: var(--navy-950); font-weight: 800; }
.user-account-assignment-form { gap: 1rem; }
.assignment-section { display: grid; gap: 1rem; }
.assignment-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.assignment-section-heading h2 { margin: .1rem 0 .25rem; color: var(--navy-950); }
.assignment-section-heading p { margin: 0; color: var(--slate-600); }
.assignment-search { display: grid; gap: .35rem; max-width: 460px; color: var(--navy-900); font-weight: 800; }
.assignment-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .65rem;
  max-height: 430px;
  overflow: auto;
  padding: .2rem;
}
.assignment-checkbox {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .8rem .85rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.assignment-checkbox:hover { border-color: var(--leitio-cyan-600); box-shadow: 0 5px 16px rgba(3, 29, 61, .08); }
.assignment-checkbox:has(input:checked) { border-color: var(--leitio-cyan-600); background: #effcfd; box-shadow: inset 0 0 0 1px rgba(8, 165, 181, .16); }
.assignment-checkbox input { width: 19px; height: 19px; flex: 0 0 auto; margin: .12rem 0 0; accent-color: var(--leitio-cyan-700); }
.assignment-checkbox span { min-width: 0; display: grid; gap: .18rem; }
.assignment-checkbox strong { overflow-wrap: anywhere; color: var(--navy-950); }
.assignment-checkbox small { color: var(--slate-600); line-height: 1.35; }
.assignment-checkbox.is-home { border-color: #8bcbd3; background: #f0fbfc; cursor: default; }
.assignment-checkbox.is-disabled { opacity: .55; cursor: not-allowed; }
.assignment-empty { grid-column: 1 / -1; margin: .4rem 0; color: var(--slate-500); text-align: center; }
.sticky-form-actions { position: sticky; bottom: .7rem; z-index: 10; display: flex; gap: .6rem; padding: .75rem; border: 1px solid rgba(148,163,184,.4); border-radius: 14px; background: rgba(255,255,255,.96); box-shadow: 0 12px 28px rgba(3,29,61,.14); backdrop-filter: blur(8px); }

@media (max-width: 1050px) {
  .tenant-logo-frame { max-width: min(210px, 24vw); }
  .tenant-logo-frame .tenant-logo-image { max-width: min(194px, 22vw) !important; }
  .user-account-summary dl { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .tenant-logo-frame { width: auto; min-width: 48px; max-width: 150px; height: 46px; padding: .18rem .32rem; }
  .tenant-logo-frame .tenant-logo-image { max-width: 138px !important; }
  .user-account-summary dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .assignment-checkbox-grid { grid-template-columns: 1fr; max-height: none; }
}
@media (max-width: 620px) {
  .tenant-logo-frame { width: auto; min-width: 44px; max-width: 112px; height: 42px; padding: .16rem .26rem; }
  .tenant-logo-frame .tenant-logo-image { max-width: 100px !important; }
  .user-account-summary dl { grid-template-columns: 1fr; }
  .assignment-section-heading { display: grid; }
  .sticky-form-actions { flex-direction: column; }
  .sticky-form-actions .btn { width: 100%; }
}

/* LEITIO 3.3.5 Revision 1 – Maschinenbilder, Symbolaktionen und fortlaufende Stammdatensortierung */
.masterdata-icon-toggle {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: .45rem;
  min-width: 0;
  min-height: 38px;
  padding: .18rem .3rem;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  color: var(--slate-600);
  font-size: .72rem;
  font-weight: 800;
}
.masterdata-icon-toggle:hover { border-color: var(--slate-300); background: #f8fafc; }
.masterdata-icon-toggle > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.masterdata-icon-toggle > input:focus-visible + .masterdata-icon-box { outline: 3px solid rgba(6, 182, 212, .3); outline-offset: 2px; }
.masterdata-icon-box,
.masterdata-symbol-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--slate-300);
  border-radius: 9px;
  background: #fff;
  color: var(--slate-500);
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}
.masterdata-icon-box svg,
.masterdata-symbol-icon svg { width: 18px; height: 18px; fill: currentColor; }
.masterdata-icon-toggle > input:checked + .masterdata-icon-box {
  border-color: #0ea5b7;
  background: linear-gradient(145deg, #0ea5b7, #087aa0);
  color: #fff;
  box-shadow: 0 5px 12px rgba(8, 122, 160, .2);
}
.masterdata-icon-toggle > input:disabled + .masterdata-icon-box { opacity: .5; }
.masterdata-icon-toggle > input:disabled ~ .masterdata-icon-label { opacity: .55; }
.masterdata-icon-label { min-width: 0; overflow-wrap: anywhere; }
.masterdata-icon-toggle.autosave-toggle small {
  position: absolute;
  left: 42px;
  top: calc(100% - 5px);
  color: var(--success);
  font-size: .58rem;
  white-space: nowrap;
}
.masterdata-symbol-action {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: .45rem;
  width: 100%;
  min-height: 38px;
  padding: .18rem .3rem;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--slate-600);
  font: inherit;
  font-size: .72rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.masterdata-symbol-action:hover { border-color: var(--slate-300); background: #f8fafc; color: var(--navy-900); }
.masterdata-symbol-action:hover .masterdata-symbol-icon { border-color: var(--navy-700); transform: translateY(-1px); }
.masterdata-symbol-action.danger { color: #b91c1c; }
.masterdata-symbol-action.danger .masterdata-symbol-icon { color: #dc2626; border-color: #fecaca; background: #fff7f7; }
.masterdata-symbol-action.danger:hover { border-color: #fecaca; background: #fff7f7; }
.masterdata-status-actions,
.machine-masterdata-actions { display: grid; align-content: center; gap: .16rem; min-width: 150px; }
.masterdata-status-actions .masterdata-delete-form,
.machine-masterdata-actions .masterdata-delete-form { width: 100%; }

.employee-masterdata-row { grid-template-columns: minmax(130px,1fr) minmax(130px,1fr) minmax(150px,1fr) 82px minmax(150px,.65fr) minmax(200px,auto); }
.area-masterdata-row { grid-template-columns: minmax(180px,1fr) 82px minmax(150px,.72fr) auto; }
.priority-masterdata-row { grid-template-columns: minmax(160px,1.2fr) minmax(120px,.8fr) 82px 90px minmax(150px,.72fr); }

.machine-masterdata-list { gap: .75rem; }
.machine-masterdata-card {
  display: grid;
  grid-template-columns: 190px minmax(280px, 1fr) 86px minmax(165px, .45fr);
  align-items: stretch;
  gap: .85rem;
  padding: .85rem;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(15, 23, 42, .05);
}
.machine-masterdata-card:target { border-color: #0ea5b7; box-shadow: 0 0 0 3px rgba(14,165,183,.14); }
.machine-masterdata-card.masterdata-add-row { margin-top: .8rem; border-style: dashed; background: #f8fafc; }
.machine-image-column { display: grid; align-content: start; gap: .42rem; min-width: 0; }
.machine-image-frame {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  background: linear-gradient(145deg, #f8fafc, #eaf2f7);
}
.machine-image-frame img { width: 100%; height: 100%; object-fit: contain; background: #f8fafc; }
.machine-image-placeholder { display: grid; place-items: center; gap: .35rem; padding: .65rem; color: var(--slate-500); text-align: center; font-size: .68rem; font-weight: 800; }
.machine-image-placeholder svg { width: 58px; height: 44px; fill: #94a3b8; }
.machine-image-credit { display: block; overflow-wrap: anywhere; color: var(--slate-500); font-size: .58rem; line-height: 1.35; }
.machine-image-credit a { color: #0e7490; }
.machine-image-controls { display: grid; gap: .12rem; }
.machine-image-controls form { margin: 0; }
.machine-image-upload-form input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.machine-masterdata-fields { display: grid; align-content: center; gap: .75rem; min-width: 0; }
.machine-sort-field { align-self: center; }
.machine-masterdata-actions { align-self: center; }
.machine-masterdata-actions .btn { width: 100%; margin-top: .2rem; }

@media (max-width: 1180px) {
  .machine-masterdata-card { grid-template-columns: 170px minmax(240px, 1fr) 82px minmax(155px, .55fr); }
  .employee-masterdata-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .employee-masterdata-row .masterdata-status-actions,
  .employee-masterdata-row .masterdata-row-actions { grid-column: span 1; }
}
@media (max-width: 900px) {
  .machine-masterdata-card { grid-template-columns: 155px minmax(0,1fr) minmax(155px,.55fr); }
  .machine-sort-field { grid-column: 2; }
  .machine-masterdata-actions { grid-column: 3; grid-row: 1 / span 2; }
  .area-masterdata-row,
  .priority-masterdata-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .machine-masterdata-card { grid-template-columns: 1fr; }
  .machine-image-column { grid-template-columns: 120px minmax(0,1fr); align-items: start; }
  .machine-image-frame { grid-row: 1 / span 2; }
  .machine-image-credit { grid-column: 2; }
  .machine-image-controls { grid-column: 2; }
  .machine-sort-field,
  .machine-masterdata-actions { grid-column: auto; grid-row: auto; }
  .machine-masterdata-actions,
  .masterdata-status-actions { min-width: 0; }
  .employee-masterdata-row,
  .area-masterdata-row,
  .priority-masterdata-row { grid-template-columns: 1fr; }
  .employee-masterdata-row .masterdata-status-actions,
  .employee-masterdata-row .masterdata-row-actions { grid-column: auto; }
}
@media (max-width: 430px) {
  .machine-image-column { grid-template-columns: 1fr; }
  .machine-image-frame { grid-row: auto; max-width: 220px; }
  .machine-image-credit,
  .machine-image-controls { grid-column: auto; }
}

/* LEITIO 4.0 Revision 1 – Flow */
.flow-page { background: #e9eef5; }
.flow-page .page-container { width: min(1900px, calc(100% - 1.25rem)); margin-top: .75rem; }
.flow-shell { --flow-accent: #0e7490; --flow-cyan: #06b6d4; --flow-ink: #10233f; display: grid; gap: .85rem; }
.flow-shell.is-saving { cursor: progress; opacity: .86; }
.flow-hero { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; padding: 1.15rem 1.35rem; border-radius: 20px; color: #fff; background: radial-gradient(circle at 84% 12%, rgba(34,211,238,.25), transparent 28%), linear-gradient(125deg, #071a36 0%, #0b315a 56%, #08788b 100%); box-shadow: 0 18px 45px rgba(7,26,54,.2); }
.flow-hero-copy { min-width: 0; }
.flow-kicker { display: inline-block; color: #67e8f9; font-size: .72rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.flow-hero h1 { margin: .1rem 0; font-size: clamp(1.8rem,3vw,3rem); letter-spacing: -.05em; }
.flow-hero p { margin: 0; color: #dbeafe; font-weight: 600; }
.flow-hero-actions { display: flex; gap: .55rem; flex-wrap: wrap; justify-content: flex-end; }
.flow-hero-actions .btn { background: rgba(255,255,255,.96); }
.flow-smart-button { border-color: rgba(103,232,249,.65); color: #0c4a6e; }
.flow-smart-button span { color: #0891b2; font-size: 1.1rem; }

.flow-control-deck { display: flex; align-items: end; justify-content: space-between; gap: .8rem; padding: .7rem .85rem; border: 1px solid #d9e3ef; border-radius: 15px; background: rgba(255,255,255,.9); box-shadow: 0 5px 18px rgba(15,23,42,.05); }
.flow-date-control { display: flex; align-items: center; gap: .45rem; }
.flow-date-arrow { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: var(--flow-ink); font-size: 1.45rem; font-weight: 800; }
.flow-date-form label, .flow-area-filter label { display: flex; align-items: center; gap: .55rem; }
.flow-date-form label > span, .flow-area-filter label > span { color: #64748b; font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.flow-date-form input { width: auto; padding: .48rem .65rem; }
.flow-area-filter select { min-width: 190px; padding: .5rem .65rem; }
.flow-today-link { padding: .45rem .65rem; border-radius: 9px; color: #0e7490; font-weight: 850; }

.flow-empty-onboarding { display: flex; align-items: center; gap: 1rem; }
.flow-empty-onboarding > div:nth-child(2) { flex: 1; }
.flow-empty-onboarding h2, .flow-empty-onboarding p { margin: .15rem 0; }
.flow-empty-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: #cffafe; color: #0e7490; font-size: 1.7rem; }

.flow-shift-tabs { display: flex; gap: .5rem; overflow-x: auto; padding: .15rem 0; }
.flow-shift-tab { min-width: 145px; display: grid; gap: .1rem; padding: .7rem .9rem; border: 1px solid #cbd5e1; border-radius: 13px; background: #fff; box-shadow: 0 3px 10px rgba(15,23,42,.04); }
.flow-shift-tab strong { color: #1e3a5f; }
.flow-shift-tab small { font-size: .72rem; }
.flow-shift-tab.is-active { border-color: #0891b2; background: linear-gradient(135deg,#ecfeff,#fff); box-shadow: 0 0 0 2px rgba(6,182,212,.12); }

.flow-status-strip { display: grid; grid-template-columns: minmax(150px,1.25fr) repeat(5,minmax(82px,.55fr)) auto; gap: .5rem; align-items: stretch; }
.flow-plan-state, .flow-stat { display: flex; align-items: center; justify-content: center; gap: .65rem; min-height: 58px; padding: .65rem .75rem; border: 1px solid #dbe3ed; border-radius: 13px; background: #fff; text-align: center; }
.flow-plan-state { justify-content: flex-start; text-align: left; }
.flow-plan-state div { display: grid; }
.flow-state-dot { width: 11px; height: 11px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 5px rgba(245,158,11,.13); }
.flow-plan-state.is-released .flow-state-dot { background: #16a34a; box-shadow: 0 0 0 5px rgba(22,163,74,.13); }
.flow-stat { display: grid; gap: 0; }
.flow-stat strong { font-size: 1.25rem; color: #10233f; }
.flow-stat span { color: #64748b; font-size: .68rem; font-weight: 850; text-transform: uppercase; }
.flow-stat.has-warning { border-color: #fcd34d; background: #fffbeb; }
.flow-stat.has-danger { border-color: #fca5a5; background: #fef2f2; }
.flow-release-button { min-width: 175px; }
.btn-warning { border-color: #f59e0b; background: #fffbeb; color: #92400e; }

.flow-mode-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .5rem; }
.flow-mode-tab { display: flex; align-items: center; gap: .55rem; padding: .65rem .8rem; border: 1px solid #d7e0ea; border-radius: 13px; background: #fff; color: #475569; font-weight: 850; }
.flow-mode-number { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; background: #e2e8f0; color: #334155; font-size: .72rem; }
.flow-mode-tab.is-active { border-color: #0891b2; color: #0e7490; background: #ecfeff; }
.flow-mode-tab.is-active .flow-mode-number { background: #0891b2; color: #fff; }

.flow-roster-board { display: grid; grid-template-columns: repeat(auto-fit,minmax(250px,1fr)); gap: .75rem; align-items: start; }
.flow-roster-lane, .flow-pool-panel, .flow-insight-panel { min-width: 0; border: 1px solid #d8e1ec; border-radius: 16px; background: rgba(255,255,255,.96); box-shadow: 0 8px 24px rgba(15,23,42,.055); overflow: hidden; }
.flow-roster-lane > header, .flow-pool-panel > header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .8rem .9rem; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.flow-roster-lane > header > div, .flow-pool-panel > header > div { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.flow-roster-lane h2, .flow-pool-panel h2 { margin: 0; color: #10233f; font-size: .93rem; }
.flow-roster-lane header p, .flow-pool-panel header p { margin: .08rem 0 0; color: #64748b; font-size: .68rem; }
.flow-lane-symbol, .flow-panel-icon { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px; background: #e0f2fe; color: #0369a1; font-weight: 900; }
.flow-roster-lane.is-selected { border-color: #22d3ee; box-shadow: 0 0 0 2px rgba(34,211,238,.12); }
.flow-absence-lane > header { background: #fff7ed; }
.flow-absence-lane .flow-lane-symbol { background: #ffedd5; color: #c2410c; }
.flow-count { min-width: 26px; padding: .25rem .42rem; border-radius: 999px; background: #e2e8f0; color: #334155; text-align: center; font-size: .72rem; font-weight: 900; }
.flow-person-stack, .flow-task-stack { display: grid; gap: .48rem; padding: .65rem; min-height: 74px; }
.flow-person-card { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .55rem; min-width: 0; padding: .55rem .6rem; border: 1px solid #d8e1ec; border-radius: 12px; background: #fff; box-shadow: 0 2px 8px rgba(15,23,42,.035); cursor: grab; touch-action: manipulation; }
.flow-person-card:hover, .flow-person-card:focus-visible { border-color: #67e8f9; box-shadow: 0 0 0 2px rgba(34,211,238,.12); outline: 0; }
.flow-person-card.is-absent { background: #fff7ed; border-color: #fed7aa; }
.flow-person-copy { display: grid; min-width: 0; }
.flow-person-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-person-copy strong { color: #17324f; font-size: .82rem; }
.flow-person-title { display: flex; align-items: center; min-width: 0; gap: .35rem; white-space: nowrap; overflow: visible; }
.flow-person-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-person-copy small { font-size: .66rem; }
.flow-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; overflow: hidden; border-radius: 12px; background: linear-gradient(135deg,#0e7490,#164e63); color: #fff; font-size: .72rem; font-weight: 900; }
.flow-avatar img { width: 100%; height: 100%; object-fit: cover; }
.flow-avatar-small { width: 27px; height: 27px; border-radius: 8px; font-size: .6rem; }
.flow-drag-handle { color: #94a3b8; font-weight: 900; }
.flow-card-action { display: grid; place-items: center; width: 27px; height: 27px; padding: 0; border: 1px solid #fdba74; border-radius: 8px; background: #fff; color: #c2410c; }
.flow-empty-drop { margin: 0; padding: .9rem .45rem; border: 1px dashed #cbd5e1; border-radius: 11px; color: #94a3b8; text-align: center; font-size: .72rem; font-weight: 700; }

.flow-workspace { display: grid; gap: .75rem; align-items: start; }
.flow-workspace-staffing { grid-template-columns: minmax(225px,.68fr) minmax(0,2.5fr) minmax(190px,.55fr); }
.flow-workspace-tasks { grid-template-columns: minmax(0,2.5fr) minmax(260px,.72fr); }
.flow-pool-panel { position: sticky; top: 78px; max-height: calc(100vh - 100px); overflow: auto; }
.flow-search { padding: .6rem .65rem 0; }
.flow-search input { padding: .52rem .65rem; font-size: .78rem; }
.flow-absence-summary { margin: .35rem .65rem .7rem; padding: .5rem .6rem; border-radius: 10px; background: #fff7ed; color: #9a3412; font-size: .7rem; }
.flow-absence-summary p { margin: .35rem 0; }
.flow-machine-board { position: relative; display: grid; grid-template-columns: repeat(auto-fit,minmax(310px,1fr)); align-items: start; gap: .7rem; min-width: 0; padding-bottom: var(--flow-machine-expanded-bottom-space, 0px); transition: padding-bottom .14s ease; }

/* Fix 4K: future Flow tasks stay visible before staffing exists. */
.flow-unstaffed-task-planning { display: grid; grid-template-columns: minmax(280px,.72fr) minmax(340px,1.28fr); align-items: start; gap: .85rem; }
.flow-open-tasks-alert { display: grid; grid-template-columns: auto minmax(0,1fr); gap: .8rem; align-items: start; padding: 1rem 1.05rem; border: 1px solid #bbf7d0; border-radius: 17px; background: #f0fdf4; color: #166534; box-shadow: 0 10px 28px rgba(15,23,42,.05); }
.flow-open-tasks-alert.has-open-tasks { border-color: #fecaca; background: linear-gradient(135deg,#fff1f2,#fff7f7); color: #991b1b; box-shadow: 0 12px 30px rgba(185,28,28,.10); }
.flow-open-tasks-alert h2 { margin: .1rem 0 .35rem; color: inherit; font-size: 1rem; }
.flow-open-tasks-alert h2 strong { display: inline-grid; place-items: center; min-width: 1.75rem; height: 1.75rem; margin-left: .35rem; padding: 0 .45rem; border-radius: 999px; background: rgba(255,255,255,.82); color: inherit; }
.flow-open-tasks-alert p { margin: 0; color: inherit; font-size: .73rem; line-height: 1.5; opacity: .88; }
.flow-open-tasks-icon { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 12px; background: rgba(255,255,255,.86); font-size: 1.1rem; font-weight: 950; box-shadow: inset 0 0 0 1px rgba(15,23,42,.05); }
.flow-task-pool-unstaffed { position: relative; top: auto; min-height: 230px; }
.flow-count.has-open-tasks { background: #dc2626; color: #fff; box-shadow: 0 0 0 4px rgba(220,38,38,.10); }
.flow-stat.has-danger { border-color: #fecaca; background: #fff1f2; color: #991b1b; }
.flow-stat.has-danger strong, .flow-stat.has-danger span { color: inherit; }
@media (max-width: 900px) { .flow-unstaffed-task-planning { grid-template-columns: 1fr; } }
.flow-machine-card, .flow-live-card { min-width: 0; overflow: hidden; border: 1px solid #d7e1ec; border-radius: 17px; background: #fff; box-shadow: 0 8px 24px rgba(15,23,42,.055); }
.flow-machine-card { position: relative; overflow: visible; z-index: 1; }
.flow-machine-card.is-expanded, .flow-machine-card.is-drag-target { z-index: 40; }
.flow-machine-card.is-unstaffed { border-color: #fbbf24; }
.flow-machine-header { display: grid; grid-template-columns: 78px minmax(0,1fr) auto; align-items: center; gap: .75rem; min-height: 76px; padding: .65rem .75rem; background: linear-gradient(135deg,#f8fafc,#eff6ff); border-radius: 16px; cursor: pointer; user-select: none; }
.flow-machine-header:focus-visible { outline: 3px solid rgba(6,182,212,.28); outline-offset: 2px; }
.flow-machine-card.is-expanded .flow-machine-header, .flow-machine-card.is-drag-target .flow-machine-header { border-radius: 16px 16px 0 0; }
.flow-machine-expandable { position: absolute; top: calc(100% - 1px); left: -1px; right: -1px; display: none; overflow: hidden; border: 1px solid #d7e1ec; border-top: 1px solid #e2e8f0; border-radius: 0 0 17px 17px; background: #fff; box-shadow: 0 22px 34px rgba(15,23,42,.16); }
.flow-machine-card.is-expanded .flow-machine-expandable, .flow-machine-card.is-drag-target .flow-machine-expandable { display: block; }
.flow-machine-card.is-unstaffed .flow-machine-expandable { border-color: #fbbf24; }
.flow-machine-card.is-blocked .flow-machine-expandable { border-color: #ef4444; background: #fff7f7; }
.flow-machine-image { display: grid; place-items: center; width: 78px; height: 56px; overflow: hidden; border: 1px solid #d8e1eb; border-radius: 11px; background: #fff; color: #94a3b8; font-size: 1.6rem; }
.flow-machine-image img { width: 100%; height: 100%; object-fit: contain; }
.flow-machine-copy { min-width: 0; }
.flow-machine-copy h2 { margin: 0; overflow: hidden; color: #10233f; font-size: .96rem; text-overflow: ellipsis; white-space: nowrap; }
.flow-machine-copy p { margin: .16rem 0 0; overflow: hidden; color: #64748b; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.flow-machine-signal { width: 10px; height: 10px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 5px rgba(245,158,11,.12); }
.flow-machine-signal.is-ready { background: #16a34a; box-shadow: 0 0 0 5px rgba(22,163,74,.12); }
.flow-machine-section { display: grid; gap: .48rem; padding: .65rem .75rem; border-top: 1px solid #f1f5f9; }
.flow-machine-section > header { display: flex; align-items: center; justify-content: space-between; color: #334155; font-size: .72rem; }
.flow-machine-section > header span { color: #94a3b8; font-weight: 900; }
.flow-capacity-line { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: -.08rem 0 .05rem; padding: .42rem .5rem; border-radius: 9px; background: #f8fafc; color: #475569; font-size: .65rem; }
.flow-capacity-line strong { color: #0f4c5c; font-size: .67rem; }
.flow-capacity-line.is-unknown { display: grid; gap: .16rem; background: #fff7ed; color: #9a3412; }
.flow-capacity-line.is-unknown strong { color: #9a3412; }

.flow-machine-people { display: flex; flex-wrap: wrap; gap: .38rem; min-height: 41px; align-items: center; }
.flow-person-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .26rem .4rem .26rem .26rem; border: 1px solid #bae6fd; border-radius: 10px; background: #f0f9ff; color: #075985; font-size: .7rem; font-weight: 900; cursor: grab; }
.flow-machine-people.is-compact { min-height: 32px; }
.flow-muted { color: #94a3b8; font-size: .72rem; }
.flow-suggestions { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; padding: .5rem .75rem .65rem; color: #64748b; font-size: .65rem; }
.flow-suggestions button { width: 28px; height: 28px; padding: 0; border: 1px solid #86efac; border-radius: 9px; background: #f0fdf4; color: #166534; font-size: .65rem; font-weight: 900; }
.flow-insight-panel { display: grid; gap: .55rem; padding: .75rem; position: sticky; top: 78px; }
.flow-insight-panel h2 { margin: 0; font-size: .9rem; color: #10233f; }
.flow-insight-panel > p { margin: .2rem 0; color: #64748b; font-size: .7rem; line-height: 1.45; }
.flow-insight { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .5rem; padding: .55rem; border-radius: 11px; background: #fffbeb; color: #92400e; }
.flow-insight strong { font-size: 1.25rem; }
.flow-insight span { font-size: .68rem; font-weight: 750; }
.flow-insight.is-good { background: #f0fdf4; color: #166534; }
.flow-insight.is-danger { background: #fef2f2; color: #991b1b; }

.flow-task-card { display: grid; grid-template-columns: 7px minmax(0,1fr) auto; gap: .55rem; align-items: center; padding: .55rem .6rem; border: 1px solid #dbe3ed; border-radius: 11px; background: #fff; cursor: grab; touch-action: manipulation; }
.flow-task-card:hover, .flow-task-card:focus-visible { border-color: #67e8f9; outline: 0; }
.flow-task-priority { width: 7px; align-self: stretch; min-height: 34px; border-radius: 6px; background: var(--priority-color,#64748b); }
.flow-task-copy { display: grid; min-width: 0; }
.flow-task-copy strong { color: #17324f; font-size: .75rem; }
.flow-task-copy small { overflow: hidden; color: #64748b; font-size: .66rem; text-overflow: ellipsis; white-space: nowrap; }
.flow-task-copy em { color: #0e7490; font-size: .61rem; font-style: normal; }
.flow-task-controls { display: inline-flex; align-items: center; gap: .22rem; }
.flow-task-action { display: inline-grid; place-items: center; width: 1.65rem; height: 1.65rem; padding: 0; border: 1px solid #dbe3ed; border-radius: 8px; background: #f8fafc; color: #334155; font: inherit; font-size: .82rem; font-weight: 800; line-height: 1; cursor: pointer; }
.flow-task-action:hover, .flow-task-action:focus-visible { border-color: #67e8f9; background: #ecfeff; color: #0e7490; outline: 0; }
.flow-task-action.is-danger:hover, .flow-task-action.is-danger:focus-visible { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.flow-task-drop-list { min-height: 100px; }
.flow-task-stack { max-height: calc(100vh - 230px); overflow: auto; }
.flow-task-card.is-static { cursor: default; }

.flow-live-board { display: grid; grid-template-columns: repeat(auto-fit,minmax(390px,1fr)); gap: .75rem; }
.flow-live-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: .45rem; padding: .65rem .75rem; }
.flow-live-summary > div { display: grid; gap: .1rem; padding: .5rem; border-radius: 10px; background: #f8fafc; }
.flow-live-summary span { color: #64748b; font-size: .61rem; font-weight: 800; text-transform: uppercase; }
.flow-live-summary strong { color: #17324f; font-size: .77rem; }
.flow-handover-card { margin: 0 .75rem .65rem; padding: .65rem; border: 1px solid #bae6fd; border-radius: 12px; background: #f0f9ff; }
.flow-handover-card.is-confirmed { border-color: #bbf7d0; background: #f0fdf4; }
.flow-handover-card header { display: flex; justify-content: space-between; gap: .5rem; color: #075985; font-size: .72rem; }
.flow-handover-card header button { padding: .25rem .45rem; border: 0; border-radius: 7px; background: #0891b2; color: #fff; font-size: .62rem; font-weight: 850; }
.flow-handover-card p { margin: .4rem 0 0; color: #334155; font-size: .7rem; line-height: 1.4; }
.flow-handover-card .is-blocker { color: #b91c1c; }
.flow-note-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; padding: .7rem .75rem .8rem; border-top: 1px solid #e2e8f0; }
.flow-note-form label { font-size: .7rem; }
.flow-note-form textarea, .flow-note-form select { padding: .52rem .58rem; font-size: .72rem; }
.flow-full { grid-column: 1 / -1; }

.flow-dialog { width: min(480px,calc(100% - 2rem)); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 30px 80px rgba(15,23,42,.32); }
.flow-dialog::backdrop { background: rgba(7,26,54,.55); backdrop-filter: blur(3px); }
.flow-dialog form { position: relative; display: grid; gap: .85rem; padding: 1.25rem; }
.flow-dialog h2 { margin: 0; color: #10233f; }
.flow-dialog-close { position: absolute; right: .65rem; top: .65rem; width: 32px; height: 32px; border: 0; border-radius: 9px; background: #f1f5f9; }
.flow-dialog-actions { display: flex; justify-content: flex-end; gap: .5rem; }

.flow-drop-zone { transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.flow-drop-zone.is-drag-over, .has-flow-selection .flow-drop-zone:hover { border-color: #06b6d4 !important; background-color: #ecfeff; box-shadow: 0 0 0 3px rgba(6,182,212,.13); }
.is-dragging { opacity: .45; }
.is-flow-selected { border-color: #0891b2 !important; box-shadow: 0 0 0 3px rgba(6,182,212,.2) !important; }
[hidden] { display: none !important; }

.flow-self-shell { max-width: 1300px; margin: 0 auto; }
.flow-self-message { text-align: center; }
.flow-self-message h2 { margin-top: 0; }
.flow-self-message.is-absence { border-color: #fed7aa; background: #fff7ed; }
.flow-self-shift-card { display: grid; grid-template-columns: repeat(2,1fr); gap: .7rem; }
.flow-self-shift-card > div { display: grid; gap: .1rem; padding: .85rem 1rem; border: 1px solid #d7e1ec; border-radius: 14px; background: #fff; }
.flow-self-shift-card span { color: #64748b; font-size: .65rem; font-weight: 900; text-transform: uppercase; }
.flow-self-shift-card strong { color: #10233f; font-size: 1.05rem; }
.flow-self-machines { grid-template-columns: repeat(auto-fit,minmax(330px,1fr)); }

@media (max-width: 1250px) {
  .flow-status-strip { grid-template-columns: repeat(4,minmax(90px,1fr)); }
  .flow-plan-state { grid-column: span 2; }
  .flow-release-button { grid-column: span 2; }
  .flow-workspace-staffing { grid-template-columns: 230px minmax(0,1fr); }
  .flow-insight-panel { position: static; grid-column: 1 / -1; grid-template-columns: auto repeat(2,minmax(0,1fr)); }
  .flow-insight-panel > p { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .flow-hero, .flow-control-deck { align-items: stretch; flex-direction: column; }
  .flow-hero-actions { justify-content: flex-start; }
  .flow-control-deck { display: grid; grid-template-columns: 1fr; }
  .flow-date-control { flex-wrap: wrap; }
  .flow-area-filter select { min-width: 0; }
  .flow-mode-tabs { grid-template-columns: repeat(2,1fr); }
  .flow-workspace-staffing, .flow-workspace-tasks { grid-template-columns: 1fr; }
  .flow-pool-panel { position: static; max-height: none; }
  .flow-task-pool { grid-row: 1; }
  .flow-machine-board { grid-template-columns: repeat(auto-fit,minmax(280px,1fr)); }
}
@media (max-width: 620px) {
  .flow-page .page-container { width: min(100% - .65rem,1900px); margin-top: .35rem; }
  .flow-shell { gap: .55rem; }
  .flow-hero { padding: .9rem; border-radius: 15px; }
  .flow-hero-actions .btn { width: 100%; }
  .flow-status-strip { grid-template-columns: repeat(2,1fr); }
  .flow-plan-state, .flow-release-button { grid-column: span 2; }
  .flow-mode-tabs { gap: .35rem; }
  .flow-mode-tab { padding: .55rem; font-size: .75rem; }
  .flow-roster-board, .flow-machine-board, .flow-live-board { grid-template-columns: 1fr; }
  .flow-machine-header { grid-template-columns: 68px minmax(0,1fr) auto; }
  .flow-machine-image { width: 68px; height: 51px; }
  .flow-note-form { grid-template-columns: 1fr; }
  .flow-full { grid-column: auto; }
  .flow-live-summary { grid-template-columns: 1fr 1fr 1fr; }
  .flow-self-shift-card { grid-template-columns: 1fr; }
}

/* LEITIO 4.1 Revision 1 – Pulse */
.pulse-page {
    --pulse-ink: #082747;
    --pulse-blue: #0b68c7;
    --pulse-cyan: #13a6b8;
    --pulse-mint: #25b685;
    --pulse-amber: #e6a126;
    --pulse-red: #d95050;
    --pulse-soft: #edf6fb;
    --pulse-border: rgba(15, 65, 104, .14);
    background: linear-gradient(180deg, #f5fbff 0, #eef6fb 55%, #f8fbfd 100%);
}
.pulse-shell { width: min(1540px, calc(100% - 40px)); margin: 28px auto 64px; color: var(--pulse-ink); }
.pulse-hero { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; padding: 30px 34px; border: 1px solid rgba(255,255,255,.9); border-radius: 26px; background: radial-gradient(circle at 82% 10%, rgba(36,196,194,.27), transparent 28%), linear-gradient(135deg, #063566 0%, #0b5d9b 55%, #147c8d 100%); color: #fff; box-shadow: 0 24px 70px rgba(9,57,99,.22); }
.pulse-hero h1 { margin: 6px 0 7px; max-width: 820px; color: #fff; font-size: clamp(2rem, 3.2vw, 3.65rem); letter-spacing: -.045em; line-height: 1.02; }
.pulse-hero p { margin: 0; max-width: 760px; color: rgba(255,255,255,.82); font-size: 1.06rem; }
.pulse-kicker { display: inline-flex; align-items: center; gap: 8px; color: #2cc7ce; font-size: .74rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.pulse-hero .pulse-kicker { color: #75edf0; }
.pulse-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.pulse-hero .btn { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.1); color: #fff; }
.pulse-hero .btn-primary { background: #fff; color: #075078; border-color: #fff; }
.pulse-control-deck { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin: 18px 0; padding: 10px; border: 1px solid var(--pulse-border); border-radius: 20px; background: rgba(255,255,255,.86); box-shadow: 0 14px 38px rgba(17,61,93,.08); backdrop-filter: blur(14px); }
.pulse-mode-tabs { display: flex; gap: 7px; flex-wrap: wrap; }
.pulse-mode-tab { padding: 11px 18px; border-radius: 13px; color: #47657d; font-weight: 760; text-decoration: none; transition: .18s ease; }
.pulse-mode-tab:hover { background: #edf7fb; color: var(--pulse-blue); }
.pulse-mode-tab.is-active { background: linear-gradient(135deg, #0b67c7, #1697a5); color: #fff; box-shadow: 0 8px 22px rgba(11,104,199,.22); }
.pulse-date-control { display: flex; align-items: center; gap: 12px; padding: 5px 8px; white-space: nowrap; }
.pulse-date-control a { color: var(--pulse-blue); font-weight: 760; text-decoration: none; }
.pulse-date-arrow { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--pulse-soft); font-size: 1.35rem; }
.pulse-stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.pulse-stat-row > div { padding: 18px 20px; border: 1px solid var(--pulse-border); border-radius: 18px; background: rgba(255,255,255,.88); box-shadow: 0 10px 28px rgba(9,48,80,.07); }
.pulse-stat-row span { display: block; color: #6a8193; font-size: .78rem; font-weight: 760; text-transform: uppercase; letter-spacing: .08em; }
.pulse-stat-row strong { display: block; margin-top: 5px; font-size: 2rem; line-height: 1; }
.pulse-live-grid { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 15px; align-items: start; }
.pulse-live-column { min-height: 360px; padding: 17px; border: 1px solid var(--pulse-border); border-radius: 22px; background: rgba(255,255,255,.9); box-shadow: 0 14px 40px rgba(18,63,97,.08); }
.pulse-live-column > header { display: flex; justify-content: space-between; align-items: center; }
.pulse-live-column > header > div { display: flex; align-items: center; gap: 9px; }
.pulse-live-column h2 { margin: 0; font-size: 1.06rem; }
.pulse-live-column > header b { display: grid; place-items: center; min-width: 30px; height: 30px; border-radius: 10px; background: #edf4f7; }
.pulse-live-column > p { margin: 7px 0 15px; color: #7990a1; font-size: .84rem; }
.pulse-live-dot { width: 10px; height: 10px; border-radius: 50%; background: #8ba1b2; box-shadow: 0 0 0 5px rgba(139,161,178,.13); }
.pulse-live-column.is-working .pulse-live-dot, .pulse-clock-card.is-running .pulse-live-dot { background: var(--pulse-mint); box-shadow: 0 0 0 5px rgba(37,182,133,.15); }
.pulse-live-column.is-break .pulse-live-dot, .pulse-clock-card.is-break .pulse-live-dot { background: var(--pulse-amber); box-shadow: 0 0 0 5px rgba(230,161,38,.16); }
.pulse-live-column.is-absent .pulse-live-dot { background: var(--pulse-red); box-shadow: 0 0 0 5px rgba(217,80,80,.14); }
.pulse-live-stack { display: grid; gap: 9px; }
.pulse-live-person { display: flex; gap: 11px; align-items: center; padding: 11px; border: 1px solid rgba(15,65,104,.1); border-radius: 15px; background: #fff; }
.pulse-live-person > div { min-width: 0; flex: 1; }
.pulse-live-person strong, .pulse-live-person small, .pulse-live-person span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pulse-live-person small { color: #7890a3; }
.pulse-live-person span { margin-top: 3px; color: #34809b; font-size: .76rem; font-weight: 690; }
.pulse-avatar { flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; overflow: hidden; background: linear-gradient(135deg, #0a65c0, #16a2a9); color: #fff; font-size: .78rem; font-weight: 850; box-shadow: 0 7px 18px rgba(11,104,199,.18); }
.pulse-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pulse-empty { margin: 0; padding: 20px 12px; border: 1px dashed rgba(20,78,116,.18); border-radius: 14px; color: #7d93a4; text-align: center; }
.pulse-planning-intro, .pulse-accounts-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin: 24px 0 14px; }
.pulse-planning-intro h2, .pulse-accounts-head h2 { margin: 4px 0 2px; font-size: 1.75rem; }
.pulse-planning-intro p, .pulse-accounts-head p { margin: 0; color: #70889b; }
.pulse-plan-badge { padding: 10px 15px; border-radius: 13px; background: #e7f6fa; color: #17768d; font-weight: 780; }
.pulse-roster-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(275px, 1fr)); gap: 15px; align-items: start; }
.pulse-roster-lane { min-height: 430px; padding: 15px; border: 1px solid var(--pulse-border); border-radius: 22px; background: rgba(255,255,255,.9); transition: .18s ease; box-shadow: 0 14px 40px rgba(18,63,97,.08); }
.pulse-roster-lane.is-unplanned { background: rgba(244,248,250,.94); }
.pulse-roster-lane.is-drag-over { transform: translateY(-3px); border-color: #1ca1ac; background: #eafafb; box-shadow: 0 20px 42px rgba(20,147,160,.18); }
.pulse-roster-lane > header { display: flex; justify-content: space-between; align-items: center; padding: 3px 2px 14px; }
.pulse-roster-lane header strong, .pulse-roster-lane header small { display: block; }
.pulse-roster-lane header small { margin-top: 3px; color: #778e9f; }
.pulse-roster-lane header b { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 11px; background: #edf6fa; color: #15738a; }
.pulse-roster-stack { display: grid; gap: 9px; }
.pulse-person-card { display: flex; align-items: center; gap: 11px; padding: 11px; border: 1px solid rgba(15,65,104,.11); border-radius: 15px; background: #fff; cursor: grab; user-select: none; box-shadow: 0 5px 16px rgba(13,60,94,.05); }
.pulse-person-card:active { cursor: grabbing; }
.pulse-person-card.is-dragging { opacity: .45; transform: scale(.98); }
.pulse-person-copy { min-width: 0; flex: 1; }
.pulse-person-copy strong, .pulse-person-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pulse-person-copy small { color: #7a90a2; }
.pulse-drag-handle { color: #8ca2b1; letter-spacing: -2px; }
.pulse-absence-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(330px, .9fr); gap: 18px; margin-top: 22px; }
.pulse-panel { padding: 21px; border: 1px solid var(--pulse-border); border-radius: 22px; background: rgba(255,255,255,.9); box-shadow: 0 14px 40px rgba(18,63,97,.08); }
.pulse-panel > header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.pulse-panel h2 { margin: 3px 0 0; }
.pulse-panel > header > b { display: grid; place-items: center; min-width: 34px; height: 34px; border-radius: 11px; background: #eaf6fa; color: #12748b; }
.pulse-request-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.pulse-request-card { padding: 17px; border: 1px solid rgba(15,65,104,.12); border-radius: 17px; background: #fff; }
.pulse-request-card.is-pending { border-color: rgba(230,161,38,.34); background: linear-gradient(180deg, #fff, #fffbf2); }
.pulse-request-top { display: flex; justify-content: space-between; gap: 12px; color: #728a9d; font-size: .78rem; font-weight: 760; text-transform: uppercase; letter-spacing: .05em; }
.pulse-request-card h3 { margin: 12px 0 5px; }
.pulse-request-card p { margin: 0 0 14px; color: #627b8f; }
.pulse-request-actions { display: flex; justify-content: flex-end; gap: 8px; }
.pulse-request-list { display: grid; gap: 8px; }
.pulse-request-list article { display: flex; align-items: center; gap: 11px; padding: 11px; border: 1px solid rgba(15,65,104,.1); border-radius: 14px; background: #fff; }
.pulse-request-list article > div { min-width: 0; flex: 1; }
.pulse-request-list strong, .pulse-request-list small { display: block; }
.pulse-request-list small { color: #768ea1; }
.pulse-request-status { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: #edf3f6; color: #5d7587; font-size: .7rem; font-weight: 800; }
.pulse-request-status.is-pending { background: #fff1cf; color: #96640b; }
.pulse-request-status.is-approved, .pulse-request-status.is-active { background: #dff7ec; color: #147653; }
.pulse-request-status.is-rejected, .pulse-request-status.is-cancelled { background: #fde8e8; color: #a63d3d; }
.pulse-month-form { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.pulse-month-form label { display: grid; gap: 4px; color: #70889b; font-size: .76rem; font-weight: 760; }
.pulse-month-form input { width: 96px; padding: 9px 10px; border: 1px solid var(--pulse-border); border-radius: 10px; background: #fff; }
.pulse-account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 15px; }
.pulse-account-card { padding: 18px; border: 1px solid var(--pulse-border); border-radius: 21px; background: rgba(255,255,255,.92); box-shadow: 0 14px 40px rgba(18,63,97,.08); }
.pulse-account-card > header { display: flex; align-items: center; gap: 12px; }
.pulse-account-card h3 { margin: 0; }
.pulse-account-card header p { margin: 3px 0 0; color: #7890a2; }
.pulse-balance { margin-left: auto; padding: 7px 10px; border-radius: 11px; background: #edf3f6; font-weight: 850; }
.pulse-balance.is-positive { background: #dff7ec; color: #137653; }
.pulse-balance.is-negative { background: #fde8e8; color: #a83d3d; }
.pulse-account-card dl { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; margin: 16px 0; }
.pulse-account-card dl div { padding: 11px; border-radius: 13px; background: #f3f8fa; }
.pulse-account-card dt { color: #7790a2; font-size: .73rem; font-weight: 760; text-transform: uppercase; }
.pulse-account-card dd { margin: 4px 0 0; font-weight: 820; }
.pulse-policy-form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; padding-top: 13px; border-top: 1px solid var(--pulse-border); }
.pulse-policy-form label { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 7px; color: #627b8e; font-size: .78rem; }
.pulse-policy-form input { width: 76px; padding: 8px; border: 1px solid var(--pulse-border); border-radius: 9px; }
.pulse-policy-form .btn { grid-column: 1 / -1; }
.pulse-self-shell { max-width: 1180px; }
.pulse-self-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 16px; margin: 20px 0; }
.pulse-clock-card, .pulse-balance-card { padding: 24px; border: 1px solid var(--pulse-border); border-radius: 23px; background: rgba(255,255,255,.94); box-shadow: 0 16px 44px rgba(18,63,97,.1); }
.pulse-clock-card > header { display: flex; align-items: center; gap: 12px; }
.pulse-clock-card header span { color: #758ea0; font-size: .76rem; font-weight: 760; text-transform: uppercase; }
.pulse-clock-card h2 { margin: 3px 0 0; }
.pulse-clock-value { margin: 24px 0 5px; font-size: clamp(3rem, 8vw, 5.8rem); font-weight: 880; letter-spacing: -.07em; line-height: .9; color: #0b4f80; }
.pulse-clock-card > p { margin: 0 0 22px; color: #748d9f; }
.pulse-clock-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pulse-action-main { min-width: 210px; }
.pulse-balance-card h2 { margin: 8px 0 18px; }
.pulse-balance-card dl { display: grid; gap: 10px; margin: 0; }
.pulse-balance-card dl div { padding: 12px; border-radius: 13px; background: #f1f7f9; }
.pulse-balance-card dt { color: #7891a3; font-size: .75rem; }
.pulse-balance-card dd { margin: 4px 0 0; font-weight: 820; }
.pulse-self-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }
.pulse-self-action-card { position: relative; overflow: hidden; padding: 22px; border: 1px solid rgba(20,130,154,.19); border-radius: 23px; background: linear-gradient(145deg, #f3fcff, #fff); box-shadow: 0 14px 40px rgba(18,63,97,.08); }
.pulse-self-action-card.is-sickness { border-color: rgba(217,80,80,.2); background: linear-gradient(145deg, #fff8f8, #fff); }
.pulse-action-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: #dff5fa; color: #167b92; font-size: 1.35rem; font-weight: 850; }
.pulse-self-action-card.is-sickness .pulse-action-icon { background: #fde9e9; color: #bd4545; }
.pulse-self-action-card h2 { margin: 13px 0 4px; }
.pulse-self-action-card > div > p { margin: 0 0 15px; color: #6f8799; }
.pulse-self-action-card form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.pulse-self-action-card label { display: grid; gap: 5px; color: #617a8d; font-size: .77rem; font-weight: 760; }
.pulse-self-action-card input, .pulse-self-action-card select, .pulse-self-action-card textarea { width: 100%; padding: 10px 11px; border: 1px solid var(--pulse-border); border-radius: 11px; background: #fff; color: var(--pulse-ink); }
.pulse-full { grid-column: 1 / -1; }
.flow-pulse-dot { display: inline-block; width: 8px; height: 8px; margin-left: 7px; border-radius: 50%; vertical-align: 1px; background: #94a6b2; box-shadow: 0 0 0 3px rgba(148,166,178,.12); }
.flow-pulse-dot.is-working { background: #25b685; box-shadow: 0 0 0 3px rgba(37,182,133,.14); }
.flow-pulse-dot.is-break { background: #e6a126; box-shadow: 0 0 0 3px rgba(230,161,38,.14); }
.flow-pulse-dot.is-absent { background: #d95050; box-shadow: 0 0 0 3px rgba(217,80,80,.14); }
@media (max-width: 1180px) {
    .pulse-live-grid { grid-template-columns: repeat(2, minmax(250px,1fr)); }
    .pulse-stat-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 860px) {
    .pulse-shell { width: min(100% - 20px, 1540px); margin-top: 14px; }
    .pulse-hero { align-items: flex-start; flex-direction: column; padding: 24px; }
    .pulse-control-deck, .pulse-planning-intro, .pulse-accounts-head { align-items: stretch; flex-direction: column; }
    .pulse-date-control { justify-content: center; }
    .pulse-absence-layout, .pulse-self-grid, .pulse-self-actions { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .pulse-live-grid, .pulse-stat-row, .pulse-account-grid { grid-template-columns: 1fr; }
    .pulse-mode-tabs { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); width: 100%; }
    .pulse-mode-tab { text-align: center; }
    .pulse-self-action-card form, .pulse-policy-form, .pulse-account-card dl { grid-template-columns: 1fr; }
    .pulse-full, .pulse-policy-form .btn { grid-column: auto; }
    .pulse-clock-value { font-size: 4rem; }
    .pulse-request-list article { align-items: flex-start; flex-wrap: wrap; }
}
/* LEITIO Pulse touch and keyboard selection */
.pulse-person-card.is-selected {
    border-color: #1595a2;
    background: #eafafb;
    box-shadow: 0 0 0 3px rgba(21,149,162,.15), 0 10px 24px rgba(18,99,112,.12);
}
.pulse-person-card[draggable="false"] { cursor: default; }
.pulse-roster-lane[data-pulse-roster-target] { cursor: pointer; }

/* LEITIO Circle 4.2 ------------------------------------------------------- */
.circle-page { background: radial-gradient(circle at 8% 0%, rgba(55, 216, 190, .12), transparent 24rem), radial-gradient(circle at 92% 10%, rgba(116, 88, 255, .12), transparent 28rem), #f5f8fc; color: #17304d; }
.circle-shell { width: min(1480px, calc(100% - 32px)); margin: 28px auto 64px; }
.circle-hero, .circle-page-head, .circle-assist-hero { position: relative; overflow: hidden; border-radius: 30px; padding: clamp(28px, 4vw, 54px); color: #fff; background: linear-gradient(125deg, #062e61 0%, #126b91 48%, #5a48d6 100%); box-shadow: 0 28px 70px rgba(6, 46, 97, .18); display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.circle-hero::after, .circle-page-head::after, .circle-assist-hero::after { content:""; position:absolute; width:320px; height:320px; border-radius:50%; right:-100px; top:-130px; background:rgba(255,255,255,.11); box-shadow:-170px 240px 0 rgba(55,216,190,.08); }
.circle-hero > *, .circle-page-head > *, .circle-assist-hero > * { position: relative; z-index: 1; }
.circle-kicker, .circle-page-head > div > span, .circle-assist-hero > span, .circle-section-head span { display:block; font-size:.76rem; font-weight:800; letter-spacing:.13em; text-transform:uppercase; color:#70f1da; }
.circle-hero h1, .circle-page-head h1, .circle-assist-hero h1 { margin:.3rem 0 .7rem; font-size:clamp(2rem,4vw,4.2rem); line-height:1.02; letter-spacing:-.04em; color:#fff; }
.circle-page-head h1 { font-size:clamp(2rem,3.2vw,3.4rem); }
.circle-hero p, .circle-page-head p, .circle-assist-hero p { max-width:760px; margin:0; color:rgba(255,255,255,.82); font-size:1.05rem; }
.circle-hero-actions { display:flex; flex-wrap:wrap; gap:12px; }
.circle-hero .button, .circle-page-head .button, .circle-assist-hero .button { background:#fff; color:#07366a; border-color:#fff; }
.circle-hero .button-secondary { background:rgba(255,255,255,.12); color:#fff; border-color:rgba(255,255,255,.35); }
.circle-subnav { margin:18px 0 28px; padding:8px; border:1px solid #dbe6f2; background:rgba(255,255,255,.9); backdrop-filter:blur(14px); border-radius:18px; display:flex; gap:4px; overflow:auto; box-shadow:0 12px 35px rgba(26,61,101,.08); position:sticky; top:8px; z-index:20; }
.circle-subnav a { white-space:nowrap; padding:11px 16px; border-radius:12px; color:#526980; text-decoration:none; font-weight:750; display:flex; align-items:center; gap:7px; }
.circle-subnav a:hover, .circle-subnav a.active { background:#eaf6fa; color:#075a76; }
.circle-subnav a span { display:inline-grid; place-items:center; min-width:20px; height:20px; border-radius:99px; padding:0 5px; background:#e63b6f; color:#fff; font-size:.7rem; }
.circle-onboarding, .circle-safety-banner { margin:20px 0; padding:20px 24px; border-radius:18px; background:linear-gradient(100deg,#e9fff9,#eef4ff); border:1px solid #bdebe1; display:flex; align-items:center; gap:18px; flex-wrap:wrap; }
.circle-onboarding p { margin:0; flex:1; min-width:240px; }
.circle-stat-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin:24px 0; }
.circle-stat-grid article { background:#fff; border:1px solid #dce7f1; border-radius:20px; padding:22px; box-shadow:0 12px 34px rgba(24,56,92,.07); }
.circle-stat-grid strong { display:block; font-size:2rem; color:#0a607b; }
.circle-stat-grid span { color:#667b91; font-weight:650; }
.circle-section, .circle-form-card { background:#fff; border:1px solid #dce7f1; border-radius:24px; padding:clamp(20px,3vw,32px); box-shadow:0 16px 46px rgba(24,56,92,.07); margin:20px 0; }
.circle-form-card.narrow { max-width:860px; margin:20px auto; }
.circle-section-head { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:20px; }
.circle-section-head h2, .circle-form-card h2 { margin:.25rem 0 0; color:#173b61; font-size:1.45rem; }
.circle-section-head > a { color:#08728d; font-weight:750; text-decoration:none; }
.circle-profile-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:18px; }
.circle-profile-card { background:linear-gradient(180deg,#fff,#f8fbfe); border:1px solid #dbe6f0; border-radius:22px; padding:22px; min-width:0; box-shadow:0 10px 30px rgba(24,56,92,.06); }
.circle-profile-card > .user-avatar, .circle-profile-identity > .user-avatar { box-shadow:0 0 0 5px #e5f7f4; }
.circle-profile-head { display:flex; gap:14px; align-items:center; }
.circle-profile-head strong, .circle-profile-card h3 { color:#173b61; font-size:1.08rem; }
.circle-profile-head span, .circle-profile-card > p { display:block; color:#6b7f93; }
.circle-company { margin:.9rem 0 .4rem; font-weight:750; color:#2e526f !important; }
.circle-meta { display:flex; flex-wrap:wrap; gap:7px; align-items:center; }
.circle-meta > span { display:inline-flex; padding:5px 9px; border-radius:99px; background:#edf4fa; color:#547086; font-size:.73rem; font-weight:700; }
.circle-tags { display:flex; gap:7px; flex-wrap:wrap; margin:10px 0; }
.circle-tags span { padding:6px 10px; border-radius:99px; background:#e7f9f5; color:#147264; font-size:.76rem; font-weight:750; }
.circle-card-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-top:16px; }
.circle-card-actions form { margin:0; }
.circle-status { padding:8px 12px; border-radius:99px; background:#fff4d8; color:#8a6210; font-size:.8rem; font-weight:750; }
.circle-match { margin:12px 0; padding:10px 12px; background:#f0ebff; border-radius:12px; color:#6545b6; font-size:.8rem; font-weight:750; }
.circle-two-column { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(300px,.75fr); gap:20px; align-items:start; }
.circle-two-column.wide-left { grid-template-columns:minmax(0,1.6fr) minmax(300px,.6fr); }
.circle-feed-item, .circle-template-mini { display:grid; gap:6px; padding:16px 0; border-bottom:1px solid #e6edf4; text-decoration:none; color:inherit; }
.circle-feed-item:last-child, .circle-template-mini:last-child { border-bottom:0; }
.circle-feed-item strong, .circle-template-mini strong { color:#173b61; font-size:1rem; }
.circle-feed-item small, .circle-template-mini small { color:#728599; }
.circle-type { width:max-content; padding:4px 8px; border-radius:99px; font-size:.68rem; font-weight:850; text-transform:uppercase; letter-spacing:.05em; background:#eaf0f6; color:#52677c; }
.circle-type-question { background:#e6f5ff; color:#14678e; }.circle-type-idea { background:#f0e9ff; color:#6e43b6; }.circle-type-practice { background:#e6faef; color:#1b7850; }.circle-type-discussion { background:#fff3d9; color:#8a6516; }
.circle-event-strip { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:12px; }
.circle-event-strip article { padding:18px; border-radius:16px; background:#f4f8fc; display:grid; gap:5px; }
.circle-event-strip time { color:#5f43c0; font-weight:800; }.circle-event-strip span { color:#6e8295; }
.circle-request { display:flex; align-items:center; gap:14px; border-bottom:1px solid #e3eaf2; padding:15px 0; }
.circle-request > div { flex:1; }.circle-request p { margin:.3rem 0 0; color:#6c8093; }.circle-request form { margin:0; }
.circle-toggle-panel { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:12px; padding:16px; border-radius:18px; background:#f3f7fb; margin-bottom:22px; }
.circle-toggle-panel.compact { grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); margin-top:18px; }
.circle-toggle-panel label { display:flex; gap:12px; align-items:flex-start; background:#fff; border:1px solid #dfe8f1; border-radius:14px; padding:14px; cursor:pointer; }
.circle-toggle-panel input { width:20px; height:20px; margin-top:2px; }.circle-toggle-panel small { display:block; color:#718497; margin-top:3px; }
.circle-form-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:16px; }
.circle-form-card label { display:grid; gap:7px; margin-bottom:16px; color:#38536d; font-weight:750; }
.circle-form-card label small { font-weight:500; color:#789; }
.circle-form-card input:not([type=checkbox]), .circle-form-card textarea, .circle-form-card select, .circle-searchbar input, .circle-searchbar select, .circle-chat-composer textarea, .circle-assist-hero input { width:100%; border:1px solid #cad8e5; border-radius:12px; background:#fff; padding:11px 13px; font:inherit; color:#183b5d; }
.circle-form-card textarea { resize:vertical; }
.circle-profile-detail, .circle-room-hero, .circle-template-detail-head { background:#fff; border:1px solid #dce7f1; border-radius:26px; padding:30px; display:flex; align-items:center; justify-content:space-between; gap:24px; box-shadow:0 16px 46px rgba(24,56,92,.07); }
.circle-profile-identity { display:flex; align-items:center; gap:20px; }.circle-profile-identity h1, .circle-room-hero h1, .circle-template-detail-head h1 { margin:.2rem 0; color:#173b61; font-size:clamp(1.8rem,3vw,3rem); }.circle-profile-identity p { margin:.3rem 0; color:#667d91; }
.circle-profile-actions form { display:flex; gap:8px; flex-wrap:wrap; }.circle-profile-actions input { border:1px solid #ccd9e5; border-radius:12px; padding:10px; }
.circle-details { margin-top:20px; }.circle-details summary { font-weight:800; color:#31536f; cursor:pointer; }
.circle-checkbox-list { display:grid; gap:8px; margin:12px 0; }.circle-checkbox-list label { display:flex; align-items:center; gap:8px; margin:0; }.circle-checkbox-list input { width:18px; height:18px; }
.circle-message-layout { display:grid; grid-template-columns:350px minmax(0,1fr); gap:20px; }
.circle-message-sidebar { background:#fff; border:1px solid #dce7f1; border-radius:22px; padding:20px; box-shadow:0 16px 46px rgba(24,56,92,.07); }
.circle-conversation-link { display:flex; align-items:center; gap:12px; padding:13px; border-radius:14px; text-decoration:none; color:#264764; }.circle-conversation-link:hover { background:#edf7f8; }.circle-conversation-link div { display:grid; }.circle-conversation-link small { color:#789; }
.circle-conversation-icon { width:40px; height:40px; border-radius:14px; background:linear-gradient(135deg,#2cc8ad,#5e55dd); color:#fff; display:grid; place-items:center; font-size:.72rem; font-weight:900; }
.circle-contact-list article { display:flex; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid #e5edf4; }.circle-contact-list strong { flex:1; }.circle-contact-list form { margin:0; }
.circle-chat-head { display:flex; align-items:center; gap:24px; margin-bottom:14px; }.circle-chat-head > a { text-decoration:none; color:#176d83; font-weight:750; }.circle-chat-head h1 { margin:0; color:#173b61; }.circle-chat-head p { margin:.2rem 0; color:#72869a; }
.circle-chat-window { min-height:55vh; max-height:65vh; overflow:auto; background:#edf3f8; border:1px solid #d8e3ed; border-radius:24px; padding:24px; display:flex; flex-direction:column; gap:14px; }
.circle-bubble { display:flex; gap:9px; align-items:flex-end; max-width:min(720px,85%); }.circle-bubble.mine { align-self:flex-end; flex-direction:row-reverse; }.circle-bubble > div { background:#fff; border-radius:18px 18px 18px 4px; padding:12px 15px; box-shadow:0 5px 18px rgba(20,50,80,.08); }.circle-bubble.mine > div { background:#0b6881; color:#fff; border-radius:18px 18px 4px 18px; }.circle-bubble strong { font-size:.76rem; }.circle-bubble p { margin:.35rem 0; white-space:normal; }.circle-bubble time { font-size:.65rem; opacity:.68; }.circle-shared-card { display:block; margin-top:8px; padding:10px; background:rgba(255,255,255,.16); border-radius:10px; color:inherit; text-decoration:none; font-weight:750; }
.circle-chat-composer { display:flex; gap:12px; margin-top:12px; }.circle-chat-composer textarea { flex:1; }
.circle-room-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(330px,1fr)); gap:18px; }.circle-room-card { display:grid; grid-template-columns:auto 1fr; gap:18px; padding:24px; background:#fff; border:1px solid #dce7f1; border-radius:22px; box-shadow:0 12px 35px rgba(24,56,92,.06); }.circle-room-card h2 { margin:.5rem 0; color:#173b61; }.circle-room-card p { color:#6a7f93; }.circle-room-card .circle-card-actions { grid-column:1/-1; }
.circle-room-icon { width:56px; height:56px; border-radius:18px; display:grid; place-items:center; background:linear-gradient(135deg,#25bfa7,#624fd6); color:#fff; font-weight:900; }.circle-room-icon.large { width:78px; height:78px; font-size:1.3rem; }
.circle-filter-pills { display:flex; gap:8px; flex-wrap:wrap; margin:20px 0; }.circle-filter-pills a { padding:9px 14px; border-radius:99px; background:#fff; border:1px solid #d8e4ee; color:#527087; text-decoration:none; font-weight:750; }.circle-filter-pills a.active { background:#0b6881; color:#fff; border-color:#0b6881; }
.circle-searchbar { display:flex; gap:10px; padding:12px; background:#fff; border:1px solid #dce7f1; border-radius:18px; margin:18px 0 24px; box-shadow:0 8px 25px rgba(24,56,92,.05); }.circle-searchbar input { flex:1; }.circle-searchbar select { max-width:230px; }
.circle-knowledge-list { display:grid; gap:12px; }.circle-knowledge-list > article { display:grid; grid-template-columns:80px 1fr; gap:18px; background:#fff; border:1px solid #dce7f1; border-radius:20px; padding:20px; }.circle-vote-box { display:grid; place-items:center; align-content:center; border-radius:14px; background:#f1f6fa; color:#56718a; }.circle-vote-box strong { font-size:1.45rem; color:#0c6881; }.circle-vote-box span { font-size:.7rem; }.circle-knowledge-list h2 { margin:.5rem 0; }.circle-knowledge-list h2 a { color:#173b61; text-decoration:none; }.circle-knowledge-list p { margin:.4rem 0; color:#62798d; }
.circle-solved { display:inline-flex; padding:5px 9px; border-radius:99px; background:#dff8e9; color:#18734a; font-size:.72rem; font-weight:850; }
.circle-post-detail { background:#fff; border:1px solid #dce7f1; border-radius:26px; padding:clamp(24px,4vw,48px); }.circle-post-detail h1 { max-width:1000px; color:#173b61; font-size:clamp(2rem,3.4vw,3.7rem); line-height:1.08; }.circle-author { display:flex; align-items:center; gap:12px; margin:22px 0; }.circle-author div { display:grid; }.circle-author small { color:#75899b; }.circle-prose { font-size:1.08rem; line-height:1.75; color:#294a65; }.circle-post-actions { display:flex; gap:12px; margin-top:28px; align-items:flex-start; }.circle-post-actions details { margin-left:auto; }
.circle-answer { display:flex; gap:14px; padding:20px; border:1px solid #dde7ef; border-radius:18px; margin:12px 0; }.circle-answer.solution { border-color:#69c89a; background:#f0fff6; }.circle-answer > div { flex:1; }.circle-answer p { line-height:1.65; }
.circle-template-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:18px; }.circle-template-card { background:#fff; border:1px solid #dce7f1; border-radius:22px; padding:20px; display:flex; flex-direction:column; gap:10px; box-shadow:0 12px 35px rgba(24,56,92,.06); }.circle-template-card h2 { margin:0; color:#173b61; }.circle-template-card p { color:#687e91; flex:1; }
.circle-template-preview { height:120px; border-radius:18px; background:linear-gradient(135deg,#072f62,#147d91 52%,#644bd3); display:flex; align-items:center; justify-content:space-between; padding:20px; color:#fff; overflow:hidden; position:relative; }.circle-template-preview::after { content:""; position:absolute; width:100px; height:100px; border-radius:50%; background:rgba(255,255,255,.12); right:-20px; top:-35px; }.circle-template-preview span { font-weight:900; letter-spacing:.12em; }.circle-template-preview strong { font-size:2.5rem; position:relative; z-index:1; }.circle-template-preview.large { width:220px; min-width:220px; height:180px; }
.circle-template-stats { display:flex; gap:14px; color:#61788e; font-weight:750; }.circle-template-stats.big { font-size:1.2rem; margin:16px 0; }
.circle-template-detail-head { justify-content:flex-start; }.circle-template-detail-head > div:last-child { max-width:900px; }
.circle-preview-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:10px; }.circle-preview-list div { background:#f3f7fb; border-radius:12px; padding:14px; display:grid; }.circle-preview-list span { font-size:.75rem; color:#71869a; }.circle-json-preview { max-height:420px; overflow:auto; background:#12273d; color:#cfeee8; border-radius:16px; padding:18px; font-size:.78rem; }
.circle-safety-check { background:#eafaf6; border:1px solid #bce9df; border-radius:15px; padding:15px; display:grid; gap:5px; margin-bottom:18px; }.circle-safety-banner strong { color:#146b5f; }.circle-safety-banner span { color:#426b69; }
.circle-event-list { display:grid; gap:14px; }.circle-event-list > article { display:grid; grid-template-columns:90px 1fr auto; align-items:center; gap:22px; background:#fff; border:1px solid #dce7f1; border-radius:22px; padding:22px; }.circle-event-date { width:70px; height:70px; border-radius:18px; background:linear-gradient(135deg,#e6f9f5,#eeeaff); display:grid; place-items:center; align-content:center; color:#3d5483; }.circle-event-date strong { font-size:1.8rem; line-height:1; }.circle-event-date span { text-transform:uppercase; font-weight:800; font-size:.72rem; }.circle-event-list h2 { color:#173b61; margin:.5rem 0; }.circle-event-list p { color:#667d91; }
.circle-assist-hero { display:block; text-align:center; }.circle-assist-hero p { margin:0 auto; }.circle-assist-hero form { max-width:900px; margin:24px auto 0; display:flex; gap:10px; }.circle-assist-hero input { flex:1; padding:15px 18px; border:0; }.circle-assist-results { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.empty-state { color:#758a9c; padding:20px; text-align:center; border:1px dashed #cbd9e5; border-radius:15px; }
@media (max-width: 980px) { .circle-stat-grid { grid-template-columns:repeat(2,1fr); }.circle-two-column, .circle-two-column.wide-left, .circle-message-layout { grid-template-columns:1fr; }.circle-profile-detail, .circle-room-hero, .circle-template-detail-head { align-items:flex-start; flex-direction:column; }.circle-event-list > article { grid-template-columns:75px 1fr; }.circle-event-list > article > div:last-child { grid-column:2; }.circle-assist-results { grid-template-columns:1fr; } }
@media (max-width: 680px) { .circle-shell { width:min(100% - 18px,1480px); margin-top:14px; }.circle-hero, .circle-page-head { padding:25px 20px; border-radius:22px; flex-direction:column; align-items:flex-start; }.circle-stat-grid { grid-template-columns:1fr 1fr; gap:10px; }.circle-stat-grid article { padding:16px; }.circle-section, .circle-form-card { padding:18px; border-radius:18px; }.circle-searchbar, .circle-chat-composer, .circle-assist-hero form { flex-direction:column; }.circle-searchbar select { max-width:none; }.circle-knowledge-list > article { grid-template-columns:1fr; }.circle-vote-box { display:flex; gap:6px; padding:8px; width:max-content; }.circle-room-card { grid-template-columns:1fr; }.circle-room-icon { width:48px; height:48px; }.circle-template-preview.large { width:100%; min-width:0; }.circle-event-list > article { grid-template-columns:1fr; }.circle-event-list > article > div:last-child { grid-column:auto; }.circle-request { align-items:flex-start; flex-wrap:wrap; }.circle-profile-actions form { width:100%; }.circle-profile-actions input { width:100%; }.circle-chat-window { padding:12px; }.circle-bubble { max-width:95%; } }

/* LEITIO 4.2.1 – planbare Anwesenheit und Neuplanungszentrum */
.flow-replan-center {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid #f59e0b;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff7ed, #fffbeb);
  box-shadow: 0 14px 35px rgba(146, 64, 14, .10);
}
.flow-replan-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 14px;
  background: #f59e0b;
  color: #fff;
  font-size: 1.45rem;
  font-weight: 900;
}
.flow-replan-copy { min-width: 0; flex: 1; }
.flow-replan-copy > strong { display: block; color: #9a3412; font-size: 1.02rem; }
.flow-replan-copy > p { margin: .28rem 0 .75rem; color: #7c2d12; }
.flow-replan-list { display: flex; flex-wrap: wrap; gap: .55rem; }
.flow-replan-list a {
  display: grid;
  gap: .08rem;
  min-width: 190px;
  padding: .55rem .7rem;
  border: 1px solid rgba(245, 158, 11, .45);
  border-radius: 12px;
  background: rgba(255,255,255,.78);
  color: #7c2d12;
  text-decoration: none;
}
.flow-replan-list a:hover { border-color: #ea580c; transform: translateY(-1px); }
.flow-replan-list span { font-weight: 800; }
.flow-replan-list small { color: #9a3412; }
.flow-machine-card.needs-replan,
.flow-live-card.needs-replan {
  outline: 3px solid rgba(245, 158, 11, .48);
  outline-offset: 2px;
}
.flow-live-team { display: flex; flex-wrap: wrap; gap: .35rem; }
.flow-live-team > span {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  padding: .18rem .42rem;
  border-radius: 999px;
  background: #eef6f8;
}
@media (max-width: 720px) {
  .flow-replan-center { align-items: stretch; }
  .flow-replan-list { display: grid; }
  .flow-replan-list a { min-width: 0; }
}

/* LEITIO 4.2.1 – Demo Studio */
.demo-studio-shell { max-width: 1500px; }
.demo-studio-hero { display:flex; justify-content:space-between; gap:1.5rem; align-items:flex-end; margin-bottom:1.4rem; padding:1.6rem; border-radius:24px; color:#fff; background:radial-gradient(circle at top right, rgba(34,211,238,.35), transparent 38%), linear-gradient(135deg,#0b2a55,#0f766e); box-shadow:0 24px 60px rgba(15,42,85,.18); }
.demo-studio-hero.compact { align-items:center; }
.demo-studio-hero h1 { margin:.15rem 0 .35rem; font-size:clamp(2rem,5vw,3.4rem); }
.demo-studio-hero p { max-width:780px; color:rgba(255,255,255,.84); }
.demo-studio-hero .eyebrow { color:#a5f3fc; }
.demo-blueprint-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(310px,1fr)); gap:1rem; }
.demo-blueprint-card { display:grid; gap:.9rem; padding:1.15rem; border:1px solid #d8e5eb; border-radius:20px; background:#fff; box-shadow:0 14px 38px rgba(15,42,85,.08); }
.demo-blueprint-mark { display:grid; place-items:center; width:48px; height:48px; border-radius:15px; color:#fff; font-weight:900; background:linear-gradient(135deg,#0891b2,#0f766e); }
.demo-blueprint-card-copy > span { color:#0e7490; font-size:.75rem; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.demo-blueprint-card-copy h2 { margin:.2rem 0; }
.demo-blueprint-card-copy p { color:#64748b; }
.demo-blueprint-meta { display:flex; justify-content:space-between; gap:.8rem; font-size:.85rem; }
.demo-blueprint-meta strong { color:#0f766e; }
.demo-blueprint-stats { display:flex; flex-wrap:wrap; gap:.4rem; }
.demo-blueprint-stats span { display:inline-grid; padding:.35rem .5rem; border-radius:10px; background:#eef7f7; color:#475569; font-size:.72rem; }
.demo-blueprint-stats b { color:#0f766e; font-size:1rem; }
.demo-studio-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(360px,.8fr); gap:1rem; margin-bottom:1rem; }
.demo-version-list { display:grid; gap:.65rem; }
.demo-version-list article { display:grid; gap:.45rem; padding:.8rem; border:1px solid #dbe7ea; border-radius:14px; }
.demo-version-list article > div { display:flex; flex-wrap:wrap; gap:.45rem; justify-content:space-between; }
.demo-version-list span { padding:.18rem .4rem; border-radius:999px; background:#eef7fa; font-size:.72rem; }
@media(max-width:900px){ .demo-studio-hero{align-items:flex-start;flex-direction:column}.demo-studio-layout{grid-template-columns:1fr} }


/* LEITIO 4.2.1 – Planung & Demo Studio */
.blueprint-workspace-banner { display:flex; align-items:center; gap:.8rem; padding:.72rem 1.15rem; background:linear-gradient(90deg,#312e81,#4f46e5 55%,#0f766e); color:#fff; box-shadow:0 8px 24px rgba(49,46,129,.2); }
.blueprint-workspace-banner strong { white-space:nowrap; }
.blueprint-workspace-banner span { flex:1; opacity:.92; }
.blueprint-workspace-banner a { color:#fff; font-weight:800; text-decoration:none; border:1px solid rgba(255,255,255,.45); border-radius:999px; padding:.35rem .72rem; }
@media (max-width:760px){.blueprint-workspace-banner{align-items:flex-start;flex-direction:column}.blueprint-workspace-banner a{align-self:flex-start}}

/* LEITIO 4.2.2 Revision 1 – Flow and dashboard integration */
.flow-status-strip { grid-template-columns: minmax(150px,1.25fr) repeat(6,minmax(76px,.52fr)) auto; }
.flow-mode-tabs { grid-template-columns: repeat(3,minmax(0,1fr)); }
.flow-workspace-planning { grid-template-columns: minmax(220px,.64fr) minmax(0,2.45fr) minmax(250px,.72fr); }
.flow-workspace-planning .flow-machine-board { grid-template-columns: repeat(auto-fit,minmax(300px,1fr)); }
.flow-task-pool-header { position: sticky; top: 0; z-index: 2; }
.flow-new-task-button { width: calc(100% - 1.3rem); margin: .65rem .65rem 0; }
.flow-machine-card.is-blocked { border-color: #ef4444; background: #fff7f7; box-shadow: 0 0 0 2px rgba(239,68,68,.09), 0 8px 24px rgba(127,29,29,.08); }
.flow-machine-card.is-blocked .flow-machine-header { background: linear-gradient(135deg,#fff1f2,#fef2f2); }
.flow-machine-signal.is-blocked { background: #dc2626; box-shadow: 0 0 0 5px rgba(220,38,38,.14); }
.flow-machine-blocked-message { display: grid; gap: .12rem; padding: .55rem .75rem; border-top: 1px solid #fecaca; border-bottom: 1px solid #fecaca; background: #fef2f2; color: #991b1b; }
.flow-machine-blocked-message strong { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.flow-machine-blocked-message span { font-size: .68rem; line-height: 1.35; }
.flow-machine-card.is-blocked .flow-drop-zone { background: rgba(254,242,242,.6); }
.flow-machine-card.is-blocked .flow-empty-drop { border-color: #fca5a5; color: #b91c1c; }
.flow-machine-card.is-blocked .flow-suggestions { display: none; }
.flow-dialog-hint { margin: -.35rem 0 .15rem; color: #64748b; font-size: .78rem; line-height: 1.45; }
.flow-task-dialog label { display: grid; gap: .3rem; color: #334155; font-size: .78rem; font-weight: 750; }
.flow-task-dialog textarea { resize: vertical; }
.flow-task-dialog { width: min(620px,calc(100% - 2rem)); }

@media (max-width: 1450px) {
  .flow-workspace-planning { grid-template-columns: minmax(205px,.58fr) minmax(0,2fr) minmax(235px,.68fr); }
  .flow-workspace-planning .flow-machine-board { grid-template-columns: repeat(auto-fit,minmax(270px,1fr)); }
}
@media (max-width: 1100px) {
  .flow-workspace-planning { grid-template-columns: 230px minmax(0,1fr); }
  .flow-workspace-planning .flow-task-pool { grid-column: 1 / -1; position: static; max-height: none; }
  .flow-workspace-planning .flow-task-stack { grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); max-height: none; }
}
@media (max-width: 760px) {
  .flow-workspace-planning { grid-template-columns: 1fr; }
  .flow-workspace-planning .flow-pool-panel { position: static; max-height: none; }
  .flow-workspace-planning .flow-task-pool { grid-column: auto; }
  .flow-mode-tabs { grid-template-columns: 1fr; }
}

/* LEITIO Skill 4.3 */
.skill-page { background: #f4f7fb; }
.skill-shell { width: min(1500px, calc(100% - 2rem)); margin: 1.5rem auto 4rem; display: grid; gap: 1rem; }
.skill-hero { display:flex; align-items:center; justify-content:space-between; gap:1.5rem; padding:2rem; border-radius:24px; color:#fff; background:linear-gradient(135deg,#062e61,#0b5f8a 62%,#0f9f9a); box-shadow:0 24px 50px rgba(6,46,97,.18); }
.skill-hero h1 { margin:.2rem 0; font-size:clamp(2rem,4vw,3.3rem); color:#fff; }.skill-hero p{max-width:780px;margin:.35rem 0 0;color:#d9f4ff}.skill-kicker{text-transform:uppercase;letter-spacing:.16em;font-size:.76rem;font-weight:800}.skill-hero-actions{display:flex;gap:.7rem;flex-wrap:wrap}.skill-hero .btn-secondary{background:rgba(255,255,255,.14);border-color:rgba(255,255,255,.35);color:#fff}
.skill-tabs{display:flex;gap:.35rem;overflow:auto;padding:.35rem;background:#fff;border:1px solid #dbe4ef;border-radius:16px}.skill-tabs a{white-space:nowrap;padding:.72rem 1rem;border-radius:12px;color:#475569;font-weight:700;text-decoration:none}.skill-tabs a.active{background:#062e61;color:#fff}
.skill-stat-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:.8rem}.skill-stat-grid article{background:#fff;border:1px solid #dbe4ef;border-radius:18px;padding:1.25rem;display:grid;gap:.25rem}.skill-stat-grid strong{font-size:2rem;color:#062e61}.skill-stat-grid span{color:#64748b;font-size:.82rem}.skill-stat-grid .is-alert{border-color:#f7b4b4;background:#fff7f7}.skill-grid-two{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(320px,.75fr);gap:1rem}.skill-machine-list,.skill-alert-list,.skill-catalog-list,.skill-requirement-list,.skill-development-list,.skill-evidence-list,.skill-history{display:grid;gap:.65rem}.skill-machine,.skill-alert-list article,.skill-catalog-list article,.skill-requirement-list article,.skill-development-list article,.skill-evidence-list article,.skill-history article,.skill-mini-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.9rem 1rem;border:1px solid #e2e8f0;border-radius:14px;background:#fff}.skill-machine div,.skill-catalog-list article>div:first-child,.skill-requirement-list article>div,.skill-development-list article>div,.skill-evidence-list article>div:first-child,.skill-history article{display:grid;gap:.15rem}.skill-machine small,.skill-machine span,.skill-alert-list span,.skill-catalog-list small,.skill-requirement-list span,.skill-requirement-list small,.skill-development-list span,.skill-development-list small,.skill-evidence-list span,.skill-evidence-list small,.skill-history span,.skill-history small,.skill-mini-row span{color:#64748b;font-size:.8rem}.skill-status-blocked{border-left:5px solid #dc2626}.skill-status-warning{border-left:5px solid #f59e0b}.skill-status-qualified{border-left:5px solid #16a34a}
.skill-section-head{display:flex;justify-content:space-between;gap:1rem;align-items:end}.skill-section-head h2{margin-bottom:.2rem}.skill-filter{max-width:340px}.skill-matrix-wrap{overflow:auto;margin-top:1rem;border:1px solid #dbe4ef;border-radius:14px}.skill-matrix{border-collapse:separate;border-spacing:0;width:max-content;min-width:100%;font-size:.82rem}.skill-matrix th,.skill-matrix td{padding:.7rem;border-right:1px solid #e2e8f0;border-bottom:1px solid #e2e8f0;text-align:center;background:#fff;min-width:130px}.skill-matrix thead th{position:sticky;top:0;z-index:2;background:#eef4fa;color:#062e61}.skill-matrix tbody th{position:sticky;left:0;z-index:1;text-align:left;background:#f8fafc}.skill-cell{position:relative}.skill-level{display:inline-grid;place-items:center;width:2rem;height:2rem;border-radius:50%;background:#e2e8f0;font-weight:900;color:#062e61}.skill-cell.status-valid .skill-level{background:#dcfce7;color:#166534}.skill-cell.status-expired .skill-level,.skill-cell.status-revoked .skill-level{background:#fee2e2;color:#991b1b}.skill-cell small{display:block;margin:.3rem 0}.skill-edit-button{border:0;background:transparent;color:#0b5f8a;text-decoration:underline;cursor:pointer;font-size:.72rem}.skill-dialog{border:0;border-radius:20px;padding:0;width:min(680px,calc(100% - 2rem));box-shadow:0 30px 80px rgba(15,23,42,.35)}.skill-dialog::backdrop{background:rgba(15,23,42,.55)}.skill-dialog header,.skill-dialog footer{padding:1.1rem 1.35rem;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #e2e8f0}.skill-dialog footer{border-top:1px solid #e2e8f0;border-bottom:0;justify-content:flex-end}.skill-dialog h2{margin:.15rem 0}.dialog-close{border:0;background:#eef2f7;border-radius:50%;font-size:1.5rem;width:2.3rem;height:2.3rem;cursor:pointer}.skill-dialog-body,.skill-form{padding:1.25rem;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}.skill-form{padding:0}.skill-dialog-body label,.skill-form label,.skill-form-row label{display:grid;gap:.35rem;font-weight:700;color:#334155;font-size:.82rem}.skill-dialog-body .full,.skill-form .full{grid-column:1/-1}.skill-form .check{display:flex;align-items:center}.skill-form-row{display:flex;align-items:end;gap:1rem;flex-wrap:wrap}.skill-tags,.skill-row-actions{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap}.skill-tags span{padding:.25rem .55rem;background:#e2e8f0;border-radius:99px;font-size:.7rem}.skill-tags .tag-danger{background:#fee2e2;color:#991b1b}.skill-card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:1rem}.skill-person-card{background:#fff;border:1px solid #dbe4ef;border-radius:18px;padding:1.15rem}.skill-person-card header{display:flex;justify-content:space-between;gap:1rem}.skill-person-card header div{display:grid}.skill-level-large{display:grid;place-items:center;width:3rem;height:3rem;border-radius:50%;background:#dbeafe;color:#062e61;font-size:1.35rem;font-weight:900}.skill-person-card.status-expired,.skill-person-card.status-revoked{border-color:#fca5a5}.skill-person-card details{margin-top:.8rem}.skill-person-card details .skill-form{margin-top:.8rem;grid-template-columns:1fr}.empty-state{color:#64748b}.btn-small{padding:.4rem .65rem;font-size:.75rem}
@media (max-width:1100px){.skill-stat-grid{grid-template-columns:repeat(3,1fr)}.skill-grid-two{grid-template-columns:1fr}}@media(max-width:700px){.skill-shell{width:min(100% - 1rem,1500px)}.skill-hero{align-items:flex-start;flex-direction:column;padding:1.4rem}.skill-stat-grid{grid-template-columns:repeat(2,1fr)}.skill-dialog-body,.skill-form{grid-template-columns:1fr}.skill-dialog-body .full,.skill-form .full{grid-column:auto}.skill-section-head{align-items:stretch;flex-direction:column}.skill-filter{max-width:none}}
.task-skill-badge{display:block;width:max-content;margin-top:.3rem;padding:.18rem .45rem;border-radius:999px;font-size:.68rem;font-weight:800}.task-skill-qualified{background:#dcfce7;color:#166534}.task-skill-warning{background:#fef3c7;color:#92400e}.task-skill-blocked{background:#fee2e2;color:#991b1b}.machine-skill-summary{display:grid;gap:.1rem;margin:.55rem 0;padding:.5rem .65rem;border-radius:10px;background:#f1f5f9;font-size:.72rem}.machine-skill-qualified{background:#ecfdf5;color:#166534}.machine-skill-warning{background:#fffbeb;color:#92400e}.machine-skill-blocked{background:#fef2f2;color:#991b1b}.task-skill-evaluation{padding:.85rem 1rem;border:1px solid #cbd5e1;border-radius:12px;background:#f8fafc}.task-skill-evaluation>div{display:grid;gap:.15rem}.task-skill-evaluation ul{margin:.45rem 0 0;padding-left:1.2rem;color:#475569}.task-skill-evaluation.is-qualified{border-color:#86efac;background:#f0fdf4}.task-skill-evaluation.is-warning{border-color:#fcd34d;background:#fffbeb}.task-skill-evaluation.is-blocked{border-color:#fca5a5;background:#fef2f2}.task-skill-evaluation label{margin-top:.7rem;display:grid;gap:.3rem}

/* LEITIO Skill integration in Flow */
.flow-machine-skill{display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin:.65rem .8rem 0;padding:.5rem .65rem;border-radius:.7rem;background:var(--surface-soft,#f8fafc);font-size:.78rem;border:1px solid var(--border,#e2e8f0)}
.flow-machine-skill.is-qualified{border-color:#86efac;background:#f0fdf4}.flow-machine-skill.is-warning{border-color:#fde68a;background:#fffbeb}.flow-machine-skill.is-blocked{border-color:#fca5a5;background:#fef2f2}
.flow-skill-dot{display:inline-block;width:.58rem;height:.58rem;border-radius:50%;margin-left:.3rem;background:#94a3b8}.flow-skill-dot.is-qualified,.flow-skill-dot.is-not_required{background:#22c55e}.flow-skill-dot.is-warning{background:#f59e0b}.flow-skill-dot.is-blocked{background:#ef4444}
.flow-skill-neutral{color:#64748b}.flow-suggestions button.is-skill-warning{box-shadow:0 0 0 2px #f59e0b inset}

.pulse-skill-training{color:#0369a1;font-weight:700}.pulse-skill-panel{border-color:#bae6fd}

/* LEITIO 4.3.1 – unified Flow shift management and universal incident reporting */
.flow-shift-model-panel { margin-bottom: 1rem; }
.flow-shift-model-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.flow-shift-model-heading h2 { margin: .15rem 0 .3rem; }
.flow-shift-model-heading p { margin: 0; max-width: 72ch; }
.flow-shift-model-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem; }
.flow-shift-model-card { border: 1px solid var(--border-color, #d9e1ea); border-radius: 16px; padding: .9rem; background: var(--surface, #fff); }
.flow-shift-model-card.is-inactive { opacity: .68; background: #f5f7fa; }
.flow-shift-model-card > header { display: flex; justify-content: space-between; gap: .75rem; }
.flow-shift-model-card > header div { display: grid; gap: .15rem; }
.flow-shift-model-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin: .8rem 0; }
.flow-shift-model-card dl div { display: grid; gap: .1rem; }
.flow-shift-model-card dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #607086; }
.flow-shift-model-card dd { margin: 0; font-weight: 650; }
.flow-shift-model-card footer { display: flex; gap: .5rem; flex-wrap: wrap; }
.flow-roster-guidance { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .7rem .9rem; margin-bottom: .75rem; border-radius: 12px; background: #eef7ff; color: #173d64; }
.flow-roster-guidance div { display: grid; gap: .15rem; }
.flow-roster-source { width: fit-content; padding: .12rem .45rem; border-radius: 999px; font-size: .68rem; font-weight: 750; }
.flow-roster-source.is-baseline { background: #e7f5ee; color: #14623c; }
.flow-roster-source.is-override { background: #fff4d8; color: #7a4a00; }
.flow-roster-reset { align-self: center; border: 0; border-radius: 9px; padding: .35rem .5rem; background: #fff3d5; color: #7c4b00; cursor: pointer; }
.flow-dialog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.flow-dialog-grid label { display: grid; gap: .3rem; }
.flow-weekday-options { border: 1px solid #d9e1ea; border-radius: 12px; margin: .8rem 0; padding: .75rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .45rem; }
.flow-weekday-options legend { padding: 0 .3rem; font-weight: 700; }
.flow-scope-options { display: grid; gap: .55rem; }
.flow-scope-options > label { display: flex; align-items: flex-start; gap: .65rem; border: 1px solid #d9e1ea; border-radius: 12px; padding: .7rem; cursor: pointer; }
.flow-scope-options > label > input[type="radio"] { width: 18px; min-width: 18px; height: 18px; flex: 0 0 18px; padding: 0; margin: .12rem 0 0; }
.flow-scope-options span { display: grid; gap: .15rem; min-width: 0; }
.flow-scope-options small { color: #607086; }
.flow-custom-scope { margin-top: .75rem; padding: .75rem; background: #f7f9fc; border-radius: 12px; }
.workforce-flow-consolidated { display: grid; gap: .4rem; margin-bottom: 1rem; border-left: 4px solid #1677ff; }
.nav-incident-action { color: #b42318; }
.nav-incident-action:hover, .nav-incident-action.is-active { background: #fff0ef; color: #8f1b13; }
.incident-report-callout { border-left: 4px solid #d92d20; background: #fff6f5; margin-bottom: 1rem; }
.support-category-incident { background: #fff0ef; color: #b42318; }
@media (max-width: 760px) {
  .flow-shift-model-heading, .flow-roster-guidance { align-items: stretch; flex-direction: column; }
  .flow-dialog-grid { grid-template-columns: 1fr; }
}
.flow-shift-model-grid-empty {
    width: 100%;
    margin-top: 1rem;
}

/* LEITIO 4.3.1 Security 1 Fix 4 */
.flow-assignment-counter{display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;min-width:1.45rem;height:1.45rem;margin-left:.1rem;padding:0 .35rem;border-radius:999px;background:var(--accent,#1588a6);color:#fff;font-size:.75rem;vertical-align:middle}
.flow-task-card.is-continuation{opacity:.82;border-style:dashed;cursor:default}
.flow-segment-badge{margin-left:.45rem;padding:.15rem .4rem;border-radius:999px;background:rgba(21,136,166,.12);font-size:.7rem;color:var(--accent,#1588a6)}
.flow-lock-handle{font-size:1.15rem;opacity:.65}
.smart-suggestion-menu{position:absolute;z-index:1000;min-width:14rem;max-width:min(34rem,90vw);max-height:16rem;overflow:auto;background:var(--surface,#fff);border:1px solid rgba(0,0,0,.16);border-radius:.7rem;box-shadow:0 12px 32px rgba(0,0,0,.18);padding:.35rem}
.smart-suggestion-menu button{display:block;width:100%;border:0;background:transparent;text-align:left;padding:.55rem .65rem;border-radius:.45rem;cursor:pointer}
.smart-suggestion-menu button:hover,.smart-suggestion-menu button:focus{background:rgba(21,136,166,.12)}

/* LEITIO 4.3.1 Fix 4G – Routineaufgaben */
.routine-page { background: #f4f7fb; }
.routine-shell { width: min(1450px,calc(100% - 2rem)); margin: 1.4rem auto 4rem; display: grid; gap: 1rem; }
.routine-hero { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.45rem 1.6rem; border: 1px solid #dbe4ef; border-radius: 22px; background: linear-gradient(135deg,#fff,#eef6ff); box-shadow: 0 16px 38px rgba(15,23,42,.07); }
.routine-hero h1 { margin: .15rem 0 .3rem; color: #10233f; }
.routine-hero p { max-width: 780px; margin: 0; color: #64748b; line-height: 1.5; }
.routine-kicker { color: #0e7490; font-size: .72rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.routine-hero-actions { display: flex; gap: .55rem; flex-wrap: wrap; justify-content: flex-end; }
.routine-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .65rem; }
.routine-summary > div { display: grid; gap: .08rem; padding: .8rem 1rem; border: 1px solid #dbe4ef; border-radius: 14px; background: #fff; }
.routine-summary strong { color: #062e61; font-size: 1.35rem; }
.routine-summary span { color: #64748b; font-size: .72rem; }
.routine-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(320px,1fr)); align-items: start; gap: .8rem; }
.routine-card { display: grid; gap: .75rem; padding: 1rem; border: 1px solid #dbe4ef; border-radius: 17px; background: #fff; box-shadow: 0 8px 24px rgba(15,23,42,.045); }
.routine-card.is-paused { opacity: .72; background: #f8fafc; }
.routine-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.routine-card > header > div { display: flex; align-items: flex-start; gap: .55rem; min-width: 0; }
.routine-card h2 { margin: 0; overflow: hidden; color: #10233f; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.routine-card header p { margin: .15rem 0 0; color: #64748b; font-size: .7rem; }
.routine-status-dot { flex: 0 0 auto; width: 9px; height: 9px; margin-top: .3rem; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 4px rgba(22,163,74,.12); }
.routine-card.is-paused .routine-status-dot { background: #94a3b8; box-shadow: none; }
.routine-state { padding: .25rem .45rem; border-radius: 999px; background: #ecfdf5; color: #166534; font-size: .63rem; font-weight: 900; }
.routine-card.is-paused .routine-state { background: #e2e8f0; color: #475569; }
.routine-card dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; margin: 0; }
.routine-card dl > div { min-width: 0; padding: .5rem .55rem; border-radius: 10px; background: #f8fafc; }
.routine-card dt { color: #94a3b8; font-size: .6rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.routine-card dd { margin: .16rem 0 0; overflow: hidden; color: #334155; font-size: .72rem; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.routine-card > footer { display: flex; justify-content: flex-end; gap: .45rem; padding-top: .15rem; border-top: 1px solid #eef2f7; }
.routine-card > footer form { margin: 0; }
.routine-empty { grid-column: 1/-1; padding: 2.2rem; border: 1px dashed #bfccdb; border-radius: 18px; background: #fff; text-align: center; color: #64748b; }
.routine-empty strong { display: block; color: #10233f; font-size: 1.05rem; }
.routine-empty p { margin: .35rem 0 1rem; }
.routine-dialog { width: min(820px,calc(100% - 1.5rem)); max-height: calc(100vh - 2rem); padding: 0; border: 0; border-radius: 20px; box-shadow: 0 30px 90px rgba(15,23,42,.3); }
.routine-dialog::backdrop { background: rgba(7,26,54,.58); backdrop-filter: blur(3px); }
.routine-dialog form > header, .routine-dialog form > footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid #e2e8f0; }
.routine-dialog form > footer { justify-content: flex-end; border-top: 1px solid #e2e8f0; border-bottom: 0; }
.routine-dialog h2 { margin: .12rem 0 0; color: #10233f; }
.routine-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .85rem; max-height: calc(100vh - 190px); overflow: auto; padding: 1.15rem 1.25rem; }
.routine-form-grid > label, .routine-rule label { display: grid; gap: .3rem; color: #334155; font-size: .75rem; font-weight: 800; }
.routine-form-grid label small { color: #94a3b8; font-weight: 650; }
.routine-form-grid .full { grid-column: 1/-1; }
.routine-form-divider { display: grid; gap: .12rem; margin-top: .25rem; padding-top: .8rem; border-top: 1px solid #e2e8f0; }
.routine-form-divider strong { color: #10233f; }
.routine-form-divider span { color: #64748b; font-size: .7rem; }
.routine-rule { margin: 0; padding: .75rem; border: 1px solid #dbe4ef; border-radius: 12px; background: #f8fafc; }
.routine-rule legend { padding: 0 .35rem; color: #334155; font-size: .75rem; font-weight: 900; }
.routine-rule > p { margin: 0 0 .45rem; color: #64748b; font-size: .68rem; }
.routine-choice-row, .routine-month-days { display: flex; flex-wrap: wrap; gap: .38rem; }
.routine-choice-row label, .routine-month-days label { display: inline-flex; align-items: center; justify-content: center; gap: .25rem; padding: .3rem .42rem; border: 1px solid #dbe4ef; border-radius: 8px; background: #fff; cursor: pointer; }
.routine-month-days label { width: 42px; }
.routine-choice-row input, .routine-month-days input { width: auto; }
.routine-inline-field { display: flex !important; grid-template-columns: none; align-items: center; gap: .45rem !important; }
.routine-inline-field input { width: 95px; }
.routine-year-rule { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; }
.routine-year-rule:not([hidden]) { display: grid; }
@media (max-width: 700px) { .routine-shell { width: min(100% - 1rem,1450px); } .routine-hero { align-items: flex-start; flex-direction: column; } .routine-summary { grid-template-columns: 1fr 1fr 1fr; } .routine-grid { grid-template-columns: 1fr; } .routine-form-grid { grid-template-columns: 1fr; } .routine-form-grid .full { grid-column: auto; } .routine-card dl { grid-template-columns: 1fr; } }

/* Fix 4I: immediate visual feedback while a Flow task write is being confirmed. */
.flow-task-card.is-flow-optimistic {
    opacity: .72;
    transform: scale(.995);
}

/* LEITIO 4.3.1 Security 1 Fix 4L – multilingual foundation */
.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: .22rem;
  flex: 0 0 auto;
}
.language-switch-form { margin: 0; display: inline-flex; }
.language-flag {
  appearance: none;
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, .38);
  border-radius: 9px;
  background: rgba(255, 255, 255, .72);
  cursor: pointer;
  padding: 0;
  font-size: 1.08rem;
  line-height: 1;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.language-flag:hover,
.language-flag:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, .58);
  box-shadow: 0 5px 14px rgba(15, 23, 42, .12);
  outline: none;
}
.language-flag.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .13);
}
.language-switcher-auth {
  justify-content: center;
  margin: -.15rem 0 .65rem;
}
.auth-login-card .language-switcher-auth { align-self: center; }
@media (max-width: 720px) {
  .topbar-actions > .language-switcher { gap: .1rem; }
  .topbar-actions > .language-switcher .language-flag { width: 27px; height: 27px; border-radius: 8px; font-size: .98rem; }
}
@media (max-width: 520px) {
  .topbar-actions > .language-switcher { max-width: 74px; overflow-x: auto; scrollbar-width: none; }
  .topbar-actions > .language-switcher::-webkit-scrollbar { display: none; }
}


/* LEITIO Fix 4M – mobile/tablet swipe-to-delete for own direct-chat messages */
.support-message-swipe-frame {
  position: relative;
  justify-self: end;
  width: min(68%, 720px);
  overflow: hidden;
  border-radius: 14px 14px 4px 14px;
}
.support-message-swipe-frame .support-message {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: none;
  justify-self: stretch;
  touch-action: pan-y;
  transition: transform .18s ease;
  will-change: transform;
}
.support-message-swipe-frame.is-swiping .support-message { transition: none; }
.support-message-swipe-frame.is-deleting .support-message { transform: translateX(-100%) !important; transition: transform .18s ease; }
.support-message-swipe-action {
  position: absolute;
  z-index: 1;
  inset: 0 0 0 auto;
  width: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #b91c1c;
  color: #fff;
  font-weight: 850;
  letter-spacing: .01em;
}
@media (max-width: 760px) {
  .support-message-swipe-frame { width: 100%; }
}

/* LEITIO 4.3.1 Security 1 Fix 4N – compact mobile language selector (Variant A) */
.language-switcher-desktop {
  display: inline-flex;
  align-items: center;
  gap: .22rem;
}
.language-switcher-mobile { display: none; }
.language-switcher-mobile > summary { list-style: none; }
.language-switcher-mobile > summary::-webkit-details-marker { display: none; }

@media (max-width: 720px) {
  .topbar-actions > .language-switcher {
    max-width: none;
    overflow: visible;
    flex: 0 0 auto;
  }
  .topbar-actions { overflow: visible !important; }
  .language-switcher-desktop { display: none; }
  .language-switcher-mobile {
    position: relative;
    display: block;
    flex: 0 0 auto;
  }
  .language-mobile-trigger {
    box-sizing: border-box;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 0 3px;
    border: 1px solid rgba(148, 163, 184, .46);
    border-radius: 11px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  .language-mobile-trigger:focus-visible {
    outline: 2px solid #67e8f9;
    outline-offset: 2px;
  }
  .language-mobile-current-flag {
    display: inline-grid;
    place-items: center;
    font-size: 1.08rem;
    line-height: 1;
  }
  .language-mobile-chevron {
    width: 5px;
    height: 5px;
    margin-top: -3px;
    border-right: 1.5px solid #475569;
    border-bottom: 1.5px solid #475569;
    transform: rotate(45deg);
    transition: transform .16s ease, margin-top .16s ease;
  }
  .language-switcher-mobile[open] .language-mobile-chevron {
    margin-top: 3px;
    transform: rotate(225deg);
  }
  .language-mobile-menu {
    position: absolute;
    z-index: 520;
    top: calc(100% + .48rem);
    left: 0;
    width: max-content;
    min-width: 172px;
    max-width: min(240px, calc(100vw - 1rem));
    padding: .35rem;
    border: 1px solid rgba(148, 163, 184, .35);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(2, 23, 50, .26);
  }
  .language-mobile-form { margin: 0; }
  .language-mobile-option {
    appearance: none;
    width: 100%;
    min-height: 42px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 18px;
    align-items: center;
    gap: .45rem;
    padding: .45rem .55rem;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #10233f;
    font: inherit;
    font-size: .84rem;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
  }
  .language-mobile-option:hover,
  .language-mobile-option:focus-visible {
    background: #eef7fb;
    outline: none;
  }
  .language-mobile-option.is-active {
    background: #e8f7f8;
    color: #075985;
  }
  .language-mobile-option-flag {
    display: inline-grid;
    place-items: center;
    font-size: 1.16rem;
    line-height: 1;
  }
  .language-mobile-check {
    color: #0f766e;
    font-weight: 900;
    text-align: center;
  }
  .language-switcher-auth .language-mobile-menu {
    left: 50%;
    transform: translateX(-50%);
  }
}


/* LEITIO 4.3.1 Security 1 Fix 4O – compact permission-aware mobile navigation */
.mobile-nav-controls,
.mobile-nav-backdrop,
.mobile-nav-drawer { display: none; }
.mobile-nav-backdrop[hidden],
.mobile-nav-drawer[hidden] { display: none !important; }

/* Fix 4Y: die kompakte, berechtigungsabhängige Drawer-Navigation ist der globale Standard. */

  body.mobile-nav-open { overflow: hidden; overscroll-behavior: contain; }
  .topbar {
    min-height: 62px;
    flex-wrap: nowrap;
    gap: .55rem;
    padding: .5rem .6rem;
  }
  .topbar-identities {
    min-width: 0;
    flex: 1 1 auto;
    gap: .42rem;
    overflow: hidden;
  }
  .topbar-actions {
    width: auto !important;
    min-width: auto;
    flex: 0 0 auto !important;
    margin-left: auto;
    justify-content: flex-end !important;
    gap: .38rem;
    overflow: visible !important;
  }
  .topbar-actions > .language-switcher,
  .topbar-actions > .topnav { display: none !important; }
  .mobile-nav-controls {
    display: flex;
    align-items: center;
    gap: .38rem;
  }
  .mobile-nav-profile-trigger,
  .mobile-nav-trigger,
  .mobile-nav-close {
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 44px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 13px;
    background: rgba(255,255,255,.08);
    color: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-nav-profile-trigger { border-radius: 999px; }
  .mobile-nav-profile-trigger .user-avatar-nav { width: 40px; height: 40px; }
  .mobile-nav-profile-trigger.is-active,
  .mobile-nav-trigger[aria-expanded="true"] {
    border-color: rgba(103,232,249,.72);
    background: rgba(8,165,181,.26);
    box-shadow: 0 0 0 2px rgba(103,232,249,.12);
  }
  .mobile-nav-trigger:focus-visible,
  .mobile-nav-profile-trigger:focus-visible,
  .mobile-nav-close:focus-visible {
    outline: 2px solid #67e8f9;
    outline-offset: 2px;
  }
  .mobile-nav-trigger .ui-icon,
  .mobile-nav-close .ui-icon { width: 1.45rem; height: 1.45rem; }

  .mobile-nav-backdrop {
    position: fixed;
    z-index: 980;
    inset: 0;
    display: block;
    background: rgba(1, 15, 33, .56);
    opacity: 0;
    backdrop-filter: blur(2px);
    transition: opacity .2s ease;
  }
  .mobile-nav-backdrop.is-open { opacity: 1; }
  .mobile-nav-drawer {
    position: fixed;
    z-index: 990;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(88vw, 380px);
    display: flex;
    flex-direction: column;
    gap: .75rem;
    overflow-x: hidden;
    overflow-y: auto;
    padding: max(.8rem, env(safe-area-inset-top)) .72rem max(1rem, env(safe-area-inset-bottom));
    border-left: 1px solid rgba(255,255,255,.16);
    background: linear-gradient(180deg, #062e61 0, #073d70 128px, #f5f9fc 128px, #f5f9fc 100%);
    box-shadow: -18px 0 48px rgba(1, 15, 33, .28);
    transform: translateX(104%);
    transition: transform .22s ease;
    overscroll-behavior: contain;
  }
  .mobile-nav-drawer.is-open { transform: translateX(0); }
  .mobile-nav-drawer-header {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .2rem .15rem .7rem;
    color: #fff;
  }
  .mobile-nav-user {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .65rem;
  }
  .mobile-nav-user .user-avatar-md { flex: 0 0 auto; }
  .mobile-nav-user > span:last-child { min-width: 0; display: grid; gap: .16rem; }
  .mobile-nav-user strong {
    overflow: hidden;
    font-size: .95rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-nav-user small {
    overflow: hidden;
    color: #c9dfef;
    font-size: .7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-nav-close { background: rgba(255,255,255,.1); }

  .mobile-nav-language-section {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    padding: .55rem .62rem;
    border: 1px solid #d6e4ed;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(3,29,61,.06);
  }
  .mobile-nav-section-label { min-width: 0; display: grid; gap: .08rem; color: #10233f; }
  .mobile-nav-section-label strong { font-size: .82rem; }
  .mobile-nav-section-label small { color: #64748b; font-size: .7rem; }
  .mobile-nav-language-section .language-switcher { flex: 0 0 auto; }
  .mobile-nav-language-section .language-mobile-menu { left: auto; right: 0; z-index: 1010; }

  .mobile-nav-list { display: grid; gap: .42rem; }
  .mobile-nav-item {
    appearance: none;
    width: 100%;
    min-height: 62px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: .65rem;
    padding: .55rem .62rem;
    border: 1px solid #d6e4ed;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(3,29,61,.055);
    color: #10233f;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, transform .15s ease, box-shadow .15s ease;
  }
  .mobile-nav-item:hover,
  .mobile-nav-item:focus-visible {
    border-color: #8ad6df;
    background: #f0fbfc;
    outline: none;
    box-shadow: 0 7px 20px rgba(3,29,61,.09);
  }
  .mobile-nav-item:active { transform: scale(.992); }
  .mobile-nav-item.is-active {
    border-color: #69cbd5;
    background: linear-gradient(100deg, #e8f8f9, #fff);
    box-shadow: inset 3px 0 0 #08a5b5, 0 5px 16px rgba(3,29,61,.06);
  }
  .mobile-nav-item-icon {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: #e9f4f8;
    color: #075985;
  }
  .mobile-nav-item-icon .ui-icon { width: 1.35rem; height: 1.35rem; }
  .mobile-nav-item-icon .user-avatar-xs { width: 34px; height: 34px; }
  .mobile-nav-item-copy { min-width: 0; display: grid; gap: .12rem; }
  .mobile-nav-item-copy strong {
    overflow: hidden;
    color: #0b2a55;
    font-size: .86rem;
    line-height: 1.18;
    text-overflow: ellipsis;
  }
  .mobile-nav-item-copy small {
    overflow: hidden;
    color: #64748b;
    font-size: .69rem;
    line-height: 1.28;
    text-overflow: ellipsis;
  }
  .mobile-nav-item-arrow { color: #607b91; font-size: 1.3rem; line-height: 1; }
  .mobile-nav-item-count {
    min-width: 25px;
    height: 25px;
    display: inline-grid;
    place-items: center;
    padding: 0 .35rem;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: .68rem;
    font-weight: 900;
  }
  .mobile-nav-logout-form { margin: .05rem 0 0; padding-top: .4rem; border-top: 1px solid #d6e4ed; }
  .mobile-nav-logout-item { color: #991b1b; }
  .mobile-nav-logout-item .mobile-nav-item-icon { background: #fee2e2; color: #b91c1c; }

  .tenant-context-bar { position: relative; z-index: 40; }

.topbar-actions > .tenant-badge { display: none !important; }

/* LEITIO 4.3.1 Security 1 Fix 4Q – Pulse attendance correction, reporting and shift guard */
.pulse-correction-hint { margin: 12px 0 0; padding: 11px 14px; border: 1px solid rgba(11,104,199,.18); border-radius: 13px; background: rgba(255,255,255,.78); color: #526f85; font-size: .86rem; }
.pulse-live-column[data-pulse-time-target] { transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.pulse-live-column[data-pulse-time-target].is-drag-over { border-color: rgba(11,104,199,.55); box-shadow: 0 0 0 3px rgba(11,104,199,.11), 0 18px 36px rgba(9,57,99,.13); transform: translateY(-2px); }
.pulse-live-person.is-time-correctable { cursor: grab; outline: none; }
.pulse-live-person.is-time-correctable:active { cursor: grabbing; }
.pulse-live-person.is-time-correctable.is-dragging { opacity: .48; }
.pulse-live-person.is-time-correctable.is-selected { box-shadow: 0 0 0 3px rgba(11,104,199,.16); border-color: rgba(11,104,199,.48); }
.pulse-shift-guard-panel { margin-top: 16px; display: grid; grid-template-columns: minmax(0,1.3fr) minmax(360px,.7fr); gap: 22px; align-items: start; }
.pulse-shift-guard-copy h2 { margin: 5px 0 8px; }
.pulse-shift-guard-copy p { margin: 0; color: #688094; }
.pulse-shift-guard-warning { margin-top: 10px !important; padding: 9px 11px; border-radius: 10px; background: rgba(230,161,38,.13); color: #8d641a !important; }
.pulse-shift-guard-form { display: grid; gap: 12px; }
.pulse-switch-row { display: flex; align-items: center; gap: 9px; font-weight: 700; }
.pulse-switch-row input { width: 18px; height: 18px; }
.pulse-shift-guard-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.pulse-shift-guard-fields label { display: grid; gap: 5px; font-size: .76rem; color: #647e92; }
.pulse-shift-guard-fields input { min-width: 0; padding: 9px; border: 1px solid var(--pulse-border); border-radius: 9px; }
.pulse-shift-guard-fields small { color: #8ba0b0; }
.pulse-note-line, .pulse-private-note { display: block; margin-top: 5px; font-size: .82rem; line-height: 1.35; }
.pulse-private-note { padding: 7px 9px; border-radius: 9px; background: rgba(8,39,71,.055); color: #536d82; }
.pulse-absence-history article > div { display: grid; gap: 2px; }
.pulse-policy-form { grid-template-columns: repeat(3, minmax(0,1fr)); }
.pulse-report-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; margin: 18px 0 12px; }
.pulse-report-head h2 { margin: 4px 0; }
.pulse-report-head p { margin: 0; color: #6e879a; }
.pulse-report-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.pulse-report-filter { margin-bottom: 12px; }
.pulse-report-table-wrap { overflow-x: auto; border: 1px solid var(--pulse-border); border-radius: 17px; background: #fff; box-shadow: 0 12px 34px rgba(9,57,99,.08); }
.pulse-report-table { width: 100%; border-collapse: collapse; min-width: 960px; }
.pulse-report-table th, .pulse-report-table td { padding: 11px 12px; border-bottom: 1px solid rgba(15,65,104,.09); text-align: right; vertical-align: top; }
.pulse-report-table th:first-child, .pulse-report-table td:first-child { text-align: left; }
.pulse-report-table thead th { position: sticky; top: 0; background: #f2f8fc; color: #5c7488; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; z-index: 1; }
.pulse-report-summary-row td:first-child strong, .pulse-report-summary-row td:first-child small { display: block; }
.pulse-report-summary-row td:first-child small { margin-top: 2px; color: #8296a6; }
.pulse-report-table .is-positive { color: #177956; }
.pulse-report-table .is-negative { color: #b84949; }
.pulse-report-detail-row td { padding: 0 12px 10px; background: #fbfdff; }
.pulse-report-detail-row summary { cursor: pointer; color: #59758b; font-size: .8rem; padding: 7px 0; }
.pulse-report-days { display: grid; gap: 5px; padding: 2px 0 8px; }
.pulse-report-days > div { display: grid; grid-template-columns: 105px repeat(4,minmax(110px,1fr)); gap: 8px; padding: 7px 9px; border-radius: 9px; background: #f3f8fb; font-size: .78rem; text-align: left; }
.pulse-shift-guard-reminder { display: grid; gap: 11px; }
.pulse-shift-guard-reminder h2 { margin: 0; }
.pulse-shift-guard-reminder p { margin: 0; color: #637c90; }
.pulse-shift-guard-deadline { font-weight: 700; color: var(--pulse-ink) !important; }

@media (max-width: 900px) {
  .pulse-shift-guard-panel { grid-template-columns: 1fr; }
  .pulse-report-head { align-items: flex-start; flex-direction: column; }
  .pulse-report-actions { justify-content: flex-start; }
}
@media (max-width: 620px) {
  .pulse-shift-guard-fields, .pulse-policy-form { grid-template-columns: 1fr; }
  .pulse-report-actions .btn { flex: 1 1 auto; }
}
@media print {
  .pulse-page { background: #fff !important; }
  .pulse-hero, .pulse-control-deck, .pulse-report-actions, .pulse-report-filter, .app-header, .site-header, .toast-stack { display: none !important; }
  .pulse-shell { width: 100%; margin: 0; }
  .pulse-report-table-wrap { box-shadow: none; border: 0; overflow: visible; }
  .pulse-report-table { min-width: 0; font-size: 10pt; }
  .pulse-report-detail-row details { display: none; }
}

/* LEITIO 4.3.1 Security 1 Fix 4R – intuitive administration information architecture */
.admin-nav { gap: .55rem !important; }
.admin-nav-group { display: grid; gap: .18rem; padding: .18rem 0 .5rem; }
.admin-nav-group + .admin-nav-group { border-top: 1px solid #e5edf2; padding-top: .7rem; }
.admin-nav-label { padding: .1rem .75rem .28rem; color: #718394; font-size: .64rem; font-weight: 850; letter-spacing: .075em; line-height: 1.25; text-transform: uppercase; }
.admin-sidebar .admin-nav-link { display: block; padding: .58rem .75rem; font-size: .86rem; line-height: 1.25; }
.admin-sidebar .admin-nav-overview { font-size: .92rem; }
.admin-nav-system { margin-top: .2rem; padding-top: .85rem !important; border-top: 2px solid #b9dce6 !important; }
.admin-nav-system .admin-nav-label { color: var(--leitio-cyan-700); }

.admin-home-heading { margin-bottom: 1.4rem; }
.admin-home-heading .eyebrow { margin: 0 0 .25rem; color: var(--leitio-cyan-700); font-size: .72rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.admin-home-section { margin-top: 1.4rem; }
.admin-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.admin-section-heading h2, .admin-section-heading h3 { margin: 0; color: var(--navy-950); }
.admin-section-heading p { margin: .2rem 0 0; color: var(--slate-600); font-size: .86rem; }
.admin-quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.admin-quick-card, .admin-area-card { display: grid; gap: .22rem; padding: 1rem; background: #fff; border: 1px solid #dbe7ed; border-radius: 14px; box-shadow: 0 8px 24px rgba(23, 55, 75, .055); color: inherit; }
.admin-quick-card:hover, .admin-area-card:hover { border-color: #9dcfdd; transform: translateY(-1px); box-shadow: 0 12px 30px rgba(23, 55, 75, .09); }
.admin-quick-card strong, .admin-area-card strong { color: var(--leitio-navy-900); }
.admin-quick-card span, .admin-area-card span { color: var(--slate-600); font-size: .8rem; line-height: 1.4; }
.admin-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin-area-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.admin-area-card { min-height: 105px; align-content: center; }
.admin-recent-list { overflow: hidden; background: #fff; border: 1px solid #dbe7ed; border-radius: 14px; }
.admin-recent-list article { display: grid; grid-template-columns: 145px minmax(0, 1fr); gap: 1rem; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid #edf2f5; }
.admin-recent-list article:last-child { border-bottom: 0; }
.admin-recent-list time { color: #6b7d8d; font-size: .76rem; }
.admin-recent-list article div { display: grid; gap: .12rem; }
.admin-recent-list article strong { color: var(--navy-950); font-size: .86rem; }
.admin-recent-list article span { color: var(--slate-600); font-size: .76rem; }
.admin-recent-list .empty-state { margin: 0; padding: 1rem; color: var(--slate-600); }

.admin-subnav { position: sticky; top: 72px; z-index: 12; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; padding: .55rem; background: rgba(255,255,255,.96); border: 1px solid #dbe7ed; border-radius: 12px; box-shadow: 0 8px 22px rgba(22,53,72,.055); backdrop-filter: blur(8px); }
.admin-subnav a, .admin-subnav button { appearance: none; border: 0; border-radius: 9px; padding: .52rem .72rem; background: transparent; color: #52697b; font: inherit; font-size: .8rem; font-weight: 750; cursor: pointer; }
.admin-subnav a:hover, .admin-subnav button:hover, .admin-subnav button.active { background: var(--leitio-cyan-100); color: var(--leitio-navy-900); }
.anchor-offset { position: relative; top: -100px; }

.settings-organized-form { display: grid; gap: 1rem; }
.settings-tab-panel { margin-bottom: 0; }
.settings-tab-panel[hidden] { display: none !important; }
.settings-savebar { position: sticky; bottom: 1rem; z-index: 10; display: flex; justify-content: flex-end; padding: .65rem; background: rgba(255,255,255,.94); border: 1px solid #dbe7ed; border-radius: 12px; box-shadow: 0 10px 28px rgba(22,53,72,.12); backdrop-filter: blur(8px); }
.settings-logo-block { display: grid; gap: .8rem; margin-top: 1rem; }
.settings-logo-block #logo-preview { width: 100%; max-width: 440px; max-height: 170px; object-fit: contain; border: 1px solid #e2e8f0; border-radius: 12px; padding: 1rem; background: #fff; }
.settings-logo-upload { display: flex; align-items: end; flex-wrap: wrap; gap: .8rem; }
.settings-logo-upload label { flex: 1 1 320px; }

@media (max-width: 980px) {
  .admin-sidebar .admin-nav { display: block; }
  .admin-nav-group { margin-bottom: .45rem; }
  .admin-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-subnav { position: static; }
}
@media (max-width: 640px) {
  .admin-quick-grid, .admin-area-grid, .admin-stat-grid { grid-template-columns: 1fr; }
  .admin-recent-list article { grid-template-columns: 1fr; gap: .2rem; }
  .admin-section-heading { align-items: stretch; flex-direction: column; }
}

/* LEITIO Fix 4S – Communication / Incident Management */
.chat-page { max-width: 1440px; }
.chat-heading { margin-bottom: 1rem; }
.chat-shell { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 1rem; min-height: min(72vh, 820px); }
.chat-shell-list-only { grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); }
.chat-sidebar { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.chat-sidebar-head { display: flex; justify-content: space-between; gap: .5rem; padding: .8rem; border-bottom: 1px solid #e2e8f0; }
.chat-search { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .45rem; padding: .8rem; }
.chat-search input, .chat-inline-search input { width: 100%; min-width: 0; }
.chat-view-switch { display: grid; grid-template-columns: 1fr 1fr; padding: 0 .8rem .7rem; gap: .35rem; }
.chat-view-switch a { padding: .48rem .65rem; border-radius: 9px; color: var(--slate-600); text-align: center; text-decoration: none; font-size: .78rem; font-weight: 800; }
.chat-view-switch a.is-active { background: #eaf2fb; color: var(--navy-900); }
.chat-list { display: grid; min-height: 0; overflow-y: auto; }
.chat-list-item { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .65rem; padding: .72rem .8rem; border-top: 1px solid #edf2f7; color: inherit; text-decoration: none; transition: background .15s ease, border-color .15s ease; }
.chat-list-item:hover, .chat-list-item:focus-visible, .chat-list-item.is-active { background: #f3f8fd; outline: none; }
.chat-list-item.is-unread { background: #eef6ff; }
.chat-list-copy { min-width: 0; display: grid; gap: .18rem; }
.chat-list-copy strong, .chat-list-title strong { overflow: hidden; color: var(--navy-950); font-size: .85rem; text-overflow: ellipsis; white-space: nowrap; }
.chat-list-title { display: flex; align-items: center; gap: .35rem; min-width: 0; }
.chat-list-preview { overflow: hidden; color: var(--slate-500); font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.chat-list-meta { display: grid; justify-items: end; gap: .35rem; color: var(--slate-500); font-size: .66rem; }
.chat-unread-count { display: inline-grid; min-width: 20px; height: 20px; place-items: center; padding: 0 .35rem; border-radius: 999px; background: #2563eb; color: #fff; font-size: .65rem; font-weight: 900; }
.chat-welcome { display: grid; place-items: center; align-content: center; gap: .75rem; padding: 3rem; text-align: center; }
.chat-welcome-icon { display: grid; width: 70px; height: 70px; place-items: center; border-radius: 22px; background: #eef6ff; font-size: 2rem; }
.chat-welcome h2 { margin: 0; color: var(--navy-950); }
.chat-welcome p { max-width: 580px; margin: 0; color: var(--slate-600); line-height: 1.55; }
.chat-conversation { display: grid; grid-template-rows: auto minmax(0,1fr) auto; min-height: 0; padding: 0; overflow: hidden; }
.chat-conversation-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .75rem 1rem; border-bottom: 1px solid #e2e8f0; }
.chat-peer { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.chat-peer > div { min-width: 0; display: grid; gap: .1rem; }
.chat-peer strong { color: var(--navy-950); }
.chat-peer span { color: var(--slate-500); font-size: .72rem; }
.chat-head-actions { display: flex; align-items: center; gap: .45rem; }
.chat-inline-search { display: flex; gap: .35rem; }
.chat-menu, .chat-message-menu { position: relative; }
.chat-menu summary, .chat-message-menu summary { cursor: pointer; list-style: none; }
.chat-menu summary::-webkit-details-marker, .chat-message-menu summary::-webkit-details-marker { display: none; }
.chat-menu-popover, .chat-message-menu > div { position: absolute; z-index: 30; top: calc(100% + .3rem); right: 0; min-width: 210px; padding: .35rem; border: 1px solid #dbe4ee; border-radius: 12px; background: #fff; box-shadow: 0 16px 42px rgba(15,23,42,.18); }
.chat-menu-popover form, .chat-message-menu form { margin: 0; }
.chat-menu-popover button, .chat-message-menu button { width: 100%; padding: .55rem .65rem; border: 0; border-radius: 8px; background: transparent; color: var(--navy-900); text-align: left; cursor: pointer; font: inherit; font-size: .76rem; }
.chat-menu-popover button:hover, .chat-message-menu button:hover { background: #f1f5f9; }
.chat-menu-popover button.is-danger, .chat-message-menu button.is-danger { color: #b91c1c; }
.chat-thread { min-height: 0; padding: 1rem; overflow-y: auto; overscroll-behavior: contain; background: linear-gradient(180deg, #f7fafc, #fff); }
.chat-bubble-row { position: relative; display: flex; align-items: flex-end; gap: .45rem; margin: .48rem 0; transition: transform .14s ease; touch-action: pan-y; }
.chat-bubble-row.is-own { justify-content: flex-end; }
.chat-bubble { max-width: min(76%, 720px); padding: .62rem .75rem .48rem; border: 1px solid #dde7f0; border-radius: 16px 16px 16px 5px; background: #fff; box-shadow: 0 4px 12px rgba(15,23,42,.04); }
.chat-bubble.is-own { border-color: #bdd8f6; border-radius: 16px 16px 5px 16px; background: #eaf4ff; }
.chat-message-body { color: #162437; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-bubble footer { display: flex; justify-content: flex-end; gap: .35rem; margin-top: .28rem; color: #64748b; font-size: .61rem; }
.chat-reply-reference { display: grid; gap: .1rem; margin-bottom: .42rem; padding: .38rem .5rem; border-left: 3px solid #3b82f6; border-radius: 7px; background: rgba(255,255,255,.58); color: inherit; text-decoration: none; }
.chat-reply-reference strong { font-size: .69rem; }
.chat-reply-reference span { overflow: hidden; color: var(--slate-600); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.chat-message-menu { align-self: center; opacity: 0; transition: opacity .12s ease; }
.chat-bubble-row:hover .chat-message-menu, .chat-message-menu[open], .chat-bubble-row:focus-within .chat-message-menu { opacity: 1; }
.chat-message-menu summary { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: #64748b; font-weight: 900; }
.chat-message-menu summary:hover { background: #e2e8f0; }
.chat-bubble-row:not(.is-own) .chat-message-menu > div { left: 0; right: auto; }
.chat-attachments { display: grid; gap: .32rem; margin-top: .5rem; }
.chat-attachments a { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .4rem; padding: .4rem .5rem; border: 1px solid rgba(100,116,139,.22); border-radius: 9px; background: rgba(255,255,255,.65); color: var(--navy-800); text-decoration: none; }
.chat-attachments a span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-attachments small { color: var(--slate-500); }
.chat-composer { padding: .7rem .85rem max(.7rem, env(safe-area-inset-bottom)); border-top: 1px solid #e2e8f0; background: #fff; }
.chat-composer-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: end; gap: .45rem; }
.chat-composer textarea { min-height: 44px; max-height: 150px; resize: vertical; }
.chat-attach-button { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid #cbd5e1; border-radius: 11px; cursor: pointer; }
.chat-attach-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.chat-reply-preview { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .45rem; padding: .45rem .55rem; border-left: 3px solid #3b82f6; border-radius: 8px; background: #f1f5f9; }
.chat-reply-preview > div { min-width: 0; display: grid; }
.chat-reply-preview span { overflow: hidden; color: var(--slate-600); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.chat-reply-preview button { border: 0; background: transparent; cursor: pointer; font-size: 1.2rem; }
.chat-empty-thread { display: grid; place-items: center; align-content: center; min-height: 100%; padding: 2rem; color: var(--slate-600); text-align: center; }
.chat-edit-dialog { width: min(560px, calc(100vw - 2rem)); border: 0; padding: 0; background: transparent; }
.chat-edit-dialog::backdrop { background: rgba(15,23,42,.42); }
.chat-edit-dialog .panel { margin: 0; }
.chat-edit-dialog header { display: flex; justify-content: space-between; align-items: center; }
.chat-edit-dialog header button { border: 0; background: none; font-size: 1.4rem; cursor: pointer; }
.chat-edit-dialog textarea { width: 100%; min-height: 130px; margin: .7rem 0; }
.chat-attachment-picker input { display: block; width: 100%; margin-top: .3rem; }

.incident-filter { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)) auto; gap: .6rem; align-items: end; margin-bottom: 1rem; }
.incident-list { display: grid; gap: .65rem; }
.incident-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .8rem; padding: .9rem 1rem; border-left: 4px solid #94a3b8; color: inherit; text-decoration: none; }
.incident-card.severity-high { border-left-color: #f97316; }
.incident-card.severity-critical { border-left-color: #dc2626; }
.incident-card.severity-low { border-left-color: #16a34a; }
.incident-card h2 { margin: .36rem 0 .2rem; color: var(--navy-950); font-size: 1rem; }
.incident-card p { margin: 0; color: var(--slate-600); font-size: .76rem; }
.incident-reference { display: inline-flex; padding: .18rem .42rem; border-radius: 999px; background: #e2e8f0; color: #334155; font-size: .68rem; font-weight: 900; letter-spacing: .02em; }
.incident-severity { display: inline-flex; padding: .18rem .42rem; border-radius: 999px; font-size: .68rem; font-weight: 900; }
.incident-severity.severity-low { background: #dcfce7; color: #166534; }
.incident-severity.severity-medium { background: #e0f2fe; color: #075985; }
.incident-severity.severity-high { background: #ffedd5; color: #9a3412; }
.incident-severity.severity-critical { background: #fee2e2; color: #991b1b; }
.incident-summary-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .65rem; margin-bottom: 1rem; }
.incident-summary-grid article { display: grid; gap: .18rem; padding: .75rem .9rem; }
.incident-summary-grid span { color: var(--slate-500); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; }
.incident-summary-grid strong { color: var(--navy-950); }
.incident-detail-layout { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(280px,.7fr); gap: 1rem; }
.incident-description h2, .incident-timeline h2 { margin-top: 0; }
.incident-update { padding: .85rem 0; border-bottom: 1px solid #e5edf5; }
.incident-update:last-child { border-bottom: 0; }
.incident-update header { display: flex; align-items: center; gap: .55rem; margin-bottom: .45rem; }
.incident-update header > div { display: grid; }
.incident-update time { color: var(--slate-500); font-size: .68rem; }
.incident-update > div { white-space: pre-wrap; line-height: 1.55; }
.incident-timeline ol { list-style: none; margin: 0; padding: 0; }
.incident-timeline li { position: relative; display: grid; grid-template-columns: 14px minmax(0,1fr); gap: .55rem; padding-bottom: .9rem; }
.incident-timeline li:not(:last-child)::before { content: ""; position: absolute; left: 5px; top: 12px; bottom: 0; width: 2px; background: #dbe7f2; }
.incident-timeline-dot { z-index: 1; width: 12px; height: 12px; margin-top: .2rem; border: 2px solid #fff; border-radius: 50%; background: #2563eb; box-shadow: 0 0 0 1px #93c5fd; }
.incident-timeline li > div { display: grid; gap: .1rem; }
.incident-timeline small { color: var(--slate-500); }
.incident-timeline p { margin: .25rem 0 0; color: var(--slate-600); font-size: .75rem; }
.incident-context { margin-top: .8rem; }
.incident-context summary { cursor: pointer; font-weight: 800; }
.incident-context dl { display: grid; gap: .5rem; }
.incident-context dl div { display: grid; gap: .1rem; }
.incident-context dt { color: var(--slate-500); font-size: .68rem; }
.incident-context dd { margin: 0; overflow-wrap: anywhere; font-size: .74rem; }
.incident-resolution-confirm { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.incident-resolution-confirm p { margin: .2rem 0 0; color: var(--slate-600); }

@media (max-width: 980px) {
  .chat-shell, .chat-shell-list-only { grid-template-columns: 1fr; }
  .chat-shell:not(.chat-shell-list-only) .chat-sidebar { display: none; }
  .chat-conversation { min-height: calc(100dvh - 190px); }
  .chat-conversation-head { align-items: flex-start; }
  .chat-inline-search { display: none; }
  .chat-message-menu { opacity: 1; }
  .chat-bubble { max-width: 86%; }
  .incident-filter { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .incident-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .incident-detail-layout { grid-template-columns: 1fr; }
  .incident-resolution-confirm { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 620px) {
  .chat-page { padding-left: .55rem; padding-right: .55rem; }
  .chat-conversation-head { padding: .65rem .7rem; }
  .chat-head-actions { margin-left: auto; }
  .chat-thread { padding: .65rem; }
  .chat-bubble { max-width: 91%; }
  .chat-composer { padding-left: .55rem; padding-right: .55rem; }
  .chat-composer-row { grid-template-columns: auto minmax(0,1fr) auto; }
  .incident-filter, .incident-summary-grid { grid-template-columns: 1fr; }
  .incident-card { grid-template-columns: 1fr; }
  .incident-card .message-ticket-time { justify-items: start; }
}

.chat-new-message-banner {
  align-self: center; margin: .45rem auto 0; border: 0; border-radius: 999px;
  padding: .45rem .8rem; font: inherit; font-size: .86rem; cursor: pointer;
  box-shadow: 0 6px 18px rgba(15,23,42,.12);
}
.chat-new-message-banner[hidden] { display: none !important; }
.incident-sla-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: .85rem 0; }
.incident-sla-grid .panel { display: grid; gap: .2rem; }
.incident-sla-grid .panel > span { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; opacity: .72; }
.incident-sla-grid .panel.is-breached { border-left: 4px solid currentColor; }
.incident-sla-grid .panel.is-met { border-left: 4px solid currentColor; }
@media (max-width: 700px) { .incident-sla-grid { grid-template-columns: 1fr; } }

/* Fix 4S: deleted chat messages remain as context-preserving tombstones. */
.chat-message-deleted { font-style: italic; opacity: .72; }

/* LEITIO Fix 4Y – unified navigation + notification surfaces */
.mobile-nav-trigger { position: relative; }
.mobile-nav-trigger-count {
  position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px;
  display: inline-grid; place-items: center; padding: 0 4px; border: 2px solid #083b70;
  border-radius: 999px; background: #dc2626; color: #fff; font-size: .62rem; font-weight: 900;
}
.notifications-page { max-width: 980px; margin: 1.4rem auto; }
.notifications-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.notifications-head h1 { margin: .2rem 0 .35rem; }
.notifications-head p { max-width: 680px; margin: 0; color: #64748b; }
.notifications-actions { display: flex; flex-wrap: wrap; gap: .55rem; justify-content: flex-end; }
.notifications-list { display: grid; gap: .65rem; margin-top: 1rem; }
.notification-card { display: grid; grid-template-columns: 10px minmax(0,1fr); gap: .7rem; padding: 1rem; border: 1px solid #d8e5ed; border-radius: 14px; background: #fff; color: #10233f; text-decoration: none; box-shadow: 0 8px 22px rgba(3,29,61,.06); }
.notification-card.is-unread { border-color: #69cbd5; background: #f1fbfc; }
.notification-dot { width: 8px; height: 8px; margin-top: .4rem; border-radius: 999px; background: #94a3b8; }
.notification-card.is-unread .notification-dot { background: #08a5b5; }
.notification-card > span:last-child { display: grid; gap: .18rem; }
.notification-card small, .notification-card time { color: #64748b; }
.notification-card time { font-size: .74rem; }
.work-user-notification-action { display: inline-flex; align-items: center; gap: .35rem; min-height: 38px; padding: .45rem .65rem; border: 1px solid rgba(255,255,255,.28); border-radius: 10px; background: rgba(255,255,255,.1); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.work-user-notification-action span { min-width: 20px; height: 20px; display: inline-grid; place-items: center; padding: 0 .25rem; border-radius: 999px; background: #dc2626; font-size: .65rem; }
@media (max-width: 720px) {
  .notifications-head { flex-direction: column; }
  .notifications-actions { justify-content: flex-start; }
  .work-user-notification-action { font-size: .72rem; }
}

/* LEITIO Fix 4Y – flexible weekly Pulse models and managed absence */
.pulse-live-column[data-pulse-absence-target] { transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.pulse-live-column[data-pulse-absence-target].is-drag-over { border-color: rgba(202,64,64,.55); box-shadow: 0 0 0 3px rgba(202,64,64,.10), 0 18px 36px rgba(9,57,99,.13); transform: translateY(-2px); }
.pulse-person-absence-action { margin-top: .45rem; padding: .32rem .5rem; border: 1px solid #d4e1e9; border-radius: 8px; background: #fff; color: #47657a; font: inherit; font-size: .72rem; font-weight: 800; cursor: pointer; }
.pulse-work-model-summary { display: grid; gap: .15rem; margin-top: .8rem; padding: .75rem .8rem; border: 1px solid #dce8ef; border-radius: 12px; background: #f6fafc; }
.pulse-work-model-summary > span { color: #71899a; font-size: .7rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.pulse-work-model-summary strong { color: #0b2a55; }
.pulse-work-model-summary small { color: #617b8e; line-height: 1.35; }
.pulse-work-model-button { width: 100%; margin-top: .65rem; }
.pulse-work-model-dialog { width: min(760px, calc(100vw - 28px)); }
.pulse-policy-dialog-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; }
.pulse-policy-dialog-grid label, .pulse-managed-absence-dates label, .pulse-work-model-dialog > form > label { display: grid; gap: .35rem; }
.pulse-policy-dialog-grid input, .pulse-managed-absence-dates input, .pulse-weekday-row input[type="text"] { min-width: 0; padding: .65rem .7rem; border: 1px solid #cfdee7; border-radius: 9px; }
.pulse-weekday-editor { display: grid; gap: .45rem; margin-top: .9rem; }
.pulse-weekday-editor-head { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.pulse-weekday-row { display: grid; grid-template-columns: 22px minmax(100px,1fr) 105px; align-items: center; gap: .65rem; padding: .5rem .65rem; border: 1px solid #e0eaf0; border-radius: 10px; background: #f9fcfd; }
.pulse-weekday-row input[type="checkbox"] { width: 18px; height: 18px; }
.pulse-weekday-row input[type="text"]:disabled { opacity: .48; background: #eef3f6; }
.pulse-managed-absence-dates { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; }
@media (max-width: 620px) {
  .pulse-policy-dialog-grid, .pulse-managed-absence-dates { grid-template-columns: 1fr; }
  .pulse-weekday-editor-head { align-items: flex-start; flex-direction: column; }
  .pulse-weekday-row { grid-template-columns: 22px minmax(80px,1fr) 92px; }
}


/* LEITIO Fix 4X Hotfix 4K – compact work-user mailbox */
.work-mailbox-page { width: min(820px, calc(100% - 24px)); max-width: 820px; margin: 0 auto; padding-top: 1.15rem; padding-bottom: 2.25rem; }
.work-mailbox-hero { align-items: center; margin-bottom: .65rem; padding: 1rem 1.1rem; }
.work-mailbox-hero h1 { margin: .06rem 0; }
.work-mailbox-hero > div:first-child > p:last-child { margin-top: .25rem; font-size: .9rem; }
.work-mailbox-title-row { display: flex; align-items: center; gap: .55rem; }
.work-mailbox-total-badge,
.work-mailbox-tabs span { display: inline-grid; min-width: 22px; height: 22px; place-items: center; padding: 0 .35rem; border-radius: 999px; background: #0b63ce; color: #fff; font-size: .7rem; font-weight: 900; }
.work-mailbox-quick-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .5rem; min-width: min(340px, 44%); }
.work-mailbox-quick-actions .btn { min-height: 44px; justify-content: center; }
.work-mailbox-kvp-action { border-color: #b8d9d0; background: #f0faf6; color: #176a4a; }
.work-mailbox-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; margin-bottom: .65rem; padding: .3rem; border: 1px solid #d7e3ec; border-radius: 14px; background: rgba(255,255,255,.82); box-shadow: 0 6px 20px rgba(15,23,42,.04); }
.work-mailbox-tabs a { display: flex; min-height: 42px; align-items: center; justify-content: center; gap: .4rem; padding: .45rem .65rem; border-radius: 10px; color: #526277; text-decoration: none; font-size: .86rem; font-weight: 850; }
.work-mailbox-tabs a.is-active { background: #eaf3fc; color: #0b2a55; }
.work-mailbox-tabs a.is-active span { background: #083b70; }
.work-mailbox-chat-shell { display: block; min-height: 0; }
.work-mailbox-chat-panel { width: 100%; min-height: 0; }
.work-mailbox-search { padding: .65rem; border-bottom: 1px solid #edf2f7; }
.work-mailbox-chat-panel .chat-list-item { min-height: 68px; padding: .65rem .75rem; }
.work-mailbox-chat-panel .chat-list-preview { font-size: .82rem; }
.work-mailbox-chat-panel .chat-list-meta time { font-size: .7rem; }
.work-mailbox-view-panel { margin: 0; padding: .85rem; }
.work-mailbox-section-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.work-mailbox-section-head h2 { margin: .08rem 0 0; color: var(--navy-950); font-size: 1.25rem; }
.work-mailbox-notification-list { gap: .38rem; margin-top: .7rem; }
.work-mailbox-notification-list .notification-card { min-height: 0; padding: .66rem .72rem; border-radius: 11px; box-shadow: none; }
.work-mailbox-notification-list .notification-card > span:last-child { grid-template-columns: minmax(0,1fr) auto; column-gap: .65rem; }
.work-mailbox-notification-list .notification-card strong,
.work-mailbox-notification-list .notification-card small { grid-column: 1; }
.work-mailbox-notification-list .notification-card time { grid-column: 2; grid-row: 1 / span 2; align-self: center; white-space: nowrap; }
.work-mailbox-notification-list .notification-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-mailbox-empty { padding: 1.4rem .8rem; }
.work-mailbox-footer { display: flex; justify-content: center; padding: .65rem 0 0; }
.work-mailbox-settings-link { display: inline-flex; align-items: center; min-height: 38px; padding: .4rem .7rem; border-radius: 9px; color: #5d6f85; text-decoration: none; font-size: .8rem; font-weight: 750; }
.work-mailbox-settings-link:hover,
.work-mailbox-settings-link.is-active { background: #eef4fa; color: #0b2a55; }
.work-mailbox-settings-panel { margin-top: .45rem; }
.work-mailbox-settings-panel > p { margin: .7rem 0; }
.work-mailbox-settings-actions { justify-content: flex-start; }
.work-user-mailbox-action.is-active { border-color: #8eb8df; background: #eaf4ff; box-shadow: 0 0 0 3px rgba(14,104,213,.08); }
.work-kvp-compose-page { width: min(680px, calc(100% - 24px)); margin: 0 auto; padding: 1.15rem 0 2.5rem; }
.work-kvp-back-link { display: inline-flex; margin-bottom: .7rem; color: #46647f; text-decoration: none; font-weight: 800; }
.work-kvp-compose-head { margin-bottom: .65rem; padding: 0 .15rem; }
.work-kvp-compose-head h1 { margin: .08rem 0 .3rem; color: #102b4e; font-size: clamp(1.7rem, 5vw, 2.25rem); }
.work-kvp-compose-head > p:last-child { margin: 0; color: #62728c; }
.work-kvp-compose-page .work-kvp-message-card { margin: 0; padding: 1rem; }
.work-kvp-compose-page .work-kvp-message-head h2 { margin: .12rem 0 0; font-size: 1.2rem; }
.work-kvp-message-note { margin: .2rem 0 .1rem; color: #526b63; font-size: .86rem; }

@media (max-width: 720px) {
  .work-mailbox-page { width: min(100% - 14px, 820px); padding-top: .65rem; }
  .work-mailbox-hero { display: grid; gap: .75rem; padding: .85rem; }
  .work-mailbox-hero > div:first-child > p:last-child { font-size: .82rem; }
  .work-mailbox-quick-actions { width: 100%; min-width: 0; }
  .work-mailbox-quick-actions .btn { width: auto; min-height: 42px; padding: .55rem .65rem; font-size: .82rem; }
  .work-mailbox-tabs { position: sticky; top: 78px; z-index: 8; }
  .work-mailbox-tabs a { min-height: 40px; padding: .4rem .3rem; font-size: .8rem; }
  .work-mailbox-search { grid-template-columns: minmax(0,1fr) auto; padding: .55rem; }
  .work-mailbox-search .btn { width: auto; }
  .work-mailbox-chat-panel .chat-list-item { grid-template-columns: auto minmax(0,1fr) auto; gap: .5rem; padding: .58rem .6rem; }
  .work-mailbox-notification-list .notification-card > span:last-child { grid-template-columns: minmax(0,1fr); }
  .work-mailbox-notification-list .notification-card time { grid-column: 1; grid-row: auto; }
  .work-mailbox-settings-actions { display: grid; }
  .work-mailbox-settings-actions .btn { width: 100%; }
  .work-kvp-compose-page { width: min(100% - 14px, 680px); padding-top: .7rem; }
  .work-kvp-compose-page .work-kvp-message-card { padding: .85rem; }
}

/* 4Q24A4C – immutable person username standard on account creation */
.generated-username-field{display:grid;gap:.35rem;align-content:start;color:var(--slate-700);font-size:.9rem}
.generated-username-field>span{min-height:43px;display:flex;align-items:center;padding:.68rem .78rem;border:1px solid var(--slate-200);border-radius:9px;background:var(--slate-100);color:var(--navy-900);font-weight:800;overflow-wrap:anywhere}
.generated-username-field>small{font-weight:500}
