/**
 * Стили планшетного интерфейса для медсестер
 */

/* Reset and base */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #5b9bd5 0%, #4a8bc2 100%);
    color: white;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 70px;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.app-header h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.header-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.header-select {
    background: transparent;
    border: none;
    color: white;
    font-size: 22px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    padding-left: 10px;
    padding-right: 20px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-select option {
    background: #4a8bc2;
    color: white;
    font-size: 18px;
    padding: 8px 10px;
}


.header-btn:active {
    transform: translateY(0);
}

.header-user {
    font-size: 16px;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
}

/* Main content */
.app-content {
    padding: 25px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Screen title */
.screen-title {
    text-align: center;
    font-size: 28px;
    color: #333;
    margin: 0 0 30px 0;
    font-weight: 500;
}

/* Cards grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Card base */
.card {
    background: white;
    border-radius: 12px;
    padding: 30px 25px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: #5b9bd5;
}

.card:active {
    transform: translateY(-2px);
}

/* Post selection card */
.post-card {
    text-align: center;
    padding: 40px 30px;
}

.post-card .icon {
    font-size: 56px;
    color: #5b9bd5;
    margin-bottom: 20px;
}

.post-card .title {
    font-size: 26px;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
}

.post-card .subtitle {
    font-size: 16px;
    color: #666;
}

/* Ward card */
.ward-card {
    text-align: center;
    padding: 45px 30px;
}

.ward-card .icon {
    font-size: 48px;
    color: #5b9bd5;
    margin-bottom: 15px;
}

.ward-card .room-number {
    font-size: 56px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    line-height: 1;
}

.ward-card .patient-count {
    font-size: 18px;
    color: #666;
}

.ward-card .patient-count i {
    margin-right: 8px;
}

/* Patient card */
.patient-card {
    text-align: left;
    position: relative;
    padding: 25px 25px;
}

.patient-card .badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #5b9bd5;
    color: white;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 500;
}

.patient-card .patient-name {
    font-size: 22px;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
    padding-right: 60px;
}

.patient-card .patient-info {
    font-size: 18px;
    color: #666;
}

.patient-card .patient-info i {
    margin-right: 8px;
    color: #5b9bd5;
}

/* Navigation tabs */
.nav-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 35px;
    justify-content: center;
}

.nav-tab {
    background: #e0e0e0;
    border: none;
    padding: 15px 35px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
    transition: all 0.3s;
    color: #666;
}

.nav-tab.active {
    background: #5b9bd5;
    color: white;
}

.nav-tab:hover:not(.active) {
    background: #d0d0d0;
}

.nav-tab i {
    margin-right: 8px;
}

/* Two column layout / Mobile pages container */
.two-column {
    display: grid;
    grid-template-columns: 2fr 1.1fr;
    grid-template-rows: 1fr 1fr;
    gap: 20px;
    align-items: stretch;
    height: calc(100vh - 120px);
}

#page-assigns,
#page-researches {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#page-assigns .panel,
#page-researches .panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-bottom: 0;
}

#page-assigns {
    grid-column: 1;
    grid-row: 1;
}

#page-researches {
    grid-column: 1;
    grid-row: 2;
}

#page-measurements {
    grid-column: 2;
    grid-row: 1 / span 2;
    height: 100%;
}

#assigns-list,
#researches-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

/* Measurements panel — sticky + scrollable */
.measurements-panel {
    position: sticky;
    top: 80px;
    /* below header */
    height: 100%;
    overflow-y: auto;
    background: white;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #c0d8f0 #f5f5f5;
}

.measurements-panel::-webkit-scrollbar {
    width: 6px;
}

.measurements-panel::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.measurements-panel::-webkit-scrollbar-thumb {
    background: #c0d8f0;
    border-radius: 3px;
}

.measurements-panel::-webkit-scrollbar-thumb:hover {
    background: #5b9bd5;
}

