:root {
    --primary: #009EE3;
    --primary-dark: #0077aa;
    --secondary: #bb86fc;
    --bg-dark: #121212;
    --bg-card: #1e1e1e;
    --text-main: #ffffff;
    --text-muted: #aaaaaa;
    --danger: #ff5252;
    --success: #00c853;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Utilities */
.hidden { display: none !important; }
.active { display: flex !important; }

/* Header */
header {
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-logo {
    height: 40px;
    border-radius: 8px;
}

.logo-container h1 {
    font-size: 1.2rem;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.header-subscription-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 20px;
    margin-right: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.header-subscription-info .plan-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    margin: 0;
}

@media (max-width: 768px) {
    .header-subscription-info {
        display: none;
    }
}

.mini-badge-logo {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    object-fit: contain;
    background: #ffffff;
    padding: 2px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

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

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

.btn-secondary {
    background: #333;
    color: white;
    border: 1px solid #555;
}
.btn-secondary:hover { background: #444; }

.btn-large {
    padding: 15px 24px;
    font-size: 1.1rem;
    width: 100%;
}

.btn-full { width: 100%; }

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
}
.btn-icon:hover { color: var(--danger); }

.btn-outline-install {
    background: transparent;
    border: 1px dashed var(--primary);
    color: var(--primary);
    font-size: 0.9rem;
    padding: 10px 14px;
    border-radius: 8px;
    transition: all 0.2s;
}
.btn-outline-install:hover {
    background: rgba(0, 168, 255, 0.12);
}

/* Main Container */
#app-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.view {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Login Cards */
.login-card {
    background: var(--bg-card);
    padding: 30px 20px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    width: 100%;
    text-align: center;
    position: relative;
}

.login-logo {
    width: 80px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.login-card h2 { margin-bottom: 5px; }
.login-card .subtitle { color: var(--text-muted); margin-bottom: 30px; font-size: 0.9rem; }

.login-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #555;
    margin: 10px 0;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #444;
}
.divider span { padding: 0 10px; font-size: 0.9rem; }

/* Form inputs */
.input-group {
    display: flex;
    flex-direction: column;
    text-align: left;
    margin-bottom: 15px;
}
.input-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}
.input-group input,
.input-group select {
    background: #121212;
    border: 1px solid #444;
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    width: 100%;
    color-scheme: dark;
}
.input-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23009EE3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}
.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 158, 227, 0.2);
}
.input-group select option {
    background: #1e1e1e;
    color: white;
    padding: 8px;
}

.btn-back {
    position: absolute;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

/* Tarjeta de Guardia Recordado (Acceso Rápido PIN) */
.guard-welcome-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 158, 227, 0.12);
    border: 1px solid rgba(0, 158, 227, 0.35);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 20px;
    text-align: left;
}

.guard-welcome-icon {
    background: rgba(0, 158, 227, 0.2);
    color: var(--primary);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.guard-welcome-icon .material-icons {
    font-size: 22px;
}

.guard-welcome-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.guard-welcome-info strong {
    font-size: 0.95rem;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guard-welcome-info span {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-text-link {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 6px;
    white-space: nowrap;
}
.btn-text-link:hover {
    color: #ffffff;
}

/* Campo de PIN Seguro sin activar el Administrador de Contraseñas de Google */
.pin-input {
    -webkit-text-security: disc !important;
    text-security: disc !important;
    letter-spacing: 10px;
    text-align: center;
    font-size: 1.4rem !important;
    font-weight: bold;
}

/* Camera View */
.camera-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 3/4;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
}

#camera-feed {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
}

.overlay-info {
    color: white;
    font-size: 0.8rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.camera-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    display: flex;
    justify-content: center;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

.btn-capture {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    border: 4px solid white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.btn-capture:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-capture .inner-circle {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: white;
    transition: transform 0.1s;
}
.btn-capture:active .inner-circle { transform: scale(0.9); }

/* Preview View */
.preview-container {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
#photo-preview {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
.preview-actions {
    display: flex;
    gap: 10px;
}
.preview-actions .btn { flex: 1; }

/* Admin Dashboard */
#admin-view {
    max-width: 960px;
    width: 100%;
    align-items: stretch;
}
.admin-dashboard {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.tab-content {
    width: 100%;
}
.tab-content.active {
    display: flex !important;
    flex-direction: column !important;
    width: 100%;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}
.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    width: 100%;
}
.filters input, .filters select {
    background: var(--bg-card);
    border: 1px solid #444;
    color: white;
    padding: 12px;
    border-radius: 8px;
    flex: 1;
    font-size: 0.95rem;
    font-family: inherit;
}
.filters select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23009EE3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}
.filters input:focus, .filters select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 158, 227, 0.2);
}
.filters select option {
    background: #1e1e1e;
    color: white;
    padding: 8px;
}

