/* ═══════════════════════════════════════════════════════
   SETTINGS — CUSTOM TAB (Redesign 2026-06-09)
   Clean SaaS aesthetic. Linear/Vercel vibe.
   ═══════════════════════════════════════════════════════ */

        #settings-tab-custom { contain: layout style; }

        #settings-tab-custom .settings-info {
            display: flex;
            gap: 12px;
            padding: 14px 16px;
            background: rgba(var(--primary-rgb), 0.06);
            border: 1px solid rgba(var(--primary-rgb), 0.18);
            border-radius: 12px;
            margin-bottom: 1.5rem;
            font-size: 0.82rem;
            line-height: 1.5;
            color: var(--text-muted);
        }
        #settings-tab-custom .settings-info::before {
            content: '';
            flex-shrink: 0;
            width: 4px;
            border-radius: 2px;
            background: var(--primary);
        }
        #settings-tab-custom .settings-info strong { color: var(--text-main); font-weight: 600; }

        .ct-section { margin-bottom: 1.75rem; }
        .ct-section:last-child { margin-bottom: 0; }

        .ct-section-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 1rem;
        }
        .ct-section-title-row {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .ct-section-title {
            font-size: 0.95rem;
            font-weight: 600;
            color: var(--text-main);
            letter-spacing: -0.01em;
        }
        .ct-section-count {
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--text-muted);
            background: rgba(255,255,255,0.05);
            padding: 2px 8px;
            border-radius: 999px;
            letter-spacing: 0.02em;
        }

        /* — Type/Field Grid — */
        .ct-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 8px;
        }

        .ct-row {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 14px;
            background: rgba(255,255,255,0.025);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 10px;
            transition: background 0.15s ease, border-color 0.15s ease;
        }
        .ct-row:hover {
            background: rgba(255,255,255,0.04);
            border-color: rgba(255,255,255,0.10);
        }
        .ct-row-emoji {
            flex-shrink: 0;
            width: 38px;
            height: 38px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.35rem;
            background: rgba(255,255,255,0.04);
            border-radius: 9px;
            line-height: 1;
        }
        .ct-row-emoji[data-tint] {
            background: rgba(var(--tint-rgb,168,85,247), 0.12);
            box-shadow: inset 0 0 0 1px rgba(var(--tint-rgb,168,85,247), 0.22);
        }
        .ct-row-info {
            flex: 1;
            min-width: 0;
        }
        .ct-row-label {
            font-size: 0.88rem;
            font-weight: 600;
            color: var(--text-main);
            line-height: 1.3;
            margin-bottom: 1px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .ct-row-desc {
            font-size: 0.75rem;
            color: var(--text-muted);
            line-height: 1.4;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .ct-row-color-dot {
            flex-shrink: 0;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
        }
        .ct-row-badge {
            flex-shrink: 0;
            font-size: 0.65rem;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            padding: 3px 8px;
            background: rgba(255,255,255,0.04);
            border-radius: 5px;
        }
        .ct-row-actions {
            display: flex;
            gap: 4px;
            flex-shrink: 0;
        }
        .ct-icon-btn {
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: transparent;
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 7px;
            color: var(--text-muted);
            cursor: pointer;
            transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
        }
        .ct-icon-btn svg { width: 14px; height: 14px; }
        .ct-icon-btn:hover {
            background: rgba(255,255,255,0.05);
            color: var(--text-main);
            border-color: rgba(255,255,255,0.12);
        }
        .ct-icon-btn-danger:hover {
            background: rgba(239,68,68,0.10);
            color: #ef4444;
            border-color: rgba(239,68,68,0.30);
        }

        /* — Empty state — */
        .ct-empty {
            text-align: center;
            padding: 1.75rem 1rem;
            border: 1px dashed rgba(255,255,255,0.08);
            border-radius: 10px;
            background: rgba(255,255,255,0.015);
        }
        .ct-empty-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            background: rgba(var(--primary-rgb), 0.08);
            border-radius: 10px;
            color: var(--primary);
            margin-bottom: 8px;
        }
        .ct-empty-icon svg { width: 18px; height: 18px; }
        .ct-empty-text {
            font-size: 0.85rem;
            color: var(--text-main);
            font-weight: 500;
            margin-bottom: 4px;
        }
        .ct-empty-hint {
            font-size: 0.75rem;
            color: var(--text-muted);
            line-height: 1.45;
        }

        /* — Add button — */
        .ct-add-btn {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 11px 16px;
            margin-top: 12px;
            background: rgba(var(--primary-rgb), 0.10);
            border: 1px solid rgba(var(--primary-rgb), 0.25);
            border-radius: 9px;
            color: var(--primary);
            font-size: 0.85rem;
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            letter-spacing: -0.005em;
            transition: background 0.15s ease, border-color 0.15s ease;
        }
        .ct-add-btn svg { width: 14px; height: 14px; }
        .ct-add-btn:hover {
            background: rgba(var(--primary-rgb), 0.16);
            border-color: rgba(var(--primary-rgb), 0.42);
        }

        /* — Inline create form (kein nested Modal!) — */
        .ct-form {
            margin-top: 10px;
            padding: 14px;
            background: rgba(255,255,255,0.025);
            border: 1px solid rgba(var(--primary-rgb), 0.28);
            border-radius: 12px;
            display: none;
        }
        .ct-form.ct-form-open { display: block; animation: ctFormSlide 0.25s ease; }
        @keyframes ctFormSlide {
            from { opacity: 0; transform: translateY(-4px); }
            to   { opacity: 1; transform: translateY(0); }
        }

        .ct-form-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 14px;
        }
        .ct-form-title {
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--text-main);
        }
        .ct-form-row {
            display: flex;
            gap: 10px;
            margin-bottom: 12px;
        }
        .ct-form-row:last-of-type { margin-bottom: 14px; }

        .ct-field { flex: 1; min-width: 0; }
        .ct-field-label {
            display: block;
            font-size: 0.68rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--text-muted);
            margin-bottom: 6px;
        }
        .ct-input,
        .ct-textarea,
        .ct-select {
            width: 100%;
            background: #0a0a0e;
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 8px;
            padding: 9px 12px;
            color: var(--text-main);
            font-size: 0.85rem;
            font-family: inherit;
            outline: none;
            transition: border-color 0.15s ease, box-shadow 0.15s ease;
        }
        .ct-input:focus,
        .ct-textarea:focus,
        .ct-select:focus {
            border-color: rgba(var(--primary-rgb), 0.5);
            box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
        }
        .ct-textarea { resize: vertical; min-height: 60px; font-family: inherit; }

        /* — Emoji-Picker Trigger — */
        .ct-emoji-trigger {
            display: flex;
            align-items: center;
            gap: 10px;
            background: #0a0a0e;
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 8px;
            padding: 6px 10px 6px 6px;
            cursor: pointer;
            transition: border-color 0.15s ease, box-shadow 0.15s ease;
            width: 100%;
        }
        .ct-emoji-trigger:hover { border-color: rgba(255,255,255,0.14); }
        .ct-emoji-trigger:focus-within {
            border-color: rgba(var(--primary-rgb), 0.5);
            box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
        }
        .ct-emoji-display {
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255,255,255,0.04);
            border-radius: 6px;
            font-size: 1.2rem;
            line-height: 1;
            flex-shrink: 0;
        }
        .ct-emoji-display.ct-emoji-empty {
            color: rgba(255,255,255,0.3);
            font-size: 1rem;
        }
        .ct-emoji-display.ct-emoji-empty svg { width: 16px; height: 16px; }
        .ct-emoji-hint {
            flex: 1;
            font-size: 0.78rem;
            color: var(--text-muted);
            text-align: left;
        }
        .ct-emoji-arrow { color: rgba(255,255,255,0.25); flex-shrink: 0; }
        .ct-emoji-arrow svg { width: 14px; height: 14px; }

        /* — Color swatches — */
        .ct-color-row {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
            margin-bottom: 8px;
        }
        .ct-color-swatch {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            border: 2px solid transparent;
            cursor: pointer;
            padding: 0;
            position: relative;
            transition: transform 0.15s ease;
            box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
        }
        .ct-color-swatch:hover { transform: scale(1.12); }
        .ct-color-swatch.ct-color-active {
            border-color: var(--text-main);
            box-shadow: 0 0 0 2px rgba(0,0,0,0.5);
        }
        .ct-color-custom {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 4px;
        }
        .ct-color-custom-picker {
            width: 32px;
            height: 32px;
            padding: 0;
            border: 1px solid rgba(255,255,255,0.10);
            border-radius: 7px;
            cursor: pointer;
            background: transparent;
        }
        .ct-color-custom-picker::-webkit-color-swatch-wrapper { padding: 2px; }
        .ct-color-custom-picker::-webkit-color-swatch { border: none; border-radius: 5px; }
        .ct-color-custom-label {
            font-size: 0.75rem;
            color: var(--text-muted);
            font-family: var(--font-mono);
        }

        /* — Form actions — */
        .ct-form-actions {
            display: flex;
            gap: 8px;
            justify-content: flex-end;
            margin-top: 14px;
            padding-top: 12px;
            border-top: 1px solid rgba(255,255,255,0.06);
        }
        .ct-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 8px 14px;
            border-radius: 8px;
            font-size: 0.82rem;
            font-weight: 600;
            font-family: inherit;
            letter-spacing: -0.005em;
            cursor: pointer;
            transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
            border: 1px solid transparent;
        }
        .ct-btn svg { width: 13px; height: 13px; }
        .ct-btn-ghost {
            background: transparent;
            border-color: rgba(255,255,255,0.10);
            color: var(--text-muted);
        }
        .ct-btn-ghost:hover {
            background: rgba(255,255,255,0.04);
            color: var(--text-main);
            border-color: rgba(255,255,255,0.18);
        }
        .ct-btn-primary {
            background: var(--primary);
            color: #fff;
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
        }
        .ct-btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
        .ct-btn-primary:disabled {
            background: rgba(255,255,255,0.05);
            color: rgba(255,255,255,0.25);
            cursor: not-allowed;
            box-shadow: none;
            transform: none;
            filter: none;
        }

        /* — Toggle row (für "Zählt als Arbeitszeit") — */
        .ct-toggle-row {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            padding: 10px 12px;
            background: rgba(255,255,255,0.025);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 10px;
            cursor: pointer;
            transition: background 0.15s ease, border-color 0.15s ease;
        }
        .ct-toggle-row:hover {
            background: rgba(255,255,255,0.04);
            border-color: rgba(255,255,255,0.10);
        }
        .ct-toggle-input {
            position: absolute;
            opacity: 0;
            pointer-events: none;
        }
        .ct-toggle-knob {
            flex-shrink: 0;
            width: 34px;
            height: 20px;
            background: rgba(255,255,255,0.08);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 999px;
            position: relative;
            margin-top: 2px;
            transition: background 0.18s ease, border-color 0.18s ease;
        }
        .ct-toggle-knob::after {
            content: '';
            position: absolute;
            top: 1px;
            left: 1px;
            width: 16px;
            height: 16px;
            background: #f8fafc;
            border-radius: 50%;
            box-shadow: 0 1px 3px rgba(0,0,0,0.4);
            transition: transform 0.18s cubic-bezier(0.4,0,0.2,1);
        }
        .ct-toggle-input:checked ~ .ct-toggle-knob {
            background: var(--primary);
            border-color: var(--primary);
        }
        .ct-toggle-input:checked ~ .ct-toggle-knob::after {
            transform: translateX(14px);
        }
        .ct-toggle-input:focus-visible ~ .ct-toggle-knob {
            box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.25);
        }
        .ct-toggle-text { flex: 1; min-width: 0; }
        .ct-toggle-title {
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--text-main);
            line-height: 1.3;
            margin-bottom: 2px;
        }
        .ct-toggle-hint {
            font-size: 0.72rem;
            color: var(--text-muted);
            line-height: 1.45;
        }

        /* — Section divider / type-label — */
        .ct-divider {
            display: flex;
            align-items: center;
            gap: 10px;
            margin: 14px 0 10px;
        }
        .ct-divider::before,
        .ct-divider::after {
            content: '';
            flex: 1;
            height: 1px;
            background: rgba(255,255,255,0.05);
        }
        .ct-divider-text {
            font-size: 0.65rem;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.1em;
        }

        /* — Mobile — */
        @media (max-width: 540px) {
            .ct-row { padding: 10px 12px; gap: 10px; }
            .ct-row-emoji { width: 34px; height: 34px; font-size: 1.2rem; }
            .ct-row-desc { display: none; }
            .ct-form-row { flex-direction: column; gap: 12px; }
            .ct-form { padding: 12px; }
        }
