/* ================================
   CITOCONTROL 2 - GLOBAL STYLE
================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Arial, sans-serif;
}

body {
    background-color: #f4f6f9;
    color: #333;
}

.layout {
    display: flex;
    min-height: 100vh;
}

/* Main area */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    background: white;
    padding: 15px 25px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar .btn {
    font-size: 14px;
}

.content {
    padding: 25px;
}

/* Buttons */
.btn {
    padding: 8px 14px;
    background: #1976d2;
    color: white;
    border: none;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-logout {
    background: #c62828;
}

.btn-logout:hover {
    background: #8e0000;
}

.btn:hover {
    background: #125aa0;
}


/* Responsive */
@media (max-width: 768px) {
    .layout {
        flex-direction: column;
    }
}

/* =========================================
   DESIGN SYSTEM - CITOCONTROL 2
========================================= */

/* =========================
   COLORS SEMANTICOS
========================= */

.status-success { color: #2e7d32; font-weight: 600; }
.status-warning { color: #ed6c02; font-weight: 600; }
.status-danger  { color: #c62828; font-weight: 600; }
.status-info    { color: #1976d2; font-weight: 600; }
.status-neutral { color: #616161; }

/* =========================
   BADGES
========================= */

.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 20px;
    font-weight: 600;
    color: white;
}

.badge-success { background: #2e7d32; }
.badge-warning { background: #ed6c02; }
.badge-danger  { background: #c62828; }
.badge-info    { background: #1976d2; }
.badge-neutral { background: #757575; }

/* =========================
   TABLE STYLE
========================= */

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 6px;
    overflow: hidden;
}

.table thead {
    background: #f0f2f5;
}

.table th, 
.table td {
    padding: 12px 14px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.table th {
    font-weight: 600;
    color: #555;
}

.table tr:hover {
    background-color: #f9fafc;
}

/* =========================
   CARD COMPONENT
========================= */

.card {
    background: white;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card-header {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.card-body {
    font-size: 14px;
}

/* =========================
   FORM STYLE
========================= */

.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
    font-weight: 500;
    color: #444;
}

input, select, textarea {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    transition: 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25,118,210,0.15);
}

/* =========================
   ALERTAS
========================= */

.alert {
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 14px;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.alert-danger {
    background: #ffebee;
    color: #c62828;
}

.alert-warning {
    background: #fff3e0;
    color: #ed6c02;
}

.alert-info {
    background: #e3f2fd;
    color: #1976d2;
}

/* =========================
   BUTTON VARIANTS
========================= */

.btn-secondary {
    background: #616161;
}

.btn-success {
    background: #2e7d32;
}

.btn-warning {
    background: #ed6c02;
}

.btn-danger {
    background: #c62828;
}

.btn-secondary:hover { background: #424242; }
.btn-success:hover   { background: #1b5e20; }
.btn-warning:hover   { background: #e65100; }
.btn-danger:hover    { background: #8e0000; }

/* =========================
   SECTION TITLES
========================= */

.section-title {
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 600;
}

/* =========================
   SEPARATORS
========================= */

.divider {
    height: 1px;
    background: #eee;
    margin: 20px 0;
}

/* ================================
   BADGES CLÍNICOS
================================ */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.badge-positive {
    background: #fdecea;
    color: #c62828;
}

.badge-negative {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-process {
    background: #eceff1;
    color: #546e7a;
}

.badge-concordante {
    background: #e8f5e9;
    color: #1b5e20;
}

.badge-discordante {
    background: #ffebee;
    color: #b71c1c;
}

.badge-alerta {
    background: #fff3e0;
    color: #e65100;
}

.badge-estado {
    background: #e3f2fd;
    color: #0d47a1;
}

/* Tabla profesional */
.table-clinica {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table-clinica th {
    background: #f1f4f8;
    padding: 10px;
    text-align: left;
    font-size: 13px;
}

.table-clinica td {
    padding: 10px;
    border-top: 1px solid #eee;
    font-size: 13px;
}

.table-clinica .action-cell {
    min-width: 150px;
    white-space: nowrap;
}

.table-clinica .action-cell .btn {
    display: inline-block;
    margin: 2px 4px 2px 0;
    white-space: nowrap;
    min-width: max-content;
}

.table-clinica tr:hover {
    background: #f9fbfd;
}

/* =========================
   BREADCRUMB
========================= */

.breadcrumb {
    font-size: 13px;
    margin-bottom: 10px;
    color: #616161;
}

.breadcrumb a {
    text-decoration: none;
    color: #1976d2;
    font-weight: 500;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    font-weight: 500;
}

.breadcrumb-separator {
    margin: 0 6px;
    color: #999;
}

/* =========================
   CHECKBOX GRID - FORM CLÍNICO
========================= */

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px 30px;
    margin-top: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    line-height: 1.4;
}

.checkbox-item input[type="checkbox"] {
    margin: 0;
    width: auto;
    transform: scale(1.05);
}

/* =========================
   ALERTA CLÍNICA INLINE
========================= */

.alert-inline-error {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    color: #c62828;
    padding: 12px 15px;
    border-radius: 6px;
    margin: 15px 0;
    font-size: 14px;
    display: none;
}

/* =========================
   MODAL CONFIRMACION
========================= */

.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(31, 45, 61, 0.42);
}

.confirm-dialog {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(17, 38, 60, 0.24);
    padding: 20px;
}

.confirm-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2d3d;
    margin-bottom: 8px;
}

.confirm-text {
    font-size: 14px;
    line-height: 1.45;
    color: #546e7a;
    margin-bottom: 18px;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

/* =========================
   DASHBOARD CITOTECNOLOGIA
========================= */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.kpi-card {
    padding: 14px 16px;
    margin-bottom: 0;
}

.kpi-label {
    font-size: 12px;
    color: #546e7a;
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: #1f2d3d;
}

.toolbar-row {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.toolbar-title {
    font-size: 14px;
    font-weight: 600;
    color: #37474f;
}

.input-search {
    max-width: 360px;
    width: 100%;
}

.toolbar-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.inline-form {
    margin: 0;
}

.check-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #37474f;
}

.check-inline input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* =========================
   ADMIN ACCESS
========================= */

.admin-access-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.admin-access-card {
    display: block;
    min-height: 86px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e0e7ef;
    border-radius: 6px;
    color: #26384a;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(17, 38, 60, 0.06);
}

.admin-access-card:hover {
    border-color: #b8d4ef;
    background: #f8fbff;
}

.admin-access-card strong {
    display: block;
    font-size: 15px;
    margin-bottom: 6px;
}

.admin-access-card span {
    display: block;
    font-size: 12px;
    line-height: 1.35;
    color: #607d8b;
}

.admin-correction-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.admin-correction-wide {
    grid-column: 1 / -1;
}

.admin-correction-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px 18px;
    font-size: 14px;
}

/* =========================
   TABLA FILTROS MINIMALES
========================= */

.table-head-tools {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    min-height: 32px;
}

.table-head-actions {
    position: absolute;
    right: 0;
    top: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    z-index: 20;
}

.table-head-tools-overlay {
    position: relative !important;
    display: block !important;
    min-height: 0 !important;
}

.table-head-actions-overlay {
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    z-index: 50 !important;
}

.mini-menu {
    position: relative;
}

.mini-menu > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    background: #f5f8fb;
    border: 1px solid #d9e2ec;
    color: #34495e;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
}

.mini-menu > summary.mini-icon-btn {
    padding: 6px 10px;
    min-width: 84px;
    text-align: center;
    letter-spacing: 0.1px;
}

.mini-menu > summary::-webkit-details-marker {
    display: none;
}

.mini-menu[open] > summary {
    background: #eaf2fd;
    border-color: #b6cef0;
}

.mini-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 280px;
    background: #fff;
    border: 1px solid #e0e7ef;
    box-shadow: 0 8px 24px rgba(17, 38, 60, 0.14);
    border-radius: 10px;
    padding: 12px;
    z-index: 30;
}

.mini-form {
    display: grid;
    gap: 8px;
}

.mini-form label {
    margin-bottom: 0;
    font-size: 12px;
    color: #5c6b7a;
}

.mini-form-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.active-query {
    margin-top: 10px;
    padding: 8px 10px;
    background: #f8fbff;
    border: 1px solid #e1ecf8;
    border-radius: 8px;
    font-size: 13px;
}

.multi-filters-wrap {
    display: grid;
    gap: 8px;
}

.filter-row-ui {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 52px;
    gap: 8px;
}

.filter-row-remove-wrap .btn {
    width: 100%;
    padding: 8px 0;
}

.quick-filters {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.quick-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 14px;
    border: 1px solid #d3e0ef;
    background: #f8fbff;
    color: #35516e;
    font-size: 12px;
    text-decoration: none;
    font-weight: 600;
}

.quick-chip:hover {
    background: #eef5ff;
    border-color: #bfd5ef;
}

@media (max-width: 680px) {
    .table-head-tools {
        min-height: 0;
    }

    .table-head-actions,
    .table-head-actions-overlay {
        position: static;
        width: 100%;
        justify-content: flex-end;
    }

    .filter-row-ui {
        grid-template-columns: 1fr;
    }
}

/* =========================
   CARGUE RAPIDO LAB
========================= */
.quickload-card {
    padding: 12px;
}

.quickload-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.quickload-wrap {
    overflow: auto;
}

.quickload-table {
    min-width: 1600px;
}

.quickload-table input,
.quickload-table select {
    min-width: 130px;
}

.quickload-table .ql-row-num {
    font-weight: 600;
    color: #455a64;
}

.ql-check-cell {
    min-width: 170px;
    position: relative;
}

.ql-popover-wrap {
    position: relative;
}

.ql-popover-btn {
    padding: 6px 10px;
    font-size: 12px;
}

.ql-popover-panel {
    position: fixed;
    z-index: 2000;
    width: 280px;
    max-width: 320px;
    padding: 8px;
    border: 1px solid #dbe2e8;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.ql-check-list {
    margin-top: 6px;
    max-height: 140px;
    overflow: auto;
    display: grid;
    gap: 8px;
    padding-right: 2px;
}

.ql-check-list label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
    text-align: left;
}

.ql-check-list input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin-top: 1px;
    flex: 0 0 auto;
}

/* =========================
   LOGIN
========================= */

.login-page {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 15% 20%, rgba(25,118,210,0.14), transparent 35%),
        radial-gradient(circle at 80% 10%, rgba(46,125,50,0.1), transparent 32%),
        linear-gradient(160deg, #f4f7fb 0%, #ecf2f9 100%);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
}

.login-card {
    width: 100%;
    max-width: 460px;
    padding: 28px;
    border-radius: 12px;
    margin-bottom: 0;
}

.login-brand {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.3px;
    color: #0d47a1;
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 999px;
    padding: 5px 10px;
    margin-bottom: 10px;
}

.login-title {
    margin: 0;
    font-size: 26px;
    color: #1f2d3d;
}

.login-subtitle {
    margin-top: 6px;
    margin-bottom: 16px;
    color: #607d8b;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 14px;
}

.login-btn {
    width: 100%;
    margin-top: 4px;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* =========================
   INFORMES ADMIN
========================= */

.report-filter-grid {
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
}

.report-filter-card {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
    padding: 14px;
}

.report-filter-title {
    font-size: 14px;
    font-weight: 700;
    color: #37474f;
    margin-bottom: 10px;
}

.report-filter-grid .form-group {
    flex: 1 1 145px;
    margin-bottom: 0;
}

.report-filter-grid label {
    font-size: 12px;
    margin-bottom: 4px;
}

.report-filter-grid input,
.report-filter-grid select {
    min-height: 34px;
    padding: 6px 8px;
}

.report-filter-actions .btn {
    width: 100%;
    min-height: 34px;
    padding: 7px 12px;
    white-space: nowrap;
}

.report-filter-actions {
    flex: 0 0 150px !important;
}

.report-page {
    background: #fff;
    border-radius: 8px;
    padding: 34px;
    box-shadow: 0 2px 10px rgba(17, 38, 60, 0.08);
    max-width: 1180px;
    margin: 0 auto 32px;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e8edf3;
}

.report-header-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.report-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.report-brand img {
    width: 78px;
    height: auto;
    object-fit: contain;
}

.report-entity {
    font-size: 18px;
    font-weight: 700;
    color: #1f2d3d;
}

.report-title {
    margin-top: 4px;
    font-size: 16px;
    color: #546e7a;
}

.report-meta-grid,
.report-kappa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px 18px;
    margin-top: 18px;
    font-size: 14px;
}

.report-meta-grid {
    padding: 14px;
    background: #f8fbff;
    border: 1px solid #e0e7ef;
    border-radius: 6px;
}

.report-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.report-kpi {
    border: 1px solid #e0e7ef;
    border-radius: 6px;
    padding: 14px;
    background: #fbfdff;
}

.report-kpi span {
    display: block;
    font-size: 12px;
    color: #607d8b;
    margin-bottom: 6px;
}

.report-kpi strong {
    font-size: 26px;
    color: #1f2d3d;
}

.report-section {
    margin-top: 20px;
    border: 1px solid #e5ebf2;
    border-radius: 8px;
    padding: 18px;
    background: #fff;
}

.report-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8edf3;
}

.report-section h2 {
    font-size: 19px;
    margin-bottom: 4px;
    color: #1f2d3d;
}

.report-section-heading p {
    margin-bottom: 0;
    color: #607d8b;
}

.report-section h3 {
    font-size: 15px;
    margin: 0 0 8px;
    color: #37474f;
}

.report-section p {
    font-size: 14px;
    line-height: 1.55;
    color: #455a64;
    margin-bottom: 10px;
}

.report-table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.report-table-grid > div {
    border: 1px solid #eef2f6;
    border-radius: 6px;
    padding: 12px;
    background: #fbfcfe;
}

.report-executive {
    border: 1px solid #d8e6f3;
    border-radius: 6px;
    padding: 18px;
    background: #fbfdff;
}

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.report-summary-item {
    border-left: 4px solid #1976d2;
    background: #fff;
    border-radius: 6px;
    padding: 12px 14px;
    box-shadow: 0 1px 2px rgba(17, 38, 60, 0.06);
}

.report-summary-item span {
    display: block;
    color: #607d8b;
    font-size: 12px;
    margin-bottom: 5px;
}

.report-summary-item strong {
    display: block;
    font-size: 24px;
    color: #1f2d3d;
}

.report-summary-item em {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    font-style: normal;
    color: #455a64;
}

.report-table th,
.report-table td {
    vertical-align: top;
}

.report-table {
    border: 1px solid #eef2f6;
    border-radius: 6px;
    overflow: hidden;
}

.report-table th {
    background: #eef3f8;
    color: #26384a;
}

.report-table td {
    background: #fff;
}

.report-count-pill,
.report-level-pill {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.report-count-pill {
    background: #e3f2fd;
    color: #0d47a1;
}

.report-level-pill {
    background: #fff3e0;
    color: #e65100;
}

.report-kappa-result {
    margin-top: 16px;
    border: 1px solid #c8ddf5;
    background: #f6fbff;
    border-radius: 6px;
    padding: 14px;
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.report-kappa-result span {
    font-weight: 600;
    color: #37474f;
}

.report-kappa-result strong {
    font-size: 28px;
    color: #0d47a1;
}

.report-kappa-result em {
    font-style: normal;
    color: #455a64;
}

.report-observations {
    min-height: 180px;
    resize: vertical;
}

.report-text-block {
    white-space: normal;
    font-size: 14px;
    line-height: 1.55;
    color: #37474f;
    background: #fbfcfe;
    border: 1px solid #eef2f6;
    border-radius: 6px;
    padding: 12px;
}

.report-signatures {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 48px;
    align-items: end;
    margin-top: 48px;
    padding: 10px 28px 0;
}

.report-signature {
    text-align: center;
    min-height: 120px;
}

.report-signature img {
    display: block;
    width: 170px;
    max-height: 70px;
    object-fit: contain;
    margin: 0 auto 4px;
}

.report-signature strong,
.report-signature span {
    display: block;
    line-height: 1.15;
    color: #111;
}

.report-signature strong {
    font-size: 13px;
}

.report-signature span {
    font-size: 12px;
}

@media print {
    body {
        background: #fff;
    }

    .topbar,
    .breadcrumb,
    .card,
    .report-print-btn {
        display: none !important;
    }

    .content {
        padding: 0;
    }

    .report-page {
        box-shadow: none;
        border-radius: 0;
        padding: 0;
    }

    .report-section {
        break-inside: avoid;
    }

    .report-signatures {
        break-inside: avoid;
    }
}

@media (max-width: 520px) {
    .login-card {
        padding: 20px;
        border-radius: 10px;
    }

    .login-title {
        font-size: 22px;
    }
}


