/* Base responsive styles */
body {
    background: #eef2f6;
    color: #222;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
}

.container {
    max-width: 100%;
    padding: 0 1rem;
    width: 100%;
}

@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
        padding: 0 2rem;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

.login-card {
    border-radius: 1rem;
}

/* Login page gradient background */
.login-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 75%, #4facfe 100%);
    background-size: 400% 400%;
    animation: gradient-shift 8s ease infinite;
    min-height: 100vh;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.report-shell {
    max-width: 100%;
    margin: 0 auto 1rem;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #f0f2f5;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

@media (min-width: 768px) {
    .report-shell {
        max-width: 900px;
        margin: 0 auto 2rem;
    }
}

.report-shell:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.12);
}

.report-header {
    padding: 1.5rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px 12px 0 0;
    color: white;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .report-header {
        padding: 2rem;
    }
}

.report-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.report-brand {
    font-size: 1.2rem;
    letter-spacing: 0.08em;
}

.report-logo .logo-badge {
    width: 70px;
    height: 70px;
    border-radius: 18px;
    background: #0d6efd;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.75rem;
}

.report-info {
    border: none;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecf1 100%);
    border-radius: 8px;
    padding: 1rem;
    margin: -1rem 1rem 1rem;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(10px);
}

@media (min-width: 768px) {
    .report-info {
        padding: 1.5rem;
        margin: -1rem 2rem 1.5rem;
    }
}

.report-info div {
    margin-bottom: 0;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.report-info div:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateX(2px);
}

.report-info .text-muted {
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
}

.report-info .fw-semibold {
    color: #2c3e50;
    font-size: 0.9rem;
    margin-top: 0rem;
}

