.table-shell {
    background: var(--surface-muted-color);
    border: 1px solid var(--form-border);
    border-radius: 1rem;
    padding: 1.25rem;
}

.table-card-clean {
    background: var(--surface-color);
    border: 1px solid var(--form-border);
    border-radius: 1rem;
    overflow: hidden;
}

.table {
    --bs-table-bg: var(--surface-color);
    --bs-table-accent-bg: var(--surface-color);
    background-color: var(--surface-color);
}

.table thead th {
    font-size: 0.86rem;
}

.table-nowrap th,
.table-nowrap td {
    white-space: nowrap;
}

.table-clean {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    color: var(--table-text);
    font-size: 0.92rem;
    background: var(--surface-color);
}

.table-clean thead th {
    background: var(--table-head);
    color: var(--table-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: none;
    border-bottom: 1px solid var(--table-line);
    padding: 0.5rem 0.5rem 1.25rem;
    white-space: nowrap;
}

.table-clean tbody td {
    padding: 0.5rem 0.5rem 1.25rem;
    border-bottom: 1px solid var(--table-line);
    vertical-align: middle;
    background: var(--surface-color);
}

.table-clean tbody tr:last-child td {
    border-bottom: 0;
}

.table-clean tbody tr:hover td {
    background: var(--table-hover);
}

.cell-title-primary {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.2;
}

.cell-title-secondary {
    font-size: 1rem;
    color: var(--sub-title-color);
    line-height: 1.2;
}

.table-clean .cell-title {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.table-clean .cell-title-primary {
    font-weight: 600;
    color: var(--header-color);
    line-height: 1.2;
}

.table-clean .cell-title-secondary {
    font-size: 1rem;
    color: var(--sub-title-color);
    line-height: 1.2;
}

.table-clean .table-status {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    border: 1px solid transparent;
}

.table-status {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.table-status.is-active {
    color: var(--active-color);
    border-color: var(--active-border);
    background: var(--active-background);
}

.table-status.is-pending {
    background: var(--pending-background);
    color: var(--pending-color);
    border-color: var(--pending-border);
}

.table-status.is-inactive {
    color: var(--inactive-color);
    border-color: var(--inactive-border);
    background: var(--inactive-background);
}

#users-table {
    min-width: 68rem;
}

#users-table th,
#users-table td {
    white-space: nowrap;
}

#users-table tbody td,
#users-table .cell-title-primary,
#users-table .cell-title-secondary,
#users-table .users-table-cell-stack,
#users-table .users-table-cell-text,
#users-table .table-status {
    font-size: 0.86rem;
    font-weight: 400;
    line-height: 1.25;
}

#users-table .users-table-cell-stack {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    color: inherit;
}

#users-table .users-table-cell-stack .users-table-cell-text {
    color: inherit;
}

#users-table th:nth-child(1),
#users-table td:nth-child(1) {
    min-width: 16rem;
}

#users-table th:nth-child(2),
#users-table td:nth-child(2) {
    min-width: 10rem;
}

#users-table th:nth-child(3),
#users-table td:nth-child(3) {
    min-width: 7rem;
}

#users-table th:nth-child(4),
#users-table td:nth-child(4) {
    min-width: 12rem;
}

#users-table th:nth-child(5),
#users-table td:nth-child(5) {
    min-width: 7rem;
}

#users-table th:nth-child(6),
#users-table td:nth-child(6) {
    min-width: 11rem;
}

#activity-log-table {
    min-width: 72rem;
}

#activity-log-table th,
#activity-log-table td {
    white-space: nowrap;
}

#activity-log-table th:nth-child(1),
#activity-log-table td:nth-child(1) {
    min-width: 10rem;
}

#activity-log-table th:nth-child(2),
#activity-log-table td:nth-child(2) {
    min-width: 22rem;
}

#activity-log-table th:nth-child(3),
#activity-log-table td:nth-child(3) {
    min-width: 12rem;
}

#activity-log-table th:nth-child(4),
#activity-log-table td:nth-child(4) {
    min-width: 10rem;
}

#activity-log-table th:nth-child(5),
#activity-log-table td:nth-child(5) {
    min-width: 12rem;
}

.table-clean .table-action-group {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.table-clean .table-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--header-color);
    font-size: 0.82rem;
    text-decoration: none;
    transition: all 0.18s ease;
}

.table-clean .table-action-btn:hover {
    background: var(--table-hover);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.table-clean .table-action-btn.icon-only {
    width: 2rem;
    padding: 0;
}

.table-clean .table-empty {
    padding: 3.5rem 1.5rem;
    text-align: center;
    color: var(--body-text-color);
    font-size: 0.95rem;
}

.task-table-icon {
    align-items: center;
    background: var(--widget-icon-bg);
    border: 1px solid var(--table-line);
    border-radius: var(--form-border-radius);
    color: var(--primary-color);
    display: inline-flex;
    flex: 0 0 2.25rem;
    height: 2.25rem;
    justify-content: center;
    width: 2.25rem;
}

.task-status-control {
    display: grid;
    gap: 0.35rem;
    min-width: 9.5rem;
}

.task-status-select {
    min-height: 2.35rem;
    color: var(--header-color);
}

.task-status-select:disabled {
    background-color: var(--surface-muted-color);
    opacity: 0.75;
}

.task-status-select.is-loading {
    cursor: wait;
}

#task-manager-table {
    min-width: 66rem;
}

#task-manager-table th,
#task-manager-table td {
    white-space: nowrap;
}

#task-manager-table th:nth-child(1),
#task-manager-table td:nth-child(1) {
    min-width: 13rem;
}

#task-manager-table th:nth-child(2),
#task-manager-table td:nth-child(2) {
    min-width: 12rem;
}

#task-manager-table th:nth-child(3),
#task-manager-table td:nth-child(3),
#task-manager-table th:nth-child(4),
#task-manager-table td:nth-child(4) {
    min-width: 9rem;
}

#task-manager-table th:nth-child(5),
#task-manager-table td:nth-child(5) {
    min-width: 11rem;
}

#task-manager-table th:nth-child(6),
#task-manager-table td:nth-child(6) {
    min-width: 13rem;
}

.table-clean .progress-table-min-width {
    min-width: 13rem;
}

.table-clean .progress {
    background: var(--surface-muted-color);
}

.table-clean .progress-bar {
    background-color: var(--primary-color);
}

#task-manager-table .progress-table-min-width {
    min-width: 13rem;
}

#task-manager-table .progress {
    height: 1rem;
    background: var(--surface-muted-color);
}

#task-manager-table .progress-bar {
    background-color: var(--primary-color);
}

.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.table-toolbar-left,
.table-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.table-search {
    min-width: 240px;
    height: 2.5rem;
    padding: 0 0.95rem;
    border: 1px solid var(--border-color);
    border-radius: var(--form-border-radius);
    background: var(--form-field-bg);
    color: var(--header-color);
    font-size: 0.88rem;
}

.table-search:focus {
    outline: none;
    border-color: var(--secondary-color);
    background: var(--surface-color);
}

.table-filter-btn,
.table-primary-btn {
    height: 2.5rem;
    padding: 0 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--body-text-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.table-primary-btn {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--surface-color);
}

.table-primary-btn:hover {
    background: var(--primary-link-hover);
    border-color: var(--primary-link-hover);
    color: var(--surface-color);
}

@media (max-width: 768px) {
    .table-clean thead th,
    .table-clean tbody td {
        padding: 0.85rem 0.9rem;
    }

    .table-shell {
        padding: 0.75rem;
        border-radius: 16px;
    }

    .table-card-clean {
        border-radius: 14px;
    }
}
