/* ============================================================
   Mi Internet — Sistema de Gestión de Instalaciones
   Mobile-First CSS
   Colores: #00B73B (verde principal), #FFFFFF (blanco)
   ============================================================ */

:root {
    --color-primary:      #00B73B;
    --color-primary-dark: #009830;
    --color-primary-light:#e6f9ec;
    --color-white:        #FFFFFF;
    --color-bg:           #F4F7F4;
    --color-text:         #212529;
    --color-muted:        #6c757d;
    --touch-target:       48px;
    --border-radius:      0.75rem;
    --shadow-card:        0 2px 8px rgba(0,0,0,0.08);
}

/* ---- Reset base ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
    background-color: var(--color-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    color: var(--color-text);
    -webkit-tap-highlight-color: transparent;
}

/* ---- Bootstrap overrides — color principal ---- */
.bg-primary-brand           { background-color: var(--color-primary) !important; }
.text-primary-brand         { color: var(--color-primary) !important; }
.border-primary-brand       { border-color: var(--color-primary) !important; }

.btn-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    min-height: var(--touch-target);
    font-weight: 600;
}
.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
}
.btn-outline-primary {
    color: var(--color-primary);
    border-color: var(--color-primary);
    min-height: var(--touch-target);
}
.btn-outline-primary:hover {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}
.btn { min-height: var(--touch-target); border-radius: 0.5rem; }
.btn-sm { min-height: 36px; }

a { color: var(--color-primary); }
a:hover { color: var(--color-primary-dark); }

/* ---- Navbar ---- */
.navbar.bg-primary-brand .navbar-brand { color: #fff; }
.logo-nav { object-fit: contain; }

/* ---- Bottom nav ---- */
.bottom-nav {
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    z-index: 1030;
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--color-muted);
    font-size: 0.7rem;
    gap: 2px;
    padding: 6px 12px;
    border-radius: 0.5rem;
    transition: color 0.15s;
    min-width: 56px;
}
.bottom-nav-item i {
    font-size: 1.35rem;
    line-height: 1;
}
.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--color-primary);
}
.pb-nav { padding-bottom: 72px; }

/* ---- Cards de instalación ---- */
.instalacion-card {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--color-primary);
    cursor: pointer;
    transition: box-shadow 0.15s;
}
.instalacion-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.instalacion-card .cliente-nombre {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 2px;
}
.instalacion-card .meta {
    font-size: 0.82rem;
    color: var(--color-muted);
}
.instalacion-card.estado-pendiente  { border-left-color: #ffc107; }
.instalacion-card.estado-en_proceso { border-left-color: #0d6efd; }
.instalacion-card.estado-finalizada { border-left-color: var(--color-primary); }

/* ---- Formulario multi-paso ---- */
.step-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #dee2e6;
    transition: background 0.2s;
}
.step-dot.active  { background: var(--color-primary); transform: scale(1.3); }
.step-dot.done    { background: var(--color-primary-dark); }

.form-step { display: none; }
.form-step.active { display: block; }

.step-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-primary-light);
}

/* ---- Inputs táctiles ---- */
.form-control,
.form-select {
    min-height: var(--touch-target);
    border-radius: 0.5rem;
    font-size: 1rem;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(0,183,59,0.2);
}
label.form-label { font-weight: 600; margin-bottom: 4px; }

/* ---- Firma digital ---- */
.signature-container {
    border: 2px dashed var(--color-primary);
    border-radius: var(--border-radius);
    background: #fff;
    padding: 4px;
    position: relative;
}
#signature-canvas {
    width: 100%;
    height: 180px;
    display: block;
    touch-action: none;
    cursor: crosshair;
}
.signature-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ccc;
    font-size: 0.875rem;
    pointer-events: none;
    text-align: center;
}

/* ---- Zona de carga de archivos ---- */
.upload-zone {
    border: 2px dashed var(--color-primary);
    border-radius: var(--border-radius);
    padding: 1.5rem 1rem;
    text-align: center;
    background: var(--color-primary-light);
    transition: background 0.2s;
    cursor: pointer;
}
.upload-zone:hover,
.upload-zone.dragover { background: #c8f2d8; }
.upload-zone i { font-size: 2rem; color: var(--color-primary); }

.archivo-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-card);
    font-size: 0.875rem;
}
.archivo-item i { font-size: 1.4rem; color: var(--color-primary); flex-shrink: 0; }
.archivo-item .nombre { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archivo-item .remove-btn {
    color: #dc3545;
    border: none;
    background: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* ---- Geolocalización ---- */
.geo-status {
    font-size: 0.8rem;
    margin-top: 4px;
}

/* ---- Login ---- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    padding: 1rem;
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    padding: 2rem 1.75rem;
}
.login-logo {
    display: block;
    margin: 0 auto 1.5rem;
    max-width: 180px;
}

/* ---- Sección de detalle ---- */
.detail-section {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    padding: 1rem;
    margin-bottom: 1rem;
}
.detail-section .section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-primary);
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-primary-light);
}
.detail-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--color-muted); flex: 0 0 45%; font-weight: 500; }
.detail-value { flex: 1; word-break: break-word; }

/* ---- Thumbnails de archivos ---- */
.file-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 2px solid #eee;
}
.file-thumb-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* ---- Tabla admin ---- */
@media (max-width: 768px) {
    .table-responsive-cards table,
    .table-responsive-cards thead,
    .table-responsive-cards tbody,
    .table-responsive-cards th,
    .table-responsive-cards td,
    .table-responsive-cards tr { display: block; }
    .table-responsive-cards thead tr { display: none; }
    .table-responsive-cards td {
        border: none;
        padding: 4px 0;
    }
    .table-responsive-cards td::before {
        content: attr(data-label);
        font-weight: 700;
        margin-right: 8px;
        color: var(--color-muted);
        font-size: 0.8rem;
    }
    .table-responsive-cards tr {
        background: #fff;
        border-radius: var(--border-radius);
        box-shadow: var(--shadow-card);
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }
}

/* ---- Badge estados ---- */
.badge { font-size: 0.8rem; padding: 0.4em 0.7em; }
.badge.bg-success { background-color: var(--color-primary) !important; }

/* ---- Misc ---- */
.page-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 1rem;
}
.card { border-radius: var(--border-radius); border: none; box-shadow: var(--shadow-card); }
.card-header { background-color: var(--color-primary-light); border-bottom: 1px solid #c3e6cb; font-weight: 700; }
hr { border-color: var(--color-primary-light); }

/* Spinner de carga */
.spinner-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
}

/* Progress upload */
.upload-progress { height: 6px; border-radius: 4px; }

@media (min-width: 768px) {
    .container-fluid { max-width: 720px; margin: 0 auto; }
}
