/* ============================================================================
   Components — Loyalty 3M Design Kit
   ----------------------------------------------------------------------------
   Componentes base sin scope: usá las clases directo en HTML/JSX.
   Requiere tokens.css cargado antes.
   ============================================================================ */

/* ── BUTTONS ── */
.btn {
    font-family: var(--font);
    font-variation-settings: 'wght' 600;
    border-radius: var(--r-sm);
    padding: 9px 16px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
    transition: background-color 0.15s, transform 0.06s, box-shadow 0.15s, border-color 0.15s;
    text-decoration: none;
}
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--accent);
    color: #ffffff;
    box-shadow: var(--shadow-xs), inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-sm), inset 0 -1px 0 rgba(0, 0, 0, 0.08); }

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--surface-2); border-color: var(--text-3); }

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

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }

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

.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ── INPUTS ── */
.input, input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="url"], input[type="search"],
textarea, select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 8px 12px;
    font-family: var(--font);
    font-size: 13px;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    box-sizing: border-box;
}
.input:focus, input:focus, textarea:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder, input::placeholder, textarea::placeholder { color: var(--text-4); }

label { font-size: 12px; color: var(--text-2); font-weight: 600; display: block; margin-bottom: 4px; }

/* ── CARDS ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}
.card-elevated { box-shadow: var(--shadow-md); }
.card-header {
    padding: 12px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    border-radius: var(--r-md) var(--r-md) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-body { padding: 16px; }
.card-footer {
    padding: 12px 16px;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--r-md) var(--r-md);
}

/* ── BADGES ── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--r-pill);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    background: var(--surface-2);
    color: var(--text-2);
}
.badge-accent  { background: var(--accent-soft);  color: var(--accent); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger); }

/* ── TABLES ── */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--surface);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.table th {
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-3);
    padding: 12px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--divider);
    color: var(--text);
}
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--accent-tint); }

/* ── STAT (KPI card) ── */
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 16px 18px;
    box-shadow: var(--shadow-xs);
}
.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-3);
    margin-bottom: 6px;
}
.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
    font-variation-settings: 'wght' 700;
}
.stat-delta { font-size: 12px; margin-top: 4px; }
.stat-delta.up   { color: var(--success); }
.stat-delta.down { color: var(--danger); }

/* ── ALERTS ── */
.alert {
    padding: 12px 14px;
    border-radius: var(--r-sm);
    font-size: 13px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
}
.alert-accent  { background: var(--accent-tint);  border-color: var(--accent-soft);  color: var(--text); }
.alert-success { background: var(--success-soft); border-color: var(--success-soft); color: var(--success-hover); }
.alert-warning { background: var(--warning-soft); border-color: var(--warning-soft); color: var(--warning); }
.alert-danger  { background: var(--danger-soft);  border-color: var(--danger-soft);  color: var(--danger-hover); }

/* ── MODAL ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 16, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}
.modal-card {
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    width: min(560px, 92vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: var(--surface-2);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* ── TOAST ── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--surface);
    border: 1px solid var(--accent);
    border-radius: var(--r-md);
    padding: 12px 18px;
    box-shadow: var(--shadow-md);
    font-size: 13px;
    z-index: 9999;
    color: var(--text);
}

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: 100vh;
    box-sizing: border-box;
}
.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}
.sidebar a:hover { background: var(--surface-2); color: var(--text); }
.sidebar a.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

/* ── LAYOUT HELPERS ── */
.row { display: flex; gap: 12px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.spacer { flex: 1; }
.muted { color: var(--text-3); }
.bold { font-weight: 700; }
</content>
</invoke>