* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #eef2f5;
    color: #1f2933;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
    border-radius: 6px;
    padding: 9px 13px;
    background: #1d4ed8;
    color: white;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    filter: brightness(0.96);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

button.secondary {
    background: #4b5563;
}

button.danger {
    background: #b91c1c;
}

button.success-button {
    background: #15803d;
    color: #ffffff;
}

button.icon-button {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    font-size: 20px;
    line-height: 1;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 9px 10px;
    background: white;
    color: #111827;
}

textarea {
    resize: vertical;
    line-height: 1.45;
}

label {
    display: block;
    margin: 10px 0 5px;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
}

.checkbox-label {
    display: flex;
    gap: 8px;
    align-items: center;
    font-weight: 700;
}

.checkbox-label input {
    width: auto;
}

.hidden {
    display: none !important;
}

.auth-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #17202a;
}

.auth-card {
    width: min(460px, 100%);
    border-radius: 6px;
    padding: 24px;
    background: #f8fafc;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.auth-form {
    display: grid;
    gap: 8px;
}

.auth-message {
    margin: 12px 0 0;
    color: #b91c1c;
    font-weight: 700;
}

.muted-text {
    margin: 0;
    color: #64748b;
}

.app-shell {
    display: grid;
    grid-template-columns: 292px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    background: #17202a;
    color: #f8fafc;
    padding: 20px;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    background: #0f766e;
    font-weight: 900;
}

.brand h1,
.user-panel h2 {
    margin: 0;
    font-size: 19px;
}

.brand p {
    margin: 3px 0 0;
    color: #cbd5e1;
    font-size: 13px;
}

.auth-brand {
    color: #17202a;
}

.auth-brand p {
    color: #536170;
}

.panel {
    padding: 14px;
    margin-bottom: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
}

.panel h2 {
    margin: 0 0 10px;
    font-size: 15px;
}

.muted-on-dark {
    margin: 2px 0 10px;
    color: #cbd5e1;
}

.sidebar label {
    color: #dbeafe;
}

.sidebar input,
.sidebar select {
    border-color: #475569;
    background: #263241;
    color: white;
}

.button-row,
.topbar-actions,
.form-actions,
.form-toolbar,
.input-action {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
}

.button-row {
    margin-top: 9px;
}

.wide {
    width: 100%;
}

