* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-canvas: #f4f6f9;
    --surface: #ffffff;
    --surface-subtle: #f8fafc;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --brand-navy: #0f2942;
    --brand-blue: #1d63b8;
    --brand-blue-soft: #eff6ff;
    --accent-teal: #0d9488;
    --accent-teal-soft: #ccfbf1;
    --accent-amber: #d97706;
    --accent-amber-soft: #fef3c7;
    --accent-emerald: #059669;
    --accent-emerald-soft: #d1fae5;
    --accent-violet: #6d28d9;
    --accent-violet-soft: #ede9fe;
    --accent-rose: #dc2626;
    --accent-rose-soft: #fee2e2;
    --accent-bronze: #8a6d3b;
    --accent-bronze-soft: #f7f3eb;

    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

body {
    font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    background: var(--bg-canvas);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.login-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 15% 20%, rgba(29, 99, 184, 0.08), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(217, 119, 6, 0.07), transparent 40%),
        #f1f5f9;
    z-index: 2000;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 36px;
}

.login-logo-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.login-logo-row.login-logo-branded {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    margin-bottom: 24px;
}

.login-brand-img {
    display: block;
    max-width: 150px;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.login-brand-sub {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-blue) 100%);
    color: #ffffff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.brand-logo-icon {
    height: 34px;
    width: auto;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
}

.login-logo-text h1 {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-primary);
}

.login-logo-text p {
    font-size: 12.5px;
    color: var(--text-muted);
}

.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

.top-header {
    height: 54px;
    min-height: 54px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 0 14px;
    gap: 14px;
    z-index: 20;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 12px;
    border-right: 1px solid var(--border);
    cursor: pointer;
    flex-shrink: 0;
}

.brand-lockup .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 14px;
    border-radius: 8px;
}

.brand-name-wrap {
    line-height: 1.15;
}

.brand-name-main {
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--brand-navy);
}

.brand-name-sub {
    font-size: 10.5px;
    color: var(--text-muted);
}

.workspace-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 4px 0;
}

.workspace-tabs::-webkit-scrollbar {
    display: none;
}

.ws-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: var(--surface-subtle);
    color: var(--text-secondary);
    font-size: 12.8px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.14s ease;
}

.ws-tab:hover {
    background: #eef2f6;
    color: var(--text-primary);
}

.ws-tab.active {
    background: var(--brand-blue-soft);
    border-color: #bfdbfe;
    color: var(--brand-blue);
    font-weight: 600;
}

.ws-tab-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-muted);
    margin-left: 2px;
}

.ws-tab-close:hover {
    background: rgba(15, 23, 42, 0.1);
    color: var(--text-primary);
}

.btn-tab-add {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px dashed var(--border-strong);
    background: transparent;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-tab-add:hover {
    background: var(--surface-subtle);
    color: var(--brand-blue);
    border-color: var(--brand-blue);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.quick-search {
    position: relative;
    width: 220px;
}

.quick-search input {
    width: 100%;
    height: 34px;
    padding: 0 12px 0 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-subtle);
    font-size: 12.5px;
    color: var(--text-primary);
}

.quick-search input:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(29, 99, 184, 0.12);
}

.quick-search svg {
    position: absolute;
    left: 10px;
    top: 9px;
    width: 15px;
    height: 15px;
    color: var(--text-muted);
}

.btn-create-top {
    height: 34px;
    padding: 0 14px;
    border-radius: 8px;
    border: none;
    background: var(--brand-blue);
    color: #ffffff;
    font-size: 12.8px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(29, 99, 184, 0.25);
}

.btn-create-top:hover {
    background: #175299;
}

.icon-action-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.icon-action-btn:hover {
    background: var(--surface-subtle);
    color: var(--text-primary);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 3px 10px 3px 4px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-subtle);
    cursor: pointer;
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--brand-navy);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    display: grid;
    place-items: center;
}

.user-chip-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.body-layout {
    flex: 1;
    display: flex;
    min-height: 0;
}

.icon-rail {
    width: 60px;
    min-width: 60px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    transition: width 0.18s ease;
    z-index: 15;
}

.icon-rail.expanded {
    width: 228px;
    min-width: 228px;
    align-items: stretch;
    padding: 10px 10px;
}

.rail-toggle {
    width: 38px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-bottom: 8px;
    align-self: center;
}

.icon-rail.expanded .rail-toggle {
    align-self: flex-start;
    margin-left: 2px;
}