.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}

/* Report Card */
.report-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.report-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.25s ease, filter 0.25s ease;
}
.report-card img:hover {
    transform: scale(1.02);
    filter: brightness(1.08);
}
.report-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.report-info h3 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    color: var(--secondary);
}
.report-info p {
    margin: 2px 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Enlace a Google Maps */
.btn-maps-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 200, 83, 0.15);
    color: var(--success);
    border: 1px solid rgba(0, 200, 83, 0.4);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    margin-top: 8px;
    transition: all 0.2s ease;
    width: fit-content;
}
.btn-maps-link:hover {
    background: rgba(0, 200, 83, 0.25);
    border-color: var(--success);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 200, 83, 0.2);
}
.btn-maps-link .material-icons {
    font-size: 18px;
}

/* Guard List Items */
.guard-item {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.guard-details h4 {
    margin: 0 0 5px 0;
    color: white;
}
.guard-details p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.guard-actions {
    display: flex;
    gap: 10px;
}
.badge-active {
    background: rgba(0, 200, 83, 0.2);
    color: var(--success);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}
.badge-inactive {
    background: rgba(255, 82, 82, 0.2);
    color: var(--danger);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Banner de Código / Nombre de Empresa */
.company-code-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    background: rgba(0, 158, 227, 0.12);
    border: 1px solid rgba(0, 158, 227, 0.35);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.banner-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Uploader de Logo de Empresa */
.company-logo-uploader {
    position: relative;
    cursor: pointer;
    width: 65px;
    height: 65px;
    border-radius: 12px;
    overflow: hidden;
    background: #181818;
    border: 2px dashed rgba(0, 158, 227, 0.5);
    flex-shrink: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-logo-uploader:hover {
    border-color: var(--primary);
    transform: scale(1.04);
    box-shadow: 0 4px 15px rgba(0, 158, 227, 0.3);
}

.company-banner-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
    padding: 2px;
}

.logo-upload-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 0;
}

.logo-upload-badge .material-icons {
    font-size: 16px;
    color: #ffffff;
}

.logo-hint {
    font-size: 0.75rem;
    color: var(--primary);
    margin-top: 4px;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
}
.logo-hint:hover {
    color: #ffffff;
}

.banner-icon {
    font-size: 32px;
    color: var(--primary);
    background: rgba(0, 158, 227, 0.2);
    padding: 10px;
    border-radius: 12px;
}

.banner-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.banner-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

#display-company-name {
    font-size: 1.25rem;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
    border-radius: 8px;
    white-space: nowrap;
}

.input-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Modal Overlay & Card */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 25px;
    width: 100%;
    max-width: 440px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(15px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.modal-icon {
    font-size: 28px;
    color: var(--primary);
}

.modal-card h3 {
    font-size: 1.25rem;
    color: white;
}

.modal-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
    text-align: left;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Visor Lightbox para Fotos Ampliadas */
.image-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 15px;
    user-select: none;
    animation: imageModalFadeIn 0.22s ease-out;
}