.invite-box,
.invite-list,
.view-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.invite-item {
    display: grid;
    gap: 3px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.invite-item span {
    color: #e5e7eb;
    font-weight: 800;
}

.invite-item strong,
.empty-on-dark {
    margin: 0;
    color: #cbd5e1;
    font-size: 13px;
}

.view-button {
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    color: #e5e7eb;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.view-button.active {
    background: #0f766e;
    border-color: #0f766e;
}

.view-group-title {
    margin: 10px 0 2px;
    color: #93a4b8;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.main {
    min-width: 0;
    padding: 22px;
}

.topbar,
.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.topbar {
    margin-bottom: 16px;
}

.notification-button span {
    display: inline-flex;
    min-width: 22px;
    height: 22px;
    margin-left: 4px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #e2e8f0;
    color: #1f2933;
    font-size: 12px;
}

.notification-button.has-unread span {
    background: #b91c1c;
    color: #ffffff;
}

.notifications-panel {
    position: fixed;
    z-index: 80;
    top: 72px;
    right: 22px;
    width: min(430px, calc(100vw - 32px));
    max-height: calc(100vh - 96px);
    overflow: auto;
    padding: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.notifications-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.notifications-header h3 {
    margin: 2px 0 0;
}

.notification-section {
    display: grid;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #e5eaf0;
}

.notification-section + .notification-section {
    margin-top: 14px;
}

.notification-section h4 {
    margin: 0;
    color: #475569;
    font-size: 13px;
}

.notification-list {
    display: grid;
    gap: 10px;
}

.notification-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #94a3b8;
    border-radius: 7px;
    background: #f8fafc;
}

.notification-card.severity-high,
.notification-card.severity-critical {
    border-left-color: #b45309;
    background: #fffbeb;
}

.notification-card.severity-overdue {
    border-left-color: #b91c1c;
    background: #fef2f2;
}

.notification-card-header,
.notification-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.notification-card-header span {
    display: inline-flex;
    padding: 3px 7px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 11px;
    font-weight: 800;
}

.notification-card time {
    color: #64748b;
    font-size: 11px;
}

.notification-card strong {
    color: #17202a;
}

.notification-card p {
    margin: 0;
    color: #334155;
    font-size: 13px;
    white-space: pre-wrap;
}

.notification-actions {
    justify-content: flex-start;
}

.notification-actions button {
    padding: 7px 10px;
}

.topbar h2,
.section-header h3 {
    margin: 0;
}

.eyebrow {
    margin: 0 0 4px;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.metric {
    min-height: 78px;
    display: grid;
    align-content: space-between;
    gap: 8px;
    padding: 12px;
    border: 1px solid #d7dee8;
    border-radius: 6px;
    background: white;
    color: #1f2933;
    text-align: left;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.metric span {
    color: #536170;
    font-size: 13px;
    font-weight: 800;
}

.metric strong {
    font-size: 28px;
    line-height: 1;
}

.metric.warning {
    border-left: 5px solid #d97706;
}

.metric.danger {
    border-left: 5px solid #b77979;
    background: #fff7f7;
}

.metric.danger strong {
    color: #7f1d1d;
}

.metric.total {
    border-left: 5px solid #0f766e;
}

.package-delivery-panel {
    position: relative;
    margin-bottom: 14px;
    border: 1px solid #d7dee8;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.package-delivery-panel summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
}

.package-delivery-panel summary::-webkit-details-marker {
    display: none;
}

.package-delivery-panel summary::before {
    content: ">";
    width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    position: absolute;
    top: 16px;
    left: 14px;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    transform: rotate(0deg);
    transition: transform 0.15s ease;
}

.package-delivery-panel[open] summary::before {
    transform: rotate(90deg);
}

.package-delivery-panel summary > span:first-child {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding-left: 24px;
}

.package-delivery-panel strong {
    color: #1f2933;
    font-size: 15px;
}

.package-delivery-panel small {
    overflow: hidden;
    color: #64748b;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.package-gantt {
    position: relative;
    display: grid;
    gap: 10px;
    padding: 6px 14px 14px;
}

.package-summary-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 10px;
}

.package-summary-card {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 8px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #d7dee8;
    border-left: 5px solid #94a3b8;
    border-radius: 6px;
    background: #f8fafc;
}

.package-summary-card span {
    grid-column: 1 / -1;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
}

.package-summary-card strong {
    color: #1f2933;
    font-size: 26px;
    line-height: 1;
}

.package-summary-card small {
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    text-align: right;
}

.package-status-overdue {
    --package-color: #dc2626;
}

.package-status-soon {
    --package-color: #d97706;
}

.package-status-future {
    --package-color: #2563eb;
}

.package-status-ok {
    --package-color: #0f766e;
}

.package-summary-card.package-status-overdue,
.package-summary-card.package-status-soon,
.package-summary-card.package-status-future,
.package-summary-card.package-status-ok {
    border-left-color: var(--package-color);
}

.package-legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid #e5eaf0;
    border-radius: 6px;
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
}

.package-legend-items {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.package-legend-item {
    white-space: nowrap;
}

.package-legend-item i {
    display: inline-block;
    margin-right: 5px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: var(--package-color, #2563eb);
    box-shadow: 0 2px 7px rgba(15, 23, 42, 0.18);
    vertical-align: middle;
}

.package-legend-item i {
    width: 10px;
    height: 10px;
}

.package-timeline {
    --package-label-width: 205px;
    position: relative;
    display: grid;
    gap: 0;
    border: 1px solid #e5eaf0;
    border-radius: 6px;
    background: #ffffff;
    overflow: hidden;
}

.package-gantt-axis {
    position: relative;
    z-index: 4;
    display: grid;
    grid-template-columns: var(--package-label-width) minmax(180px, 1fr);
    gap: 16px;
    min-height: 42px;
    padding: 10px 12px 0;
    border-bottom: 1px solid #e5eaf0;
    background: #ffffff;
    color: #64748b;
    font-size: 11px;
}

.package-axis-track {
    position: relative;
    min-height: 30px;
}

.package-axis-spacer::after {
    content: "Сортировка по дате сдачи";
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
}

.package-month-tick {
    position: absolute;
    top: 0;
    color: #64748b;
    font-weight: 900;
    transform: translateX(-50%);
    white-space: nowrap;
}

.package-month-tick::after {
    content: "";
    position: absolute;
    top: 18px;
    left: 50%;
    height: 12px;
    width: 2px;
    background: #d7dee8;
}

.package-today-badge {
    position: absolute;
    top: 19px;
    z-index: 3;
    padding: 2px 7px;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    transform: translateX(-50%);
    white-space: nowrap;
}

.package-gantt-scroll {
    position: relative;
    display: grid;
    gap: 2px;
    max-height: 250px;
    padding: 8px 12px 10px;
    overflow-y: auto;
    scrollbar-gutter: stable;
}

.package-gantt-grid {
    position: absolute;
    top: 0;
    right: 12px;
    bottom: 0;
    left: calc(var(--package-label-width) + 28px);
    pointer-events: none;
}

.package-gantt-grid i {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #e5eaf0;
}

.package-gantt-grid .package-gantt-today-line {
    width: 2px;
    background: #dc2626;
    opacity: 0.9;
}

.package-gantt-divider {
    position: relative;
    z-index: 2;
    margin: 5px 0 3px;
    padding: 5px 0 4px var(--package-label-width);
    border-top: 1px dashed #cbd5e1;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.package-gantt-row {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: var(--package-label-width) minmax(180px, 1fr);
    gap: 16px;
    align-items: center;
    min-height: 28px;
    padding: 2px 0;
    border-radius: 6px;
    cursor: pointer;
}

.package-gantt-row:hover {
    background: #f8fafc;
}

.package-gantt-label {
    min-width: 0;
}

.package-gantt-label strong,
.package-gantt-label span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.package-gantt-label strong {
    font-size: 12px;
}

.package-gantt-label span {
    color: #64748b;
    font-size: 11px;
}

.package-gantt-track {
    position: relative;
    min-height: 24px;
    border-radius: 999px;
    background: #eef2f5;
}

.package-gantt-track i {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: var(--package-color, #2563eb);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.22);
    transform: translate(-50%, -50%);
}

.package-gantt-track em {
    position: absolute;
    top: 50%;
    max-width: min(220px, 36vw);
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #334155;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: translate(12px, -50%);
    white-space: nowrap;
}

.package-gantt-track em.is-left {
    transform: translate(calc(-100% - 12px), -50%);
}

.filters-panel,
.task-table-panel,
.group-panel {
    border: 1px solid #d7dee8;
    border-radius: 6px;
    background: white;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.filters-panel {
    display: grid;
    grid-template-columns: repeat(8, minmax(130px, 1fr));
    gap: 0 10px;
    padding: 12px;
    margin-bottom: 14px;
}

.filter-search {
    grid-column: 1 / -1;
}

.filter-search-row,
.deadline-range,
.bulk-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.filter-search-row input {
    min-width: 260px;
}

.filter-search-row button {
    flex: 0 0 auto;
}

.deadline-range {
    margin-top: 8px;
}

.task-table-panel {
    padding: 16px;
    margin-bottom: 14px;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.segmented-control {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #f8fafc;
}

.segmented-control button {
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #475569;
    padding: 8px 12px;
}

.segmented-control button.active {
    background: #1f4fd8;
    color: #ffffff;
}

.table-scroll {
    width: 100%;
    overflow: auto;
    margin-top: 14px;
}

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

.task-table th,
.task-table td {
    max-width: 230px;
    padding: 10px;
    border-bottom: 1px solid #e5eaf0;
    text-align: left;
    vertical-align: top;
}

.task-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 900;
}

.sort-header {
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: #475569;
    text-align: left;
    font: inherit;
    font-weight: 900;
}

.select-col {
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    text-align: center;
}

.select-col input {
    width: auto;
}

.task-table-row {
    cursor: pointer;
}

.task-table-row:hover {
    background: #f8fafc;
}

.task-table-row.overdue td:first-child {
    border-left: 5px solid #dc2626;
}

.task-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
}

.archive-only {
    display: none;
}

.task-table-panel.archive-mode .archive-only {
    display: table-cell;
}

.task-table .optional-col {
    display: none;
}

.task-table-panel.archive-mode .optional-col {
    display: table-cell;
}

.task-table .cell-title {
    min-width: 360px;
    font-weight: 900;
    white-space: normal;
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.kanban-column {
    min-width: 0;
    padding: 10px;
    border: 1px solid #d7dee8;
    border-radius: 6px;
    background: #f8fafc;
}

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

.kanban-card-list {
    display: grid;
    gap: 8px;
}

.kanban-card {
    width: 100%;
    border: 1px solid #d7dee8;
    border-radius: 6px;
    background: #ffffff;
    color: #1f2933;
    padding: 10px;
    text-align: left;
}

.kanban-card:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.kanban-card strong,
.kanban-project {
    display: block;
}

.kanban-card strong {
    line-height: 1.35;
}

.kanban-project {
    margin-top: 5px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.kanban-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.deadline-pill {
    display: inline-block;
    border-radius: 999px;
    padding: 5px 9px;
    font-weight: 900;
}

.deadline-none {
    background: #e5e7eb;
    color: #4b5563;
}

.deadline-ok {
    background: #dcfce7;
    color: #166534;
}

.deadline-soon {
    background: #fef3c7;
    color: #92400e;
}

.deadline-today {
    background: #ffedd5;
    color: #9a3412;
}

.deadline-overdue {
    background: #fee2e2;
    color: #991b1b;
}

.deadline-critical-overdue {
    background: #7f1d1d;
    color: #fff7ed;
}

.deadline-done {
    background: #eef2ff;
    color: #3730a3;
}

.hide-role-column .admin-table th:nth-child(4),
.hide-role-column .admin-table td:nth-child(4) {
    display: none;
}

.cell-title strong,
.cell-title span {
    display: block;
}

.cell-title strong {
    line-height: 1.35;
}

.cell-title span {
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.cell-title span:empty {
    display: none;
}

.number {
    text-align: right;
}

.status-pill {
    display: inline-block;
    max-width: 150px;
    border-radius: 999px;
    padding: 4px 8px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-pill.status-new {
    background: #e0f2fe;
    color: #075985;
}

.status-pill.status-work {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-pill.status-paused {
    background: #fef3c7;
    color: #92400e;
}

.status-pill.status-rework {
    background: #ffe4e6;
    color: #9f1239;
}

.status-pill.status-done {
    background: #dcfce7;
    color: #166534;
}

.empty-row td {
    padding: 22px;
    color: #64748b;
    text-align: center;
}

.counter {
    min-width: 34px;
    border-radius: 999px;
    padding: 5px 9px;
    background: #e0f2fe;
    color: #075985;
    text-align: center;
    font-weight: 900;
}

.bulk-actions {
    margin-top: 12px;
    padding: 10px;
    border: 1px solid #d7dee8;
    border-radius: 6px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bulk-actions strong {
    margin-right: 4px;
}

.bulk-actions select,
.bulk-actions input {
    width: 170px;
}

.bulk-actions button {
    white-space: nowrap;
}

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

.report-chart-card {
    padding: 14px;
    border: 1px solid #d7dee8;
    border-radius: 6px;
    background: #ffffff;
}

.report-chart-card.wide {
    grid-column: 1 / -1;
}

.report-chart-card h4 {
    margin: 0 0 12px;
}

.report-bars {
    display: grid;
    gap: 10px;
}

.report-bar-row {
    display: grid;
    grid-template-columns: minmax(140px, 0.8fr) minmax(160px, 1.2fr) 42px;
    align-items: center;
    gap: 10px;
}

.report-bar-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-bar-row div {
    height: 10px;
    border-radius: 999px;
    background: #e5eaf0;
    overflow: hidden;
}

.report-bar-row i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #14877a;
}

.report-bar-row strong {
    text-align: right;
}

.report-assignee-grid {
    display: grid;
    gap: 8px;
}

.assignee-report-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(120px, auto));
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e5eaf0;
}

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(120px, 1fr));
    gap: 10px;
}

.report-metric-card {
    min-height: 82px;
    display: grid;
    align-content: space-between;
    gap: 8px;
    border: 1px solid #d7dee8;
    background: #f8fafc;
    color: #1f2933;
    text-align: left;
}

.report-metric-card span {
    color: #536170;
    font-size: 12px;
    font-weight: 900;
}

.report-metric-card strong {
    font-size: 28px;
    line-height: 1;
}

.report-metric-card.good {
    border-left: 5px solid #16a34a;
    background: #f0fdf4;
}

.report-metric-card.info {
    border-left: 5px solid #2563eb;
    background: #eff6ff;
}

.report-metric-card.warn {
    border-left: 5px solid #d97706;
    background: #fffbeb;
}

.report-metric-card.bad {
    border-left: 5px solid #dc2626;
    background: #fef2f2;
}

.report-metric-card.critical {
    border-left: 5px solid #7f1d1d;
    background: #fff1f2;
}

.report-problem-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.report-problem-grid ul {
    display: grid;
    gap: 7px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.report-problem-grid button {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    background: #f8fafc;
    color: #1f2933;
    text-align: left;
}

.report-problem-grid b {
    color: #991b1b;
}

.report-table-wrap {
    overflow: auto;
}

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

.report-table th,
.report-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #e5eaf0;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.report-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    font-weight: 900;
}

.report-table .clickable-row {
    cursor: pointer;
}

.report-table .clickable-row:hover {
    background: #f8fafc;
}

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

.server-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.server-health-card {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 18px;
    padding: 18px;
    border: 1px solid #bbf7d0;
    border-left: 7px solid #16a34a;
    border-radius: 6px;
    background: #f0fdf4;
}

.server-health-card.warning {
    border-color: #fde68a;
    border-left-color: #d97706;
    background: #fffbeb;
}

.server-health-card.critical,
.server-health-card.stopped {
    border-color: #fecaca;
    border-left-color: #dc2626;
    background: #fef2f2;
}

.server-health-card span,
.server-status-group span {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.server-health-card strong {
    display: block;
    margin-top: 4px;
    font-size: 28px;
}

.server-health-card p {
    margin: 8px 0 0;
    color: #334155;
    font-weight: 700;
}

.server-health-card dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.server-health-card dl div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.server-health-card dt {
    color: #64748b;
}

.server-health-card dd {
    margin: 0;
    font-weight: 900;
}

.server-status-group {
    padding: 14px;
    border: 1px solid #d7dee8;
    border-radius: 6px;
    background: #ffffff;
}

.server-status-group h4 {
    margin: 0 0 12px;
}

.server-status-group div {
    display: grid;
    gap: 8px;
}

.server-status-group p {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5eaf0;
}

.server-status-group p:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.server-status-group strong {
    min-width: 0;
    overflow-wrap: anywhere;
    text-align: right;
}

.disk-status-card .disk-bar {
    height: 18px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.disk-status-card .disk-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #16a34a, #d97706, #dc2626);
}

.server-summary div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.server-summary span {
    color: #64748b;
    font-size: 12px;
}

.server-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #0f766e;
}

.link-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #1d4ed8;
    box-shadow: none;
    white-space: nowrap;
}

.link-button:hover {
    background: transparent;
    color: #1e40af;
}

.group-panel {
    padding: 14px;
}

.group-panel h3 {
    margin: 0 0 10px;
    font-size: 15px;
}

.group-list {
    display: grid;
    gap: 7px;
}

.group-row {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(180px, auto);
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid #e5eaf0;
    border-radius: 0;
    background: transparent;
    color: #1f2933;
    text-align: left;
    font-weight: 400;
}

.group-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.group-row strong {
    color: #334155;
    font-size: 12px;
    line-height: 1.35;
    white-space: normal;
    text-align: right;
}

.analytics-chart-panel {
    padding: 14px;
    border: 1px solid #d7dee8;
    border-radius: 6px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.stacked-chart-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.analytics-table {
    display: grid;
    gap: 6px;
}

.analytics-row {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(180px, 1.6fr) repeat(2, minmax(82px, 0.45fr)) minmax(160px, 0.9fr);
    gap: 10px;
    align-items: center;
    padding: 9px 10px;
    border: 1px solid #e5eaf0;
    border-left: 5px solid #0f766e;
    border-radius: 6px;
    background: #ffffff;
    color: #1f2933;
    text-align: left;
}

.analytics-row:not(.analytics-head):hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.analytics-head {
    border-left-color: transparent;
    background: #f8fafc;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.analytics-row span,
.analytics-row small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analytics-row b {
    color: #1f2933;
}

.analytics-detail {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: -3px 0 2px 15px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.stacked-chart-row {
    width: 100%;
    border: 1px solid #e5eaf0;
    border-radius: 6px;
    background: #f8fafc;
    color: #1f2933;
    padding: 10px;
    text-align: left;
}

.stacked-chart-row:hover {
    border-color: #94a3b8;
    background: #ffffff;
}

.chart-row-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.chart-row-head span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 900;
}

.chart-row-head strong {
    color: #475569;
    white-space: nowrap;
}

.stacked-bar {
    display: flex;
    height: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.stacked-bar i {
    display: block;
    min-width: 0;
}

.bar-new {
    background: #93c5fd;
}

.bar-active {
    background: #2563eb;
}

.bar-rework {
    background: #fb7185;
}

.bar-paused {
    background: #f59e0b;
}

.bar-done {
    background: #22c55e;
}

.stacked-chart-row small {
    display: block;
    margin-top: 7px;
    color: #64748b;
    font-weight: 700;
}

.empty {
    margin: 0;
    color: #64748b;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: start center;
    padding: 28px;
    overflow: auto;
    background: rgba(15, 23, 42, 0.6);
}

.modal-card {
    width: min(1040px, 100%);
    border-radius: 6px;
    padding: 18px;
    background: white;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.management-panel {
    border: 1px solid #d7dee8;
    border-radius: 6px;
    padding: 16px;
    background: white;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.directory-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.directory-table-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 12px;
    margin-top: 12px;
}

.directory-table-card {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 10px;
    border: 1px solid #d7dee8;
    border-radius: 6px;
    background: #ffffff;
    overflow: visible;
}

.directory-table-card .section-header {
    align-items: center;
}

.directory-table-card .table-scroll {
    max-height: none;
    overflow: visible;
}

.dictionary-table {
    min-width: 0;
    table-layout: fixed;
}

.dictionary-table input {
    width: 100%;
    min-height: 32px;
    padding: 6px 8px;
}

.dictionary-table th,
.dictionary-table td {
    padding: 6px;
}

.dictionary-table th:last-child,
.dictionary-table td:last-child {
    width: 92px;
    text-align: right;
}

.dictionary-table .tiny-button {
    min-width: 72px;
    min-height: 32px;
    padding: 6px 8px;
    white-space: nowrap;
}

.wide-field {
    grid-column: 1 / -1;
}

.directory-users-header {
    margin-top: 16px;
}

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

.admin-table th,
.admin-table td {
    padding: 10px;
    border-bottom: 1px solid #e5eaf0;
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    color: #334155;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 900;
}

.admin-table select {
    min-width: 180px;
}

.directory-table-card .admin-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: 12px;
}

.directory-table-card .admin-table th,
.directory-table-card .admin-table td {
    padding: 5px 6px;
}

.directory-table-card .admin-table th:last-child,
.directory-table-card .admin-table td:last-child {
    width: 72px;
}

.directory-table-card .dictionary-table input {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    min-height: 30px;
    font-size: 12px;
}

.directory-table-card .dictionary-table .tiny-button {
    min-width: 60px;
    min-height: 30px;
    padding: 5px 7px;
    font-size: 11px;
}

.invite-workspace {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 14px;
    margin-top: 14px;
}

.invite-create-card {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 12px;
    border: 1px solid #d7dee8;
    border-radius: 6px;
    background: #f8fafc;
}

.report-text {
    margin-top: 14px;
    font-family: Consolas, "Courier New", monospace;
}

.guide-panel {
    max-width: 1120px;
}

.guide-meta {
    margin-top: 8px;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.guide-editor {
    min-height: 560px;
    margin-top: 14px;
    font-family: Consolas, "Courier New", monospace;
    line-height: 1.5;
}

.guide-viewer {
    max-width: 920px;
    margin-top: 18px;
    color: #1f2933;
    line-height: 1.65;
}

.guide-viewer h1,
.guide-viewer h2,
.guide-viewer h3 {
    margin: 22px 0 8px;
    color: #111827;
    letter-spacing: 0;
}

.guide-viewer h1 {
    margin-top: 0;
    font-size: 26px;
}

.guide-viewer h2 {
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    font-size: 20px;
}

.guide-viewer h3 {
    font-size: 16px;
}

.guide-viewer p {
    margin: 8px 0;
}

.guide-viewer ul {
    margin: 8px 0 12px 20px;
    padding: 0;
}

.guide-viewer li {
    margin: 4px 0;
}

.server-status-panel {
    display: grid;
    gap: 14px;
}

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

.status-card {
    min-height: 82px;
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 12px;
    border: 1px solid #d7dee8;
    border-radius: 6px;
    background: #f8fafc;
}

.status-card span,
.backup-item span,
.history-item span {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.status-card strong {
    overflow-wrap: anywhere;
    font-size: 14px;
}

.status-warning {
    padding: 12px;
    border: 1px solid #f1c2c2;
    border-radius: 6px;
    background: #fff7f7;
    color: #7f1d1d;
    font-weight: 800;
}

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

.backup-actions > div,
.backup-item,
.history-item {
    padding: 12px;
    border: 1px solid #d7dee8;
    border-radius: 6px;
    background: white;
}

.backup-list-header {
    margin-top: 4px;
}

.backup-list,
.task-history-list {
    display: grid;
    gap: 8px;
}

.backup-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.backup-item div,
.history-item div {
    display: grid;
    gap: 4px;
}

.button-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
}

.task-history-section {
    margin-top: 14px;
}

.task-history-section .section-header {
    align-items: center;
}

.history-item p {
    margin: 8px 0 0;
    color: #334155;
    overflow-wrap: anywhere;
}

.passport-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 14px;
    margin-top: 14px;
    align-items: start;
}

.passport-sidebar {
    position: sticky;
    top: 12px;
    display: grid;
    gap: 10px;
    min-height: 0;
}

.passport-search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.passport-list {
    display: grid;
    align-content: start;
    gap: 8px;
    max-height: calc(100vh - 260px);
    min-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

.passport-list-item {
    width: 100%;
    background: #f1f5f9;
    color: #1f2933;
    text-align: left;
}

.passport-list-item.active {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e3a8a;
}

.passport-list-item span,
.passport-list-item small {
    display: block;
}

.passport-list-item small {
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
}

.passport-list-item.archived {
    background: #fff7ed;
    border-color: #fed7aa;
}

.passport-form select[multiple] {
    min-height: 118px;
}

.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    border: 1px solid #c8d4e3;
    border-radius: 6px;
    background: #ffffff;
}

.check-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid #d7dee8;
    border-radius: 6px;
    background: #f8fafc;
    font-weight: 800;
    color: #253244;
}

.check-pill input {
    width: 16px;
    height: 16px;
}

.datetime-control,
.date-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 52px 70px 70px;
    gap: 8px;
}

.datetime-control {
    grid-template-columns: minmax(0, 1fr) 120px;
}

.date-control input[type="date"] {
    min-width: 52px;
    padding: 9px 4px;
}

.quick-deadline-row,
.copy-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-deadline-row {
    margin-top: 8px;
    flex-wrap: wrap;
}

.quick-deadline-row button {
    padding: 8px 10px;
}

.person-picker {
    position: relative;
    display: grid;
    gap: 6px;
    min-height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px;
    background: #ffffff;
}

.person-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 24px;
}

.person-empty {
    color: #94a3b8;
    font-weight: 700;
}

.person-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    border-radius: 999px;
    padding: 3px 7px 3px 3px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 900;
}

.person-chip i,
.person-suggestions i {
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: #ffffff;
    color: #1f2933;
    font-style: normal;
    font-weight: 900;
}

.person-chip button {
    min-width: 0;
    padding: 0 3px;
    border: 0;
    background: transparent;
    color: #475569;
    box-shadow: none;
}

.person-picker input {
    border: 0;
    min-height: 26px;
    padding: 2px;
}

.person-picker input:focus {
    outline: none;
}

.person-suggestions {
    position: absolute;
    z-index: 5;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    display: grid;
    gap: 4px;
    max-height: 220px;
    overflow: auto;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px;
    background: #ffffff;
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.18);
}

.person-suggestions button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border-radius: 5px;
    background: #f8fafc;
    color: #1f2933;
    text-align: left;
}

.person-suggestion-empty {
    margin: 0;
    padding: 8px;
    color: #64748b;
}

.status-locked-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 8px 12px;
    background: #e0f2fe;
    color: #075985;
    font-weight: 900;
}

