:root{
    --bg:#0b0d12;
    --panel:#191d28;
    --panel2:#222735;
    --border:#303648;
    --text:#f7f5ff;
    --muted:#aeb4c5;
    --purple:#8b5cf6;
    --purple2:#b69cff;
    --green:#22c55e;
    --red:#ef4444;
}

*{box-sizing:border-box}

body{
    margin:0;
    background:
        radial-gradient(circle at top right,rgba(139,92,246,.12),transparent 30rem),
        var(--bg);
    color:var(--text);
    font-family:Arial,Helvetica,sans-serif;
    min-height:100vh;
}

a{color:var(--purple2);text-decoration:none}

.topbar{
    min-height:72px;
    display:flex;
    align-items:center;
    gap:24px;
    justify-content:space-between;
    padding:12px 28px;
    background:#080a0f;
    border-bottom:1px solid var(--border);
}

.brand a{font-size:22px;color:#fff}
.brand strong{color:var(--purple)}
.brand span{font-weight:800}
.brand small{display:block;color:var(--muted);font-size:11px}

nav{display:flex;gap:8px;flex-wrap:wrap}
nav a{padding:9px 10px;color:var(--muted);border-radius:8px}
nav a:hover{background:var(--panel);color:#fff}
.nav-logout{display:inline;margin:0}
.nav-logout button{
    padding:9px 10px;
    border:0;
    border-radius:8px;
    background:transparent;
    color:var(--muted);
    font:inherit;
    cursor:pointer;
}
.nav-logout button:hover{background:var(--panel);color:#fff}

.userbox{color:var(--muted);font-size:14px;white-space:nowrap}

.page{
    max-width:1300px;
    margin:auto;
    padding:34px 24px 64px;
}

.page-header{margin-bottom:22px}
.muted{color:var(--muted)}

.grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
    gap:18px;
}

.card{
    display:block;
    background:var(--panel);
    border:1px solid var(--border);
    border-radius:14px;
    padding:22px;
    color:var(--text);
    margin-bottom:18px;
}

a.card:hover{
    background:var(--panel2);
    border-color:var(--purple);
}

.label{
    color:var(--muted);
    text-transform:uppercase;
    font-size:12px;
}

.value{
    color:var(--purple2);
    font-size:34px;
    font-weight:800;
    margin-top:8px;
}

.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:10px 16px;
    border-radius:9px;
    border:0;
    background:var(--purple);
    color:white;
    font-weight:800;
    cursor:pointer;
}

input,select,textarea{
    width:100%;
    background:#10131a;
    color:white;
    border:1px solid var(--border);
    border-radius:9px;
    padding:11px 12px;
    margin:6px 0 15px;
}

label{color:var(--muted)}

.login-shell{min-height:70vh;display:grid;place-items:center}
.login-card{width:min(430px,100%)}

.table-wrapper{
    background:var(--panel);
    border:1px solid var(--border);
    border-radius:14px;
    overflow:auto;
}

table{width:100%;border-collapse:collapse}
th,td{padding:13px;border-bottom:1px solid var(--border);text-align:left}
th{color:var(--muted);font-size:12px;text-transform:uppercase}

.flash{
    padding:12px 14px;
    border:1px solid var(--border);
    border-radius:10px;
    margin-bottom:16px;
}
.flash-success{border-color:#22c55e77}
.flash-danger{border-color:#ef444477}

.permissions-card{margin-bottom:26px}
.permission-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
    gap:10px;
    margin-bottom:18px;
}
.permission-item{
    display:flex;
    gap:10px;
    align-items:flex-start;
    padding:11px;
    background:#11151d;
    border:1px solid var(--border);
    border-radius:10px;
}
.permission-item input{
    width:auto;
    margin:3px 0 0;
}
.permission-item small{color:var(--muted)}

@media(max-width:850px){
    .topbar{align-items:flex-start;flex-direction:column}
    .userbox{white-space:normal}
}


.page-header-row{
    display:flex;
    justify-content:space-between;
    gap:18px;
    align-items:flex-start;
}
.toolbar{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    align-items:center;
}
.btn-secondary{
    background:#272c3a;
    border:1px solid var(--border);
}
.form-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
    gap:16px 20px;
}
.small{font-size:12px}
.small-value{font-size:24px}
.badge,.role-badge{
    display:inline-flex;
    padding:4px 8px;
    border-radius:999px;
    background:rgba(139,92,246,.15);
    border:1px solid rgba(139,92,246,.35);
    color:var(--purple2);
    font-size:12px;
    font-weight:800;
}
.status-ok{color:#86efac;font-weight:700}
.status-off{color:#fca5a5;font-weight:700}

.segmented{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-bottom:18px;
}
.segmented label{
    display:flex;
    gap:8px;
    align-items:center;
    padding:10px 14px;
    background:#11151d;
    border:1px solid var(--border);
    border-radius:10px;
    cursor:pointer;
}
.segmented input{width:auto;margin:0}

.permission-override-list,
.assignment-list{
    display:flex;
    flex-direction:column;
    gap:10px;
}
.permission-override-row,
.assignment-row{
    display:grid;
    grid-template-columns:minmax(260px,1fr) minmax(220px,360px);
    gap:18px;
    align-items:center;
    padding:12px 14px;
    background:#11151d;
    border:1px solid var(--border);
    border-radius:10px;
}
.permission-override-row select,
.assignment-row select{
    margin:0;
}
.permission-override-active,
.assignment-active{
    border-color:var(--purple) !important;
    background:rgba(139,92,246,.14) !important;
    box-shadow:0 0 0 1px rgba(139,92,246,.22);
}

@media(max-width:750px){
    .page-header-row{flex-direction:column}
    .permission-override-row,
    .assignment-row{grid-template-columns:1fr}
}


.full-width{grid-column:1 / -1}
.eyebrow{
    color:var(--purple2);
    text-transform:uppercase;
    letter-spacing:.08em;
    font-size:12px;
    font-weight:800;
    margin-bottom:5px;
}
.code-badge{
    display:inline-flex;
    padding:5px 9px;
    background:rgba(139,92,246,.16);
    border:1px solid rgba(139,92,246,.4);
    border-radius:8px;
    color:var(--purple2);
    font-family:Consolas,monospace;
    font-weight:800;
}
.card-header-row{
    display:flex;
    justify-content:space-between;
    gap:16px;
    align-items:flex-start;
}
.unit-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
    gap:12px;
    margin-top:16px;
}
.unit-card{
    display:flex;
    flex-direction:column;
    gap:5px;
    padding:14px;
    border-radius:10px;
    border:1px solid var(--border);
    background:#11151d;
    color:var(--text);
}
.unit-card:hover{
    border-color:var(--purple);
    background:#181d28;
}
.unit-card strong{
    color:var(--purple2);
    font-family:Consolas,monospace;
}
.unit-card span,.unit-card small{color:var(--muted)}
.unit-card h4{margin:3px 0 0}
.inner-table{border-radius:10px}
.identifier-preview{
    padding:12px 14px;
    margin-bottom:18px;
    border:1px solid rgba(139,92,246,.35);
    background:rgba(139,92,246,.08);
    border-radius:10px;
}
.identifier-preview strong{
    display:block;
    margin-top:5px;
    color:var(--purple2);
    font-family:Consolas,monospace;
    font-size:18px;
}
.status-dot{
    width:9px;
    height:9px;
    display:inline-block;
    border-radius:50%;
    margin-right:4px;
}
.status-dot-ok{background:#22c55e}
.status-dot-off{background:#ef4444}

@media(max-width:750px){
    .card-header-row{flex-direction:column}
}


.task-quickfilters{
    display:flex;
    flex-wrap:wrap;
    gap:9px;
    margin-bottom:16px;
}
.task-filter{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:9px 15px;
    border-radius:999px;
    border:1px solid var(--border);
    background:#171b25;
    color:var(--muted);
    font-weight:800;
}
.task-filter.active,
.task-filter:hover{
    color:#fff;
    background:var(--purple);
    border-color:var(--purple);
}
.filter-selected,
.filter-active{
    border-color:var(--purple) !important;
    background:rgba(139,92,246,.16) !important;
    box-shadow:0 0 0 1px rgba(139,92,246,.25);
}
.task-list{
    display:flex;
    flex-direction:column;
    gap:9px;
}
.task-row{
    display:grid;
    grid-template-columns:42px minmax(280px,1fr) minmax(150px,220px) 110px 100px;
    gap:12px;
    align-items:center;
    padding:14px 16px;
    border-radius:12px;
    border:1px solid var(--border);
    background:var(--panel);
    color:var(--text);
}
.task-row:hover{
    border-color:var(--purple);
    background:var(--panel2);
}
.task-priority-symbol{
    display:grid;
    place-items:center;
    width:32px;
    height:32px;
    border-radius:9px;
    font-size:20px;
    font-weight:900;
}
.task-title-line{
    display:flex;
    align-items:center;
    flex-wrap:wrap;
    gap:9px;
}
.task-meta{
    color:var(--muted);
    font-size:12px;
    margin-top:5px;
}
.task-assignee,.task-due,.task-status{
    font-size:13px;
}
.priority-pill{
    display:inline-flex;
    align-items:center;
    padding:4px 8px;
    border-radius:999px;
    font-size:11px;
    font-weight:900;
    border:1px solid currentColor;
}
.priority-critical{
    color:#fecaca !important;
    background:rgba(239,68,68,.13);
}
.priority-high{
    color:#fed7aa !important;
    background:rgba(249,115,22,.12);
}
.priority-normal{
    color:#c4b5fd !important;
    background:rgba(139,92,246,.10);
}
.priority-low{
    color:#bae6fd !important;
    background:rgba(14,165,233,.08);
}
.task-heading-icon{
    display:inline-flex;
    width:38px;
    height:38px;
    align-items:center;
    justify-content:center;
    border-radius:10px;
    vertical-align:middle;
}
.priority-select-active{
    border-color:#f97316 !important;
}
.priority-alert{
    color:#fed7aa;
    font-weight:800;
}
.preline{white-space:pre-line}
.timeline{
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-top:18px;
}
.timeline-item{
    padding:13px 14px;
    border-radius:10px;
    background:#11151d;
    border:1px solid var(--border);
}
.timeline-item p:last-child{margin-bottom:0}

@media(max-width:950px){
    .task-row{
        grid-template-columns:38px 1fr;
    }
    .task-assignee,.task-due,.task-status{
        grid-column:2;
    }
}


.board-tabs{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-bottom:16px;
}
.board-tab{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:44px;
    padding:10px 16px;
    border-radius:10px;
    border:1px solid var(--border);
    background:#171b25;
    color:var(--muted);
    font-weight:900;
}
.board-tab:hover,
.board-tab.active{
    color:#fff;
    border-color:var(--purple);
    background:var(--purple);
    box-shadow:0 0 0 2px rgba(139,92,246,.18);
}
.board-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
    gap:14px;
}
.board-card{
    display:flex;
    flex-direction:column;
    min-height:190px;
    padding:18px;
    border-radius:13px;
    border:1px solid var(--border);
    background:var(--panel);
    color:var(--text);
}
.board-card:hover{
    background:var(--panel2);
    border-color:var(--purple);
}
.board-card-head{
    display:flex;
    justify-content:space-between;
    gap:10px;
    align-items:center;
}
.board-card h3{
    margin:16px 0 8px;
}
.board-preview{
    display:-webkit-box;
    -webkit-line-clamp:4;
    -webkit-box-orient:vertical;
    overflow:hidden;
    color:#d6d9e2;
    white-space:pre-line;
    flex:1;
}
.board-meta{
    display:flex;
    flex-direction:column;
    gap:4px;
    margin-top:16px;
    color:var(--muted);
    font-size:12px;
}


.time-range-tabs{
    display:flex;
    flex-wrap:wrap;
    gap:9px;
    margin-bottom:16px;
}
.timer-running{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:18px;
    padding:15px;
    border-radius:12px;
    border:1px solid rgba(34,197,94,.45);
    background:rgba(34,197,94,.08);
}
.timer-running p{margin-bottom:0}
.timer-start{
    margin-top:12px;
    background:#16a34a;
}
.timer-stop{
    background:#dc2626;
}
.status-running{
    color:#86efac;
    font-weight:800;
}
.time-status{
    display:inline-flex;
    padding:4px 8px;
    border-radius:999px;
    font-size:12px;
    font-weight:800;
    border:1px solid var(--border);
}
.time-status-running{
    color:#86efac;
    border-color:rgba(34,197,94,.4);
    background:rgba(34,197,94,.08);
}
.time-status-submitted{
    color:#fde68a;
    border-color:rgba(234,179,8,.4);
    background:rgba(234,179,8,.08);
}
.time-status-approved{
    color:#bbf7d0;
    border-color:rgba(34,197,94,.4);
    background:rgba(34,197,94,.08);
}
.time-status-rejected{
    color:#fecaca;
    border-color:rgba(239,68,68,.4);
    background:rgba(239,68,68,.08);
}
.time-status-void{
    color:#cbd5e1;
    border-color:#475569;
    background:rgba(71,85,105,.15);
}

/* ONE 0.2 Workflow UX */
.form-hint{margin-top:8px;padding:9px 11px;border-left:3px solid var(--purple);background:rgba(139,92,246,.08);color:var(--muted);font-size:12px;line-height:1.45}
.compact-header{margin-bottom:14px}.compact-header p{margin-bottom:0}
.workflow-tabs{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}
.compact-filterbar{display:grid;grid-template-columns:minmax(220px,1fr) minmax(220px,340px) auto;gap:8px;align-items:center;margin-bottom:12px}.compact-filterbar input,.compact-filterbar select{margin:0}.btn-small{min-height:36px;padding:7px 11px}
.workflow-list{border:1px solid var(--border);border-radius:12px;overflow:hidden;background:var(--panel)}
.workflow-row{display:grid;grid-template-columns:1.4fr 2fr .8fr 1fr 1.45fr .75fr;gap:14px;align-items:center;padding:12px 14px;border-bottom:1px solid var(--border);color:var(--text);min-height:68px}.workflow-row:last-child{border-bottom:0}a.workflow-row:hover{background:var(--panel2)}
.workflow-row-head{min-height:auto;padding-top:9px;padding-bottom:9px;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted);font-weight:800}
.workflow-title-cell,.workflow-location-cell{display:flex;flex-direction:column;gap:3px}.workflow-title-cell small,.workflow-location-cell small{color:var(--muted);font-size:11px}.workflow-title-cell em{color:var(--muted);font-style:normal;font-size:12px}.workflow-location-cell{line-height:1.35}.workflow-next{font-weight:700;line-height:1.35}.approval-warning{display:block;margin-top:4px;color:#fbbf24;font-weight:800}.empty-state{padding:24px;color:var(--muted)}
.workflow-status{display:inline-flex;align-items:center;width:max-content;padding:4px 8px;border-radius:999px;border:1px solid var(--border);font-size:11px;font-weight:800}.workflow-status-open{color:#c4b5fd}.workflow-status-in_progress{color:#93c5fd}.workflow-status-waiting{color:#fcd34d}.workflow-status-work_done{color:#86efac}.workflow-status-closed{color:#bbf7d0}.workflow-status-cancelled{color:#cbd5e1}
.workflow-case-header{display:flex;justify-content:space-between;gap:24px;align-items:flex-start;padding-bottom:16px;border-bottom:1px solid var(--border)}.workflow-case-header h1{margin:5px 0 8px}.workflow-address{color:#d7d9e1;margin:2px 0}.technical-id{margin-top:6px;color:var(--muted);font-size:11px}.workflow-header-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.workflow-current-strip{display:grid;grid-template-columns:1.7fr 1fr 1fr .7fr .7fr;gap:1px;margin:14px 0;border:1px solid var(--border);border-radius:10px;overflow:hidden;background:var(--border)}.workflow-current-strip>div{background:var(--panel);padding:10px 12px}.workflow-current-strip span{display:block;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.05em;margin-bottom:4px}.workflow-current-strip strong{font-size:13px}
.workflow-alert{display:flex;justify-content:space-between;gap:20px;align-items:center;margin:12px 0;padding:13px 15px;border-radius:10px;border:1px solid rgba(245,158,11,.45);background:rgba(245,158,11,.08)}.workflow-alert p{margin:3px 0 0;color:var(--muted)}.approval-actions{display:flex;gap:7px;align-items:center}.approval-actions input{margin:0;min-width:190px}
.workflow-layout{display:grid;grid-template-columns:minmax(0,1fr) 340px;gap:18px;margin-top:14px}.workflow-section{border-top:1px solid var(--border);padding-top:12px}.workflow-section-head{display:flex;justify-content:space-between;align-items:center;gap:10px}.workflow-section-head h2,.workflow-section-head h3{margin:0}.timeline-note-form{display:grid;grid-template-columns:1fr auto;gap:8px;margin:10px 0 16px}.timeline-note-form input{margin:0}
.workflow-timeline{position:relative;margin-left:12px}.workflow-timeline:before{content:"";position:absolute;left:12px;top:10px;bottom:10px;width:1px;background:var(--border)}.workflow-event{position:relative;display:grid;grid-template-columns:26px 1fr;gap:12px;padding:10px 0;border:0}.workflow-event-icon{position:relative;z-index:1;width:25px;height:25px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:var(--panel2);border:1px solid var(--purple);font-size:11px;font-weight:900}.workflow-event-meta{display:flex;justify-content:space-between;gap:12px;font-size:12px}.workflow-event-meta span{color:var(--muted)}.workflow-event p{margin:4px 0 0;white-space:pre-line}
.workflow-side{border-left:1px solid var(--border);padding-left:16px}.workflow-side-section{padding:0 0 15px;margin-bottom:15px;border-bottom:1px solid var(--border)}.workflow-side-section:last-child{border-bottom:0}.workflow-side-section h3{margin:0 0 9px;font-size:14px}.workflow-side-section form{display:flex;flex-direction:column;gap:7px}.workflow-side-section input,.workflow-side-section select,.workflow-side-section textarea{margin:0}
.workflow-step,.appointment-line{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 0;border-bottom:1px solid rgba(148,163,184,.12)}.workflow-step>div,.appointment-line>div{display:flex;flex-direction:column;gap:2px}.workflow-step small,.appointment-line small,.appointment-line span{color:var(--muted);font-size:11px}.workflow-step.done strong{text-decoration:line-through;color:var(--muted)}
.icon-button{width:30px;height:30px;border-radius:8px;border:1px solid var(--border);background:var(--panel2);color:var(--text);cursor:pointer}.icon-button:hover{border-color:var(--purple)}.inline-details{margin-top:9px}.inline-details summary{cursor:pointer;color:#c4b5fd;font-size:12px;font-weight:800}.inline-details form{margin-top:9px}.text-link{font-size:12px;color:#c4b5fd}.check-line{display:flex;gap:8px;align-items:flex-start;font-size:12px}.check-line input{width:auto;margin-top:2px}.time-pair{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.workflow-form-section{padding:16px 0;border-top:1px solid var(--border)}.workflow-form-section h2{margin:0 0 13px}.narrow-form{max-width:640px}
.public-confirmation{max-width:680px;margin:30px auto;padding:24px;border:1px solid var(--border);border-radius:14px;background:var(--panel)}.confirmation-time{display:flex;gap:8px;align-items:baseline;margin:22px 0 12px;font-size:18px}.confirmation-actions{display:flex;flex-direction:column;gap:9px;margin-top:18px}.alternative-box{padding-top:9px;border-top:1px solid var(--border)}.alternative-box summary{cursor:pointer;margin-bottom:10px}.confirmation-finished{margin-top:18px;padding:12px;border-radius:8px;background:rgba(34,197,94,.08)}
.time-compact-panel{margin-bottom:12px}.time-start-details{border:1px solid var(--border);border-radius:10px;background:var(--panel)}.time-start-details>summary{cursor:pointer;padding:10px 13px;font-weight:800}.time-start-details form{padding:0 13px 13px}.time-summary-strip{display:flex;align-items:center;gap:8px;padding:9px 2px 11px;color:var(--muted)}.time-summary-strip strong{color:var(--text)}.time-compact-panel .timer-running{padding:10px 12px}
@media(max-width:1050px){.workflow-row{grid-template-columns:1.2fr 1.8fr .8fr 1fr}.workflow-row>:nth-child(5),.workflow-row>:nth-child(6),.workflow-row-head>:nth-child(5),.workflow-row-head>:nth-child(6){display:none}.workflow-current-strip{grid-template-columns:1fr 1fr}.workflow-layout{grid-template-columns:1fr}.workflow-side{border-left:0;padding-left:0;border-top:1px solid var(--border);padding-top:16px}}
@media(max-width:700px){.compact-filterbar{grid-template-columns:1fr}.workflow-row{grid-template-columns:1fr;gap:5px}.workflow-row-head{display:none}.workflow-case-header,.workflow-alert{flex-direction:column}.workflow-current-strip{grid-template-columns:1fr}.approval-actions{width:100%;flex-wrap:wrap}}


/* Native calendar/time controls in ONE dark mode ----------------------- */
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"] {
    color-scheme: dark;
}



/* V6.7.3 --------------------------------------------------------------- */

.timer-start,
.time-start-details > summary{
    background:#b91c1c;
    border-color:#ef4444;
    color:#fff;
}
.timer-start:hover,
.time-start-details > summary:hover{
    background:#dc2626;
    border-color:#f87171;
}
.time-start-details > summary{
    border-radius:9px;
}

.global-timer-bar{
    position:sticky;
    top:0;
    z-index:90;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    min-height:43px;
    padding:7px 18px;
    background:#3f1111;
    border-bottom:1px solid #ef4444;
    box-shadow:0 4px 16px rgba(0,0,0,.25);
}
.global-timer-main{
    display:flex;
    align-items:center;
    gap:9px;
    min-width:0;
}
.global-timer-dot{
    color:#f87171;
    animation:timerPulse 1.6s infinite;
}
.global-timer-elapsed{
    font-variant-numeric:tabular-nums;
    font-weight:900;
    color:#fff;
}
.global-timer-location{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    color:#fecaca;
    font-size:12px;
}
.global-timer-stop{
    border:1px solid rgba(255,255,255,.3);
    border-radius:8px;
    background:#fff;
    color:#7f1d1d;
    padding:7px 11px;
    font-weight:900;
    cursor:pointer;
}
@keyframes timerPulse{
    0%,100%{opacity:1}
    50%{opacity:.35}
}

.pause-note{
    display:block;
    margin-top:2px;
    color:var(--muted);
    font-size:10px;
}
.pause-quick{
    display:flex;
    gap:3px;
    align-items:center;
    margin-top:5px;
    flex-wrap:wrap;
}
.pause-quick form{margin:0}
.pause-quick button{
    border:1px solid var(--border);
    background:var(--panel2);
    color:var(--muted);
    border-radius:6px;
    padding:2px 6px;
    font-size:10px;
    cursor:pointer;
}
.pause-quick button:hover,
.pause-quick button.active{
    border-color:var(--purple);
    color:#fff;
    background:rgba(139,92,246,.18);
}
.pause-quick-large button{
    padding:7px 10px;
    font-size:12px;
}
.pause-adjust-row{
    display:flex;
    justify-content:space-between;
    gap:14px;
    align-items:center;
}
.pause-adjust-row h2{margin:0 0 3px}
.compact-card{
    padding-top:12px;
    padding-bottom:12px;
}

.unit-status-strip{
    display:flex;
    align-items:center;
    gap:9px;
    margin:0 0 13px;
    padding:8px 11px;
    border:1px solid var(--border);
    border-radius:9px;
    width:max-content;
}
.unit-status-strip span{
    color:var(--muted);
    font-size:11px;
}
.unit-status-text{font-weight:700}
.unit-status-occupied{color:#86efac}
.unit-status-vacant{color:#cbd5e1}
.unit-status-renovation{color:#fcd34d}
.unit-status-inactive{color:#94a3b8}

.property-responsibility-strip{
    display:grid;
    grid-template-columns:1fr 1fr 1fr .55fr auto;
    gap:1px;
    margin:0 0 14px;
    overflow:hidden;
    border:1px solid var(--border);
    border-radius:10px;
    background:var(--border);
}
.property-responsibility-strip > div{
    background:var(--panel);
    padding:9px 11px;
}
.property-responsibility-strip span{
    display:block;
    margin-bottom:3px;
    color:var(--muted);
    font-size:10px;
    text-transform:uppercase;
    letter-spacing:.04em;
}
.property-responsibility-strip .btn{
    align-self:stretch;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:0;
}

.assignment-explainer{
    display:grid;
    grid-template-columns:1fr auto 1fr auto 1fr;
    align-items:center;
    gap:10px;
    margin:0 0 18px;
    padding:12px 14px;
    border:1px solid var(--border);
    border-radius:10px;
    background:var(--panel);
}
.assignment-explainer > div:not(.assignment-arrow){
    display:flex;
    gap:9px;
    align-items:flex-start;
}
.assignment-explainer > div > span{
    display:flex;
    flex:0 0 27px;
    width:27px;
    height:27px;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    background:rgba(139,92,246,.15);
    color:#c4b5fd;
    font-weight:900;
}
.assignment-explainer p{
    margin:0;
    line-height:1.35;
    font-size:12px;
}
.assignment-arrow{color:var(--muted)}
.assignment-section{
    padding:15px 0;
    border-top:1px solid var(--border);
}
.assignment-section h2{margin:0 0 12px}
.assignment-static{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}
.assignment-static > div{
    display:flex;
    flex-direction:column;
}
.assignment-static small{color:var(--muted)}
.assignment-check-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:8px;
}
.assignment-check{
    display:flex;
    align-items:center;
    gap:9px;
    padding:9px 10px;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--panel);
    cursor:pointer;
}
.assignment-check input{
    width:auto;
    margin:0;
}
.assignment-check span{
    display:flex;
    flex-direction:column;
}
.assignment-check small{color:var(--muted)}

.dashboard-workflow-summary{
    display:flex;
    gap:18px;
    align-items:center;
    margin-bottom:14px;
    padding:8px 11px;
    border-top:1px solid var(--border);
    border-bottom:1px solid var(--border);
}
.dashboard-workflow-summary > div{
    display:flex;
    gap:7px;
    align-items:baseline;
}
.dashboard-workflow-summary span{
    color:var(--muted);
    font-size:11px;
}
.dashboard-workflow-summary strong{font-size:17px}
.dashboard-approval-count strong{color:#fcd34d}
.section-heading-row{
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
    gap:12px;
    margin-bottom:9px;
}
.section-heading-row h2{margin:0}
.section-heading-row p{margin:2px 0 0}
.dashboard-workflow-row{
    grid-template-columns:1.35fr 2fr .8fr 1.5fr .7fr;
}
.dashboard-quicklinks{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:14px;
}
.dashboard-quicklinks a{
    display:flex;
    gap:8px;
    align-items:center;
    padding:7px 10px;
    border:1px solid var(--border);
    border-radius:8px;
    color:var(--muted);
    font-size:12px;
}

@media(max-width:900px){
    .property-responsibility-strip{
        grid-template-columns:1fr 1fr;
    }
    .assignment-check-grid{
        grid-template-columns:1fr 1fr;
    }
    .dashboard-workflow-row{
        grid-template-columns:1.2fr 1.8fr .8fr;
    }
    .dashboard-workflow-row > :nth-child(4),
    .dashboard-workflow-row > :nth-child(5){
        display:none;
    }
}
@media(max-width:650px){
    .global-timer-bar{
        align-items:flex-start;
        padding-left:10px;
        padding-right:10px;
    }
    .global-timer-main{flex-wrap:wrap}
    .global-timer-location{
        flex-basis:100%;
        max-width:75vw;
    }
    .pause-adjust-row{
        flex-direction:column;
        align-items:flex-start;
    }
    .property-responsibility-strip,
    .assignment-check-grid,
    .assignment-explainer{
        grid-template-columns:1fr;
    }
    .assignment-arrow{display:none}
}


/* V6.7.4 UX Polish ---------------------------------------------------- */

.time-duration-cell{
    min-width:110px;
}
.time-duration-cell strong{
    display:block;
    font-size:14px;
}
.time-duration-cell small{
    display:block;
    margin-top:2px;
    color:var(--muted);
    font-size:10px;
}
.time-break-cell{
    min-width:148px;
}
.pause-current{
    display:flex;
    gap:6px;
    align-items:baseline;
}
.pause-current span{
    color:var(--muted);
    font-size:10px;
    text-transform:uppercase;
    letter-spacing:.04em;
}
.pause-current strong{
    font-size:12px;
}
.pause-quick{
    margin-top:6px;
}
.pause-quick button{
    min-width:30px;
    padding:4px 7px;
}
.time-detail-total span{
    color:var(--muted);
    font-size:11px;
    text-transform:uppercase;
    letter-spacing:.05em;
}
.time-detail-total h1{
    margin-top:2px;
}
.time-detail-breakdown{
    display:flex;
    flex-wrap:wrap;
    gap:7px;
    margin:5px 0 8px;
}
.time-detail-breakdown > span{
    padding:5px 8px;
    border:1px solid var(--border);
    border-radius:7px;
    color:var(--muted);
    font-size:11px;
    background:var(--panel);
}
.time-detail-breakdown strong{
    color:var(--text);
}

.dashboard-kpi-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
    margin:4px 0 22px;
}
.dashboard-kpi{
    min-height:116px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    padding:17px 19px;
    border:1px solid var(--border);
    border-radius:13px;
    background:var(--panel);
    color:var(--text);
    transition:border-color .15s ease, transform .15s ease, background .15s ease;
}
.dashboard-kpi:hover{
    border-color:var(--purple);
    background:var(--panel2);
    transform:translateY(-1px);
}
.dashboard-kpi > span{
    color:var(--muted);
    font-size:12px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.04em;
}
.dashboard-kpi strong{
    margin:5px 0 3px;
    font-size:34px;
    line-height:1;
}
.dashboard-kpi small{
    color:var(--muted);
    font-size:11px;
}
.dashboard-kpi-warning{
    border-color:rgba(245,158,11,.55);
    background:rgba(245,158,11,.055);
}
.dashboard-kpi-warning strong{
    color:#fcd34d;
}
.dashboard-kpi-danger{
    border-color:rgba(239,68,68,.55);
    background:rgba(239,68,68,.055);
}
.dashboard-kpi-danger strong{
    color:#fca5a5;
}
.dashboard-due{
    display:flex;
    flex-direction:column;
    gap:3px;
}
.due-overdue{
    color:#fca5a5;
    font-weight:800;
}
.due-today{
    color:#fcd34d;
    font-weight:800;
}
.dashboard-quicklinks{
    gap:10px;
    margin-top:18px;
}
.dashboard-quicklinks a{
    min-width:150px;
    min-height:54px;
    justify-content:space-between;
    padding:11px 14px;
    font-size:13px;
    background:var(--panel);
}
.dashboard-quicklinks a strong{
    font-size:16px;
    color:var(--text);
}

@media(max-width:800px){
    .dashboard-kpi-grid{
        grid-template-columns:1fr;
    }
    .dashboard-kpi{
        min-height:88px;
    }
}


/* V6.7.5 – Rechte-Matrix ------------------------------------------------ */

.permission-matrix-note{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
    margin-bottom:14px;
}
.permission-matrix-note > div{
    padding:11px 12px;
    border:1px solid var(--border);
    border-radius:9px;
    background:var(--panel);
}
.permission-matrix-note strong{
    display:block;
    margin-bottom:3px;
    font-size:12px;
}
.permission-matrix-note span{
    display:block;
    color:var(--muted);
    font-size:11px;
    line-height:1.4;
}

.permission-matrix-wrap{
    overflow:auto;
    max-width:100%;
    border:1px solid var(--border);
    border-radius:11px;
    background:var(--panel);
}
.permission-matrix,
.permission-user-table{
    width:100%;
    min-width:820px;
    border-collapse:separate;
    border-spacing:0;
}
.permission-matrix th,
.permission-matrix td,
.permission-user-table th,
.permission-user-table td{
    border-bottom:1px solid var(--border);
}
.permission-matrix thead th,
.permission-user-table thead th{
    position:sticky;
    top:0;
    z-index:6;
    background:var(--panel2);
    padding:10px 11px;
    text-align:left;
    font-size:11px;
    text-transform:uppercase;
    letter-spacing:.04em;
}
.permission-matrix thead .permission-name-col{
    left:0;
    z-index:8;
}
.permission-name-col{
    position:sticky;
    left:0;
    z-index:3;
    width:420px;
    min-width:320px;
    background:var(--panel);
}
.permission-matrix-row:hover td{
    background:rgba(139,92,246,.035);
}
.permission-matrix-row:hover .permission-name-col{
    background:var(--panel2);
}
.permission-matrix-row td{
    padding:9px 11px;
}
.permission-name-main{
    display:flex;
    align-items:center;
    gap:7px;
}
.permission-name-col small,
.permission-user-table td small{
    display:block;
    margin-top:2px;
    color:var(--muted);
    font-size:10px;
    font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
}
.permission-role-col{
    width:145px;
    min-width:125px;
    text-align:center !important;
}
.permission-role-col strong{
    display:block;
}
.permission-role-col small{
    display:block;
    margin-top:2px;
    color:var(--muted);
    text-transform:none;
    letter-spacing:0;
    font-weight:500;
}
.permission-admin-col{
    background:rgba(139,92,246,.055) !important;
}

.permission-category-row th{
    padding:0 !important;
    background:#17151e;
    border-bottom:1px solid var(--border);
    text-align:left;
}
.permission-category-toggle{
    width:100%;
    display:flex;
    align-items:center;
    gap:8px;
    padding:9px 11px;
    border:0;
    background:transparent;
    color:var(--text);
    font-weight:900;
    cursor:pointer;
    text-align:left;
}
.permission-category-toggle small{
    color:var(--muted);
    font-weight:500;
}
.permission-category-chevron{
    width:15px;
    color:#c4b5fd;
}
.permission-category-toggle.collapsed .permission-category-chevron{
    transform:rotate(-90deg);
}

.matrix-check{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
}
.matrix-check input{
    position:absolute;
    opacity:0;
    pointer-events:none;
}
.matrix-check span{
    width:27px;
    height:27px;
    display:flex;
    align-items:center;
    justify-content:center;
    border:1px solid var(--border);
    border-radius:7px;
    background:var(--panel2);
    transition:.12s ease;
}
.matrix-check span::after{
    content:"";
}
.matrix-check input:checked + span{
    border-color:#8b5cf6;
    background:rgba(139,92,246,.2);
}
.matrix-check input:checked + span::after{
    content:"✓";
    color:#ddd6fe;
    font-weight:1000;
}
.permission-admin-col .matrix-check span{
    border-color:#8b5cf6;
    background:rgba(139,92,246,.13);
    opacity:.72;
}
.permission-info{
    width:18px;
    height:18px;
    padding:0;
    border:1px solid var(--border);
    border-radius:50%;
    background:transparent;
    color:var(--muted);
    font-size:10px;
    font-weight:900;
    cursor:help;
}
.permission-info:hover{
    border-color:var(--purple);
    color:#c4b5fd;
}

.permission-matrix-footer{
    position:sticky;
    bottom:0;
    z-index:10;
    display:flex;
    justify-content:space-between;
    gap:16px;
    align-items:center;
    margin-top:10px;
    padding:10px 12px;
    border:1px solid var(--border);
    border-radius:10px;
    background:rgba(18,17,24,.94);
    backdrop-filter:blur(8px);
}
.permission-matrix-footer p{
    margin:0;
}

.permission-user-toolbar{
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:center;
    margin-bottom:10px;
}
.permission-user-table th,
.permission-user-table td{
    padding:9px 11px;
}
.permission-user-table .permission-category-row th{
    padding:8px 11px !important;
    color:#c4b5fd;
}
.permission-user-table select{
    margin:0;
    min-width:180px;
}
.permission-state{
    display:inline-flex;
    align-items:center;
    padding:3px 7px;
    border-radius:999px;
    font-size:10px;
    font-weight:800;
}
.permission-state-on{
    background:rgba(34,197,94,.09);
    color:#86efac;
}
.permission-state-off{
    background:rgba(148,163,184,.08);
    color:#94a3b8;
}
.permission-admin-warning{
    margin-bottom:12px;
    padding:10px 12px;
    border:1px solid rgba(139,92,246,.4);
    border-radius:9px;
    background:rgba(139,92,246,.08);
    color:#ddd6fe;
}

@media(max-width:820px){
    .permission-matrix-note{
        grid-template-columns:1fr;
    }
    .permission-name-col{
        min-width:260px;
    }
    .permission-matrix-footer,
    .permission-user-toolbar{
        align-items:flex-start;
        flex-direction:column;
    }
}


/* V6.8 Stammdaten ----------------------------------------------------- */
.master-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:16px}
.master-summary-grid a{display:flex;justify-content:space-between;align-items:center;padding:15px 17px;border:1px solid var(--border);border-radius:11px;background:var(--panel);color:var(--text)}
.master-summary-grid span{color:var(--muted);font-size:12px}.master-summary-grid strong{font-size:22px}
.master-entry-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.master-entry{padding:16px;border:1px solid var(--border);border-radius:11px;background:var(--panel);color:var(--text)}.master-entry strong,.master-entry span{display:block}.master-entry span{margin-top:5px;color:var(--muted);font-size:12px}.master-entry:hover{border-color:var(--purple)}
.master-list{border:1px solid var(--border);border-radius:11px;overflow:hidden;background:var(--panel)}.master-list-row{display:grid;grid-template-columns:1.3fr 1fr 1.6fr 1fr;gap:12px;align-items:center;padding:11px 13px;border-bottom:1px solid var(--border);color:var(--text)}.master-list-row:last-child{border-bottom:0}a.master-list-row:hover{background:var(--panel2)}.master-list-row>span:first-child{display:flex;flex-direction:column}.master-list-row small{color:var(--muted)}
.master-contact-row{grid-template-columns:1.4fr 1.5fr 1fr 1.2fr}.master-badges,.tag-row{display:flex;gap:5px;flex-wrap:wrap}.master-badges b,.tag-row span,.compact-tags b{padding:3px 7px;border:1px solid var(--border);border-radius:999px;font-size:10px;font-weight:700}.badge-favorite{color:#fde68a}.badge-emergency{color:#fca5a5;border-color:rgba(239,68,68,.45)!important}.trade-inline{font-size:12px;color:var(--muted)}
.flag-grid{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 14px}.flag-grid label,.role-check-grid label{display:flex;gap:7px;align-items:center;padding:8px 10px;border:1px solid var(--border);border-radius:8px;background:var(--panel)}.flag-grid input,.role-check-grid input,.trade-check input{width:auto;margin:0}.flag-favorite{border-color:rgba(250,204,21,.35)!important}.flag-emergency{border-color:rgba(239,68,68,.35)!important}
.trade-check-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}.trade-check{display:flex;align-items:center;gap:8px;padding:8px;border:1px solid var(--border);border-radius:8px;background:var(--panel)}.trade-check span{display:flex;flex-direction:column}.trade-check small{color:var(--muted)}.role-check-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.master-detail-strip,.customer-master-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;margin-bottom:15px;border:1px solid var(--border);border-radius:10px;overflow:hidden;background:var(--border)}.master-detail-strip>div,.customer-master-strip>div{padding:10px 12px;background:var(--panel)}.master-detail-strip span,.customer-master-strip span{display:block;color:var(--muted);font-size:10px;text-transform:uppercase;margin-bottom:3px}.master-section{padding:14px 0;border-top:1px solid var(--border)}.master-section h2{margin:0 0 10px}
.external-lead-box,.master-contact-pick{margin-top:12px;padding:12px;border:1px solid var(--border);border-radius:9px;background:rgba(139,92,246,.05)}.master-contact-pick{margin-bottom:14px}.master-linked{display:block;width:max-content;margin-top:3px;padding:2px 6px;border-radius:999px;background:rgba(139,92,246,.12);color:#c4b5fd;font-size:9px}
@media(max-width:900px){.master-summary-grid{grid-template-columns:1fr 1fr}.trade-check-grid{grid-template-columns:1fr 1fr}.master-list-row,.master-contact-row{grid-template-columns:1fr 1fr}.master-detail-strip,.customer-master-strip{grid-template-columns:1fr 1fr}}
@media(max-width:600px){.master-summary-grid,.master-entry-grid,.trade-check-grid,.role-check-grid,.master-list-row,.master-contact-row,.master-detail-strip,.customer-master-strip{grid-template-columns:1fr}}


/* V6.9 – Bewohnerkommunikation ----------------------------------------- */

.communication-toplinks{
    display:flex;
    gap:8px;
    margin-bottom:12px;
}
.communication-toplinks a{
    color:#c4b5fd;
    font-size:12px;
    font-weight:800;
}

.communication-list{
    border:1px solid var(--border);
    border-radius:10px;
    overflow:hidden;
}
.communication-row{
    display:grid;
    grid-template-columns:1.4fr 2fr .8fr .6fr .9fr;
    gap:12px;
    align-items:center;
    padding:10px 12px;
    border-bottom:1px solid var(--border);
    color:var(--text);
    background:var(--panel);
}
.communication-row:last-child{
    border-bottom:0;
}
a.communication-row:hover{
    background:var(--panel2);
}
.communication-row > span{
    min-width:0;
}
.communication-row strong,
.communication-row small,
.communication-row em{
    display:block;
}
.communication-row small,
.communication-row em{
    margin-top:2px;
    color:var(--muted);
    font-size:10px;
}
.communication-row-head{
    background:var(--panel2);
    color:var(--muted);
    font-size:10px;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.04em;
}

.communication-mode{
    display:inline-flex;
    padding:3px 7px;
    border-radius:999px;
    font-size:10px;
    font-weight:900;
}
.communication-mode-notice{
    background:rgba(59,130,246,.1);
    color:#93c5fd;
}
.communication-mode-direct{
    background:rgba(34,197,94,.1);
    color:#86efac;
}
.communication-mode-both{
    background:rgba(139,92,246,.12);
    color:#c4b5fd;
}

.communication-template-catalog h2{
    margin:18px 0 7px;
    font-size:14px;
}
.communication-template-line{
    display:flex;
    justify-content:space-between;
    gap:14px;
    align-items:center;
    padding:9px 11px;
    border-top:1px solid var(--border);
    color:var(--text);
}
.communication-template-line:last-child{
    border-bottom:1px solid var(--border);
}
.communication-template-line:hover{
    background:var(--panel);
}
.communication-template-line span:first-child{
    min-width:0;
}
.communication-template-line strong,
.communication-template-line small{
    display:block;
}
.communication-template-line small{
    margin-top:2px;
    color:var(--muted);
}

.communication-form-section{
    margin-bottom:18px;
    padding:15px;
    border:1px solid var(--border);
    border-radius:10px;
    background:var(--panel);
}
.communication-form-section h2{
    margin:0 0 14px;
    font-size:14px;
}
.communication-recipient-picker{
    margin-top:12px;
    padding:10px;
    border:1px solid var(--border);
    border-radius:9px;
    background:var(--panel2);
}
.communication-recipient-picker-head{
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:center;
    margin-bottom:8px;
}
.communication-recipient-picker-head strong,
.communication-recipient-picker-head small{
    display:block;
}
.communication-recipient-picker-head small{
    margin-top:2px;
    color:var(--muted);
}
#recipient-live-count{
    color:#c4b5fd;
    font-size:11px;
    font-weight:900;
}
.communication-recipient-checks{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:6px;
    max-height:320px;
    overflow:auto;
}
.communication-recipient-check{
    display:flex;
    gap:8px;
    align-items:flex-start;
    padding:8px;
    border:1px solid var(--border);
    border-radius:7px;
    background:var(--panel);
}
.communication-recipient-check input{
    width:auto;
    margin-top:3px;
}
.communication-recipient-check span{
    min-width:0;
}
.communication-recipient-check strong,
.communication-recipient-check small{
    display:block;
}
.communication-recipient-check small{
    margin-top:2px;
    color:var(--muted);
    overflow-wrap:anywhere;
}

.communication-detail-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}
.communication-meta-strip{
    display:flex;
    flex-wrap:wrap;
    gap:1px;
    margin-bottom:14px;
    overflow:hidden;
    border:1px solid var(--border);
    border-radius:9px;
    background:var(--border);
}
.communication-meta-strip > div{
    min-width:135px;
    flex:1 1 135px;
    padding:8px 10px;
    background:var(--panel);
}
.communication-meta-strip span{
    display:block;
    margin-bottom:2px;
    color:var(--muted);
    font-size:9px;
    text-transform:uppercase;
    letter-spacing:.04em;
}
.communication-meta-strip strong{
    font-size:12px;
}
.communication-detail-layout{
    display:grid;
    grid-template-columns:minmax(0,1fr) 310px;
    gap:14px;
}
.communication-letter{
    min-height:420px;
    padding:28px 34px;
    border:1px solid var(--border);
    border-radius:10px;
    background:#f8fafc;
    color:#111827;
}
.communication-letter h2{
    margin:0 0 24px;
    text-align:center;
    color:#111827;
}
.communication-letter .preline{
    line-height:1.65;
}
.communication-recipient-line{
    padding:7px 0;
    border-bottom:1px solid var(--border);
}
.communication-recipient-line:last-child{
    border-bottom:0;
}
.communication-recipient-line strong,
.communication-recipient-line small{
    display:block;
}
.communication-recipient-line small{
    margin-top:2px;
    color:var(--muted);
}
.communication-missing-contact{
    color:#fca5a5 !important;
}
.copy-source{
    position:fixed;
    left:-10000px;
    top:-10000px;
}
.workflow-communication-line{
    display:block;
    padding:6px 0;
    border-bottom:1px solid var(--border);
    color:var(--text);
}
.workflow-communication-line strong,
.workflow-communication-line small{
    display:block;
}
.workflow-communication-line small{
    margin-top:2px;
    color:var(--muted);
}

@media(max-width:900px){
    .communication-row{
        grid-template-columns:1.3fr 1.7fr .8fr;
    }
    .communication-row > :nth-child(4),
    .communication-row > :nth-child(5){
        display:none;
    }
    .communication-detail-layout{
        grid-template-columns:1fr;
    }
}
@media(max-width:650px){
    .communication-recipient-checks{
        grid-template-columns:1fr;
    }
    .communication-letter{
        padding:20px;
    }
}


/* ONE Projects 0.3 – ONE Core v1 --------------------------------------- */
.core-summary-grid .core-summary-static{
    display:flex;
    flex-direction:column;
    justify-content:center;
    min-height:68px;
    padding:10px 12px;
    border:1px solid var(--border);
    border-radius:9px;
    background:var(--panel);
}
.core-summary-grid .core-summary-static span{
    color:var(--muted);
    font-size:10px;
    text-transform:uppercase;
    letter-spacing:.04em;
}
.core-summary-grid .core-summary-static strong{
    margin-top:3px;
    font-size:20px;
}
.master-entry-core{
    border-color:rgba(139,92,246,.42) !important;
    background:rgba(139,92,246,.055) !important;
}
.core-readiness{
    display:inline-flex;
    align-items:center;
    padding:6px 10px;
    border-radius:999px;
    font-size:11px;
    font-weight:900;
}
.core-readiness.ready{
    background:rgba(34,197,94,.10);
    color:#86efac;
}
.core-readiness.pending{
    background:rgba(245,158,11,.10);
    color:#fcd34d;
}
.core-status-table{
    border:1px solid var(--border);
    border-radius:9px;
    overflow:hidden;
}
.core-status-table > div{
    display:flex;
    justify-content:space-between;
    gap:16px;
    padding:8px 10px;
    border-bottom:1px solid var(--border);
}
.core-status-table > div:last-child{
    border-bottom:0;
}
.core-status-table span{
    color:var(--muted);
}
.core-map{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
}
.core-map > div{
    padding:10px 11px;
    border:1px solid var(--border);
    border-radius:8px;
    background:var(--panel);
}
.core-map strong,
.core-map span{
    display:block;
}
.core-map span{
    margin-top:3px;
    color:var(--muted);
    font-size:11px;
}
@media(max-width:700px){
    .core-map{
        grid-template-columns:1fr;
    }
}


/* ONE Core 0.3.1 – Querschnitt */
.core-activity-list{
    border:1px solid var(--border);
    border-radius:9px;
    overflow:hidden;
}
.core-activity-list > div{
    display:grid;
    grid-template-columns:125px minmax(160px,.7fr) minmax(260px,1.8fr);
    gap:10px;
    padding:8px 10px;
    border-bottom:1px solid var(--border);
    align-items:start;
}
.core-activity-list > div:last-child{border-bottom:0;}
.core-activity-list span,
.core-activity-list small{color:var(--muted);font-size:10px;}
.core-activity-list strong{font-size:11px;}
@media(max-width:760px){
    .core-activity-list > div{grid-template-columns:1fr;gap:2px;}
}


/* ONE Billing 0.4 */
.module-kicker{
    color:var(--purple2);
    font-size:12px;
    font-weight:900;
    letter-spacing:.08em;
    text-transform:uppercase;
}
.billing-subnav{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin:-10px 0 24px;
    padding-bottom:14px;
    border-bottom:1px solid var(--border);
}
.billing-subnav a{
    padding:8px 12px;
    border:1px solid var(--border);
    border-radius:999px;
    background:rgba(139,92,246,.06);
    font-size:12px;
    font-weight:800;
}
.billing-subnav a:hover{border-color:var(--purple);background:rgba(139,92,246,.14)}
.billing-nav-more{position:relative}
.billing-nav-more > summary{list-style:none;padding:8px 12px;border:1px solid var(--border);border-radius:999px;background:rgba(139,92,246,.06);font-size:12px;font-weight:800;cursor:pointer}
.billing-nav-more > summary::-webkit-details-marker{display:none}
.billing-nav-more > summary::after{content:" ▾";color:var(--muted)}
.billing-nav-more[open] > summary{border-color:var(--purple);background:rgba(139,92,246,.14)}
.billing-nav-menu{position:absolute;z-index:20;right:0;top:42px;display:grid;min-width:245px;padding:8px;border:1px solid var(--border);border-radius:12px;background:#151922;box-shadow:0 16px 35px rgba(0,0,0,.35)}
.billing-nav-menu a{border:0;border-radius:8px;background:transparent}
.billing-import-action{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:11px;font-weight:800}
.billing-import-create{background:rgba(34,197,94,.15);color:#86efac}
.billing-import-update{background:rgba(59,130,246,.15);color:#93c5fd}
.billing-import-skip{background:rgba(148,163,184,.14);color:#cbd5e1}
.billing-import-error{background:rgba(239,68,68,.15);color:#fca5a5}
.billing-error-text{color:#fca5a5}
.billing-import-stats{margin-bottom:18px}
.billing-import-upload{max-width:720px}
.billing-mapping-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.compact-header{align-items:center;margin-bottom:14px}
.billing-supplier-editor{margin-top:18px}
.billing-stats,.billing-money-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:14px;
}
.billing-stats .card,.billing-money-grid .card{padding:18px}
.billing-form{max-width:980px}
.billing-form h2{margin:8px 0 14px;font-size:17px}
.billing-form h2:not(:first-child){margin-top:26px;padding-top:20px;border-top:1px solid var(--border)}
.billing-form-section + .billing-form-section{margin-top:26px;padding-top:22px;border-top:1px solid var(--border)}
.billing-form-section h2,.billing-form-section h2:not(:first-child){display:flex;align-items:center;gap:9px;margin:0 0 16px;padding:0;border:0}
.billing-step{display:inline-flex;width:26px;height:26px;align-items:center;justify-content:center;border-radius:999px;background:rgba(139,92,246,.18);color:var(--purple2);font-size:12px;font-weight:900}
.billing-calc-hint{display:grid;grid-template-columns:1fr 1fr;gap:6px 16px;padding:12px 14px;border-radius:10px;background:rgba(139,92,246,.07);font-size:12px}
.billing-calc-hint strong{grid-column:1/-1}
.billing-calc-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:12px;border:1px solid var(--border);border-radius:10px;background:#11151d}
.billing-calc-summary div{display:flex;flex-direction:column;gap:3px}
.billing-calc-summary span{color:var(--muted);font-size:11px}
.billing-calc-summary strong{font-size:15px}
.billing-ratio-line{grid-column:1/-1;margin:2px 0 0;padding-top:9px;border-top:1px solid var(--border);color:var(--muted);font-size:11px}
.billing-ratio-line strong{color:var(--text);font-size:12px}
.billing-details{border:1px solid var(--border);border-radius:10px;background:rgba(255,255,255,.015)}
.billing-details summary{padding:11px 13px;color:var(--muted);font-size:12px;font-weight:800;cursor:pointer}
.billing-details[open] summary{border-bottom:1px solid var(--border);color:var(--text)}
.billing-details-content{padding:14px}
.billing-calculation-help{background:transparent}
.billing-internal-details{margin-top:20px}
.billing-info-note{margin:0 0 14px;padding:10px 12px;border:1px solid rgba(139,92,246,.3);border-radius:9px;background:rgba(139,92,246,.07);font-size:12px}
.billing-reference-box{margin-top:16px;padding:13px 14px;border:1px solid var(--border);border-radius:10px;background:rgba(255,255,255,.018)}
.billing-reference-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:11px}
.billing-reference-heading strong{font-size:13px}
.billing-invoice-lines{display:flex;flex-direction:column;gap:14px;margin-bottom:14px}
.billing-invoice-line{padding:14px;border:1px solid var(--border);border-radius:11px;background:#11151d}
.billing-line-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.billing-line-grid{display:grid;grid-template-columns:1.2fr 1fr 1fr 1fr;gap:11px}
.billing-line-catalog,.billing-line-description{grid-column:span 2}
.billing-line-result{display:grid;grid-template-columns:auto 1fr;align-content:center;gap:5px 10px;padding:9px 11px;border-radius:8px;background:rgba(255,255,255,.035)}
.billing-line-result span{color:var(--muted);font-size:11px}
.billing-line-result strong{text-align:right;font-size:13px}
.billing-invoice-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:16px;padding:14px;border:1px solid rgba(139,92,246,.3);border-radius:11px;background:rgba(139,92,246,.07)}
.billing-invoice-summary div,.billing-invoice-detail-summary div{display:flex;flex-direction:column;gap:3px}
.billing-invoice-summary span,.billing-invoice-detail-summary span{color:var(--muted);font-size:11px}
.billing-invoice-summary p{grid-column:1/-1;margin:0;padding-top:9px;border-top:1px solid var(--border);font-size:12px}
.billing-invoice-detail-summary{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:16px;margin-top:18px}
.billing-finalize-card{margin-top:18px;border-color:rgba(139,92,246,.35)}
.billing-finalize-card h2{margin-top:0}
.form-span-2{grid-column:span 2}
.money-cell{text-align:right;white-space:nowrap}
.cell-subline{display:block;margin-top:4px;color:var(--muted);font-size:11px;max-width:360px}
.billing-status{
    display:inline-flex;
    padding:4px 8px;
    border:1px solid var(--border);
    border-radius:999px;
    font-size:11px;
    font-weight:900;
}
.billing-status-draft{color:#cbd5e1}
.billing-status-issued{color:#86efac;border-color:rgba(34,197,94,.42)}
.billing-status-due{color:#fcd34d;border-color:rgba(245,158,11,.42)}
.billing-status-paid{color:#86efac;border-color:rgba(34,197,94,.42)}
.billing-status-credited{color:#c4b5fd;border-color:rgba(139,92,246,.42)}
.billing-status-credit_balance{color:#fcd34d;border-color:rgba(245,158,11,.42)}
.billing-status-cancelled{color:#fca5a5;border-color:rgba(239,68,68,.35)}
.billing-status-open{color:#fcd34d;border-color:rgba(245,158,11,.42)}
.billing-status-partial{color:#93c5fd;border-color:rgba(59,130,246,.42)}
.billing-status-overdue{color:#fca5a5;border-color:rgba(239,68,68,.5);background:rgba(239,68,68,.08)}
.billing-status-not_applicable{color:#94a3b8}
.billing-status-booked{color:#86efac;border-color:rgba(34,197,94,.42)}
.billing-status-reversed{color:#94a3b8;text-decoration:line-through}
.billing-status-sent{color:#86efac;border-color:rgba(34,197,94,.42)}
.billing-status-failed{color:#fca5a5;border-color:rgba(239,68,68,.5);background:rgba(239,68,68,.08)}
.billing-status-pending{color:#fcd34d;border-color:rgba(245,158,11,.42)}
.billing-status-pair{display:flex;flex-wrap:wrap;gap:7px}
.billing-overdue-amount{color:#fca5a5}
.billing-invoice-stats{margin-bottom:16px}
.billing-op-filters{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 14px}
.billing-op-filters a{padding:7px 11px;border:1px solid var(--border);border-radius:999px;color:var(--muted);font-size:12px;font-weight:800}
.billing-op-filters a:hover,.billing-op-filters a.active{border-color:var(--purple);background:rgba(139,92,246,.12);color:var(--text)}
.billing-invoice-filter{display:grid;grid-template-columns:minmax(280px,2fr) minmax(170px,1fr) minmax(170px,1fr) auto auto;gap:11px;align-items:end;margin-bottom:10px}
.billing-invoice-filter label,.billing-dashboard-filter label{margin:0}
.billing-invoice-filter input,.billing-invoice-filter select,.billing-dashboard-filter input,.billing-dashboard-filter select{margin-bottom:0}
.billing-custom-period{grid-column:1/-1}
.billing-custom-period-fields{display:grid;grid-template-columns:180px 180px 1fr;gap:11px;align-items:end;padding:12px}
.billing-result-count{margin:0 0 10px;font-size:12px}
.billing-recurring-filter{grid-template-columns:minmax(300px,2fr) minmax(180px,1fr) auto auto}
.billing-dashboard-filter{display:grid;grid-template-columns:minmax(220px,1.5fr) minmax(150px,1fr) minmax(150px,1fr) auto;gap:11px;align-items:end;margin-bottom:10px}
.billing-dashboard-period{margin:0 0 14px;font-size:12px}
.billing-dashboard-kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin-bottom:16px}
.billing-dashboard-kpis .card{padding:18px}
.billing-negative{color:#fca5a5!important}
.billing-revenue-chart{margin-top:0}
.billing-chart-legend{display:flex;flex-wrap:wrap;gap:13px;color:var(--muted);font-size:11px}
.billing-chart-legend span{display:inline-flex;align-items:center;gap:5px}
.billing-chart-legend i{display:inline-block;width:16px;height:6px;border-radius:999px}
.billing-legend-revenue{background:linear-gradient(90deg,#8b5cf6,#a78bfa)}
.billing-legend-profit{background:linear-gradient(90deg,#10b981,#86efac)}
.billing-chart-scroll{display:flex;flex-direction:column;gap:10px;max-height:520px;overflow:auto;padding-right:4px}
.billing-chart-row{display:grid;grid-template-columns:74px minmax(180px,1fr) minmax(105px,auto);gap:12px;align-items:center}
.billing-chart-label{color:var(--muted);font-size:11px;font-weight:800;text-align:right}
.billing-chart-bars{display:flex;flex-direction:column;gap:4px}
.billing-chart-track{height:9px;overflow:hidden;border-radius:999px;background:rgba(255,255,255,.045)}
.billing-chart-bar{display:block;height:100%;min-width:2px;border-radius:999px}
.billing-chart-revenue{background:linear-gradient(90deg,#6d28d9,#a78bfa)}
.billing-chart-revenue.negative{background:linear-gradient(90deg,#b91c1c,#fca5a5)}
.billing-chart-profit{background:linear-gradient(90deg,#059669,#86efac)}
.billing-chart-profit.negative{background:linear-gradient(90deg,#b91c1c,#fca5a5)}
.billing-chart-values{display:flex;flex-direction:column;align-items:flex-end;gap:2px;white-space:nowrap}
.billing-chart-values strong{font-size:12px}
.billing-chart-values small{color:#86efac;font-size:10px}
.billing-dashboard-note{font-size:11px}
.billing-payments-card{margin-top:18px}
.billing-section-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:16px}
.billing-section-heading h2{margin:3px 0 0}
.billing-payment-balance{display:flex;flex-direction:column;align-items:flex-end;gap:3px}
.billing-payment-balance span{color:var(--muted);font-size:11px}
.billing-payment-balance strong{font-size:22px}
.billing-payment-form{display:grid;grid-template-columns:1fr 1fr 1.2fr 1.5fr auto;gap:11px;align-items:end;padding:14px;border:1px solid rgba(139,92,246,.3);border-radius:11px;background:rgba(139,92,246,.06)}
.billing-payment-form label{margin:0}
.billing-payment-form input,.billing-payment-form select{margin-bottom:0}
.billing-payment-notes{grid-column:1/-1}
.billing-payment-notes textarea{margin-bottom:0}
.billing-payment-table{margin-top:16px}
.billing-payment-reversed{opacity:.68}
.billing-payment-reversed .money-cell strong{text-decoration:line-through}
.billing-paid-note{margin:0;padding:12px 14px;border:1px solid rgba(34,197,94,.35);border-radius:10px;background:rgba(34,197,94,.07);color:#86efac}
.billing-girocode-card{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:16px;padding:14px 16px}.billing-girocode-card>div{display:flex;flex-direction:column;gap:3px}.billing-girocode-card p{margin:0;color:var(--muted);text-align:right}.billing-girocode-ready{border-color:rgba(34,197,94,.35);background:rgba(34,197,94,.06)}.billing-girocode-warning{border-color:rgba(245,158,11,.4);background:rgba(245,158,11,.06)}
@media(max-width:700px){.billing-girocode-card{align-items:flex-start;flex-direction:column}.billing-girocode-card p{text-align:left}}
.billing-no-payments{margin:15px 0 0}
.core-logo-current{display:flex;align-items:center;gap:16px;margin:0 0 14px;padding:12px;border:1px solid var(--border);border-radius:10px;background:rgba(255,255,255,.02)}
.core-logo-current img{display:block;width:170px;max-width:35vw;height:70px;object-fit:contain;object-position:left center;border-radius:6px;background:#fff;padding:6px}
.core-logo-current div{display:flex;flex-direction:column;align-items:flex-start;gap:4px}
.billing-inline-action{margin:6px 0 0}
.billing-inline-action button{
    padding:0;
    border:0;
    background:none;
    color:var(--purple2);
    font:inherit;
    font-size:11px;
    font-weight:800;
    cursor:pointer;
}
.billing-inline-action button:hover{text-decoration:underline}
.billing-price-preview{
    display:flex;
    min-height:42px;
    align-items:center;
    padding:10px 12px;
    border:1px solid var(--border);
    border-radius:8px;
    background:#11151d;
    color:#86efac;
    font-size:18px;
    font-weight:900;
}
.billing-calc-button{margin-top:8px;width:100%}
.billing-sequence-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.billing-sequence-card h2{margin-top:0;font-size:18px}
.billing-number-note{display:flex;flex-direction:column;gap:4px;margin-bottom:16px}
.billing-detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.detail-list{margin:0}
.detail-list > div{display:grid;grid-template-columns:minmax(145px,.7fr) 1.3fr;gap:12px;padding:10px 0;border-bottom:1px solid var(--border)}
.detail-list > div:last-child{border-bottom:0}
.detail-list dt{color:var(--muted);font-size:12px}
.detail-list dd{margin:0;font-weight:700}
.detail-list dd small{display:block;color:var(--muted);font-weight:400}
.billing-account-group h2,.billing-report-group h2{margin:4px 0 0}
.billing-account-group .table-wrapper,.billing-report-group .table-wrapper{margin-top:14px}
.year-filter{display:flex;gap:8px;align-items:center}
.year-filter input{width:110px;margin:0}
@media(max-width:900px){
    .billing-stats,.billing-money-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
    .billing-dashboard-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
    .billing-invoice-filter{grid-template-columns:1fr 1fr}
    .billing-search-field,.billing-custom-period{grid-column:1/-1}
    .billing-payment-form{grid-template-columns:1fr 1fr}
    .billing-payment-form button{width:100%}
}
@media(max-width:700px){
    .billing-detail-grid,.billing-stats,.billing-money-grid,.billing-sequence-grid{grid-template-columns:1fr}
    .form-span-2{grid-column:span 1}
    .billing-calc-hint,.billing-calc-summary{grid-template-columns:1fr 1fr}
    .billing-line-grid,.billing-invoice-summary,.billing-invoice-detail-summary{grid-template-columns:1fr 1fr}
    .billing-reference-heading{align-items:flex-start;flex-direction:column;gap:3px}
    .core-logo-current{align-items:flex-start;flex-direction:column}
    .core-logo-current img{max-width:100%;width:100%;height:90px}
    .billing-line-catalog,.billing-line-description{grid-column:span 2}
    .year-filter{width:100%}
    .page-header-row{flex-direction:column}
    .billing-payment-form{grid-template-columns:1fr}
    .billing-payment-notes{grid-column:1}
    .billing-section-heading{align-items:flex-start;flex-direction:column}
    .billing-mapping-grid{grid-template-columns:1fr}
    .billing-nav-menu{left:0;right:auto}
    .billing-payment-balance{align-items:flex-start}
    .billing-dashboard-filter,.billing-dashboard-kpis,.billing-invoice-filter,.billing-custom-period-fields{grid-template-columns:1fr}
    .billing-search-field,.billing-custom-period{grid-column:1}
    .billing-chart-row{grid-template-columns:56px minmax(135px,1fr)}
    .billing-chart-values{grid-column:2;align-items:flex-start;flex-direction:row;gap:10px}
}