@keyframes imageModalFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.image-modal-container {
    position: relative;
    max-width: 95vw;
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.image-modal-container img {
    max-width: 100%;
    max-height: 76vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.image-modal-close {
    position: absolute;
    top: -46px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.image-modal-close:hover {
    background: var(--danger);
    transform: scale(1.1);
}

.image-modal-details {
    margin-top: 12px;
    background: rgba(25, 25, 25, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 18px;
    width: 100%;
    max-width: 650px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.image-modal-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}
.image-modal-info strong {
    font-size: 1rem;
    color: #ffffff;
}
.image-modal-info span {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.image-modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Utilidad Accesible para Select Oculto */
.hidden-accessible {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Selector Visual de Roles en Modal de Equipo */
.role-selector-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
    width: 100%;
}

.role-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 15px;
    background: #141416;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    position: relative;
    text-align: left;
}

.role-card:hover {
    border-color: rgba(0, 158, 227, 0.45);
    background: #191b22;
    transform: translateY(-1px);
}

.role-card.active {
    background: rgba(0, 158, 227, 0.12);
    border-color: var(--primary);
    box-shadow: 0 0 16px rgba(0, 158, 227, 0.22);
}

.role-card-radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #555;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.2s ease;
}

.role-card.active .role-card-radio {
    border-color: var(--primary);
}

.radio-inner {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    transform: scale(0);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.role-card.active .radio-inner {
    transform: scale(1);
}

.role-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.role-card-icon .material-icons {
    font-size: 22px;
}

.role-card.active .role-card-icon {
    background: rgba(0, 158, 227, 0.2);
    color: var(--primary);
}

.role-card-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.role-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #ffffff;
}

.role-card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.role-card.active .role-card-desc {
    color: #cbd5e1;
}

/* Checkbox estilizado para permisos de equipo */
.custom-checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #141416;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.88rem;
    color: #e2e8f0;
    transition: all 0.2s ease;
    margin-top: 4px;
    user-select: none;
    width: 100%;
}

.custom-checkbox-label:hover {
    background: #181920;
    border-color: rgba(255, 255, 255, 0.18);
}

.custom-checkbox-label input[type="checkbox"] {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

/* --- Panel de Suscripción & Pagos --- */
.subscription-plan-card {
    background: linear-gradient(135deg, rgba(187, 134, 252, 0.12) 0%, rgba(30, 30, 35, 0.95) 100%);
    border: 1px solid rgba(187, 134, 252, 0.3);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.plan-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.plan-badge-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(187, 134, 252, 0.2);
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.plan-badge-icon .material-icons {
    font-size: 26px;
}

.plan-header-text h3 {
    font-size: 1.15rem;
    color: var(--secondary);
    margin-bottom: 4px;
}

.plan-info-text {
    font-size: 0.92rem;
    color: #e2e8f0;
    line-height: 1.5;
}

.usage-progress-container {
    width: 100%;
}

.usage-progress-bar {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    height: 10px;
    border-radius: 6px;
    overflow: hidden;
}

.usage-bar-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.4s ease, background-color 0.3s ease;
}

.usage-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Tarjeta Principal de Pago y Transferencia */
.payment-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 25px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45);
    text-align: left;
}

.payment-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.payment-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(0, 158, 227, 0.15);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.payment-header-icon .material-icons {
    font-size: 24px;
}

.payment-card-header h4 {
    font-size: 1.2rem;
    color: #ffffff;
    margin-bottom: 2px;
}

.section-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Grid de Datos Bancarios */
.bank-info-container {
    margin-bottom: 20px;
}

.bank-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 12px 0;
}

.bank-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.bank-item-card {
    background: #14151a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all 0.2s ease;
}

.bank-item-card:hover {
    border-color: rgba(0, 158, 227, 0.35);
    background: #181920;
}

.bank-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.bank-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.bank-value {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 1.05rem;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: all;
}

.btn-copy-bank {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 158, 227, 0.12);
    color: var(--primary);
    border: 1px solid rgba(0, 158, 227, 0.35);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-copy-bank .material-icons {
    font-size: 16px;
}

.btn-copy-bank:hover {
    background: rgba(0, 158, 227, 0.25);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.btn-copy-bank.copied {
    background: rgba(0, 200, 83, 0.2);
    border-color: var(--success);
    color: var(--success);
}

.bank-instructions-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 14px;
    font-size: 0.88rem;
    color: #cbd5e1;
    line-height: 1.5;
}

.bank-info-icon {
    font-size: 20px;
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.instructions-title {
    font-weight: 600;
    color: #ffffff;
    display: block;
    margin-bottom: 2px;
}

.instructions-text {
    margin: 0;
    color: var(--text-muted);
}

/* Divisor de Pago */
.payment-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #71717a;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    margin: 24px 0 20px 0;
}

.payment-divider::before,
.payment-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.payment-divider span {
    padding: 0 14px;
}

/* Formulario de Pago */
.payment-form-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.payment-form-icon-wrapper {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(0, 158, 227, 0.12);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.payment-form-icon-wrapper .material-icons {
    font-size: 20px;
}

.payment-form-header h5 {
    font-size: 1.05rem;
    color: #ffffff;
    margin-bottom: 2px;
}

.form-help-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}

.payment-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Dropzone de Carga de Comprobante */
.hidden-file-input {
    display: none !important;
}

.file-upload-card {
    background: #14151a;
    border: 2px dashed rgba(0, 158, 227, 0.4);
    border-radius: 14px;
    padding: 16px;
    transition: all 0.22s ease;
    margin-top: 4px;
}

.file-upload-card:hover {
    border-color: var(--primary);
    background: rgba(0, 158, 227, 0.05);
}

.file-upload-content {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    width: 100%;
}

.file-upload-icon-wrapper {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: rgba(0, 158, 227, 0.15);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.file-upload-card:hover .file-upload-icon-wrapper {
    transform: scale(1.05);
    background: rgba(0, 158, 227, 0.25);
}

.file-icon {
    font-size: 26px;
}

.file-upload-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    text-align: left;
}

.file-upload-text strong {
    font-size: 0.95rem;
    color: #ffffff;
}

