/* ═══════════════════════════════════════════════
   SCRUD Base — estilos compartidos del admin
   Cargado por cada módulo que usa tablas/tabs/form
   ═══════════════════════════════════════════════ */

/* ── Layout ── */
.scrud {
    padding: 24px;
    width: 100%;
    box-sizing: border-box;
    animation: fadeIn 300ms ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.scrud__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.scrud__title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* ── Table ── */
.scrud__table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border, #444c56);
    border-radius: var(--radius-md, 8px);
    background: var(--bg-tertiary, #334155);
}

.scrud__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.scrud__table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-secondary, #9198a1);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border, #444c56);
    background: var(--bg-secondary, #1e293b);
}

.scrud__table td {
    padding: 12px 16px;
    color: var(--text-primary, #fff);
    border-bottom: 1px solid var(--border, #444c56);
}

.scrud__table tr:last-child td {
    border-bottom: none;
}

.scrud__table tr:hover td {
    background: var(--bg-hover, rgba(255,255,255,0.03));
}

.scrud__empty {
    text-align: center;
    color: var(--text-muted, #6c7480);
    padding: 40px 16px !important;
}

/* ── Badges ── */
.scrud__badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.scrud__badge--success {
    background: rgba(46, 160, 67, 0.15);
    color: #3fb950;
}

.scrud__badge--muted {
    background: rgba(108, 116, 128, 0.15);
    color: #9198a1;
}

/* ── Actions ── */
.scrud__actions {
    display: flex;
    gap: 6px;
}

/* ── Buttons ── */
.scrud__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm, 6px);
    font-family: var(--font-sans, 'Outfit', sans-serif);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 150ms ease;
}

.scrud__btn--primary {
    background: var(--accent-btn, #10b981);
    color: #fff;
}

.scrud__btn--primary:hover {
    background: var(--accent-btn-hover, #34d399);
}

.scrud__btn--outline {
    background: transparent;
    border: 1px solid var(--border, #444c56);
    color: var(--text-primary, #fff);
}

.scrud__btn--outline:hover {
    background: var(--bg-hover, rgba(255,255,255,0.05));
    border-color: var(--text-secondary, #9198a1);
}

.scrud__btn--danger {
    background: transparent;
    border: 1px solid rgba(218, 54, 51, 0.3);
    color: var(--danger, #da3633);
}

.scrud__btn--danger:hover {
    background: rgba(218, 54, 51, 0.1);
}

.scrud__btn--sm {
    padding: 5px 12px;
    font-size: 0.8rem;
}

.scrud__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Form ── */
.scrud-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.scrud-form__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.scrud-form__field label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary, #9198a1);
}

.scrud-form__field .required {
    color: var(--danger, #da3633);
}

.scrud-form__field input,
.scrud-form__field select,
.scrud-form__field textarea {
    padding: 9px 12px;
    font-family: var(--font-sans, 'Outfit', sans-serif);
    font-size: 0.9rem;
    color: var(--text-primary, #fff);
    background: var(--bg-input, #0f172a);
    border: 1px solid var(--border, #444c56);
    border-radius: var(--radius-sm, 6px);
    outline: none;
    transition: border-color 200ms;
    box-sizing: border-box;
}

.scrud-form__field input:focus,
.scrud-form__field select:focus,
.scrud-form__field textarea:focus {
    border-color: var(--accent, #38bdf8);
}

.scrud-form__field textarea {
    resize: vertical;
}

.scrud-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.scrud-form__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border, #444c56);
}

/* ── Tabs ── */
.scrud-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border, #444c56);
    padding-bottom: 0;
}

.scrud-tabs__btn {
    padding: 10px 20px;
    font-family: var(--font-sans, 'Outfit', sans-serif);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary, #9198a1);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 150ms ease;
    margin-bottom: -1px;
}

.scrud-tabs__btn:hover {
    color: var(--text-primary, #fff);
    border-bottom-color: var(--text-muted, #6c7480);
}

.scrud-tabs__btn--active {
    color: var(--accent, #38bdf8);
    border-bottom-color: var(--accent, #38bdf8);
}

/* ── Filter Bar ── */
.scrud-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--bg-tertiary, #334155);
    border: 1px solid var(--border, #444c56);
    border-radius: var(--radius-md, 8px);
}

.scrud-filter label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary, #9198a1);
    white-space: nowrap;
}

.scrud-filter__select {
    flex: 1;
    padding: 8px 12px;
    font-family: var(--font-sans, 'Outfit', sans-serif);
    font-size: 0.9rem;
    color: var(--text-primary, #fff);
    background: var(--bg-input, #0f172a);
    border: 1px solid var(--border, #444c56);
    border-radius: var(--radius-sm, 6px);
    outline: none;
    max-width: 400px;
}

.scrud-filter__select:focus {
    border-color: var(--accent, #38bdf8);
}