.rail-toggle:hover {
    background: var(--surface-subtle);
    color: var(--text-primary);
}

.rail-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
}

.rail-item {
    position: relative;
    height: 38px;
    width: 40px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.12s ease;
}

.icon-rail.expanded .rail-item {
    width: 100%;
    justify-content: flex-start;
    padding: 0 11px;
    gap: 11px;
}

.rail-item:hover {
    background: var(--surface-subtle);
    color: var(--text-primary);
}

.rail-item.active {
    background: var(--brand-blue-soft);
    color: var(--brand-blue);
    font-weight: 600;
}

.rail-item.active::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--brand-blue);
}

.rail-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.rail-label {
    display: none;
    font-size: 13px;
    white-space: nowrap;
}

.icon-rail.expanded .rail-label {
    display: inline;
}

.rail-divider {
    width: 26px;
    height: 1px;
    background: var(--border);
    margin: 6px auto;
}

.icon-rail.expanded .rail-divider {
    width: 100%;
}

.rail-bottom {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.main-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 22px 26px 48px;
}

.page-wrap {
    max-width: 1380px;
    margin: 0 auto;
}

.welcome-banner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 18px;
}

.welcome-title {
    font-size: 21px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.welcome-sub {
    font-size: 13.2px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.meta-pill-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-pill {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

@media (max-width: 1150px) {
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .kpi-grid { grid-template-columns: 1fr; }
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--brand-blue);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    box-shadow: var(--shadow-xs);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.kpi-card.amber { border-top-color: var(--accent-amber); }
.kpi-card.emerald { border-top-color: var(--accent-emerald); }
.kpi-card.violet { border-top-color: var(--accent-violet); }

.kpi-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 4px 0 2px;
    line-height: 1.1;
}

.kpi-foot {
    font-size: 11.8px;
    color: var(--text-muted);
}

.kpi-badge-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--brand-blue-soft);
    color: var(--brand-blue);
    flex-shrink: 0;
}

.kpi-badge-icon svg {
    width: 20px;
    height: 20px;
}

.kpi-card.amber .kpi-badge-icon { background: var(--accent-amber-soft); color: var(--accent-amber); }
.kpi-card.emerald .kpi-badge-icon { background: var(--accent-emerald-soft); color: var(--accent-emerald); }
.kpi-card.violet .kpi-badge-icon { background: var(--accent-violet-soft); color: var(--accent-violet); }

.dash-split {
    display: grid;
    grid-template-columns: 1.55fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

@media (max-width: 1080px) {
    .dash-split { grid-template-columns: 1fr; }
}

.card-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    box-shadow: var(--shadow-xs);
    min-width: 0;
}

.card-box.bo-accent {
    border-top: 3px solid var(--accent-bronze);
}

.card-box.diag-accent {
    border-top: 3px solid var(--accent-teal);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.card-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.card-title svg {
    width: 18px;
    height: 18px;
    color: var(--brand-blue);
    flex-shrink: 0;
}

.card-box.bo-accent .card-title svg {
    color: var(--accent-bronze);
}

.card-box.diag-accent .card-title svg {
    color: var(--accent-teal);
}

.card-link {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--brand-blue);
    background: none;
    border: none;
    cursor: pointer;
}

.card-link:hover {
    text-decoration: underline;
}

.clean-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.clean-table th {
    text-align: left;
    font-size: 11.2px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-subtle);
}

.clean-table td {
    padding: 10px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-primary);
    vertical-align: middle;
    overflow-wrap: anywhere;
}

.clean-table tr.clickable-row {
    cursor: pointer;
}

