/* ===== CLIENT FORM STYLES ===== */

body {
    margin: 0;
    font-family: 'Barlow', 'Segoe UI', sans-serif;
    background-color: #f4f6f8;
}

/* === NAVBAR === */
.navbar {
    background-color: #1f2937;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar .logo {
    font-weight: bold;
    font-size: 1.2rem;
}

.navbar .nav-links {
    display: flex;
    gap: 1rem;
}

.navbar .nav-links a,
.navbar form button {
    color: white;
    text-decoration: none;
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
    padding: 0.5rem 0.8rem;
    transition: background 0.2s;
}

.navbar .nav-links a:hover,
.navbar form button:hover {
    background-color: #374151;
    border-radius: 6px;
}

/* === FORMULARIO === */
.form-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.form-container h1,
.form-container h2,
.form-container h3 {
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-row > div {
    flex: 1;
    min-width: 250px;
}

form .form-group {
    margin-bottom: 1.2rem;
}

label {
    font-weight: 600;
    margin-bottom: 0.3rem;
    display: block;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 1rem;
    box-sizing: border-box;
}

.password-input {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input__field {
    width: 100%;
    padding-right: 2.75rem;
}

.password-input__toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

.password-input__toggle[aria-pressed="true"] {
    color: #0f766e;
}

.password-feedback {
    margin-top: 0.75rem;
}

.password-feedback__rules {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0.5rem;
    font-size: 0.9rem;
}

.password-feedback__rules li {
    position: relative;
    padding-left: 1.4rem;
    margin-bottom: 0.2rem;
    color: #6b7280;
}

.password-feedback__rules li::before {
    content: 'x';
    position: absolute;
    left: 0;
    color: #b91c1c;
}

.password-feedback__rules li[data-rule-status="valid"] {
    color: #0f766e;
}

.password-feedback__rules li[data-rule-status="valid"]::before {
    content: 'v';
    color: #0f766e;
}

.password-feedback__strength[data-strength="is-weak"] {
    color: #b91c1c;
}

.password-feedback__strength[data-strength="is-medium"] {
    color: #b45309;
}

.password-feedback__strength[data-strength="is-strong"] {
    color: #0f766e;
}

.password-feedback__strength[data-strength="is-pending"] {
    color: #6b7280;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

button[type="submit"],
.btn-primary {
    background-color: #0066cc;
    color: white;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

button[type="submit"]:hover,
.btn-primary:hover {
    background-color: #004a99;
}

.btn-link {
    color: #0066cc;
    text-decoration: none;
    margin-top: 1rem;
    display: inline-block;
}

.btn-link:hover {
    text-decoration: underline;
}

/* === TABLAS === */
.table-wrapper {
    max-width: 100%;
    margin: 2rem auto;
    overflow-x: auto;
    padding: 0 1rem;
}

@media (min-width: 1024px) {
    .table-wrapper {
        max-width: 1400px; /* o incluso 1600px si lo deseas */
    }
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 8px rgba(0,0,0,0.05);
    table-layout: auto;
}

thead {
    background-color: #e5e7eb;
    font-weight: bold;
}

thead th {
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid #d1d5db;
}

tbody td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

tbody tr:hover {
    background-color: #f9fafb;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.actions form {
    display: inline;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }

    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .navbar .nav-links {
        flex-direction: column;
        width: 100%;
    }

    table {
        font-size: 0.9rem;
    }

    thead {
        display: none;
    }

    tbody td {
        display: block;
        padding: 0.6rem 0.8rem;
    }

    tbody tr {
        display: block;
        margin-bottom: 1rem;
        background-color: white;
        border-radius: 6px;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    }

    tbody td::before {
        content: attr(data-label);
        font-weight: bold;
        display: block;
        margin-bottom: 0.4rem;
    }
}

.nav-user {
    margin-right: 1rem;
    font-weight: 500;
    font-size: 0.95rem;
    color: #d1d5db;
}

/* === BOTONES BONITOS === */
.btn {
    display: inline-block;
    font-size: 1rem;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.btn-primary {
    background-color: #0066cc;
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: #004a99;
}

.btn-secondary {
    background-color: #e5e7eb;
    color: #111827;
    border: none;
}

.btn-secondary:hover {
    background-color: #d1d5db;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
    border: none;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.address-box {
    background-color: #f9fafb;
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid #3b82f6;
    margin-bottom: 2rem;
}

.address-text {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #111827;
}

/* === PAGINADOR === */
.pagination-container {
    text-align: center;
    margin-top: 2rem;
}

.pagination {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination li {
    display: inline;
}

.pagination a {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    text-decoration: none;
    color: #111827;
    transition: all 0.2s ease-in-out;
}

.pagination a:hover {
    background-color: #e5e7eb;
    color: #000;
}

.pagination .active a,
.pagination li.active a {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

@media (max-width: 600px) {
    .pagination {
        justify-content: center;
        gap: 0.3rem;
    }

    .pagination a {
        font-size: 0.85rem;
        padding: 0.4rem 0.7rem;
    }
}


/* === ENCABEZADO DE PÁGINA === */
.page-header {
    max-width: 1000px;
    margin: 2rem auto 1rem auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0 1rem;
}

.page-header h1 {
    font-size: 1.8rem;
    margin: 0;
    color: #111827;
}

.page-header .btn {
    white-space: nowrap;
}

/* === TD lista de supplies === */

.supply-list {
    list-style: disc;
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.95rem;
}

.supply-list li {
    margin-bottom: 0.2rem;
}

/* === BOTÓN CANCELAR === */
.btn.btn-cancel {
    background-color: #dc2626;
    color: white;
    border: none;
}

.btn.btn-cancel:hover {
    background-color: #b91c1c;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    max-width: 600px;
    margin: 3rem auto;
}

.stripe-card-element {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    background-color: #fff;
    width: 100%;
    box-sizing: border-box;
    font-size: 1rem;
    line-height: 1.4;
}

.StripeElement--focus,
.stripe-card-element:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.2);
    outline: none;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.empty-message {
    font-size: 1rem;
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* o incluso 0.75rem si se sienten muy juntos */
    flex-wrap: wrap;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

.btn-icon {
    font-size: 1.1rem;
    padding: 0.5rem 0.7rem; /* Aumentamos un poco el padding */
    line-height: 1;
    text-align: center;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 6px;
}

.btn-icon.btn-secondary {
    background-color: #e5e7eb;
    color: #111827;
}

.btn-icon.btn-secondary:hover {
    background-color: #d1d5db;
}

.btn-icon.btn-cancel {
    background-color: #dc2626;
    color: white;
}

.btn-icon.btn-cancel:hover {
    background-color: #b91c1c;
}

.search-container {
    text-align: center;
}

.search-bar {
    display: inline-block;
    width: auto;
}

.search-bar input.form-control {
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

/* Dropdown dentro del navbar */
.dropdown {
    position: relative;
}

.dropdown-toggle::after {
    content: ' ▼';
    font-size: 0.6rem;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 38px;
    left: 0;
    background-color: #1b3a61;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 1000;
    padding: 10px 0;
    border-radius: 4px;
    min-width: 180px;
    flex-direction: column;
}

.dropdown-menu a {
    padding: 8px 16px;
    color: white;
    display: block;
    text-decoration: none;
}

.dropdown-menu a:hover {
    background-color: #2a5d9e;
}

.navbar .dropdown-toggle {
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
    color: white;
    text-decoration: none;
    padding: 0.5rem 0.8rem;
    transition: background 0.2s;
    display: inline-block;
}

/* Hover igual al resto */
.navbar .dropdown-toggle:hover {
    background-color: #374151;
    border-radius: 6px;
}

/* Opcional: quitar bordes redondeados y sombreado si se ve demasiado diferente */
.dropdown-menu {
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

/* Corrige el alineado para que esté al centro como los otros */
.navbar .dropdown {
    display: flex;
    align-items: center;
    position: relative;
}

.dropdown-menu {
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.item-form {
    position: relative;
    padding-right: 3rem; /* espacio para botón eliminar */
    background-color: #ffffff;
    border-radius: 8px;
}

.remove-item-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    background-color: #dc2626;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    z-index: 10;
}
.remove-item-btn:hover {
    background-color: #b91c1c;
}

.item-form {
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.item-form.removed {
    opacity: 0;
    transform: scale(0.95);
}

.btn-success {
    background-color: #10b981; /* verde tipo Tailwind */
    color: white;
    border: none;
}

.btn-success:hover {
    background-color: #059669;
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-wrapper i {
    position: absolute;
    left: 12px;
    color: #6b7280;
    font-size: 1rem;
    pointer-events: none; /* evita que el ícono bloquee el input */
}

.input-icon-wrapper input {
    padding-left: calc(1em + 24px); /* deja espacio para el icono */
}


/* Pildoras de estatus */
.badge-status{
    display:inline-block; padding:.25rem .5rem; border-radius:999px; font-size:.85rem;
    border:1px solid #d1d5db; background:#f3f4f6; color:#111827;
}
.badge-status.active{ background:#ecfdf5; color:#065f46; border-color:#a7f3d0; }
.badge-status.suspended{ background:#fff7ed; color:#92400e; border-color:#fed7aa; }
.badge-status.inactive{ background:#f3f4f6; color:#374151; border-color:#e5e7eb; }

/* Reutiliza la barrita del componente de card */
.sim-card__bar{ height:10px; background:#f3f4f6; border-radius:999px; overflow:hidden; border:1px solid #e5e7eb; }
.sim-card__bar-fill{ height:100%; background:#3b82f6; transition:width .25s ease; }
.sim-card__bar-fill.ok{ background:#10b981; }
.sim-card__bar-fill.warning{ background:#f59e0b; }
.sim-card__bar-fill.danger{ background:#ef4444; }


/* --- Accesibilidad de texto oculto --- */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,1px,1px); white-space: nowrap; border: 0;
}

/* Agrupar logo + botón */
.nav-left { display:flex; align-items:center; gap:.75rem; }

/* Botón hamburguesa (oculto en desktop) */
.navbar-toggle {
    display:none; /* se muestra en móvil */
    width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.2);
    background: transparent; color: white; border-radius: 8px; cursor: pointer;
    align-items:center; justify-content:center; padding:0; position: relative;
}
.navbar-toggle span {
    position:absolute; width: 20px; height: 2px; background: #fff; transition: transform .2s, opacity .2s, top .2s;
}
.navbar-toggle span:nth-child(1){ top: 12px; }
.navbar-toggle span:nth-child(2){ top: 19px; }
.navbar-toggle span:nth-child(3){ top: 26px; }
.navbar-toggle.is-open span:nth-child(1){ top: 19px; transform: rotate(45deg); }
.navbar-toggle.is-open span:nth-child(2){ opacity: 0; }
.navbar-toggle.is-open span:nth-child(3){ top: 19px; transform: rotate(-45deg); }

/* --- MODO MÓVIL --- */
@media (max-width: 768px){
    .navbar {
        padding: .75rem 1rem;
        gap: .5rem;
        flex-wrap: wrap;                /* permite que el menú baje */
    }

    .navbar .logo { font-size: 1rem; }  /* un pelín más compacto */

    .navbar-toggle { display: inline-flex; }

    /* El menú se oculta por defecto y aparece como bloque vertical */
    .navbar .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: .25rem;
        padding-top: .5rem;
        border-top: 1px solid rgba(255,255,255,.12);
    }
    .navbar .nav-links.is-open { display: flex; }

    .navbar .nav-links a,
    .navbar .nav-links form button {
        width: 100%;
        text-align: left;
        padding: .6rem .7rem;
        border-radius: 6px;
    }
}

/* --- MODO DESKTOP (se mantiene como lo tenías) --- */
@media (min-width: 769px){
    .navbar { justify-content: space-between; }
}


/**
RECARGAS
 */

.plan-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.plan-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: box-shadow .2s, border-color .2s;
}

.plan-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
}

.plan-card.active {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59,130,246,.3);
}

.plan-details {
    margin: .5rem 0 1rem 0;
    font-size: 1.1rem;
    color: #111827;
}

.price {
    font-weight: bold;
    color: #111827;
}

.saved-cards {
.saved-cards {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: .5rem;
    margin: 0 0 1rem 0;
}

.card-option {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    margin: .25rem 0;
}

.card-option input[type="radio"] {
    margin: 0;
    transform: scale(1.2);
    cursor: pointer;
}

.card-box {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: .5rem;
    padding: .8rem 1rem;
    border-radius: 8px;
    background: #f3f4f6;
    min-width: 240px;
    width: 100%;
    cursor: pointer;
    margin: .15rem 0;
}

.saved-card-option .card-box {
    justify-content: space-between;
}

.delete-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid #ef4444;
    background: #fef2f2;
    color: #b91c1c;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
    margin-left: auto;
}

.delete-card-btn:hover {
    background: #fee2e2;
    color: #991b1b;
    border-color: #dc2626;
}

.delete-card-btn i {
    font-size: 0.95rem;
}

.card-box__info {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.card-box.new-card-box {
    background: #e5e7eb;
}

.card-box i {
    font-size: 1.4rem;
    color: #374151;
}

#new-card-form {
    margin-top: 1rem;
}

/* === Barra de filtros === */

.filters-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

.filters-left,
.filters-right {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.filters-left input.form-control {
    width: 240px;
}

.filters-right select.form-control {
    width: 200px;
}

@media (max-width: 768px) {
    .filters-bar {
        flex-direction: column;
        align-items: center;
    }

    .filters-left,
    .filters-right {
        width: 100%;
        justify-content: center;
    }
}
}