.copy-cell span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tiny-button {
    padding: 6px 9px;
    font-size: 12px;
}

.panel-toggle {
    width: 100%;
    padding: 0;
    background: transparent;
    color: #f8fafc;
    text-align: left;
}

.task-form {
    display: grid;
    gap: 8px;
}

.task-form label:has(+ input[required])::after,
.task-form label:has(+ select[required])::after,
.task-form label:has(+ textarea[required])::after,
.task-form label:has(+ .input-action input[required])::after,
.task-form label:has(+ .datetime-control)::after {
    content: " *";
    color: #dc2626;
}

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

.nested-input {
    margin-top: 8px;
}

.input-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
}

.form-actions {
    justify-content: flex-end;
    margin-top: 8px;
}

.task-worklog {
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid #e5eaf0;
}

.worklog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.section-header.compact {
    align-items: center;
    margin-bottom: 8px;
}

.section-header.compact h4 {
    margin: 0;
}

.comment-list,
.attachment-list {
    display: grid;
    gap: 8px;
    max-height: 260px;
    overflow: auto;
    padding-right: 4px;
}

.comment-item,
.attachment-item {
    display: grid;
    gap: 5px;
    border: 1px solid #e5eaf0;
    border-radius: 6px;
    padding: 10px;
    background: #f8fafc;
}

