* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f4f7fb;
    color: #222;
    line-height: 1.5;
}

.container {
    width: min(1100px, 92%);
    margin: 0 auto;
}

.topbar {
    background: #1e3a5f;
    color: #fff;
    padding: 16px 0;
    margin-bottom: 24px;
}

.topbar-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    font-size: 1.4rem;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.nav a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

.auth-box,
.ticket-box,
.form,
.card,
.comment,
.table-wrap {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.form {
    display: grid;
    gap: 12px;
}

.form input,
.form textarea,
.form select,
.form button {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

.form button {
    background: #1e3a5f;
    color: #fff;
    border: none;
    cursor: pointer;
}

.form button:hover {
    opacity: 0.92;
}

.form input[type="file"] {
    padding: 10px;
    background: #fff;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: 20px;
}

.card h3 {
    margin-bottom: 10px;
    font-size: 1rem;
}

.card p {
    font-size: 2rem;
    font-weight: bold;
}

.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.success {
    background: #dff6e3;
    color: #166534;
}

.error {
    background: #fde2e2;
    color: #991b1b;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.comment {
    margin-bottom: 14px;
}

.ticket-box p,
.comment p {
    margin-bottom: 10px;
}

/* Galerías de imágenes */
.ticket-images,
.comment-images {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Miniaturas */
.ticket-images img,
.comment-images img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ticket-images img:hover,
.comment-images img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

/* Modal de imagen */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    padding: 20px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
}

.image-modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.image-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
}

.image-close:hover {
    opacity: 0.7;
}

/* Mensaje ticket cerrado */
.ticket-closed-message {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
    padding: 14px;
    border-radius: 10px;
    margin-top: 12px;
    margin-bottom: 20px;
}

/* Links de archivos PDF / docs */
.file-link {
    display: inline-block;
    padding: 10px 14px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    color: #1e3a5f;
    text-decoration: none;
    font-weight: bold;
    margin: 5px 10px 5px 0;
}

.file-link:hover {
    background: #dbeafe;
}

/* Formulario público */
.public-wrap {
    max-width: 900px;
    margin: 30px auto;
}

.section-title {
    margin: 20px 0 10px;
    font-size: 1.2rem;
    color: #1e3a5f;
}

.progress-wrap {
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    height: 16px;
    margin: 18px 0 24px;
}

.progress-bar {
    height: 16px;
    width: 0%;
    background: #1e3a5f;
    transition: width 0.3s ease;
}

.progress-text {
    margin-bottom: 12px;
    font-weight: bold;
    color: #1e3a5f;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.full {
    grid-column: 1 / -1;
}

.help {
    font-size: 0.9rem;
    color: #555;
    margin-top: -4px;
}

/* Header público */
.brand-public-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-public-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
    padding: 5px;
}

.brand-public-text {
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
}

.public-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.public-nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.public-cta {
    background: #fff;
    color: #1e3a5f !important;
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 800;
}

/* Footer público */
.public-footer {
    background: #111827;
    color: #fff;
    margin-top: 50px;
}

.public-footer-inner {
    padding: 30px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.public-footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.public-footer-brand img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
    padding: 5px;
}

.public-footer-brand p {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
}

.public-footer-social {
    display: flex;
    gap: 12px;
}

.public-footer-social a {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    text-decoration: none;
    transition: 0.2s ease;
}

.public-footer-social a:hover {
    background: #04777C;
    transform: translateY(-2px);
}

.public-footer-copy {
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 12px;
}

@media (max-width: 900px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .topbar-wrap {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 700px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .public-nav {
        justify-content: center;
        width: 100%;
    }

    .brand-public-link {
        justify-content: center;
    }

    .public-footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .public-footer-brand {
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    .cards {
        grid-template-columns: 1fr;
    }

    .nav {
        flex-direction: column;
        width: 100%;
    }

    .nav a {
        display: block;
        padding: 8px 0;
    }

    table th,
    table td {
        font-size: 0.9rem;
        padding: 10px;
    }

    .ticket-images img,
    .comment-images img {
        width: 80px;
        height: 80px;
    }

    .auth-box,
    .ticket-box,
    .form,
    .card,
    .comment,
    .table-wrap {
        padding: 16px;
    }
}