.grids, .grids-online{
  vertical-align: middle !important;
}
.grids-center{
  vertical-align: middle !important;
  text-align: center !important;
}
.grids-online span{
  float: right;
}
.control-label{
  width: 100%;
  margin-bottom: 5px;
  font-weight: 500;
  },
.fc-icon-chevron-right:before, .fc .bi-chevron-right:before {
    content: "\e900" !important;
}
#extract .select2-container .select2-selection--single {
    height: 33px !important;
}
.fc-daygrid-event {
    white-space: nowrap; /* Запрещает перенос текста */
    overflow: hidden; /* Обрезает текст, выходящий за рамки */
    text-overflow: ellipsis; /* Добавляет многоточие, если текст обрезан */
    max-width: 100%; /* Гарантирует, что элемент не выходит за свои границы */
}
.nk-content {
    padding: 75px 22px !important;
}
/* ============ METRICS PARSER STYLES ============ */

.metrics-parser-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* --- Header --- */
.parser-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}
.parser-header h1 {
    margin: 0 0 8px 0;
    font-size: 24px;
    color: #2c3e50;
}
.parser-header h1 i { color: #27ae60; }
.parser-header p {
    margin: 0;
    color: #7f8c8d;
    font-size: 14px;
}
.parser-header__stats {
    display: flex;
    gap: 16px;
}
.stat-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 20px;
    text-align: center;
    min-width: 90px;
}
.stat-card--success { background: #d4edda; border-color: #c3e6cb; }
.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
}
.stat-card--success .stat-number { color: #27ae60; }
.stat-label {
    font-size: 12px;
    color: #7f8c8d;
    text-transform: uppercase;
}

/* --- Upload Zone --- */
.upload-zone {
    border: 3px dashed #bdc3c7;
    border-radius: 16px;
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafbfc;
    margin-bottom: 30px;
}
.upload-zone:hover,
.upload-zone--active {
    border-color: #27ae60;
    background: #f0faf3;
}
.upload-zone__icon {
    font-size: 56px;
    color: #bdc3c7;
    margin-bottom: 16px;
    transition: color 0.3s;
}
.upload-zone:hover .upload-zone__icon { color: #27ae60; }
.upload-zone h3 { margin: 0 0 8px; color: #2c3e50; }
.upload-zone p { margin: 0; color: #95a5a6; }
.upload-zone__formats {
    margin-top: 12px !important;
    font-size: 12px;
    color: #bdc3c7 !important;
}

/* Progress */
.upload-zone__progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.progress-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e9ecef;
    border-top-color: #27ae60;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-bar {
    width: 300px;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}
.progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}

/* --- Result Card --- */
.result-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: border-color 0.3s;
}
.result-card--saved { border-color: #27ae60; }
.result-card--error { border-color: #e74c3c; }

.result-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}
.result-card--saved .result-card__header { background: #f0faf3; }
.patient-name { margin: 0 0 4px; font-size: 18px; color: #2c3e50; }
.patient-details { font-size: 13px; color: #7f8c8d; margin-right: 12px; }
.lab-name { font-size: 13px; color: #95a5a6; display: block; margin-top: 4px; }

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.status-badge--parsed { background: #fff3cd; color: #856404; }
.status-badge--saved { background: #d4edda; color: #155724; }

/* --- Date Field --- */
.result-card__date {
    padding: 10px 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 10px;
}
.result-card__date label {
    font-size: 13px;
    color: #495057;
    white-space: nowrap;
    margin: 0;
}
.result-card__date .analysis-date-input {
    max-width: 200px;
    height: 36px;
    font-size: 14px;
}
.result-card__date .date-hint {
    font-size: 12px;
    font-style: italic;
}

/* --- Patient Match --- */
.patient-match { padding: 16px 24px; }
.match-found {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 12px 16px;
    border-radius: 8px;
    color: #155724;
}
.match-found i { color: #27ae60; margin-right: 6px; }
.match-not-found {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 16px;
    border-radius: 8px;
    color: #856404;
}
.match-not-found i { margin-right: 6px; }
.patient-search-inline {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.patient-search-inline input {
    flex: 1;
    max-width: 300px;
}

/* Candidates */
.candidates-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.candidate-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
}
.candidate-item strong { margin-right: 8px; }
.candidate-item small { color: #7f8c8d; flex: 1; }

/* --- Metrics Table --- */
.metrics-table-wrap { padding: 0 24px; overflow-x: auto; }
.metrics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.metrics-table th {
    background: #f8f9fa;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    font-size: 12px;
    text-transform: uppercase;
}
.metrics-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f3f5;
}
.metric-row:hover { background: #f8f9fa; }

/* Статуси рядків */
.metric-row.status-high { background: #fff5f5; }
.metric-row.status-high .metric-value { color: #e74c3c; font-weight: 700; }
.metric-row.status-low { background: #eff8ff; }
.metric-row.status-low .metric-value { color: #2980b9; font-weight: 700; }
.metric-row.status-ok .metric-value { color: #27ae60; }

/* Дублі показників */
.metric-row.status-duplicate {
    background: #fff3cd;
    opacity: 0.65;
}
.metric-row.status-duplicate .metric-value {
    color: #856404;
}
.metric-row.status-duplicate .metric-name strong {
    text-decoration: line-through;
    color: #856404;
}
.metric-row.status-duplicate .metric-status {
    color: #856404;
    font-weight: 600;
}

/* --- Actions --- */
.result-card__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e9ecef;
    background: #fafbfc;
}
.save-result { margin-left: 12px; font-size: 14px; }

.error-text {
    padding: 16px 24px;
    color: #e74c3c;
    font-size: 14px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .parser-header { flex-direction: column; gap: 16px; }
    .result-card__header { flex-direction: column; gap: 12px; }
    .result-card__date { flex-wrap: wrap; }
    .patient-search-inline { flex-direction: column; }
    .result-card__actions { flex-wrap: wrap; }
}
