:root {
    --app-surface: #ffffff;
    --app-surface-soft: #faf8ff;
    --app-border: #ece7f6;
    --app-border-strong: #ddd6ef;
    --app-text: #1f2937;
    --app-text-soft: #6b7280;
    --app-shadow-sm: 0 8px 18px rgba(17, 24, 39, 0.04);
    --app-shadow-md: 0 14px 28px rgba(17, 24, 39, 0.08);
    --app-radius-sm: 14px;
    --app-radius-md: 18px;
    --app-radius-lg: 22px;
}

/* Layout base */
.detail-card,
.dashboard-card,
.dashboard-panel,
.summary-card,
.catalog-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow-sm);
}

.detail-card,
.dashboard-panel,
.catalog-card {
    padding: 1.15rem;
}

.dashboard-card:hover,
.dashboard-quick-card:hover,
.list-item:hover {
    box-shadow: var(--app-shadow-md);
}

/* Títulos y texto */
h1, h2, h3, h4 {
    color: var(--app-text);
    letter-spacing: -0.02em;
}

.muted,
.text-muted {
    color: var(--app-text-soft) !important;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: inline-block;
    margin-bottom: 0.45rem;
    font-weight: 600;
    color: var(--app-text);
}

.form-control,
textarea.form-control,
select.form-control,
input.form-control {
    width: 100%;
    border: 1px solid var(--app-border-strong);
    border-radius: 14px;
    padding: 0.82rem 0.95rem;
    background: #fff;
    color: var(--app-text);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.form-control:focus,
textarea.form-control:focus,
select.form-control:focus,
input.form-control:focus {
    outline: none;
    border-color: var(--brand-primary, #6f42c1);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-primary, #6f42c1) 12%, transparent);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0.85rem 0 1rem;
}

/* Buttons */
.btn-primary,
.btn-secondary,
button.btn-primary,
button.btn-secondary {
    border-radius: 14px !important;
    padding: 0.82rem 1.05rem;
    font-weight: 700;
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.07);
}

.btn-primary:hover,
.btn-secondary:hover,
button.btn-primary:hover,
button.btn-secondary:hover {
    transform: translateY(-1px);
}

.btn-sm {
    border-radius: 12px !important;
    padding: 0.58rem 0.82rem !important;
    font-size: 0.92rem;
}

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

/* Tables */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--app-border);
    border-radius: 18px;
    background: #fff;
}

.clients-table,
.table,
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.clients-table thead th,
.table thead th,
table thead th {
    background: #faf8ff;
    color: var(--app-text);
    font-weight: 700;
    font-size: 0.92rem;
    text-align: left;
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--app-border);
}

.clients-table tbody td,
.table tbody td,
table tbody td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid #f1edf8;
    vertical-align: middle;
}

.clients-table tbody tr:last-child td,
.table tbody tr:last-child td,
table tbody tr:last-child td {
    border-bottom: 0;
}

.clients-table tbody tr:hover,
.table tbody tr:hover,
table tbody tr:hover {
    background: #fcfbff;
}

/* Pills / badges */
.badge,
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.38rem 0.72rem;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1;
}

.badge.active {
    background: color-mix(in srgb, var(--brand-primary, #6f42c1) 14%, white);
    color: var(--brand-primary, #6f42c1);
}

.badge.inactive {
    background: #f3f4f6;
    color: #6b7280;
}

/* Lists */
.list-stack {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.list-item {
    width: 100%;
    border: 1px solid var(--app-border);
    background: #fff;
    border-radius: 16px;
    padding: 0.9rem 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    text-align: left;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.list-item:hover {
    border-color: var(--brand-primary, #6f42c1);
    transform: translateY(-1px);
}

.list-title {
    font-weight: 700;
    color: var(--app-text);
}

.list-subtitle {
    color: var(--app-text-soft);
    font-size: 0.92rem;
}

/* Section headers */
.section-header,
.dashboard-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

/* Alerts */
.alert {
    border-radius: 16px;
    padding: 0.9rem 1rem;
    border: 1px solid transparent;
    margin-bottom: 1rem;
}

.alert.success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.alert.error {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

/* Responsive */
@media (max-width: 720px) {
    .detail-card,
    .dashboard-panel,
    .catalog-card {
        padding: 1rem;
        border-radius: 18px;
    }

    .clients-table thead th,
    .table thead th,
    table thead th,
    .clients-table tbody td,
    .table tbody td,
    table tbody td {
        padding: 0.82rem 0.85rem;
    }

    .actions-row,
    .table-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .actions-row > *,
    .table-actions > * {
        width: 100%;
    }
}