:root {
    --primary: #2C3E50;
    --primary-light: #34495E;
    --secondary: #95A5A6;
    --success: #27AE60;
    --danger: #E74C3C;
    --bg-color: #F8F9FA;
    --text-color: #333333;
    --card-bg: #FFFFFF;
    --border-color: #E2E8F0;
    --border-radius: 12px; /* Mayor radio para look de app */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --bottom-nav-height: 70px;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    /* Ajuste para el bottom nav en móviles */
    padding-bottom: var(--bottom-nav-height); 
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Authentication Layout */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 20px;
    background-color: #EDF2F7;
    padding-bottom: 20px; /* Sin nav bar aqui */
}

.auth-card {
    background: var(--card-bg);
    width: 100%;
    max-width: 420px;
    padding: 30px 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.auth-card h1, .auth-card h2 {
    text-align: center;
    margin-bottom: 24px;
    color: var(--primary);
    font-weight: 600;
}

.auth-logo {
    text-align: center;
    margin-bottom: 20px;
    font-size: 2rem;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: -1px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    color: #4A5568;
}

.form-control {
    width: 100%;
    padding: 14px 16px; /* Más grande para dedos */
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #FFFFFF;
    -webkit-appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234A5568' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* Buttons */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 14px 24px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    gap: 8px;
}

.btn:active {
    transform: scale(0.98);
}

.btn-danger { background-color: var(--danger); }
.btn-success { background-color: var(--success); }
.btn-secondary { background-color: var(--secondary); }

.btn-sm {
    padding: 10px 16px;
    font-size: 0.9rem;
    width: auto;
}

/* Floating Action Button (FAB) */
.fab {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 20px);
    right: 20px;
    width: 56px;
    height: 56px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    text-decoration: none;
    z-index: 100;
    transition: transform 0.2s;
}
.fab:active {
    transform: scale(0.9);
}

/* Alerts */
.alert {
    padding: 14px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

.alert-error {
    background-color: #FED7D7;
    color: #C53030;
    border: 1px solid #FEB2B2;
}

.alert-success {
    background-color: #C6F6D5;
    color: #2F855A;
    border: 1px solid #9AE6B4;
}

/* Dashboard Layout */
.dashboard-header {
    background-color: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.dashboard-header .brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-content {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.section-title {
    margin-bottom: 20px;
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 600;
}

/* Bottom Navigation (App-like) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background-color: #FFFFFF;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom); /* Para iPhones */
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #718096;
    text-decoration: none;
    width: 100%;
    height: 100%;
    font-size: 0.75rem;
    font-weight: 500;
    gap: 4px;
}

.nav-item i {
    font-size: 1.25rem;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active i {
    font-weight: 900;
}

/* Search Bar Mobile */
.search-container {
    background: #FFF;
    padding: 12px 20px;
    position: sticky;
    top: 60px; /* Debajo del header */
    z-index: 9;
    border-bottom: 1px solid var(--border-color);
    margin: -20px -20px 20px -20px; /* Para que ocupe todo el ancho en movil */
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #A0AEC0;
}

.search-input-wrapper input {
    padding-left: 44px;
    border-radius: 30px;
    background-color: #EDF2F7;
    border: none;
}

.search-input-wrapper input:focus {
    background-color: #FFF;
    border: 1px solid var(--primary);
}

/* Mobile Cards (Reemplazo de Tablas) */
.data-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.data-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.data-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    border-bottom: 1px solid #EDF2F7;
    padding-bottom: 12px;
}

.data-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
}

.data-card-subtitle {
    font-size: 0.85rem;
    color: #718096;
    margin-top: 4px;
}

.data-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
}

.data-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4A5568;
}

.data-row i {
    color: #A0AEC0;
    width: 16px;
    text-align: center;
}

.data-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #EDF2F7;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    text-decoration: none;
    color: white;
    font-size: 1.1rem;
}

.btn-edit { background-color: #E2E8F0; color: #4A5568; }
.btn-delete { background-color: #FED7D7; color: #C53030; }
.btn-whatsapp { background-color: #25D366; color: white; }

/* Desktop overrides (Por si lo abre en PC) */
@media (min-width: 768px) {
    body { padding-bottom: 0; padding-left: 250px; }
    
    .bottom-nav {
        top: 0;
        left: 0;
        width: 250px;
        height: 100vh;
        flex-direction: column;
        justify-content: flex-start;
        border-top: none;
        border-right: 1px solid var(--border-color);
        padding-top: 70px; /* Para dejar espacio al header teorico */
    }
    
    .nav-item {
        flex-direction: row;
        justify-content: flex-start;
        height: auto;
        padding: 16px 24px;
        font-size: 1rem;
        gap: 12px;
    }
    
    .nav-item i {
        font-size: 1.25rem;
        width: 24px;
        text-align: center;
    }

    .data-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }

    .fab {
        bottom: 40px;
        right: 40px;
    }
}
