/* ====== Botones ====== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: .65rem 1.1rem;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
    white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--color-red); color: #fff; }
.btn-primary:hover { background: var(--color-red-dark); }

.btn-dark { background: var(--color-black); color: #fff; }
.btn-dark:hover { background: var(--color-black-soft); }

.btn-outline { background: transparent; color: var(--color-black); border-color: var(--color-border); }
.btn-outline:hover { border-color: var(--color-black); }

.btn-success { background: var(--color-green); color: #fff; }
.btn-success:hover { filter: brightness(0.92); }

.btn-ghost { background: transparent; color: var(--color-text-soft); }
.btn-ghost:hover { background: var(--color-surface-soft); }

.btn-sm { padding: .4rem .75rem; font-size: .82rem; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 50%; }

/* ====== Tarjetas ====== */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
}

.card-title {
    font-size: 1rem;
    color: var(--color-text-soft);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .25rem;
}

.card-value {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--color-black);
}

/* ====== Badges de estatus ====== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem .65rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .02em;
}
.badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}
.badge-disponible, .badge-listo { background: var(--color-green-light); color: var(--color-green); }
.badge-ocupada, .badge-en_preparacion { background: var(--color-red-light); color: var(--color-red); }
.badge-pendiente { background: var(--color-gray-light); color: var(--color-gray); }
.badge-entregado { background: var(--color-surface-soft); color: var(--color-black); }
.badge-pagado { background: var(--color-black); color: #fff; }
.badge-cancelado { background: var(--color-gray-light); color: var(--color-text-faint); text-decoration: line-through; }

/* ====== Formularios ====== */
.form-group { margin-bottom: 1rem; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--color-text-soft);
    margin-bottom: .35rem;
}

input, select, textarea {
    width: 100%;
    padding: .6rem .75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    font-family: inherit;
    background: #fff;
    color: var(--color-text);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-red);
    box-shadow: 0 0 0 3px var(--color-red-light);
}
textarea { resize: vertical; min-height: 70px; }

fieldset { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1rem; margin-bottom: 1rem; }
legend { font-weight: 700; padding: 0 .4rem; color: var(--color-red); }

/* ====== Alertas ====== */
.alert {
    padding: .8rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: .9rem;
}
.alert-error { background: var(--color-red-light); color: var(--color-red-dark); }
.alert-success { background: var(--color-green-light); color: var(--color-green); }
.alert-info { background: var(--color-gray-light); color: var(--color-text); }

/* ====== Tablas ====== */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: var(--color-surface); border-radius: var(--radius-md); overflow: hidden; }
.table th, .table td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--color-border); font-size: .9rem; }
.table th { background: var(--color-surface-soft); color: var(--color-text-soft); text-transform: uppercase; font-size: .75rem; letter-spacing: .04em; }
.table tr:last-child td { border-bottom: none; }

/* ====== Modal ====== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(26,23,21,.55);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem; z-index: 1000;
}
.modal-overlay.hidden { display: none; }
.modal {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.1rem 1.4rem;
    border-bottom: 1px solid var(--color-border);
    position: sticky; top: 0; background: var(--color-surface);
}
.modal-header h2 { margin: 0; font-size: 1.15rem; }
.modal-body { padding: 1.4rem; }
.modal-footer {
    padding: 1rem 1.4rem;
    border-top: 1px solid var(--color-border);
    display: flex; justify-content: flex-end; gap: .6rem;
    position: sticky; bottom: 0; background: var(--color-surface);
}
.modal-close {
    background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--color-text-soft);
    line-height: 1;
}

/* ====== Pills / tabs ====== */
.tabs { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .25rem; }
.tab-btn {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: 999px;
    padding: .5rem 1rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--color-text-soft);
    cursor: pointer;
    white-space: nowrap;
}
.tab-btn.active { background: var(--color-black); color: #fff; border-color: var(--color-black); }

/* ====== Empty state ====== */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--color-text-faint); }
.empty-state .icon { font-size: 2.5rem; margin-bottom: .5rem; }

/* ====== Toast ====== */
.toast-container {
    position: fixed; top: 1rem; right: 1rem; z-index: 2000;
    display: flex; flex-direction: column; gap: .5rem; max-width: 320px;
}
.toast {
    background: var(--color-black);
    color: #fff;
    padding: .8rem 1rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    font-size: .88rem;
    animation: toast-in .2s ease;
}
.toast.toast-error { background: var(--color-red); }
.toast.toast-success { background: var(--color-green); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ====== Spinner ====== */
.spinner {
    width: 18px; height: 18px;
    border: 2.5px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
