/* ============================================================
   0724 Client Area — Shared Components (Phase 1)
   Prefixed cx-* to avoid fighting Bootstrap/WHMCS class names.
   ============================================================ */

/* —— Cards —— */
.cx-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem 1.35rem;
    color: var(--text);
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cx-card--interactive:hover {
    border-color: var(--cyan-border);
    box-shadow: 0 0 28px var(--cyan-glow);
}

.cx-card__title {
    margin: 0 0 0.35rem;
    color: var(--white);
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.cx-card__meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.cx-card__body {
    margin-top: 0.85rem;
}

.cx-card__footer {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
}

/* —— Status chips —— */
.cx-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--cyan-border);
    background: rgba(0, 212, 255, 0.05);
    color: var(--cyan);
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.3;
    white-space: nowrap;
}

.cx-chip--success {
    color: var(--cx-success);
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.1);
}

.cx-chip--warning {
    color: var(--cx-warning);
    border-color: rgba(249, 115, 22, 0.4);
    background: rgba(249, 115, 22, 0.1);
}

.cx-chip--danger {
    color: #ff8a8a;
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.12);
}

.cx-chip--neutral {
    color: var(--muted2);
    border-color: var(--border-l);
    background: var(--surface2);
}

.cx-chip__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

/* —— Buttons / action groups —— */
.cx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.5rem;
    padding: 0.55rem 1.2rem;
    border-radius: var(--r-sm);
    border: 1px solid transparent;
    font-family: var(--sans);
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.cx-btn:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

.cx-btn--primary {
    background: var(--cyan);
    color: var(--bg);
}

.cx-btn--primary:hover {
    color: var(--bg);
    text-decoration: none;
    box-shadow: 0 0 24px rgba(0, 212, 255, 0.4);
    transform: translateY(-1px);
}

.cx-btn--outline {
    background: transparent;
    border-color: var(--border-l);
    color: var(--text);
}

.cx-btn--outline:hover {
    border-color: var(--cyan);
    color: var(--cyan);
    text-decoration: none;
}

.cx-btn--ghost {
    background: transparent;
    border-color: var(--cyan-border);
    color: var(--cyan);
}

.cx-btn--ghost:hover {
    background: var(--cyan-glow);
    color: var(--cyan);
    text-decoration: none;
}

.cx-btn--danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.45);
    color: #ffb4b4;
}

.cx-btn--sm {
    min-height: 2.1rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
}

.cx-btn--block {
    width: 100%;
}

.cx-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: center;
}

/* —— Forms —— */
.cx-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.cx-label {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
}

.cx-input,
.cx-select,
.cx-textarea {
    width: 100%;
    min-height: 2.65rem;
    padding: 0.55rem 0.85rem;
    background: var(--surface);
    border: 2px solid var(--border-l);
    border-radius: var(--r-sm);
    color: var(--text);
    font-family: var(--sans);
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cx-textarea {
    min-height: 7rem;
    resize: vertical;
}

.cx-input:focus,
.cx-select:focus,
.cx-textarea:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: var(--cx-focus);
    background: var(--surface2);
}

.cx-input::placeholder,
.cx-textarea::placeholder {
    color: var(--muted);
    opacity: 0.75;
}

.cx-help {
    color: var(--muted);
    font-size: 0.8rem;
}

/* —— Tables —— */
.cx-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.cx-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    color: var(--text);
    font-size: 0.9rem;
}

.cx-table th,
.cx-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    text-align: left;
}

.cx-table th {
    background: var(--surface2);
    color: var(--white);
    font-weight: 650;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.cx-table tbody tr:hover {
    background: rgba(0, 212, 255, 0.04);
}

.cx-table tbody tr:last-child td {
    border-bottom: none;
}

@media (max-width: 767.98px) {
    .cx-table--stack thead {
        display: none;
    }

    .cx-table--stack tr {
        display: block;
        padding: 0.85rem 1rem;
        border-bottom: 1px solid var(--border);
    }

    .cx-table--stack td {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        border: none;
        padding: 0.35rem 0;
    }

    .cx-table--stack td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.75rem;
        font-weight: 650;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }
}

/* —— Alerts —— */
.cx-alert {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 0.9rem 1.1rem;
    border-radius: var(--r);
    border: 1px solid var(--border-l);
    background: var(--surface2);
    color: var(--text);
    font-size: 0.92rem;
}

.cx-alert__body {
    flex: 1;
    min-width: 0;
}

.cx-alert__title {
    margin: 0 0 0.2rem;
    color: var(--white);
    font-weight: 700;
    font-size: 0.95rem;
}

.cx-alert--info {
    border-color: var(--cyan-border);
    background: rgba(0, 212, 255, 0.06);
}

.cx-alert--success {
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.08);
}

.cx-alert--warning {
    border-color: rgba(249, 115, 22, 0.4);
    background: rgba(249, 115, 22, 0.08);
}

.cx-alert--danger {
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(239, 68, 68, 0.1);
}

/* —— Empty states —— */
.cx-empty {
    text-align: center;
    padding: 2.25rem 1.25rem;
    border: 1px dashed var(--border-l);
    border-radius: 14px;
    background: var(--surface);
}

.cx-empty__title {
    margin: 0 0 0.4rem;
    color: var(--white);
    font-size: 1.05rem;
    font-weight: 700;
}

.cx-empty__text {
    margin: 0 auto 1.1rem;
    max-width: 36ch;
    color: var(--muted);
    font-size: 0.9rem;
}

/* Focus / motion */
@media (prefers-reduced-motion: reduce) {
    .cx-btn,
    .cx-card,
    .cx-btn--primary:hover {
        transition: none;
        transform: none;
    }
}

:where(.cx-btn, .cx-input, .cx-select, .cx-textarea, a.cx-card):focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}
