:root {
    --bg-color: #FDF7F2;
    --primary-color: #C06C4C; /* Terracota del logo */
    --secondary-color: #4A3728; /* Café oscuro */
    --text-color: #333333;
    --accent-color: #E8D5C4;
}

body {
    background-color: var(--bg-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    width: 90%;
    max-width: 400px;
    text-align: center;
    border: 1px solid var(--accent-color);
}

.logo-small {
    width: 130px;
    height: 130px;
    object-fit: contain;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 8px 18px rgba(74, 55, 40, 0.18));
}

h1, h2 {
    color: var(--secondary-color);
    font-weight: 300;
}

/* Pantallas de autenticación (registro / login) */
.auth-body {
    position: relative;
    overflow-x: hidden;
}

.auth-body::before,
.auth-body::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    filter: blur(70px);
    pointer-events: none;
    z-index: 0;
}

.auth-body::before {
    width: 380px;
    height: 380px;
    background: var(--accent-color);
    opacity: 0.7;
    top: -110px;
    left: -110px;
}

.auth-body::after {
    width: 360px;
    height: 360px;
    background: var(--primary-color);
    opacity: 0.16;
    bottom: -130px;
    right: -130px;
}

.auth-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 90%;
    max-width: 420px;
}

.auth-wrap .container {
    width: 100%;
    margin-top: 0.5rem;
}

.badge-pill {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--secondary-color);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 50px;
    margin-bottom: 0.8rem;
}

.subtitle {
    color: #888;
    margin-top: -0.3rem;
    margin-bottom: 1.2rem;
    font-size: 0.92rem;
}

.switch-link {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #777;
}

.form-error {
    background-color: #fdecea;
    color: #c0392b;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin: 0 0 0.8rem;
}

.auth-footer {
    margin-top: 1.5rem;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #b9a99c;
}

/* Inputs con ícono */
.input-group {
    position: relative;
    margin: 10px 0;
}

.input-group input {
    width: 100%;
    margin: 0;
    padding: 12px 14px 12px 42px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(192, 108, 76, 0.15);
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.95rem;
    opacity: 0.65;
}

.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    margin-top: 1rem;
    box-shadow: 0 8px 18px rgba(192, 108, 76, 0.3);
    transition: 0.3s;
}

.btn:hover {
    background-color: var(--secondary-color);
    box-shadow: 0 10px 20px rgba(74, 55, 40, 0.3);
    transform: translateY(-1px);
}

input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
}

.qr-container {
    background: white;
    padding: 15px;
    display: inline-block;
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    margin: 20px 0;
}

.visit-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
}

.dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.dot.filled {
    background-color: var(--primary-color);
}

/* ============================
   Panel de administración
   ============================ */

/* Las páginas de admin no usan la tarjeta centrada de las páginas de
   cliente/login: necesitan ancho completo, así que se anula el centrado
   flex de <body> para ellas. */
body.admin-body {
    display: block;
    min-height: 100vh;
    padding: 2rem 1.5rem 3rem;
    box-sizing: border-box;
}

.admin-page {
    max-width: 1100px;
    margin: 0 auto;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: inline-block;
}

.brand-sub {
    font-size: 1rem;
    font-weight: 400;
    color: #999;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    color: #777;
    font-size: 0.95rem;
}

.btn-link {
    color: white;
    background-color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 18px;
    border: 1px solid var(--primary-color);
    border-radius: 50px;
    transition: 0.3s;
    font-size: 0.9rem;
}

.btn-link:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-link-ghost {
    color: var(--primary-color);
    background-color: transparent;
}

.btn-link-ghost:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Tarjetas de resumen */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border: 1px solid var(--accent-color);
    border-radius: 16px;
    padding: 1.2rem 1.4rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary-color);
    line-height: 1.1;
}

.stat-card .stat-label {
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card-highlight {
    border-color: var(--primary-color);
    background-color: #fff7f2;
}

.stat-card-highlight .stat-value {
    color: var(--primary-color);
}

/* Tarjeta contenedora del listado */
.card {
    background: white;
    border: 1px solid var(--accent-color);
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    box-sizing: border-box;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.card-header h2 {
    margin: 0;
}

.search-input {
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 50px;
    width: 260px;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 0.9rem;
}

.empty-state {
    color: #999;
    text-align: center;
    padding: 1.5rem 0;
}

/* Tabla de clientes */
.table-wrap {
    overflow-x: auto;
    max-width: 100%;
}

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

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--accent-color);
    white-space: nowrap;
}

.admin-table th {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.admin-table tbody tr:hover {
    background-color: var(--bg-color);
}

.admin-table tbody tr.row-highlight {
    background-color: #fff7f2;
}

.client-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: var(--accent-color);
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 10px;
    border-radius: 50px;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.visit-dots.small {
    margin: 0;
    gap: 5px;
    justify-content: flex-start;
}

.visit-dots.small .dot {
    width: 12px;
    height: 12px;
}

@media (max-width: 640px) {
    .admin-table th,
    .admin-table td {
        white-space: normal;
    }
}