.clean-table tr.clickable-row:hover td {
    background: #f0f7ff;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2.5px 9px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.pill-blue { background: #dbeafe; color: #1e40af; }
.pill-teal { background: #ccfbf1; color: #0f766e; }
.pill-amber { background: #fef3c7; color: #b45309; }
.pill-green { background: #d1fae5; color: #065f46; }
.pill-rose { background: #fee2e2; color: #b91c1c; }
.pill-slate { background: #f1f5f9; color: #475569; }
.pill-violet { background: #ede9fe; color: #5b21b6; }
.pill-bronze { background: var(--accent-bronze-soft); color: var(--accent-bronze); border: 1px solid #e5dcc8; }

.donut-wrap {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 18px;
    padding: 8px 0;
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 9px;
    flex: 1;
}

.legend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
}

.legend-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 3px;
    flex-shrink: 0;
}

.service-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px;
}

@media (max-width: 760px) {
    .service-mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.service-mini-card {
    border: 1px solid var(--border);
    background: var(--surface-subtle);
    border-radius: 10px;
    padding: 12px 13px;
    display: flex;
    align-items: center;
    gap: 11px;
    cursor: pointer;
    transition: all 0.13s ease;
}

.service-mini-card:hover {
    background: #ffffff;
    border-color: #93c5fd;
    box-shadow: var(--shadow-xs);
}

.mini-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--brand-blue);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.mini-icon svg {
    width: 17px;
    height: 17px;
}

.mini-title {
    font-size: 12.8px;
    font-weight: 600;
    color: var(--text-primary);
}

.mini-sub {
    font-size: 11.2px;
    color: var(--text-muted);
    margin-top: 1px;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.info-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-item-left {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.info-badge {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.info-badge svg {
    width: 16px;
    height: 16px;
}

.info-badge.warn { background: var(--accent-amber-soft); color: var(--accent-amber); }
.info-badge.ok { background: var(--accent-emerald-soft); color: var(--accent-emerald); }
.info-badge.info { background: var(--brand-blue-soft); color: var(--brand-blue); }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 16px;
}

.filter-bar .form-control {
    height: 34px;
    font-size: 12.8px;
    width: auto;
    min-width: 155px;
}

.filter-bar .search-field {
    flex: 1;
    min-width: 220px;
}

.ticket-dossier-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 14px;
}

.ticket-num-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 4px;
}

.ticket-num {
    font-size: 20px;
    font-weight: 800;
    color: var(--brand-navy);
    letter-spacing: 0.02em;
}

.ticket-subject {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.ticket-actions-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.workflow-stepper {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 16px;
}

@media (max-width: 900px) {
    .workflow-stepper { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.wf-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
}

.wf-step.done {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.wf-step.current {
    background: var(--brand-blue-soft);
    border-color: #93c5fd;
    color: var(--brand-blue);
    font-weight: 700;
}

.wf-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid currentColor;
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.dossier-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

@media (max-width: 1100px) {
    .dossier-grid { grid-template-columns: minmax(0, 1fr); }
}

.dossier-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.meta-kv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
}

@media (max-width: 640px) {
    .meta-kv-grid { grid-template-columns: 1fr; }
}

.kv-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.kv-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.kv-icon svg {
    width: 15px;
    height: 15px;
}

.kv-label {
    font-size: 11.2px;
    color: var(--text-muted);
}

.kv-val {
    font-size: 13.2px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1px;
}

.kv-sub {
    font-size: 11.5px;
    color: var(--text-secondary);
}

.desc-box {
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 13px 15px;
    font-size: 13.4px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.diag-groups-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

@media (max-width: 780px) {
    .diag-groups-grid { grid-template-columns: 1fr; }
}

.diag-group-box {
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 10px 12px;
}

.diag-group-title {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--accent-teal);
    margin-bottom: 8px;
}

.diag-check-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12.6px;
    color: var(--text-primary);
    line-height: 1.35;
    padding: 4px 0;
    cursor: pointer;
    user-select: none;
}

.diag-check-item input[type="checkbox"] {
    margin-top: 2px;
    width: 15px;
    height: 15px;
    accent-color: var(--accent-teal);
    flex-shrink: 0;
    cursor: pointer;
}

.diag-check-item.checked span {
    color: #0f766e;
    font-weight: 600;
}

.bo-ref-banner {
    background: var(--accent-bronze-soft);
    border: 1px solid #e5dcc8;
    border-radius: 9px;
    padding: 10px 13px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.bo-comm-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.bo-comm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.bo-comm-card {
    background: #fcfaf6;
    border: 1px solid #e6decb;
    border-left: 3px solid var(--accent-bronze);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.bo-comm-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11.3px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.bo-comm-body {
    font-size: 12.6px;
    color: var(--text-primary);
    line-height: 1.5;
    white-space: pre-wrap;
    max-height: 190px;
    overflow-y: auto;
}

.timeline {
    position: relative;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 360px;
    overflow-y: auto;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: #e2e8f0;
}

.tl-item {
    position: relative;
}

.tl-dot {
    position: absolute;
    left: -17px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand-blue);
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px var(--brand-blue);
}

.tl-dot.status { background: var(--accent-teal); box-shadow: 0 0 0 1px var(--accent-teal); }
.tl-dot.loesung { background: var(--accent-emerald); box-shadow: 0 0 0 1px var(--accent-emerald); }
.tl-dot.anhang { background: var(--accent-amber); box-shadow: 0 0 0 1px var(--accent-amber); }
.tl-dot.hersteller { background: var(--accent-bronze); box-shadow: 0 0 0 1px var(--accent-bronze); }

.tl-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11.2px;
    color: var(--text-muted);
}

.tl-head {
    font-size: 12.8px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 1px 0 3px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.tl-body {
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 11px;
    font-size: 12.6px;
    color: var(--text-secondary);
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

.icon-del-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.12s ease;
}

.icon-del-btn:hover {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

.icon-del-btn svg {
    width: 13.5px;
    height: 13.5px;
}

.attachment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-subtle);
    margin-bottom: 8px;
}

.btn {
    height: 34px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 12.8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-sm {
    height: 29px;
    padding: 0 11px;
    font-size: 12px;
}

.btn-primary {
    background: var(--brand-blue);
    color: #ffffff;
}

.btn-primary:hover {
    background: #175299;
}

.btn-teal {
    background: var(--accent-teal);
    color: #ffffff;
}

.btn-teal:hover {
    background: #0f766e;
}

.btn-bronze {
    background: var(--accent-bronze);
    color: #ffffff;
}

.btn-bronze:hover {
    background: #6f562c;
}

.btn-emerald {
    background: var(--accent-emerald);
    color: #ffffff;
}

.btn-emerald:hover {
    background: #047857;
}

.btn-secondary {
    background: #ffffff;
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--surface-subtle);
}

.btn-danger-soft {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

.btn-danger-soft:hover {
    background: #ffe4e6;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.form-control {
    width: 100%;
    height: 36px;
    padding: 0 11px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    font-size: 13.2px;
    font-family: inherit;
    color: var(--text-primary);
    background: #ffffff;
}

textarea.form-control {
    height: auto;
    padding: 9px 11px;
    resize: vertical;
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(29, 99, 184, 0.12);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

@media (max-width: 680px) {
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1500;
    padding: 16px;
}

.modal-box {
    width: 100%;
    max-width: 540px;
    max-height: 92vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid var(--border);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.modal-box.wide {
    max-width: 760px;
}

.modal-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--brand-blue);
    margin: 14px 0 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.alert-msg {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12.8px;
    margin-bottom: 14px;
}

.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

.hidden { display: none !important; }


.card-box.loc-accent { border-top: 3px solid var(--brand-blue); }
.diag-toggle-header { cursor: pointer; user-select: none; }
.diag-chevron {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 6px;
    background: var(--surface-subtle); border: 1px solid var(--border);
    color: var(--text-secondary); font-size: 12px; line-height: 1; font-weight: 700;
    flex-shrink: 0; transition: transform 0.18s ease, background 0.15s ease;
}
.diag-chevron.open {
    transform: rotate(180deg); background: var(--accent-teal-soft);
    color: var(--accent-teal); border-color: #99f6e4;
}
.diag-accordion-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
details.diag-acc-group {
    background: var(--surface-subtle); border: 1px solid var(--border);
    border-radius: 9px; overflow: hidden; transition: border-color 0.14s ease;
}
details.diag-acc-group[open] {
    background: #ffffff; border-color: #99f6e4; box-shadow: var(--shadow-xs);
}
details.diag-acc-group > summary {
    list-style: none; display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 10px 13px; cursor: pointer; user-select: none;
    font-size: 12.2px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.03em; color: var(--text-primary);
}
details.diag-acc-group > summary::-webkit-details-marker { display: none; }
details.diag-acc-group > summary:hover { background: #f1f5f9; }
details.diag-acc-group[open] > summary {
    background: #f0fdfa; color: #0f766e; border-bottom: 1px solid #ccfbf1;
}
.diag-acc-arrow { font-size: 11px; color: var(--text-muted); transition: transform 0.16s ease; }
details.diag-acc-group[open] .diag-acc-arrow { transform: rotate(180deg); color: #0f766e; }
.diag-acc-body { padding: 9px 13px 11px; }
.loc-current-banner {
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdfa 100%);
    border: 1px solid #bfdbfe; border-radius: 10px; padding: 12px 14px;
    margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.linked-repair-card {
    background: #f0fdfa; border: 1px solid #99f6e4; border-left: 4px solid var(--accent-teal);
    border-radius: 9px; padding: 11px 13px; margin-top: 10px;
}
.work-summary-bar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: 10px; background: var(--surface-subtle); border: 1px solid var(--border);
    border-radius: 9px; padding: 10px 13px; margin-bottom: 12px;
}
.duration-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.dur-chip {
    border: 1px solid var(--border-strong); background: #ffffff; color: var(--text-secondary);
    border-radius: 6px; padding: 2px 8px; font-size: 11.2px; font-weight: 600; cursor: pointer;
}
.dur-chip:hover { border-color: var(--brand-blue); color: var(--brand-blue); background: var(--brand-blue-soft); }
.handover-info-banner {
    background: #f0fdfa; border: 1px solid #99f6e4; border-left: 4px solid var(--accent-teal);
    border-radius: 9px; padding: 11px 14px; margin-bottom: 14px; font-size: 12.6px; color: #115e59; line-height: 1.45;
}


/* ================= SIGNATURE PAD & MOBILE / TABLET RESPONSIVE ================= */
.sig-pad-wrap {
    position: relative;
    border: 2px dashed var(--border-strong);
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.sig-canvas {
    display: block;
    width: 100%;
    height: 190px;
    cursor: crosshair;
    touch-action: none;
}

.sig-pad-hint {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 11px;
    color: #94a3b8;
    pointer-events: none;
}

.sig-preview-box {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #a7f3d0;
    background: #f0fdf4;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.sig-preview-box.tech-sig {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.sig-preview-box img {
    max-height: 58px;
    max-width: 220px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 6px;
}

.mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    z-index: 1090;
}

@media (min-width: 961px) {
    #btnMobileHeaderMenu {
        display: none !important;
    }
}

@media (max-width: 960px) {
    body {
        height: auto;
        min-height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .app-shell {
        height: auto;
        min-height: 100dvh;
        width: 100%;
    }

    .top-header {
        position: sticky;
        top: 0;
        height: auto;
        min-height: 54px;
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 8px;
        z-index: 1050;
    }

    .header-left {
        width: 100%;
        justify-content: flex-start;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }

    .quick-search {
        flex: 1;
        width: auto;
        min-width: 120px;
    }

    .body-layout {
        display: block;
    }

    .main-viewport {
        height: auto !important;
        overflow: visible !important;
    }

    .page-wrap {
        padding: 14px 12px 32px !important;
        max-width: 100%;
    }

    .icon-rail {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 256px;
        min-width: 256px;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        z-index: 1100;
        box-shadow: var(--shadow-md);
        align-items: stretch;
        padding: 14px 12px;
    }

    .icon-rail.expanded {
        transform: translateX(0);
    }

    .icon-rail .rail-item {
        width: 100%;
        justify-content: flex-start;
        padding: 0 12px;
        gap: 11px;
        height: 44px;
    }

    .icon-rail .rail-label {
        display: inline !important;
        opacity: 1 !important;
        font-size: 13.5px;
    }

    .welcome-banner {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
        padding: 14px 16px !important;
    }

    .welcome-title {
        font-size: 18px !important;
    }

    .card-box {
        padding: 14px 14px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .card-head {
        flex-wrap: wrap;
    }

    .clean-table {
        min-width: 560px;
    }

    .filter-bar .form-control,
    .filter-bar .search-field {
        width: 100%;
        min-width: 100%;
    }

    .ticket-actions-bar {
        width: 100%;
    }

    .ticket-actions-bar .btn,
    .ticket-actions-bar a.btn,
    .ticket-actions-bar select {
        flex: 1 1 auto;
        justify-content: center;
    }

    .modal-backdrop {
        padding: 8px;
        align-items: flex-end;
    }

    .modal-box,
    .modal-box.wide {
        max-width: 100%;
        max-height: 92dvh;
        padding: 18px 16px;
        border-radius: 16px 16px 12px 12px;
    }

    .sig-canvas {
        height: 210px;
    }
}

@media (max-width: 600px) {
    .brand-name-sub,
    .user-chip-name {
        display: none;
    }

    .btn-create-top span:last-child {
        display: none;
    }

    .btn-create-top {
        padding: 0 12px;
        font-size: 18px;
    }

    .form-control,
    input[type="text"],
    input[type="password"],
    input[type="number"],
    input[type="time"],
    input[type="datetime-local"],
    select,
    textarea {
        font-size: 16px !important;
        min-height: 40px;
    }

    .btn {
        min-height: 40px;
        padding: 0 13px;
    }

    .btn-sm {
        min-height: 36px;
    }

    .dur-chip {
        padding: 6px 11px;
        font-size: 12.5px;
    }

    .workflow-stepper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .donut-wrap {
        flex-direction: column;
    }

    .service-mini-grid {
        grid-template-columns: 1fr;
    }
}

/* ================= CUSTOMER AUTOCOMPLETE SEARCH DROPDOWN ================= */
.cust-ac-wrap {
    position: relative;
    width: 100%;
}

.cust-ac-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 260px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
    z-index: 1650;
}

.cust-ac-item {
    padding: 8px 11px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cust-ac-item:last-child {
    border-bottom: none;
}

.cust-ac-item:hover,
.cust-ac-item.active {
    background: #eff6ff;
}

.cust-ac-empty {
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ================= ATTACHMENT THUMBNAILS & PICTURE VIEWER LIGHTBOX ================= */
.att-thumb-btn {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    background: #ffffff;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.att-thumb-btn:hover {
    transform: scale(1.04);
    border-color: var(--brand-blue);
    box-shadow: 0 4px 12px rgba(29, 99, 184, 0.2);
}

.att-thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pic-viewer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(9, 14, 26, 0.92);
    backdrop-filter: blur(4px);
    z-index: 2500;
    display: flex;
    flex-direction: column;
    user-select: none;
}

.pic-viewer-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    background: rgba(15, 23, 42, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

.pic-viewer-btn {
    height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pic-viewer-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.pic-viewer-btn.pic-viewer-close {
    width: 36px;
    padding: 0;
    font-size: 20px;
    background: rgba(220, 38, 38, 0.35);
    border-color: rgba(248, 113, 113, 0.45);
}

.pic-viewer-btn.pic-viewer-close:hover {
    background: rgba(220, 38, 38, 0.65);
}

.pic-viewer-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 18px;
}

.pic-viewer-stage img {
    max-width: 92vw;
    max-height: 76vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
    transition: transform 0.18s ease;
    cursor: zoom-in;
}

.pic-viewer-stage img.zoomed {
    max-width: none;
    max-height: none;
    cursor: zoom-out;
}

.pic-viewer-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 56px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(15, 23, 42, 0.72);
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2510;
}

.pic-viewer-nav:hover {
    background: rgba(29, 99, 184, 0.85);
}

.pic-viewer-nav.prev { left: 14px; }
.pic-viewer-nav.next { right: 14px; }

.pic-viewer-thumbs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(15, 23, 42, 0.85);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    overflow-x: auto;
    flex-shrink: 0;
}

.pic-viewer-thumb {
    width: 52px;
    height: 40px;
    border-radius: 6px;
    border: 2px solid transparent;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    flex-shrink: 0;
    padding: 0;
    background: #0f172a;
}

.pic-viewer-thumb.active {
    border-color: #60a5fa;
    opacity: 1;
}

.pic-viewer-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* ================= DRAG & DROP FILE UPLOAD ZONE ================= */
.file-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    padding: 16px 14px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
    margin-bottom: 12px;
    user-select: none;
}

.file-dropzone:hover {
    border-color: var(--brand-blue);
    background: #f0f7ff;
}

.file-dropzone.drag-over {
    border-color: var(--brand-blue);
    background: #e0f2fe;
    box-shadow: 0 0 0 3px rgba(29, 99, 184, 0.15);
}

.file-dropzone.uploading {
    opacity: 0.72;
    pointer-events: none;
}

.file-dropzone-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-navy);
    margin-bottom: 3px;
}

.file-dropzone-sub {
    font-size: 11.8px;
    color: var(--text-muted);
}


/* ================= IN-APP NOTIFICATION BELL & POPOVER ================= */
.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.notif-popover {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 370px;
    max-width: 92vw;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
    z-index: 60;
    overflow: hidden;
}

.notif-popover-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-navy);
}

.notif-popover-body {
    max-height: 380px;
    overflow-y: auto;
}

.notif-item {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.14s ease;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item:hover {
    background: #f1f5f9;
}

.notif-item.unread {
    background: #eff6ff;
}

.notif-item.unread:hover {
    background: #dbeafe;
}

.draggable-row {
    transition: background-color 0.12s ease;
}
.draggable-row.dragging {
    opacity: 0.45;
    background: #eff6ff;
}
.draggable-row.drag-over-row td {
    border-top: 2px solid var(--brand-blue);
}
.drag-handle-cell {
    width: 34px;
    color: var(--text-muted);
    cursor: grab;
    user-select: none;
    white-space: nowrap;
}
.drag-handle-cell:active {
    cursor: grabbing;
}
.row-move-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 1px 4px;
    font-size: 11px;
    line-height: 1.1;
}
.row-move-btn:hover:not(:disabled) {
    color: var(--brand-navy);
    background: #e2e8f0;
}
.row-move-btn:disabled {
    opacity: 0.25;
    cursor: default;
}

/* Dynamic responsive table rows & wrapping inside dossier cards */
.card-box .clean-table {
    table-layout: auto;
    width: 100%;
    border-collapse: collapse;
}
.card-box .clean-table th,
.card-box .clean-table td {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: top;
}
.card-box .clean-table .pill {
    white-space: normal;
    display: inline-block;
    text-align: left;
    line-height: 1.3;
}


/* ================= ADAPTIVE DESKTOP / TABLET / SMARTPHONE SUITE ================= */
.mobile-bottom-nav {
    display: none;
}

.mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 1090;
}

/* Tablet optimization (iPad / Android Tablets: 641px .. 1024px) */
@media (max-width: 1024px) {
    .top-header {
        padding-top: max(8px, env(safe-area-inset-top));
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }

    .workspace-tabs {
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }

    .ws-tab {
        min-height: 36px;
        padding: 0 11px;
    }

    .btn,
    .icon-action-btn,
    .rail-item,
    .card-link {
        touch-action: manipulation;
    }

    .form-row-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ticket-dossier-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .notif-popover {
        position: fixed;
        right: 12px;
        left: 12px;
        top: 62px;
        width: auto;
        max-width: none;
        z-index: 1400;
    }
}

/* Smartphone optimization (iPhone & Android Phones: <= 640px) */
@media (max-width: 640px) {
    body {
        padding-bottom: calc(64px + env(safe-area-inset-bottom));
    }

    .page-wrap {
        padding: 12px 10px calc(84px + env(safe-area-inset-bottom)) !important;
    }

    .header-left {
        gap: 8px;
    }

    .brand-lockup {
        padding-right: 8px;
        border-right: none;
    }

    .workspace-tabs {
        flex: 1;
        min-width: 0;
    }

    .ws-tab {
        font-size: 12px;
        padding: 0 9px;
        height: 32px;
    }

    .header-right {
        gap: 6px;
    }

    .quick-search input {
        font-size: 16px !important;
        height: 38px;
    }

    .icon-action-btn {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px;
    }

    .user-chip {
        padding: 3px 6px;
        min-height: 38px;
    }

    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr !important;
    }

    .card-box {
        padding: 12px;
        border-radius: 10px;
    }

    .clean-table {
        min-width: 480px;
        font-size: 12.5px;
    }

    .clean-table th,
    .clean-table td {
        padding: 8px 7px;
    }

    .modal-backdrop {
        padding: 0;
        align-items: flex-end;
    }

    .modal-box,
    .modal-box.wide {
        width: 100%;
        max-width: 100%;
        max-height: 94dvh;
        border-radius: 16px 16px 0 0;
        padding: 16px 14px calc(18px + env(safe-area-inset-bottom));
    }

    .modal-actions {
        flex-direction: column-reverse;
        gap: 8px;
    }

    .modal-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .login-card {
        padding: 24px 18px;
    }

    .mobile-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        background: #ffffff;
        border-top: 1px solid var(--border);
        box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.08);
        padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
        z-index: 1080;
    }

    .mob-nav-btn {
        background: none;
        border: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 5px 2px;
        color: var(--text-secondary);
        font-size: 10px;
        font-weight: 600;
        cursor: pointer;
        border-radius: 8px;
        touch-action: manipulation;
    }

    .mob-nav-btn svg {
        width: 19px;
        height: 19px;
    }

    .mob-nav-btn.active {
        color: var(--brand-blue);
        background: var(--brand-blue-soft);
    }
}


