/* 📞 Contacts Module — RADIM tokens */

.ct-module {
    max-width: 980px;
    margin: 0 auto;
    padding: 16px;
    color: #2d3748;
}

.ct-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.ct-header h2 {
    font-size: 1.45rem;
    margin: 0 0 4px;
    color: #2d3748;
    font-weight: 700;
}
.ct-subtitle {
    color: #718096;
    font-size: 0.95rem;
    margin: 0;
}

.ct-btn-primary,
.ct-btn-ghost {
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all 0.15s;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ct-btn-primary {
    background: var(--radim-primary, var(--radim-primary));
    color: #fff;
}
.ct-btn-primary:hover {
    box-shadow: 0 4px 12px color-mix(in srgb, var(--radim-primary) 30%, transparent);
    transform: translateY(-1px);
}
.ct-btn-ghost {
    background: transparent;
    color: #2d3748;
    border-color: #e2e8f0;
}
.ct-btn-ghost:hover {
    border-color: var(--radim-primary, var(--radim-primary));
    color: var(--radim-primary, var(--radim-primary));
}

/* ── Tabs ───────────────────────────────────────────────────────── */
.ct-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    border-bottom: 1.5px solid #e2e8f0;
    overflow-x: auto;
}
.ct-tab {
    background: transparent;
    border: none;
    padding: 12px 18px;
    font-size: 1rem;
    font-weight: 600;
    color: #718096;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -1.5px;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}
.ct-tab:hover { color: #2d3748; }
.ct-tab-active {
    color: var(--radim-primary, var(--radim-primary));
    border-bottom-color: var(--radim-primary, var(--radim-primary));
}

/* ── Content ────────────────────────────────────────────────────── */
.ct-content { min-height: 200px; }
.ct-loading {
    text-align: center;
    color: #a0aec0;
    padding: 40px 16px;
}

.ct-section { margin-bottom: 28px; }
.ct-section h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 12px;
}

.ct-hint {
    background: color-mix(in srgb, var(--radim-primary) 8%, transparent);
    border-left: 3px solid var(--radim-primary, var(--radim-primary));
    padding: 12px 16px;
    border-radius: 12px;
    margin: 16px 0;
    color: #2d3748;
    font-size: 0.92rem;
    line-height: 1.5;
}

.ct-muted { color: #a0aec0; font-size: 0.88rem; }

/* ── Big cards (Quick tab) ──────────────────────────────────────── */
.ct-big-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.ct-big-card {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
    transition: all 0.15s;
    position: relative;
}
.ct-big-card:hover {
    border-color: var(--radim-primary, var(--radim-primary));
    box-shadow: 0 4px 16px color-mix(in srgb, var(--radim-primary) 15%, transparent);
}

.ct-big-avatar {
    width: 72px;
    height: 72px;
    margin: 0 auto 10px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--radim-primary) 0%, var(--radim-primary-deep) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.6rem;
    font-weight: 700;
}
.ct-big-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.ct-big-avatar-initial { display: inline-block; }

.ct-big-name {
    font-weight: 700;
    font-size: 1.08rem;
    color: #2d3748;
}
.ct-big-relation {
    color: #718096;
    font-size: 0.85rem;
    margin-top: 2px;
    min-height: 1.2em;
}
.ct-linked-badge {
    display: inline-block;
    background: rgba(72, 187, 120, 0.12);
    color: #48bb78;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 6px;
}

.ct-big-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}
.ct-big-actions button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.15s;
}
.ct-big-actions button:hover {
    border-color: var(--radim-primary, var(--radim-primary));
    background: color-mix(in srgb, var(--radim-primary) 8%, transparent);
    transform: scale(1.08);
}

/* ── List (All tab) ─────────────────────────────────────────────── */
.ct-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ct-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #fff;
    border: 1.5px solid #edf2f7;
    border-radius: 14px;
    margin-bottom: 8px;
    transition: all 0.15s;
}
.ct-row:hover { border-color: var(--radim-primary, var(--radim-primary)); }

