/* ====================================================================
 * qmsnes.css — inside-GLPI (staff) pages.
 * Loaded globally via $PLUGIN_HOOKS[Hooks::ADD_CSS]['qmsnes'].
 * Focuses on responsive/compact behavior for the staff console,
 * service/window forms, ticket list and Supersalud report.
 * ==================================================================== */

/* ----------------------------------------------------------------------
 * Plugin top nav — horizontal pill bar with active state and role badge.
 * ---------------------------------------------------------------------- */
nav.qmsnes-nav {
    border-radius: 14px;
    border: 1px solid #e3e8f0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    padding: 12px 16px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}
.qmsnes-nav-inner {
    display: flex;
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
.qmsnes-nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #1d4ed8;
    font-size: 15px;
    padding-right: 6px;
    border-right: 1px solid #e3e8f0;
    margin-right: 4px;
}
.qmsnes-nav-brand .ti { font-size: 18px; }
.qmsnes-nav-items {
    display: inline-flex;
    flex-direction: row !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}
.qmsnes-nav-link {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: transparent;
    color: #475569;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s, transform 0.04s;
    border: 1px solid transparent;
}
.qmsnes-nav-link:hover {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #dbeafe;
}
.qmsnes-nav-link .ti { font-size: 16px; }
.qmsnes-nav-link.is-active {
    background: #1d4ed8;
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 4px 8px rgba(29, 78, 216, 0.20);
}
.qmsnes-nav-link.is-active:hover { background: #1e40af; }

.qmsnes-nav-role {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #ffffff;
}
.qmsnes-nav-role .ti { font-size: 14px; }
.qmsnes-role-superadmin { background: #c2185b; }
.qmsnes-role-supervisor { background: #f59e0b; }
.qmsnes-role-manager    { background: #10b981; }
.qmsnes-role-guest      { background: #6b7280; }

@media (max-width: 576px) {
    nav.qmsnes-nav { padding: 8px 10px; border-radius: 10px; }
    .qmsnes-nav-brand { font-size: 13px; border-right: 0; padding-right: 0; }
    .qmsnes-nav-link { font-size: 12px; padding: 6px 10px; }
    .qmsnes-nav-link .ti { font-size: 14px; }
    .qmsnes-nav-role { font-size: 10px; padding: 4px 8px; }
}

/* "Current ticket" big-number card — stack ticket label + action
 * buttons on narrow viewports so the buttons don't overlap the label. */
@media (max-width: 768px) {
    .card.p-3.bg-light .d-flex.justify-content-between {
        flex-direction: column;
        gap: 12px;
        align-items: stretch !important;
    }
    .card.p-3.bg-light form.d-flex { justify-content: stretch; flex-wrap: wrap; }
    .card.p-3.bg-light form .btn { flex: 1 1 0; }
}

/* "Reclamar ventanilla" + sede header — same flex/stack treatment. */
@media (max-width: 576px) {
    form.d-flex.gap-2.align-items-end {
        flex-direction: column;
        align-items: stretch !important;
    }
    form.d-flex.gap-2.align-items-end .form-select,
    form.d-flex.gap-2.align-items-end .form-control {
        width: 100% !important;
        max-width: none !important;
    }
}

/* "Call next" service buttons row — already flex-wrap; just make the
 * buttons taller and breathable for finger taps on a tablet. */
.d-flex.gap-2.flex-wrap.mb-4 .btn {
    min-height: 44px;
    padding: 10px 16px;
}

/* Waiting queue table — too many columns for mobile. Wrap with
 * horizontal scroll instead of letting it burst the container. */
table.table-sm {
    display: block;
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}
@media (min-width: 992px) {
    table.table-sm { display: table; overflow: visible; }
}

/* Empty-state alerts with a "+ Crear" button: keep the message and
 * the CTA on one line wide, stack them on narrow. */
@media (max-width: 576px) {
    .alert.d-flex.justify-content-between {
        flex-direction: column;
        gap: 8px;
        align-items: stretch !important;
    }
    .alert.d-flex.justify-content-between .btn { width: 100%; }
}

/* Supersalud report KPI cards — Bootstrap grid handles this, but
 * trim padding on tiny screens so 4 KPIs still read. */
@media (max-width: 576px) {
    .row.g-3.mb-4 .card.p-3 { padding: 12px !important; }
    .row.g-3.mb-4 .fs-2     { font-size: 1.4rem !important; }
    .row.g-3.mb-4 .text-muted.small { font-size: 11px; }
}

/* GLPI "Search::show" tables — same overflow treatment. */
.search_page table,
.search-table table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
}
@media (min-width: 992px) {
    .search_page table,
    .search-table table { display: table; overflow: visible; }
}