/* Dashboard 6-card KPI row & mobile hiding */
.dash-kpi-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 1280px) {
    .dash-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .dash-kpi-grid,
    .kpi-grid {
        display: none !important;
    }
}


/* Explicit SVG icon constraints across buttons, badges & mobile layouts */
.btn svg,
a.btn svg,
.ticket-actions-bar .btn svg,
.ticket-actions-bar a.btn svg {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    min-height: 16px;
    max-width: 16px;
    max-height: 16px;
    flex-shrink: 0;
}

.btn-sm svg {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px;
    min-height: 14px;
    max-width: 14px;
    max-height: 14px;
}

.pill svg,
.card-link svg,
.ws-tab svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.card-box span > svg,
.card-box label > svg,
.card-box button > svg {
    width: 15px;
    height: 15px;
    max-width: 18px;
    max-height: 18px;
    flex-shrink: 0;
}


/* ================= HR MITARBEITER-DOSSIER (CLOCKIN-INSPIRED) ================= */
.hr-dossier-hero {
    display: grid;
    grid-template-columns: 230px minmax(0, 1.35fr) 310px;
    gap: 20px;
    align-items: start;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow-xs);
    margin-bottom: 18px;
}

@media (max-width: 1180px) {
    .hr-dossier-hero {
        grid-template-columns: 1fr;
    }
}

