/* ============================================
   ESTILOS - Sistema de Gestión de Puntos
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f0f4f8;
    color: #333;
    min-height: 100vh;
}

/* ---- HEADER ---- */
header {
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: white;
    padding: 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 30px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-logo .logo-icon {
    font-size: 32px;
}

.header-logo h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.header-logo p {
    font-size: 13px;
    opacity: 0.85;
    margin-top: 2px;
}

.header-nav a {
    color: white;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.header-nav a:hover {
    background: rgba(255,255,255,0.2);
}

/* ---- CONTENEDOR PRINCIPAL ---- */
.container {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
}

/* ---- PANEL / TARJETAS ---- */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    padding: 30px;
    margin-bottom: 24px;
}

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a73e8;
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e8f0fe;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---- MENÚ PRINCIPAL (index) ---- */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.menu-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 30px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    color: white;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
    cursor: pointer;
    border: none;
}

.menu-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.menu-btn .icon {
    font-size: 40px;
}

.menu-btn.azul    { background: linear-gradient(135deg, #1a73e8, #0d47a1); }
.menu-btn.verde   { background: linear-gradient(135deg, #34a853, #1e7e34); }
.menu-btn.naranja { background: linear-gradient(135deg, #f57c00, #e65100); }
.menu-btn.morado  { background: linear-gradient(135deg, #7b1fa2, #4a148c); }
.menu-btn.rojo    { background: linear-gradient(135deg, #e53935, #b71c1c); }
.menu-btn.cian    { background: linear-gradient(135deg, #00838f, #006064); }

/* ---- FORMULARIOS ---- */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #555;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #dde1e7;
    border-radius: 8px;
    font-size: 15px;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafafa;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
    outline: none;
    background: white;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

/* ---- BOTONES ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.1s;
}

.btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary  { background: #1a73e8; color: white; }
.btn-success  { background: #34a853; color: white; }
.btn-warning  { background: #f57c00; color: white; }
.btn-danger   { background: #e53935; color: white; }
.btn-secondary{ background: #78909c; color: white; }
.btn-purple   { background: #7b1fa2; color: white; }
.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* ---- TABLAS ---- */
.table-wrapper {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e8eaed;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    background: linear-gradient(135deg, #1a73e8, #0d47a1);
    color: white;
}

thead th {
    padding: 13px 16px;
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.3px;
}

tbody tr {
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.15s;
}

tbody tr:hover {
    background: #f0f6ff;
}

tbody td {
    padding: 12px 16px;
    color: #444;
}

.badge-puntos {
    display: inline-block;
    background: linear-gradient(135deg, #34a853, #1e7e34);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

/* ---- MENSAJES ---- */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #43a047;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #e53935;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border-left: 4px solid #1e88e5;
}

.alert-warning {
    background: #fff8e1;
    color: #e65100;
    border-left: 4px solid #fb8c00;
}

/* ---- TARJETA RESULTADO CLIENTE ---- */
.cliente-card {
    background: linear-gradient(135deg, #f0f6ff, #e8f0fe);
    border: 2px solid #c5d8fc;
    border-radius: 12px;
    padding: 24px;
    margin-top: 20px;
}

.cliente-card h3 {
    font-size: 20px;
    color: #1a73e8;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.info-item {
    background: white;
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.info-item .label {
    font-size: 12px;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item .value {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-top: 4px;
}

.info-item.puntos-box .value {
    color: #34a853;
    font-size: 24px;
}

/* ---- PUNTOS RESUMEN ---- */
.puntos-resumen {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.puntos-item {
    flex: 1;
    min-width: 140px;
    background: white;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    border-top: 4px solid #1a73e8;
}

.puntos-item.antes  { border-top-color: #78909c; }
.puntos-item.suma   { border-top-color: #34a853; }
.puntos-item.resta  { border-top-color: #e53935; }
.puntos-item.total  { border-top-color: #1a73e8; }

.puntos-item .p-label {
    font-size: 12px;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
}

.puntos-item .p-value {
    font-size: 28px;
    font-weight: 800;
    margin-top: 6px;
}

.puntos-item.antes  .p-value { color: #78909c; }
.puntos-item.suma   .p-value { color: #34a853; }
.puntos-item.resta  .p-value { color: #e53935; }
.puntos-item.total  .p-value { color: #1a73e8; }

/* ---- BÚSQUEDA ---- */
.search-box {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.search-box .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* ---- STATS (index) ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    border-top: 4px solid #1a73e8;
}

.stat-card .s-icon { font-size: 28px; }
.stat-card .s-value { font-size: 30px; font-weight: 800; color: #1a73e8; margin: 6px 0; }
.stat-card .s-label { font-size: 13px; color: #888; font-weight: 600; }

/* ---- BREADCRUMB ---- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #888;
    margin-bottom: 20px;
}

.breadcrumb a {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb a:hover { text-decoration: underline; }

/* ---- FOOTER ---- */
footer {
    text-align: center;
    padding: 24px;
    color: #aaa;
    font-size: 13px;
    margin-top: 40px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 700px) {
    .header-inner { flex-direction: column; gap: 12px; text-align: center; }
    .form-row { grid-template-columns: 1fr; }
    .menu-grid { grid-template-columns: 1fr 1fr; }
    .search-box { flex-direction: column; }
    .container { padding: 0 12px; }
    .card { padding: 20px 16px; }
    .puntos-resumen { flex-direction: column; }
}

@media (max-width: 480px) {
    .menu-grid { grid-template-columns: 1fr; }
}
