@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@300;400;500;600;700&display=swap');

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

body {
    margin: 0;
    font-family: 'Barlow', system-ui, -apple-system, '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;
}

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;
}

.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 */
}



/* --- 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; }
}