.hr-avatar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.hr-avatar-ring {
    width: 158px;
    height: 158px;
    border-radius: 50%;
    padding: 5px;
    background: #ffffff;
    border: 4px solid #65a30d;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.hr-avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand-navy), var(--brand-blue));
    color: #ffffff;
    font-size: 42px;
    font-weight: 700;
}

.hr-avatar-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hr-pill-btn {
    width: 100%;
    max-width: 210px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: var(--text-primary);
    font-size: 12.2px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    transition: all 0.14s ease;
}

.hr-pill-btn:hover {
    background: #f8fafc;
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}

.hr-fields-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
}

.hr-fields-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 12px;
}

@media (max-width: 900px) {
    .hr-fields-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .hr-fields-grid,
    .hr-fields-grid-4 {
        grid-template-columns: 1fr;
    }
}

.hr-soft-field {
    background: #f3f4f6;
    border: 1px solid transparent;
    border-radius: 18px;
    padding: 7px 14px;
    transition: all 0.14s ease;
}

.hr-soft-field:focus-within {
    background: #ffffff;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(29, 99, 184, 0.1);
}

.hr-soft-field label {
    display: block;
    font-size: 10.8px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.hr-soft-field input,
.hr-soft-field select,
.hr-soft-field textarea {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    outline: none;
    padding: 0;
    font-family: inherit;
}

.hr-access-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

@media (max-width: 640px) {
    .hr-access-cards-row {
        grid-template-columns: 1fr;
    }
}

.hr-access-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

.hr-summary-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hr-progress-track {
    flex: 1;
    height: 11px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.hr-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: #10b981;
    transition: width 0.25s ease;
}

.hr-progress-fill.over {
    background: #f87171;
}

.hr-kv-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.8px;
    color: var(--text-secondary);
    padding: 2px 0;
}

