.table-layout-header-tools {
    padding: 3px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #f8fafc;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.table-layout-selector {
    width: 116px;
    height: 26px;
    border: 0;
    border-radius: 999px;
    padding: 0 1.6rem 0 0.75rem;
    background:
        linear-gradient(45deg, transparent 50%, #64748b 50%) calc(100% - 13px) 50% / 5px 5px no-repeat,
        linear-gradient(135deg, #64748b 50%, transparent 50%) calc(100% - 9px) 50% / 5px 5px no-repeat,
        transparent;
    color: #475569;
    font-size: inherit;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.table-layout-selector:hover,
.table-layout-selector:focus {
    background-color: #ffffff;
    color: #0f172a;
}

.table-layout-selector option {
    color: #334155;
    background: #ffffff;
    font-weight: 600;
}

.table-layout-designer-btn {
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #475569;
    display: inline-grid;
    place-items: center;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.table-layout-designer-btn:hover {
    background: #0f172a;
    color: #ffffff;
}

.table-layout-designer-btn:focus,
.table-layout-selector:focus {
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.12);
}

.fullscreen-header .header-right {
    gap: 0.55rem !important;
}

.exceptions-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: flex-end;
    margin-top: 0.8rem;
}

.table-layout-designer-page {
    min-height: calc(100vh - 140px);
    padding: 1.25rem;
    background: #f8fafc;
}

.table-layout-designer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem 1.15rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.designer-eyebrow {
    color: #6d28d9;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.table-layout-designer-header h2 {
    margin: 0.15rem 0 0.2rem;
    color: #0f172a;
    font-size: 1.35rem;
    font-weight: 800;
}

.table-layout-designer-header p {
    margin: 0;
    color: #64748b;
}

.table-layout-designer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: flex-end;
}

.table-layout-status {
    min-height: 1.25rem;
    margin: 0.25rem 0 0.75rem;
    color: #475569;
    font-weight: 700;
}

.table-layout-status.success {
    color: #15803d;
}

.table-layout-status.error {
    color: #b91c1c;
}

.table-layout-designer-grid {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr) 300px;
    gap: 1rem;
    align-items: start;
}

.layout-designer-panel {
    min-height: 420px;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.layout-preview-panel {
    min-width: 0;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.85rem;
    color: #0f172a;
    font-weight: 800;
}

.panel-title i {
    color: #7c3aed;
}

.layout-column-search,
.layout-field input[type="text"] {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.62rem 0.72rem;
    color: #0f172a;
}

.layout-column-library,
.layout-selected-columns,
.layout-saved-list {
    display: grid;
    gap: 0.55rem;
}

.layout-column-library {
    max-height: 58vh;
    margin-top: 0.75rem;
    overflow: auto;
}

.layout-column-chip,
.layout-selected-chip {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.65rem 0.72rem;
    background: #ffffff;
    color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    font-weight: 700;
}

.layout-column-chip {
    cursor: grab;
}

.layout-column-chip.is-used {
    background: #f8fafc;
    color: #94a3b8;
}

.layout-chip-actions {
    display: inline-flex;
    gap: 0.3rem;
}

.layout-chip-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #ffffff;
    color: #334155;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
}

.layout-chip-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.layout-selected-chip.is-protected {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.layout-selected-chip.is-drop-target {
    outline: 2px solid #7c3aed;
}

.layout-preview-table-wrap {
    margin-top: 1rem;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.layout-preview-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.layout-preview-table th,
.layout-preview-table td {
    padding: 0.72rem;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    white-space: nowrap;
}

.layout-preview-table th {
    background: #f1f5f9;
    color: #334155;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.layout-field {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.layout-field > span {
    color: #334155;
    font-weight: 800;
}

.layout-radio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}

.layout-radio.is-disabled {
    color: #94a3b8;
}

.layout-saved-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.7rem;
    display: grid;
    gap: 0.35rem;
}

.layout-saved-item strong {
    color: #0f172a;
}

.layout-saved-item small {
    color: #64748b;
}

.layout-saved-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.layout-protection-note {
    margin-top: 1rem;
    padding: 0.8rem;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    display: flex;
    gap: 0.65rem;
}

.layout-protection-note i {
    color: #2563eb;
    margin-top: 0.2rem;
}

.layout-protection-note p {
    margin: 0;
}

@media (max-width: 1120px) {
    .table-layout-designer-grid {
        grid-template-columns: 1fr;
    }

    .layout-designer-panel {
        min-height: auto;
    }
}

@media (max-width: 720px) {
    .table-layout-designer-header {
        flex-direction: column;
    }

    .table-layout-designer-actions,
    .exceptions-toolbar-actions {
        justify-content: flex-start;
    }
}