.ct-row-avatar { flex-shrink: 0; }
.ct-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, var(--radim-primary) 0%, var(--radim-primary-deep) 100%);
}
.ct-avatar-text {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}

.ct-row-body { flex: 1; min-width: 0; }
.ct-row-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ct-inline-badge {
    background: rgba(72, 187, 120, 0.12);
    color: #48bb78;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}
.ct-pri-badge {
    background: rgba(236, 201, 75, 0.14);
    color: #975a16;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 8px;
}
.ct-row-sub {
    color: #718096;
    font-size: 0.88rem;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ct-row-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.ct-row-action {
    background: transparent;
    border: 1.5px solid #e2e8f0;
    color: #2d3748;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.ct-row-action:hover {
    border-color: var(--radim-primary, var(--radim-primary));
    background: color-mix(in srgb, var(--radim-primary) 8%, transparent);
    color: var(--radim-primary, var(--radim-primary));
}

.ct-row-tail {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.ct-star {
    background: transparent;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    opacity: 0.35;
    transition: opacity 0.15s, transform 0.15s;
    padding: 4px;
}
.ct-star:hover { opacity: 0.7; transform: scale(1.15); }
.ct-star-on { opacity: 1; }

.ct-icon-btn {
    background: transparent;
    border: none;
    color: #718096;
    font-size: 1rem;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.ct-icon-btn:hover { background: #f7fafc; color: #2d3748; }
.ct-icon-btn.ct-danger:hover { background: rgba(229, 62, 62, 0.1); color: #e53e3e; }

/* ── Empty state ────────────────────────────────────────────────── */
.ct-empty {
    text-align: center;
    padding: 60px 24px;
    color: #718096;
}
.ct-empty-icon { font-size: 3rem; margin-bottom: 12px; }
.ct-empty h3 {
    color: #2d3748;
    margin: 0 0 8px;
    font-size: 1.25rem;
}
.ct-empty p {
    margin: 0 0 18px;
    line-height: 1.55;
    font-size: 0.98rem;
}

.ct-family-footer {
    text-align: center;
    margin-top: 18px;
}

/* ── Dialog ─────────────────────────────────────────────────────── */
.ct-dialog-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: ct-fadein 0.2s ease-out;
}
@keyframes ct-fadein { from { opacity: 0; } to { opacity: 1; } }

.ct-dialog {
    background: #fff;
    border-radius: 20px;
    padding: 28px 24px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}
.ct-dialog h3 {
    margin: 0 0 14px;
    color: #2d3748;
    font-size: 1.3rem;
}

.ct-dialog label {
    display: block;
    margin-top: 12px;
    font-weight: 500;
    color: #2d3748;
    font-size: 0.92rem;
}
.ct-dialog input,
.ct-dialog select,
.ct-dialog textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    font-size: 1rem;
    color: #2d3748;
    background: #fff;
    margin-top: 4px;
    font-family: inherit;
}
.ct-dialog input:focus,
.ct-dialog select:focus,
.ct-dialog textarea:focus {
    border-color: var(--radim-primary, var(--radim-primary));
    outline: none;
}

.ct-checkbox {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin-top: 14px !important;
    cursor: pointer;
}
.ct-checkbox input[type="checkbox"] {
    width: auto !important;
    margin: 0 !important;
}

.ct-dialog-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ── Mobile ─────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .ct-module { padding: 12px; }
    .ct-header { flex-direction: column; }
    .ct-btn-primary, .ct-btn-ghost { width: 100%; justify-content: center; }
    .ct-big-grid { grid-template-columns: repeat(2, 1fr); }
    .ct-big-card { padding: 16px 10px; }
    .ct-big-avatar { width: 56px; height: 56px; font-size: 1.3rem; }
    .ct-big-name { font-size: 1rem; }
    .ct-row { flex-wrap: wrap; padding: 12px 14px; }
    .ct-row-tail {
        flex-direction: row;
        width: 100%;
        justify-content: flex-end;
        margin-top: 4px;
    }
    .ct-dialog { padding: 20px 16px; max-height: 95vh; }
}