.report-row {
    padding: 1rem 0;
    border-bottom: 1px solid #f1f3f6;
    transition: all 0.3s ease;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

@media (min-width: 768px) {
    .report-row {
        padding: 0.75rem 0;
        flex-wrap: nowrap;
        gap: 0;
    }
}

.report-row:hover {
    background: rgba(102, 126, 234, 0.03);
    padding: 1rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: 6px;
}

@media (min-width: 768px) {
    .report-row:hover {
        padding: 0.75rem 0.5rem;
        margin: 0 -0.5rem;
    }
}

.report-row .col-md-2 {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    padding: 0 0.5rem;
}

@media (min-width: 768px) {
    .report-row .col-md-2 {
        flex: 0 0 auto;
        width: 16.666667%;
        max-width: 16.666667%;
        padding: 0;
    }
}

.report-row .col-md-8 {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    padding: 0 0.5rem;
}

@media (min-width: 768px) {
    .report-row .col-md-8 {
        flex: 0 0 auto;
        width: 66.666667%;
        max-width: 66.666667%;
        padding: 0;
    }
}

.report-row:last-child {
    border-bottom: none;
}

.metric-bar {
    height: 14px;
    border-radius: 8px;
    background: #e9ecef;
    position: relative;
    overflow: visible;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.report-row:hover .metric-bar {
    height: 16px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05), 0 2px 8px rgba(0, 0, 0, 0.08);
}

.bar-segment {
    height: 100%;
    float: left;
    transition: all 0.3s ease;
}

.bar-segment.low { 
    background: linear-gradient(135deg, #4d9cf7 0%, #2e7fd9 100%);
    box-shadow: 0 2px 8px rgba(77, 156, 247, 0.3);
}

.bar-segment.healthy { 
    background: linear-gradient(135deg, #3ec17f 0%, #2a9d6f 100%);
    box-shadow: 0 2px 8px rgba(62, 193, 127, 0.3);
}

.bar-segment.overweight { 
    background: linear-gradient(135deg, #f7de3c 0%, #e8cd1f 100%);
    box-shadow: 0 2px 8px rgba(247, 222, 60, 0.3);
}

.bar-segment.high { 
    background: linear-gradient(135deg, #f58d2e 0%, #e67e1f 100%);
    box-shadow: 0 2px 8px rgba(245, 141, 46, 0.3);
}

.bar-segment.danger { 
    background: linear-gradient(135deg, #ea3f2b 0%, #d1341f 100%);
    box-shadow: 0 2px 8px rgba(234, 63, 43, 0.3);
}


.report-row:hover .bar-dot {
    width: 24px;
    height: 24px;
    top: -5px;
    box-shadow: 0 0 0 2px #667eea, 
                0 5px 15px rgba(102, 126, 234, 0.5),
                inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.bar-labels {
    font-size: 0.55rem;
    letter-spacing: 0.01em;
    font-weight: 600;
    color: #5a6c7d;
    margin-top: 0.15rem;
    display: flex;
    width: 100%;
    flex-wrap: nowrap;
    gap: 0.1rem;
}

.bar-labels .label-item {
    display: inline-block;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0.1rem 0.05rem;
    flex-shrink: 0;
    flex: 1;
    min-width: 0;
}

.report-label {
    font-weight: 700;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.7rem;
    transition: all 0.3s ease;
}

.report-row:hover .report-label {
    color: #764ba2;
}

.status-badge {
    padding: 0.5em 0.75em;
    font-size: 0.80rem;
    border-radius: 999px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.status-badge:hover {
    transform: scale(1.05);
}

.signature-line {
    width: 190px;
    height: 2px;
    background: linear-gradient(90deg, #667eea 0%, transparent 100%);
    margin: 14px 0 6px;
    transition: all 0.3s ease;
}

.report-footer {
    padding-top: 0.75rem;
    border-top: 2px solid #f1f3f6;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
}

.report-content {
    background: white;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.report-body {
    padding: 0.5rem 0;
}

@media (max-width: 768px) {
    .report-shell {
        margin: 0.5rem;
        max-width: 100%;
    }
    
    .report-content {
        margin: 0;
    }
    
    .report-info {
        margin: 0 0.5rem;
        padding: 0.75rem;
    }
    
    .report-row {
        padding: 0.3rem 0;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .report-row > .col-md-2 {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    .report-row > .col-md-8 {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    .report-info {
        margin: 0 0.5rem;
    }
    
    .report-info div {
        padding: 0.3rem;
        font-size: 0.8rem;
        margin-bottom: 0.2rem;
    }
    
    .metric-bar {
        height: 12px;
    }
    
    .bar-labels {
        font-size: 0.5rem;
        margin-top: 0.1rem;
    }
    
    .bar-dot {
        width: 18px;
        height: 18px;
        top: -3px;
    }
    
    .report-label {
        font-size: 0.65rem;
    }
    
    .report-row:hover .bar-dot {
        width: 20px;
        height: 20px;
        top: -4px;
    }
    
    .report-row:hover .metric-bar {
        height: 14px;
    }
    
    /* Tablet dashboard styles */
    .container {
        padding: 0 1rem;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .table th, .table td {
        padding: 0.75rem 0.5rem;
    }
    
    .d-flex.justify-content-between {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    /* Tablet form styles */
    .col-md-6, .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    .col-md-3, .col-md-2 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    /* Report mobile styles */
    .report-shell {
        margin: 0.25rem;
        padding: 0;
    }
    
    .report-content {
        margin: 0;
    }
    
    .report-header {
        padding: 1rem;
    }
    
    .report-info {
        margin: 0 0.5rem;
        padding: 0.75rem;
    }
    
    .report-info div {
        padding: 0.5rem;
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .report-row {
        padding: 1rem 0.5rem;
        gap: 0.5rem;
        flex-direction: column;
    }
    
    .bar-labels {
        font-size: 0.45rem;
        gap: 0.05rem;
    }
    
    .metric-bar {
        height: 10px;
    }
    
    .bar-dot {
        width: 16px;
        height: 16px;
        top: -3px;
    }
    
    .report-label {
        font-size: 0.6rem;
    }
    
    .h5 {
        font-size: 0.9rem !important;
    }
    
    /* Dashboard mobile styles */
    .container {
        padding: 0 0.5rem;
    }
    
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start !important;
    }
    
    .table-responsive {
        font-size: 0.75rem;
    }
    
    .table th, .table td {
        padding: 0.5rem 0.25rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
        margin-bottom: 0.25rem;
    }
    
    .navbar-brand img {
        height: 30px !important;
        margin-right: 8px !important;
    }
    
    .navbar-brand {
        font-size: 0.9rem !important;
    }
    
    /* Form mobile styles */
    .col-md-6, .col-md-4, .col-md-3, .col-md-2 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    .form-control, .form-select {
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    
    .small {
        font-size: 0.75rem !important;
    }
    
    /* Login page mobile styles */
    .login-card {
        margin: 1rem;
        max-width: 100% !important;
    }
    
    .login-card .card-body {
        padding: 2rem !important;
    }
    
    .vh-100.d-flex {
        min-height: 100vh;
        padding: 1rem;
    }
    
    .login-gradient {
        background-size: 200% 200% !important;
    }
}

/* Enhanced button styling */
.btn {
    transition: all 0.3s ease;
    font-weight: 600;
    border: none;
    padding: 0.5rem 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: white;
}

.btn-outline-primary {
    color: #667eea;
    border: 2px solid #667eea;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.btn-outline-secondary {
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    transform: translateY(-2px);
}

/* Card enhancements */
.card {
    border: none;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
}

/* Table enhancements */
.table tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
}

/* Navbar enhancements */
.navbar-brand {
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

@media print {
    body {
        background: #fff;
    }
    .navbar, .btn, .login-card, .container > .row:not(.report-shell) {
        display: none !important;
    }
    .report-shell {
        box-shadow: 0 0 0 1px #e7eaee;
        border: 1px solid #e7eaee;
        margin: 0;
        page-break-inside: avoid;
    }
    .report-shell, .report-content, .report-body {
        width: 100%;
        max-width: 100%;
    }
    .report-content {
        background: white;
        margin: 0;
    }
    .report-shell:hover {
        transform: none;
        box-shadow: 0 0 0 1px #e7eaee;
    }
    .report-header {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .report-header::before {
        display: none;
    }
    .report-info {
        background: #f5f7fa;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .report-info div {
        /* background: white;
        border: 1px solid #e9ecf1; */
    }
    .metric-bar {
        height: 14px;
    }
    .report-row:hover {
        background: transparent;
        padding: 1rem 0;
        margin: 0;
    }
    .bar-dot {
        width: 18px;
        height: 18px;
        top: -2px;
        border: 3px solid white;
        box-shadow: 0 0 0 2px #667eea;
    }
    .report-row:hover .bar-dot {
        width: 18px;
        height: 18px;
        top: -2px;
    }
    .report-row:hover .metric-bar {
        height: 14px;
    }
    .bar-labels {
        font-size: 0.5rem;
        margin-top: 0.1rem;
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 0.05rem !important;
    }
    .bar-labels .label-item {
        text-align: center !important;
        flex: 1 !important;
        min-width: 0 !important;
        padding: 0.1rem 0.05rem !important;
    }
    .report-footer {
        border-top: 2px solid #667eea;
        background: transparent;
    }
    @page {
        size: A4;
        margin: 18mm;
    }
}
.patient-info {
    display: flex;
    justify-content: space-between;
    margin-top: -1rem;
    padding: 1rem 1.5rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.info-col {
    width: 48%;
}

.info-col div {
    display: flex;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

/* label */
.info-col span {
    width: 140px;
    font-weight: 600;
    position: relative;
}

/* colon alignment */
.info-col span::after {
    content: ":";
    position: absolute;
    right: 5px;
}

/* value */
.info-col b {
    font-weight: 500;
    margin-left: 10px;
}
.metric-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.metric-left {
    width: 140px;
}

.metric-label {
    font-weight: 600;
    font-size: 0.85rem;
}

.metric-value {
    font-size: 0.85rem;
    color: #333;
}

.metric-right {
    flex: 1;
}

/* bar */
.metric-bar {
    height: 10px;
    display: flex;
    position: relative;
    background: #eee;
    border-radius: 4px;
    /* overflow: hidden; */
}

.bar-dot {
    position: absolute;
    top: 0px;
    width: 10px;
    height: 10px;
    background: #000;
    border-radius: 50%;
    background: linear-gradient(135deg, #212529 0%, #495057 100%);
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 2px #667eea, 
                0 3px 10px rgba(102, 126, 234, 0.35),
                inset 0 1px 2px rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    z-index: 10;
}

.metric-labels {
    display: flex;
    font-size: 0.65rem;
    margin-top: 2px;
}

@media print {
    .row, .col-md-* {
        all: unset !important;
    }

    .metric-row {
        page-break-inside: avoid;
    }

    .patient-info {
        border: 1px solid #ccc;
    }
}