.hr-kv-line strong {
    color: var(--text-primary);
    font-weight: 700;
}

.hr-accordion-stack {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
    margin-bottom: 16px;
}

.hr-acc-item {
    border-bottom: 1px solid var(--border);
}

.hr-acc-item:last-child {
    border-bottom: none;
}

.hr-acc-item > summary {
    list-style: none;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.hr-acc-item > summary::-webkit-details-marker {
    display: none;
}

.hr-acc-item > summary::after {
    content: "▾";
    font-size: 13px;
    color: var(--text-muted);
    transition: transform 0.15s ease;
}

.hr-acc-item[open] > summary::after {
    transform: rotate(180deg);
}

.hr-acc-body {
    padding: 4px 18px 18px;
    border-top: 1px solid #f1f5f9;
}

.hr-sub-heading {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 14px 0 8px;
}


/* Universal collapsible card-box support across Service, Installation & Reparatur */
.card-box.is-collapsible > .card-head.card-collapse-head {
    cursor: pointer;
    user-select: none;
}

.card-box.is-collapsed > .card-head.card-collapse-head {
    margin-bottom: 0 !important;
}

.card-box.is-collapsed > .card-collapse-body {
    display: none !important;
}

.card-collapse-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--surface-subtle);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    flex-shrink: 0;
    transition: transform 0.18s ease, background-color 0.15s ease, color 0.15s ease;
}

.card-box:not(.is-collapsed) > .card-head.card-collapse-head .card-collapse-chevron {
    transform: rotate(180deg);
    background: var(--brand-blue-soft);
    border-color: #bfdbfe;
    color: var(--brand-blue);
}