/* Panels */
.panel {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.panel-title {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 25px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-title i {
    color: #5b9bd5;
}

/* Filter buttons in panel title */
.filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-btn {
    background: #f0f4f8;
    border: 2px solid #d0dce8;
    color: #5c7089;
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn:hover {
    background: #e1e9f1;
    border-color: #5b9bd5;
    color: #333;
}

.filter-btn.active {
    background: #5b9bd5;
    border-color: #5b9bd5;
    color: white;
    box-shadow: 0 4px 10px rgba(91, 155, 213, 0.3);
}

.filter-btn i {
    font-size: 14px;
}

.filter-btn.active i {
    color: white;
}

/* Assign items */
.assign-item {
    background: #f9f9f9;
    border-top: 6px solid #5b9bd5;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    gap: 20px;
    align-items: center;
}

.assign-item:hover {
    background: #f0f0f0;
    transform: translateX(5px);
}

.assign-item.item-loading {
    opacity: 0.6;
    background: #eee !important;
    pointer-events: none;
    position: relative;
    overflow: hidden;
}

.assign-item.item-loading::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.date-divider {
    margin: 25px 0 15px 0;
    position: relative;
    text-align: center;
}

.date-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
    z-index: 1;
}

.date-divider span {
    background: #f5f5f5;
    padding: 0 15px;
    position: relative;
    z-index: 2;
    color: #555;
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.quick-complete {
    margin-left: auto;
    background: #eef9f0;
    color: #2e7d32;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #c8e6c9;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(46, 125, 50, 0.1);
}

.quick-complete:hover {
    background: #2e7d32;
    color: #fff;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.25);
    border-color: #2e7d32;
}

.quick-complete:active {
    transform: scale(0.95);
}

.quick-complete.loading {
    background: #f0f0f0;
    color: #999;
    cursor: not-allowed;
    animation: pulse 1s infinite alternate;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

@keyframes pulse {
    from {
        opacity: 1;
    }

    to {
        opacity: 0.5;
    }
}

.assign-item.delivered {
    border-top-color: #4caf50;
    opacity: 0.7;
}

.assign-item.overdue {
    border-top-color: #f44336 !important;
    background: #fff5f5 !important;
}

.assign-time {
    flex-shrink: 0;
    text-align: center;
    min-width: 80px;
}

.assign-time .icon {
    font-size: 36px;
    margin-bottom: 8px;
    display: block;
}

.assign-time .icon.pending {
    color: #00a8e8;
}

.assign-time .icon.delivered {
    color: #4caf50;
}

.assign-time .icon.overdue {
    color: #f44336;
}

.assign-time .time {
    font-size: 20px;
    font-weight: 500;
    color: #333;
}

.assign-info {
    flex-grow: 1;
}

.assign-info .drug {
    font-size: 19px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    line-height: 1.3;
}

.assign-info .dosage {
    font-size: 17px;
    color: #666;
}


.type-icon {
    margin-right: 6px;
    font-size: 18px;
}

.type-icon.med {
    color: #5b9bd5;
}

.type-icon.transfusion {
    color: #e53935;
}

.type-icon.action {
    color: #43a047;
}

/* Transfusion/Action modal info grid */
.transfusion-info-grid {
    margin-bottom: 15px;
}

.info-row {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 17px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: #888;
    display: inline-block;
    margin-right: 8px;
}

.info-value {
    color: #333;
    font-weight: 500;
    word-break: break-word;
}

/* Status badges in modals */
.badge-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

.badge-appointed {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-prepared {
    background: #fff3e0;
    color: #e65100;
}

.badge-started {
    background: #fce4ec;
    color: #c62828;
}

.badge-completed {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-canceled {
    background: #f5f5f5;
    color: #757575;
}

.badge-pending {
    background: #e3f2fd;
    color: #1565c0;
}

/* Custom success button (not in UIKit v3) */
.uk-button-success {
    background: #43a047;
    color: white;
    border-color: #388e3c;
}

.uk-button-success:hover {
    background: #388e3c;
    color: white;
}

/* Badges for CITO and HIGHRISK */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    margin-right: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-warning {
    background: #ff9800;
    color: white;
}

.badge-danger {
    background: #e53935;
}

.badge-success {
    background: #43a047;
    color: white;
}

/* High-risk confirmation badge */
.confirm-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.confirm-badge .uk-badge {
    background: #e53935;
    cursor: pointer;
    font-size: 14px;
    height: 28px;
    min-width: 28px;
    padding: 0 8px;
    transition: transform 0.2s;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.confirm-badge .uk-badge:hover {
    transform: scale(1.1);
    background: #c62828;
}

.confirm-badge.pulse .uk-badge {
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(229, 57, 53, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(229, 57, 53, 0);
    }
}

/* Modal list styles */
.confirm-list {
    max-height: 400px;
    overflow-y: auto;
}

.confirm-list-item {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}

.confirm-list-item:last-child {
    border-bottom: none;
}

.confirm-item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.confirm-item-info {
    flex: 1;
}

.confirm-item-patient {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.confirm-item-drug {
    color: #e53935;
    font-weight: 600;
    margin-top: 2px;
}

.confirm-item-meta {
    font-size: 13px;
    color: #888;
    margin-top: 4px;
}

.confirm-item-actions {
    margin-left: 15px;
}

/* Measurements */
.measurements-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.measurement-card {
    background: white;
    border-radius: 12px;
    padding: 18px 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    border-top: 6px solid transparent;
    transition: all 0.3s;
}

.measurement-card.overdue {
    border-top-color: #f44336 !important;
    background: #fff5f5;
}

.measurement-card.special-regime {
    border-top-color: #ff9800;
}

.measurement-card.overdue.special-regime {
    border-top-color: #f44336;
}

.measurement-card.critical-regime {
    background: #fdecea;
    border-top-color: #d32f2f !important;
}

.measurement-card.critical-regime .meas-title-text {
    color: #d32f2f;
}

/* Ряд: [‹] [значение+время] [›] */
.meas-body {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.meas-center {
    flex: 1;
    text-align: center;
}

/* Кнопки ‹ › */
.meas-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    background: #eef4fb;
    color: #5b9bd5;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.meas-btn:hover:not(:disabled) {
    background: #5b9bd5;
    color: white;
}

.meas-btn:disabled,
.meas-btn-disabled {
    opacity: 0.25;
    cursor: default;
}

.measurement-card h3 {
    font-size: 19px;
    margin: 0 0 18px 0;
    color: #333;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.measurement-card h3 i {
    color: #5b9bd5;
}

.measurement-value {
    font-size: 36px;
    font-weight: bold;
    color: #5b9bd5;
    margin-bottom: 12px;
    line-height: 1.1;
    /* Slightly increased for wrapped text */
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.measurement-time {
    font-size: 14px;
    color: #999;
    margin-bottom: 18px;
}

.add-measurement-btn {
    background: #5b9bd5;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 17px;
    width: 100%;
    transition: all 0.3s;
    font-weight: 500;
}

.add-measurement-btn:hover {
    background: #4a8bc2;
    transform: translateY(-2px);
}

.add-measurement-btn:active {
    transform: translateY(0);
}

.add-measurement-btn i {
    margin-right: 8px;
}

/* Login form */
.login-container {
    max-width: 450px;
    margin: 80px auto;
    background: white;
    border-radius: 16px;
    padding: 45px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.login-logo {
    text-align: center;
    margin-bottom: 35px;
}

.login-logo i {
    font-size: 72px;
    color: #5b9bd5;
}

.login-logo h2 {
    font-size: 28px;
    margin: 15px 0 5px 0;
    color: #333;
}

.login-logo p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    font-size: 17px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.3s;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #5b9bd5;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.form-group input::placeholder {
    color: #999;
    font-size: 16px;
}

.form-group select option[disabled] {
    color: #999;
}

.form-group select:invalid {
    color: #999;
}

.form-group select:valid {
    color: #333;
}

.btn-login {
    width: 100%;
    background: #5b9bd5;
    color: white;
    border: none;
    padding: 16px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    margin-top: 10px;
}

.btn-login:hover {
    background: #4a8bc2;
    transform: translateY(-2px);
}

.btn-login:active {
    transform: translateY(0);
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    color: #ccc;
}

.empty-state p {
    font-size: 20px;
}

/* Loading spinner */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.loading i {
    font-size: 48px;
    color: #5b9bd5;
}


/* Modals */
.uk-modal-dialog {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.uk-modal-header {
    background: #f8fbff;
    border-bottom: 1px solid #eee;
    padding: 20px 30px;
}

.uk-modal-header h2,
.uk-modal-header h3 {
    margin: 0;
    font-size: 24px;
    color: #333;
    font-weight: 500;
}

.uk-modal-body {
    padding: 30px;
}

.uk-modal-footer {
    padding: 20px 30px;
    background: #f8fbff;
    border-top: 1px solid #eee;
}

/* Modal specific inputs */
.uk-modal-body .uk-input,
.uk-modal-body .uk-select,
.uk-modal-body .uk-textarea {
    border-radius: 8px;
    border: 2px solid #eef2f6;
    background: #fcfdfe;
    transition: all 0.3s;
    font-size: 17px;
    padding: 12px 16px;
    height: 48px;
    display: block;
    width: 100%;
}

.uk-modal-body .uk-textarea {
    height: auto;
}

.uk-modal-body .uk-select {
    padding-top: 0;
    padding-bottom: 0;
    line-height: normal;
}

.uk-modal-body .uk-input:focus,
.uk-modal-body .uk-select:focus,
.uk-modal-body .uk-textarea:focus {
    border-color: #5b9bd5;
    background: white;
    box-shadow: 0 0 0 4px rgba(91, 155, 213, 0.1);
    outline: none;
}

.uk-modal-body .uk-form-label {
    font-size: 16px;
    font-weight: 500;
    color: #444;
    margin-bottom: 8px;
    display: block;
}

/* Modal buttons */
.uk-modal-footer .uk-button {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
    font-size: 18px;
    padding: 12px 30px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: auto;
    line-height: 1.2;
}

.uk-modal-footer .uk-button-primary {
    background: #5b9bd5;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(91, 155, 213, 0.3);
}

.uk-modal-footer .uk-button-primary:hover {
    background: #4a8bc2;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(91, 155, 213, 0.4);
}

.uk-modal-footer .uk-button-default {
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
}

.uk-modal-footer .uk-button-default:hover {
    background: #f9f9f9;
    color: #333;
    border-color: #ccc;
    transform: translateY(-2px);
}

.uk-modal-footer .uk-button:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 1200px) {
    .app-content {
        padding: 20px 0;
        overflow-x: hidden;
    }

    .cards-grid {
        padding: 0 15px;
    }

    .two-column {
        display: flex;
        width: 300%;
        gap: 0;
        transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        will-change: transform;
        position: relative;
        height: auto;
        align-items: start;
    }

    #page-assigns,
    #page-measurements,
    #page-researches {
        grid-column: auto;
        grid-row: auto;
        height: auto;
        display: block;
    }

    .mobile-page {
        width: 33.333%;
        flex-shrink: 0;
        padding: 0 15px;
        min-height: calc(100vh - 160px);
    }

    #assigns-list,
    #researches-list {
        flex: none;
        max-height: none;
        overflow-y: visible;
    }

    .measurements-panel {
        height: auto;
    }

    .measurements-panel {
        position: static;
        max-height: none;
        box-shadow: none;
        padding: 0;
        background: transparent;
    }


    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .app-content {
        padding: 15px 0;
    }

    .screen-title {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .header-btn span {
        display: none;
    }

    .header-btn i {
        font-size: 20px;
    }

    .app-header {
        padding: 10px 15px;
    }

    .header-left h1 {
        font-size: 18px;
    }

    .header-select {
        font-size: 18px;
        max-width: 180px;
    }

    .info-row {
        flex-direction: column;
        gap: 4px;
    }

    .info-label {
        min-width: auto;
        font-size: 14px;
    }

    .info-value {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .header-user {
        display: none;
    }

    .header-select {
        max-width: 140px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (min-width: 1201px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* Touch improvements */
@media (hover: none) {
    .card:hover {
        transform: none;
    }

    .card:active {
        transform: scale(0.98);
    }
}

/* Scale Questionnaires */
.scale-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px 5px;
    margin-top: 15px;
}

.scale-question {
    background: #f8fbff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e1e8f0;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.scale-q-title {
    font-weight: 600;
    font-size: 17px;
    color: #333;
    margin-bottom: 15px;
    border-bottom: 1px solid #eef2f6;
    padding-bottom: 10px;
    display: block;
}

.scale-q-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scale-q-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: white;
    border: 1px solid #d0dbe5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.01);
}

.scale-q-option:hover {
    border-color: #5b9bd5;
    background: #f0f7ff;
    transform: translateX(4px);
}

.scale-q-option input[type="radio"],
.scale-q-option input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.scale-total-bar {
    margin-top: 25px;
    padding: 20px;
    background: #eef4fb;
    border-radius: 12px;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    border: 1px solid #d8e6f5;
}

#scale-total-label {
    color: #5b9bd5;
    font-size: 26px;
}

/* Pain Scale Slider improvements */
#pain-text-label {
    font-size: 22px;
    font-weight: 600;
    color: #5b9bd5;
    margin: 15px 0;
}

.uk-range {
    height: 30px;
}

/* Research List Styles */
#researches-list {
    padding-bottom: 80px;
}

.research-group {
    margin-bottom: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.research-group-header {
    background: #f8f9fa;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    color: #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.research-group-header .lab-name {
    font-size: 0.9em;
    color: #666;
    font-weight: normal;
}

.research-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.research-item:last-child {
    border-bottom: none;
}

.research-item.sampled {
    background: #f0fdf4;
}

.research-item .rsch-check {
    margin-right: 15px;
}

.research-item .rsch-check input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
}

.research-item .rsch-info {
    flex: 1;
}

.research-item .rsch-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
}

.research-item .rsch-meta {
    font-size: 0.85em;
    color: #888;
}

.research-item .rsch-status-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
}

.status-not-sampled {
    color: #f39c12;
}

.status-sampled {
    color: #27ae60;
}

/* Bulk actions bar at the bottom */
.bulk-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 15px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    z-index: 1000;
}

.bulk-btn {
    background: #4a69bd;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(74, 105, 189, 0.3);
    cursor: pointer;
    transition: all 0.2s;
}

.bulk-btn:active {
    transform: scale(0.95);
}