.file-upload-text span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-browse-file {
    background: rgba(0, 158, 227, 0.18);
    color: var(--primary);
    border: 1px solid rgba(0, 158, 227, 0.4);
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.file-upload-card:hover .btn-browse-file {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.file-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(0, 200, 83, 0.12);
    border: 1px solid rgba(0, 200, 83, 0.4);
    border-radius: 10px;
    padding: 10px 14px;
}

.file-preview-info {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.file-success-icon {
    color: var(--success);
    font-size: 22px;
    flex-shrink: 0;
}

.file-preview-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-file-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-file-clear:hover {
    color: var(--danger);
    background: rgba(255, 82, 82, 0.15);
}

.btn-file-clear .material-icons {
    font-size: 20px;
}

/* Grid de Campos Fecha y Monto */
.form-row-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.btn-submit-payment {
    margin-top: 8px;
    padding: 14px 20px;
    font-size: 1.05rem;
    box-shadow: 0 4px 18px rgba(0, 158, 227, 0.35);
}

.btn-submit-payment:hover {
    box-shadow: 0 6px 24px rgba(0, 158, 227, 0.5);
    transform: translateY(-1px);
}

/* Animación de Giro para Indicadores de Carga */
@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.spin-animation {
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* ============================== */
/* MODALES DE PLANES (SÚPER ADMIN) */
/* ============================== */

/* Modal ancho para formularios más complejos */
.modal-card-wide {
    max-width: 560px;
    width: 95%;
}

/* Campos condicionales de prueba / mensual */
#sa-plan-campos-prueba,
#sa-plan-campos-mensual {
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

/* Selector input type="month" en modo oscuro */
input[type="month"] {
    color-scheme: dark;
}

/* Caja informativa del plan de prueba */
.plan-trial-info-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(255, 193, 7, 0.08);
    border: 1px solid rgba(255, 193, 7, 0.25);
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 8px;
    color: #ffca28;
    font-size: 0.85rem;
    line-height: 1.5;
}
.plan-trial-info-box .material-icons {
    font-size: 1.3rem;
    margin-top: 2px;
    flex-shrink: 0;
}
.plan-trial-info-box p {
    margin: 0;
    color: #ccc;
}
.plan-trial-info-box strong {
    color: #ffca28;
}

/* ============================== */
/* HISTORIAL DE PRECIOS - TABLA   */
/* ============================== */
.history-table-container {
    max-height: 300px;
    overflow-y: auto;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 20px;
}

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

.history-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.history-table th {
    background: rgba(255, 255, 255, 0.06);
    color: #aaa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.history-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #ddd;
}

.history-table tr:last-child td {
    border-bottom: none;
}

.history-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

/* Badge de "Vigente" */
.badge-vigente {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(76, 175, 80, 0.15);
    color: #66bb6a;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}
.badge-vigente .material-icons {
    font-size: 0.85rem;
}

/* Sección de nuevo precio */
.history-new-price-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px 20px;
}

.history-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-size: 0.95rem;
    margin: 0 0 14px 0;
}
.history-section-title .material-icons {
    font-size: 1.2rem;
}

/* ============================== */
/* BADGES DE PLAN EN LISTA SA     */
/* ============================== */
.plan-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.plan-type-badge.badge-mensual {
    background: rgba(33, 150, 243, 0.15);
    color: #42a5f5;
}

.plan-type-badge.badge-prueba {
    background: rgba(255, 193, 7, 0.15);
    color: #ffca28;
}

.plan-type-badge.badge-whatsapp {
    background: rgba(37, 211, 102, 0.15);
    color: #25D366;
}

/* Botón de historial en la lista de planes */
.btn-icon-small {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #aaa;
    cursor: pointer;
    padding: 6px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-icon-small:hover {
    background: rgba(0, 158, 227, 0.15);
    color: var(--primary);
    border-color: rgba(0, 158, 227, 0.3);
}
.btn-icon-small .material-icons {
    font-size: 1.1rem;
}

/* Observación / Novedad en Cámara */
.observacion-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto 12px auto;
    padding: 0 12px;
    box-sizing: border-box;
}

.observacion-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 4px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.observacion-label .material-icons {
    font-size: 1.05rem;
    color: var(--primary);
}

.input-observacion {
    width: 100%;
    background: rgba(18, 26, 38, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #fff;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-family: inherit;
    resize: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-observacion:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 158, 227, 0.25);
}

.observacion-counter {
    display: block;
    text-align: right;
    font-size: 0.7rem;
    color: #aaa;
    margin-top: 2px;
}

/* Botón WhatsApp */
.btn-whatsapp {
    background: #25D366;
    color: #fff;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn-whatsapp:hover {
    background: #1DA851;
}

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