.comment-item {
    width: 86%;
    border-radius: 8px;
    background: #eef6ff;
}

.comment-item.own-comment {
    justify-self: end;
    background: #ecfdf5;
}

.comment-item div,
.attachment-item div {
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.comment-item span,
.attachment-item span {
    color: #64748b;
    font-size: 12px;
}

.comment-item p,
.attachment-item p {
    margin: 0;
    white-space: pre-wrap;
}

.attachment-item a {
    overflow: hidden;
    color: #1d4ed8;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comment-form,
.attachment-form {
    margin-top: 10px;
}

.small-modal {
    width: min(560px, 100%);
}

@media (max-width: 1400px) {
    .dashboard {
        grid-template-columns: repeat(3, minmax(130px, 1fr));
    }

    .report-summary-grid {
        grid-template-columns: repeat(4, minmax(120px, 1fr));
    }

    .filters-panel {
        grid-template-columns: repeat(4, minmax(130px, 1fr));
    }

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

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

@media (max-width: 980px) {
    .app-shell,
    .groups-grid,
    .directory-table-grid,
    .passport-layout,
    .report-charts,
    .report-problem-grid {
        grid-template-columns: 1fr;
    }

    .passport-sidebar {
        position: static;
    }

    .passport-list {
        max-height: 320px;
    }

    .analytics-row {
        grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(70px, 0.6fr));
    }

    .server-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .package-summary-cards {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .package-legend {
        align-items: flex-start;
        flex-direction: column;
    }

    .package-timeline {
        --package-label-width: 170px;
    }

    .server-health-card {
        grid-template-columns: 1fr;
    }

    .sidebar,
    .main {
        padding: 16px;
    }
}

@media (max-width: 680px) {
    .dashboard,
    .filters-panel,
    .report-summary-grid,
    .form-grid,
    .worklog-grid,
    .directory-grid,
    .invite-workspace,
    .status-grid,
    .backup-actions,
    .passport-layout {
        grid-template-columns: 1fr;
    }

    .topbar,
    .section-header,
    .input-action {
        display: grid;
    }

    .package-summary-cards {
        grid-template-columns: 1fr;
    }

    .package-timeline {
        --package-label-width: 0px;
    }

    .package-gantt-axis {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .package-axis-spacer {
        display: none;
    }

    .package-gantt-row {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 4px 0 8px;
    }

    .package-gantt-grid {
        left: 12px;
    }

    .package-gantt-divider {
        padding-left: 0;
    }

    .analytics-row {
        grid-template-columns: 1fr;
    }

    .analytics-head {
        display: none;
    }

    .package-gantt-label strong,
    .package-gantt-label span {
        white-space: normal;
    }

    .modal {
        padding: 12px;
    }
}

/* ============================================================
   INPLUG visual system
   Shared visual language with inplug.pro: monochrome surfaces,
   generous radii, compact controls and high-contrast actions.
   ============================================================ */

:root {
    color-scheme: dark;
    --inplug-black: #000000;
    --inplug-graphite: #181818;
    --inplug-graphite-2: #232323;
    --inplug-graphite-3: #303030;
    --inplug-card: #141414;
    --inplug-white: #ffffff;
    --inplug-muted: #a6a6a6;
    --inplug-line: #333333;
    --inplug-soft-line: #242424;
    --inplug-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

html {
    background: var(--inplug-black);
}

body {
    background: var(--inplug-black);
    color: var(--inplug-white);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

button {
    min-height: 42px;
    border: 1px solid var(--inplug-white);
    border-radius: 14px;
    padding: 0 16px;
    background: var(--inplug-white);
    color: var(--inplug-black);
    font-weight: 900;
    transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

button:hover {
    filter: none;
    transform: translateY(-1px);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--inplug-white);
    outline-offset: 2px;
}

button.secondary,
button.icon-button,
.view-button,
.tiny-button,
.link-button,
.button-link {
    border-color: var(--inplug-line);
    background: var(--inplug-black);
    color: var(--inplug-white);
}

button.danger {
    border-color: #7f1d1d;
    background: #210b0b;
    color: #fecaca;
}

button.success-button {
    border-color: var(--inplug-white);
    background: var(--inplug-white);
    color: var(--inplug-black);
}

input,
select,
textarea {
    min-height: 44px;
    border: 1px solid var(--inplug-line);
    border-radius: 14px;
    padding: 10px 12px;
    background: var(--inplug-black);
    color: var(--inplug-white);
}

input::placeholder,
textarea::placeholder {
    color: #777777;
}

select option {
    background: var(--inplug-graphite);
    color: var(--inplug-white);
}

label {
    color: var(--inplug-muted);
    font-size: 0.82rem;
    letter-spacing: 0.01em;
}

.muted-text,
.muted-on-dark,
.empty-on-dark,
.brand p,
.auth-brand p,
.cell-title span,
.kanban-project,
.kanban-meta,
.package-delivery-panel small,
.status-card span,
.backup-item span,
.history-item span {
    color: var(--inplug-muted);
}

.auth-screen {
    position: relative;
    overflow: hidden;
    padding: 24px;
    background:
        radial-gradient(circle at 85% 12%, rgba(255, 255, 255, 0.08), transparent 28rem),
        var(--inplug-black);
}

.auth-screen::before {
    content: "INPLUG";
    position: absolute;
    left: clamp(-16px, 3vw, 48px);
    bottom: -0.2em;
    color: rgba(255, 255, 255, 0.035);
    font-size: clamp(7rem, 22vw, 22rem);
    font-weight: 950;
    line-height: 0.72;
    letter-spacing: -0.08em;
    pointer-events: none;
}

.auth-card {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    border: 1px solid var(--inplug-soft-line);
    border-radius: 28px;
    padding: clamp(24px, 5vw, 38px);
    background: var(--inplug-graphite);
    color: var(--inplug-white);
    box-shadow: var(--inplug-shadow);
}

.auth-card .brand {
    margin-bottom: 30px;
}

.auth-brand {
    color: var(--inplug-white);
}

.auth-form {
    gap: 10px;
}

.auth-form h2 {
    margin: 0 0 4px;
    font-size: clamp(1.9rem, 6vw, 3rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

.auth-form button[type="submit"] {
    width: 100%;
    min-height: 50px;
    margin-top: 12px;
}

.auth-message {
    color: #fca5a5;
}

.app-shell {
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
    min-height: 100vh;
    padding: 18px;
    background: var(--inplug-black);
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: calc(100vh - 36px);
    padding: 20px;
    border: 1px solid var(--inplug-soft-line);
    border-radius: 28px;
    background: var(--inplug-graphite);
    color: var(--inplug-white);
}

.brand {
    margin-bottom: 0;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--inplug-white);
    color: var(--inplug-black);
    letter-spacing: -0.04em;
}

.brand h1,
.user-panel h2 {
    color: var(--inplug-white);
}

.brand h1 {
    letter-spacing: -0.035em;
}

.panel {
    margin-bottom: 0;
    padding: 16px;
    border: 1px solid var(--inplug-soft-line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.035);
}

.sidebar label {
    color: var(--inplug-muted);
}

.sidebar input,
.sidebar select {
    border-color: var(--inplug-line);
    background: var(--inplug-black);
    color: var(--inplug-white);
}

.view-list {
    gap: 8px;
}

.view-button {
    min-height: 48px;
    border-radius: 16px;
    padding: 0 14px;
}

.view-button.active {
    border-color: var(--inplug-white);
    background: var(--inplug-white);
    color: var(--inplug-black);
}

.view-group-title,
.eyebrow {
    color: var(--inplug-muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.1em;
}

.main {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
    padding: 0;
}

.topbar {
    align-items: center;
    min-height: 128px;
    margin-bottom: 0;
    padding: 24px 28px;
    border: 1px solid var(--inplug-soft-line);
    border-radius: 28px;
    background: var(--inplug-graphite);
}

.topbar h2 {
    margin-top: 8px;
    font-size: clamp(2.2rem, 5vw, 4.8rem);
    line-height: 0.9;
    letter-spacing: -0.055em;
}

.topbar-actions {
    justify-content: flex-end;
}

.notification-button span,
.counter {
    border: 1px solid var(--inplug-line);
    background: var(--inplug-graphite-2);
    color: var(--inplug-white);
}

.notifications-panel {
    top: 24px;
    right: 24px;
    border: 1px solid var(--inplug-line);
    border-radius: 24px;
    background: var(--inplug-graphite);
    color: var(--inplug-white);
    box-shadow: var(--inplug-shadow);
}

.notifications-header,
.notification-section,
.notification-card {
    border-color: var(--inplug-soft-line);
}

.notification-card {
    border-radius: 18px;
    background: var(--inplug-card);
}

.dashboard {
    gap: 12px;
}

.metric {
    min-height: 142px;
    border: 1px solid var(--inplug-soft-line);
    border-radius: 24px;
    padding: 20px;
    background: var(--inplug-graphite);
    color: var(--inplug-white);
}

.metric:hover {
    border-color: var(--inplug-line);
}

.metric span {
    color: var(--inplug-muted);
}

.metric strong {
    color: var(--inplug-white);
    font-size: clamp(2.6rem, 5vw, 4.5rem);
    letter-spacing: -0.06em;
}

.metric.warning,
.metric.danger,
.metric.total {
    background: var(--inplug-graphite);
}

.metric.warning {
    border-color: #5b4615;
}

.metric.danger {
    border-color: #5f2424;
}

.metric.total {
    border-color: #454545;
}

.package-delivery-panel,
.filters-panel,
.task-table-panel,
.group-panel,
.report-chart-card,
.report-metric-card,
.report-problem-grid,
.server-health-card,
.server-status-group,
.analytics-chart-panel,
.directory-table-card,
.invite-create-card,
.guide-panel,
.server-status-panel,
.passport-sidebar,
.modal-card {
    border: 1px solid var(--inplug-soft-line);
    border-radius: 24px;
    background: var(--inplug-graphite);
    color: var(--inplug-white);
}

.package-delivery-panel summary {
    min-height: 76px;
    padding: 18px 22px;
}

.package-delivery-panel summary::before {
    border-color: var(--inplug-line);
    background: var(--inplug-black);
    color: var(--inplug-white);
}

.package-summary-card,
.package-timeline,
.package-gantt-row,
.group-row,
.analytics-row,
.stacked-chart-row,
.status-card,
.backup-item,
.history-item,
.passport-list-item {
    border-color: var(--inplug-soft-line);
    border-radius: 18px;
    background: var(--inplug-card);
    color: var(--inplug-white);
}

.filters-panel {
    gap: 12px;
    padding: 16px;
}

.task-table-panel {
    padding: 20px;
}

.section-header h3 {
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}

.segmented-control {
    border: 1px solid var(--inplug-line);
    border-radius: 16px;
    padding: 4px;
    background: var(--inplug-black);
}

.segmented-control button {
    min-height: 34px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--inplug-muted);
}

.segmented-control button.active {
    background: var(--inplug-white);
    color: var(--inplug-black);
}

.table-scroll {
    border: 1px solid var(--inplug-soft-line);
    border-radius: 18px;
    background: var(--inplug-black);
}

.task-table,
.report-table,
.admin-table,
.dictionary-table {
    color: var(--inplug-white);
}

.task-table th,
.task-table td,
.report-table th,
.report-table td,
.admin-table th,
.admin-table td,
.dictionary-table th,
.dictionary-table td {
    border-color: var(--inplug-soft-line);
}

.task-table th,
.report-table th,
.admin-table th,
.dictionary-table th {
    background: var(--inplug-card);
    color: var(--inplug-muted);
}

.task-table-row:hover,
.report-table .clickable-row:hover {
    background: var(--inplug-graphite-2);
}

.cell-title strong,
.kanban-card strong,
.kanban-project {
    color: var(--inplug-white);
}

.status-pill,
.deadline-pill {
    border-radius: 999px;
}

.kanban-board {
    gap: 12px;
}

.kanban-column {
    border: 1px solid var(--inplug-soft-line);
    border-radius: 22px;
    background: var(--inplug-graphite);
}

.kanban-card {
    border: 1px solid var(--inplug-soft-line);
    border-radius: 18px;
    background: var(--inplug-card);
    color: var(--inplug-white);
}

.bulk-actions,
.server-summary {
    border: 1px solid var(--inplug-line);
    border-radius: 18px;
    background: var(--inplug-black);
    color: var(--inplug-white);
}

.report-bar-row,
.assignee-report-row,
.directory-grid,
.directory-table-grid,
.invite-workspace,
.status-grid,
.passport-layout {
    gap: 12px;
}

.report-bars,
.report-assignee-grid,
.group-list,
.stacked-chart-list,
.backup-list,
.task-history-list,
.passport-list {
    gap: 8px;
}

.modal {
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(8px);
}

.modal-card {
    box-shadow: var(--inplug-shadow);
}

.management-panel,
.task-form,
.passport-form {
    color: var(--inplug-white);
}

.comment-item,
.attachment-item,
.person-picker,
.person-suggestions,
.guide-editor,
.guide-viewer {
    border-color: var(--inplug-soft-line);
    border-radius: 16px;
    background: var(--inplug-card);
    color: var(--inplug-white);
}

.comment-item.own-comment {
    border-color: var(--inplug-line);
    background: var(--inplug-graphite-2);
}

.person-chip,
.check-pill,
.status-locked-badge {
    border-color: var(--inplug-line);
    background: var(--inplug-black);
    color: var(--inplug-white);
}

.invite-item {
    border-color: var(--inplug-soft-line);
    border-radius: 16px;
    background: var(--inplug-card);
}

.invite-item span,
.invite-item strong {
    color: var(--inplug-white);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--inplug-black);
}

::-webkit-scrollbar-thumb {
    border: 2px solid var(--inplug-black);
    border-radius: 999px;
    background: var(--inplug-graphite-3);
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .sidebar {
        min-height: auto;
    }

    .main {
        gap: 12px;
    }

    .topbar {
        align-items: flex-start;
    }
}

/* ============================================================
   Task workspace UX: density, pinned columns, quick actions,
   adaptive Kanban and loading skeletons
   ============================================================ */

:root {
    --task-cell-x: 12px;
    --task-cell-y: 12px;
    --task-title-width: 330px;
    --task-select-width: 42px;
    --task-actions-width: 118px;
    --skeleton-base: color-mix(in srgb, var(--inplug-graphite-3) 62%, var(--inplug-graphite));
    --skeleton-shine: color-mix(in srgb, var(--inplug-white) 13%, transparent);
}

:root[data-table-density="compact"] {
    --task-cell-x: 9px;
    --task-cell-y: 7px;
    --task-title-width: 290px;
    --task-actions-width: 106px;
}

.task-table th,
.task-table td {
    padding: var(--task-cell-y) var(--task-cell-x);
}

:root[data-table-density="compact"] .task-table {
    font-size: 0.76rem;
}

:root[data-table-density="compact"] .task-table .status-pill,
:root[data-table-density="compact"] .task-table .deadline-pill {
    padding: 4px 7px;
    font-size: 0.68rem;
}

.density-control {
    border-right: 1px solid var(--inplug-soft-line);
    padding-right: 8px;
    margin-right: 2px;
}

.task-table .select-col {
    position: sticky;
    left: 0;
    z-index: 4;
    width: var(--task-select-width);
    min-width: var(--task-select-width);
    max-width: var(--task-select-width);
    background: var(--inplug-graphite);
}

.task-table .title-col,
.task-table .cell-title {
    position: sticky;
    left: var(--task-select-width);
    z-index: 3;
    width: var(--task-title-width);
    min-width: var(--task-title-width);
    max-width: var(--task-title-width);
    background: var(--inplug-graphite);
    box-shadow: 12px 0 18px -18px rgba(0, 0, 0, 0.9);
}

.task-table .quick-actions-col {
    position: sticky;
    right: 0;
    z-index: 4;
    width: var(--task-actions-width);
    min-width: var(--task-actions-width);
    max-width: var(--task-actions-width);
    background: var(--inplug-graphite);
    box-shadow: -12px 0 18px -18px rgba(0, 0, 0, 0.9);
    text-align: right;
}

.task-table thead .select-col,
.task-table thead .title-col,
.task-table thead .quick-actions-col {
    z-index: 8;
    background: var(--inplug-graphite-2);
}

.task-table-row:hover .select-col,
.task-table-row:hover .cell-title,
.task-table-row:hover .quick-actions-col {
    background: color-mix(in srgb, var(--theme-accent) 7%, var(--inplug-graphite));
}

.task-quick-actions {
    display: inline-flex;
    justify-content: flex-end;
    gap: 5px;
}

.quick-action {
    display: inline-grid;
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--inplug-line);
    border-radius: 9px;
    background: var(--theme-control);
    color: var(--inplug-white);
    font-size: 0.9rem;
    line-height: 1;
}

.quick-action:hover,
.quick-action:focus-visible {
    border-color: var(--theme-accent);
    background: color-mix(in srgb, var(--theme-accent) 12%, var(--theme-control));
}

.quick-action.quick-complete,
.quick-action.is-success {
    color: var(--theme-success-text);
}

.kanban-board {
    align-items: start;
}

.kanban-column {
    border-color: var(--inplug-soft-line);
    background: var(--inplug-card);
}

.kanban-column-header {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 4px 2px 10px;
    background: var(--inplug-card);
}

.kanban-card {
    min-height: 104px;
    border-color: var(--inplug-line);
    background: var(--theme-control);
    color: var(--inplug-white);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--inplug-black) 45%, transparent);
}

.kanban-card:hover {
    border-color: var(--theme-accent);
    background: color-mix(in srgb, var(--theme-accent) 7%, var(--theme-control));
    transform: translateY(-2px);
}

.skeleton {
    display: block;
    overflow: hidden;
    border-radius: 7px;
    background:
        linear-gradient(100deg, transparent 25%, var(--skeleton-shine) 45%, transparent 65%) 0 0 / 220% 100%,
        var(--skeleton-base);
    animation: skeleton-sweep 1.25s ease-in-out infinite;
}

.skeleton-check {
    width: 16px;
    height: 16px;
}

.skeleton-title {
    width: min(220px, 82%);
    height: 16px;
}

.skeleton-text {
    width: 92px;
    height: 13px;
}

.skeleton-text.short {
    width: 58px;
}

.skeleton-line {
    width: min(650px, 88%);
    height: 13px;
}

.skeleton-action {
    width: 96px;
    height: 32px;
    margin-left: auto;
}

.skeleton-kanban-column {
    display: grid;
    gap: 14px;
    min-height: 320px;
}

.skeleton-card {
    width: 100%;
    height: 108px;
}

@keyframes skeleton-sweep {
    to {
        background-position: -220% 0, 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton {
        animation: none;
    }
}

@media (max-width: 920px) {
    .task-table-panel > .section-header {
        align-items: flex-start;
        gap: 12px;
    }

    .task-table-panel > .section-header .toolbar-actions {
        width: 100%;
        justify-content: space-between;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .kanban-board {
        display: flex;
        grid-template-columns: none;
        gap: 12px;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scroll-snap-type: x mandatory;
        scrollbar-width: thin;
        padding: 2px 2px 12px;
    }

    .kanban-board.hidden {
        display: none;
    }

    .kanban-column {
        flex: 0 0 min(86vw, 360px);
        min-width: 270px;
        scroll-snap-align: start;
        scroll-margin-left: 2px;
    }
}

@media (max-width: 680px) {
    :root {
        --task-title-width: 210px;
        --task-actions-width: 82px;
    }

    :root[data-table-density="compact"] {
        --task-title-width: 190px;
        --task-actions-width: 76px;
    }

    .task-table-panel {
        padding-inline: 10px;
    }

    .density-control {
        order: 2;
    }

    .density-control button,
    .task-table-panel .segmented-control button {
        min-height: 40px;
    }

    .task-quick-actions {
        gap: 4px;
    }

    .quick-action {
        width: 36px;
        min-width: 36px;
        height: 36px;
        min-height: 36px;
    }

    .quick-copy {
        display: none;
    }

    .kanban-column {
        flex-basis: min(88vw, 330px);
    }

    .kanban-card {
        min-height: 112px;
        padding: 14px;
    }
}

@media (max-width: 680px) {
    .auth-screen {
        padding: 12px;
    }

    .auth-card {
        border-radius: 22px;
        padding: 22px;
    }

    .app-shell {
        padding: 8px;
    }

    .sidebar,
    .topbar,
    .filters-panel,
    .task-table-panel {
        border-radius: 20px;
    }

    .topbar {
        min-height: auto;
        padding: 20px;
    }

    .topbar-actions,
    .topbar-actions button {
        width: 100%;
    }

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

    .metric {
        min-height: 112px;
    }

    .metric:last-child {
        grid-column: 1 / -1;
    }
}

/* ============================================================
   Accessible light and dark themes
   ============================================================ */

:root {
    --inplug-black: #090c0b;
    --inplug-graphite: #151918;
    --inplug-graphite-2: #202624;
    --inplug-graphite-3: #35403c;
    --inplug-card: #111514;
    --inplug-white: #f7faf8;
    --inplug-muted: #b5c0bb;
    --inplug-line: #3a4641;
    --inplug-soft-line: #29322f;
    --inplug-shadow: 0 24px 80px rgba(0, 0, 0, 0.52);
    --theme-accent: #bdf553;
    --theme-accent-hover: #d3ff7a;
    --theme-control: #0d100f;
    --theme-overlay: rgba(0, 0, 0, 0.76);
    --theme-danger-bg: #2a1111;
    --theme-danger-text: #ffb8b8;
    --theme-warning-bg: #2b220d;
    --theme-warning-text: #ffe28a;
    --theme-success-bg: #10251a;
    --theme-success-text: #a7efbd;
    --theme-info-bg: #111f32;
    --theme-info-text: #b8d7ff;
}

:root[data-theme="light"] {
    color-scheme: light;
    --inplug-black: #f4f7f5;
    --inplug-graphite: #ffffff;
    --inplug-graphite-2: #edf2ef;
    --inplug-graphite-3: #d8e2dd;
    --inplug-card: #fafcfb;
    --inplug-white: #111815;
    --inplug-muted: #5b6b63;
    --inplug-line: #c5d1ca;
    --inplug-soft-line: #dde6e1;
    --inplug-shadow: 0 20px 60px rgba(18, 35, 27, 0.13);
    --theme-accent: #8ecb24;
    --theme-accent-hover: #78b414;
    --theme-control: #ffffff;
    --theme-overlay: rgba(20, 31, 25, 0.42);
    --theme-danger-bg: #fff0f0;
    --theme-danger-text: #8f1d1d;
    --theme-warning-bg: #fff8df;
    --theme-warning-text: #72520a;
    --theme-success-bg: #eaf8ef;
    --theme-success-text: #166534;
    --theme-info-bg: #edf5ff;
    --theme-info-text: #1e4f91;
}

.theme-toggle {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 1200;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--inplug-line);
    border-radius: 999px;
    background: var(--inplug-graphite);
    color: var(--inplug-white);
    box-shadow: var(--inplug-shadow);
    font-size: 0.8rem;
    font-weight: 850;
}

.theme-toggle:hover {
    border-color: var(--theme-accent);
    transform: translateY(-2px);
}

.theme-toggle-icon {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    background: var(--theme-accent);
    color: #111815;
    font-size: 1rem;
}

html,
body,
.app-shell {
    background: var(--inplug-black);
    color: var(--inplug-white);
}

.auth-screen {
    background:
        radial-gradient(circle at 85% 12%, color-mix(in srgb, var(--theme-accent) 10%, transparent), transparent 28rem),
        var(--inplug-black);
}

.auth-screen::before {
    color: color-mix(in srgb, var(--inplug-white) 4%, transparent);
}

.auth-card,
.sidebar,
.topbar,
.notifications-panel,
.metric,
.package-delivery-panel,
.filters-panel,
.task-table-panel,
.group-panel,
.report-chart-card,
.report-metric-card,
.report-problem-grid,
.server-health-card,
.server-status-group,
.analytics-chart-panel,
.directory-table-card,
.invite-create-card,
.guide-panel,
.server-status-panel,
.passport-sidebar,
.modal-card {
    border-color: var(--inplug-soft-line);
    background: var(--inplug-graphite);
    color: var(--inplug-white);
}

.panel,
.notification-card,
.package-summary-card,
.package-timeline,
.package-gantt-row,
.group-row,
.analytics-row,
.stacked-chart-row,
.status-card,
.backup-item,
.history-item,
.passport-list-item,
.comment-item,
.attachment-item,
.person-picker,
.person-suggestions,
.guide-editor,
.guide-viewer,
.invite-item,
.kanban-card {
    border-color: var(--inplug-soft-line);
    background: var(--inplug-card);
    color: var(--inplug-white);
}

.topbar h2,
.section-header h3,
.section-header h4,
.auth-form h2,
.panel h2,
.brand h1,
.user-panel h2,
.cell-title strong,
.kanban-card strong,
.task-table td,
.report-table td,
.admin-table td,
.dictionary-table td,
.guide-viewer h1,
.guide-viewer h2,
.guide-viewer h3,
.guide-viewer p,
.guide-viewer li {
    color: var(--inplug-white);
}

.muted-text,
.muted-on-dark,
.empty-on-dark,
.empty-state,
.brand p,
.auth-brand p,
.cell-title span,
.kanban-project,
.kanban-meta,
.package-delivery-panel small,
.status-card span,
.backup-item span,
.history-item span,
.passport-list-item span,
.passport-list-item small,
.comment-item span,
.attachment-item span,
.report-bar-row span,
.report-metric-card span,
.guide-meta,
label {
    color: var(--inplug-muted);
}

input,
select,
textarea,
.sidebar input,
.sidebar select {
    border-color: var(--inplug-line);
    background: var(--theme-control);
    color: var(--inplug-white);
    caret-color: var(--inplug-white);
}

input::placeholder,
textarea::placeholder {
    color: var(--inplug-muted);
    opacity: 0.78;
}

select option {
    background: var(--inplug-graphite);
    color: var(--inplug-white);
}

.table-scroll,
.segmented-control,
.bulk-actions,
.server-summary {
    border-color: var(--inplug-soft-line);
    background: var(--theme-control);
    color: var(--inplug-white);
}

.task-table,
.report-table,
.admin-table,
.dictionary-table {
    background: transparent;
    color: var(--inplug-white);
}

.task-table th,
.report-table th,
.admin-table th,
.dictionary-table th {
    border-color: var(--inplug-soft-line);
    background: var(--inplug-card);
    color: var(--inplug-muted);
}

.task-table td,
.report-table td,
.admin-table td,
.dictionary-table td {
    border-color: var(--inplug-soft-line);
}

.task-table-row:hover,
.report-table .clickable-row:hover,
.passport-list-item:hover {
    background: var(--inplug-graphite-2);
}

button {
    border-color: var(--theme-accent);
    background: var(--theme-accent);
    color: #111815;
}

button:hover {
    background: var(--theme-accent-hover);
}

button.secondary,
button.icon-button,
.view-button,
.tiny-button,
.link-button,
.button-link {
    border-color: var(--inplug-line);
    background: var(--theme-control);
    color: var(--inplug-white);
}

.view-button.active,
.segmented-control button.active {
    border-color: var(--theme-accent);
    background: var(--theme-accent);
    color: #111815;
}

button.danger,
.status-pill.status-rework,
.deadline-pill.overdue {
    border-color: color-mix(in srgb, var(--theme-danger-text) 40%, transparent);
    background: var(--theme-danger-bg);
    color: var(--theme-danger-text);
}

.status-pill.status-done,
.deadline-pill.ok {
    border-color: color-mix(in srgb, var(--theme-success-text) 40%, transparent);
    background: var(--theme-success-bg);
    color: var(--theme-success-text);
}

.status-pill.status-work,
.deadline-pill.soon {
    border-color: color-mix(in srgb, var(--theme-info-text) 40%, transparent);
    background: var(--theme-info-bg);
    color: var(--theme-info-text);
}

.status-pill.status-paused,
.deadline-pill.warning {
    border-color: color-mix(in srgb, var(--theme-warning-text) 40%, transparent);
    background: var(--theme-warning-bg);
    color: var(--theme-warning-text);
}

.modal {
    background: var(--theme-overlay);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline-color: var(--theme-accent);
}

::-webkit-scrollbar-track {
    background: var(--inplug-black);
}

::-webkit-scrollbar-thumb {
    border-color: var(--inplug-black);
    background: var(--inplug-graphite-3);
}

@media (max-width: 680px) {
    .theme-toggle {
        right: 10px;
        bottom: 10px;
        min-width: 44px;
        padding: 0 10px;
    }

    .theme-toggle-label {
        display: none;
    }
}

.company-badge {
    display: inline-flex;
    max-width: 100%;
    margin-bottom: 8px;
    padding: 5px 9px;
    overflow: hidden;
    border: 1px solid var(--inplug-line);
    border-radius: 999px;
    background: var(--theme-control);
    color: var(--theme-accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pending-members {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.pending-members h3 {
    margin: 0;
    color: var(--inplug-white);
    font-size: 13px;
}

.pending-member-card {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--inplug-line);
    border-radius: 12px;
    background: var(--theme-control);
}

.pending-member-card > div:first-child {
    display: grid;
    min-width: 0;
}

.pending-member-card small {
    overflow: hidden;
    color: var(--inplug-muted);
    text-overflow: ellipsis;
}

.company-import {
    display: grid;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--inplug-soft-line);
}

.company-import input[type="file"] {
    width: 100%;
    min-width: 0;
    font-size: 11px;
}

.company-import small {
    color: var(--inplug-muted);
    line-height: 1.4;
}

@media (max-width: 680px) {
    .topbar {
        align-items: flex-start;
    }

    .topbar-actions,
    .filter-search-row,
    .section-header .toolbar-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .topbar-actions button,
    .filter-search-row button,
    .section-header .toolbar-actions button {
        width: 100%;
    }

    .filters-panel {
        grid-template-columns: 1fr !important;
    }

    .task-table-panel,
    .table-scroll {
        overflow: visible;
    }

    .task-table,
    .task-table tbody {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .task-table thead {
        display: none;
    }

    .task-table tbody {
        display: grid;
        gap: 12px;
    }

    .task-table .task-table-row {
        position: relative;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0;
        padding: 14px;
        overflow: hidden;
        border: 1px solid var(--inplug-soft-line);
        border-radius: 16px;
        background: var(--inplug-card);
        box-shadow: 0 10px 28px rgb(0 0 0 / 12%);
    }

    .task-table .task-table-row td {
        display: grid;
        min-width: 0;
        padding: 9px 8px;
        border: 0;
        border-bottom: 1px solid var(--inplug-soft-line);
        white-space: normal;
    }

    .task-table .task-table-row td::before {
        content: attr(data-label);
        margin-bottom: 4px;
        color: var(--inplug-muted);
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .task-table .task-table-row .cell-title,
    .task-table .task-table-row .cell-project,
    .task-table .task-table-row .cell-assignee,
    .task-table .task-table-row .cell-quick-actions {
        grid-column: 1 / -1;
    }

    .task-table .task-table-row .cell-title {
        padding-right: 42px;
        font-size: 16px;
    }

    .task-table .task-table-row .select-col {
        position: absolute;
        top: 14px;
        right: 14px;
        z-index: 1;
        display: block;
        width: auto;
        padding: 0;
        border: 0;
    }

    .task-table .task-table-row .select-col::before {
        display: none;
    }

    .task-table .task-table-row .optional-col {
        display: none;
    }

    .task-table-panel.archive-mode .task-table-row .archive-only {
        display: grid;
    }

    .task-quick-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        opacity: 1;
    }

    .task-quick-actions button {
        width: 100%;
        min-height: 42px;
    }

    .task-table .empty-row,
    .task-table .empty-row td {
        display: block;
        width: 100%;
    }

    .modal-card {
        width: calc(100vw - 16px);
        max-height: calc(100dvh - 16px);
        margin: 8px;
        overflow: auto;
        border-radius: 18px;
    }
}

/* ============================================================
   Theme contrast and containment audit
   Keep every workspace readable in both themes and prevent long
   project/task values from expanding panels past the application.
   ============================================================ */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.app-shell,
.main,
.main > *,
.management-panel,
.task-table-panel,
.filters-panel,
.package-delivery-panel,
.group-panel,
.report-chart-card,
.report-metric-card,
.report-problem-grid,
.analytics-chart-panel,
.directory-table-card,
.invite-workspace,
.invite-create-card,
.guide-panel,
.server-status-panel,
.passport-layout,
.passport-sidebar,
.modal-card,
.section-header,
.section-header > *,
.toolbar-actions {
    min-width: 0;
    max-width: 100%;
}

.package-delivery-panel {
    overflow: hidden;
}

.package-delivery-panel summary strong,
.package-summary-card strong,
.package-gantt-label strong,
.package-gantt strong,
.management-panel h2,
.management-panel h3,
.management-panel h4,
.invite-workspace h2,
.invite-workspace h3,
.invite-workspace h4 {
    color: var(--inplug-white);
}

.view-button.active,
.segmented-control button.active {
    color: #111815;
}

.panel-toggle {
    color: var(--inplug-white);
}

.management-panel {
    border-color: var(--inplug-soft-line);
    background: var(--inplug-graphite);
    color: var(--inplug-white);
}

.metric.danger strong {
    color: var(--theme-danger-text);
}

.sort-header {
    color: var(--inplug-muted);
}

.report-metric-card.good,
.report-metric-card.info,
.report-metric-card.warn,
.report-metric-card.bad,
.report-metric-card.critical,
.server-health-card,
.server-health-card.warning,
.server-health-card.critical,
.server-health-card.stopped,
.report-problem-grid button,
.backup-actions > div {
    border-color: var(--inplug-soft-line);
    background: var(--inplug-card);
    color: var(--inplug-white);
}

.server-health-card p,
.server-health-card dd,
.server-summary span {
    color: var(--inplug-white);
}

.server-health-card span,
.server-health-card dt,
.server-status-group span {
    color: var(--inplug-muted);
}

.passport-list-item.active,
.passport-list-item.archived.active {
    border-color: var(--theme-accent);
    background: var(--inplug-graphite-2);
    color: var(--inplug-white);
}

.passport-list-item.active span,
.passport-list-item.active small {
    color: var(--inplug-muted);
}

.user-name-input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    text-overflow: ellipsis;
}

:root[data-theme="light"] .company-badge {
    color: #4f730c;
}

.package-gantt,
.table-scroll,
.report-table-wrap,
.admin-table-wrap,
.directory-table-card,
.analytics-chart-panel {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

.kanban-board {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    overflow: hidden;
}

.kanban-column,
.kanban-card,
.kanban-card-list,
.kanban-card strong,
.kanban-project,
.kanban-meta,
.kanban-meta > * {
    min-width: 0;
    max-width: 100%;
}

.kanban-column,
.kanban-card {
    overflow: hidden;
}

.kanban-card strong,
.kanban-project,
.kanban-meta,
.deadline-pill,
.cell-title,
.package-gantt-label,
.invite-item,
.pending-member-card,
.backup-item,
.history-item,
.passport-list-item,
.comment-item,
.attachment-item {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.kanban-meta {
    flex-wrap: wrap;
    align-items: flex-start;
}

.deadline-pill {
    white-space: normal;
}

@media (max-width: 920px) {
    .kanban-board {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
    }
}
.revit-context-panel {
    margin: 18px 0;
    padding: 16px 18px;
    border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border));
    border-radius: 14px;
    background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.revit-context-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.revit-context-heading h4 {
    margin: 2px 0 0;
}

.revit-context-kicker {
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
}

.revit-context-panel pre {
    max-height: 280px;
    margin: 0;
    padding: 12px;
    overflow: auto;
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface) 84%, transparent);
    color: var(--text);
    font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.revit-element-hint {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
}
