﻿html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* THÊM VÀO LÚC 10G38 28/11/2025================================
   DARK UI OVERRIDES CHO TOÀN SITE
   (Login, Studies, v.v.)
   ================================ */

/* Nền & chữ mặc định */
html, body {
    background-color: #000000;
    color: #f3f4f6; /* Trắng xám, dễ đọc */
}

/* Tiêu đề */
h1, h2, h3, h4, h5, h6 {
    color: #f9fafb;        /* gần trắng */
    font-weight: 600;
}

/* Label & text thường */
label,
.control-label,
.form-label,
.table,
.table th,
.table td {
    color: #f3f4f6;
}

/* Input, select, textarea trên nền đen */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
    background-color: #111827;   /* xám rất đậm */
    color: #f9fafb;              /* chữ trắng */
    border: 1px solid #4b5563;   /* viền xám */
}

/* Hover + focus cho input để dễ thấy */
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;       /* xanh dương */
    box-shadow: 0 0 0 1px #3b82f6;
}

/* Placeholder trong ô input (vd: dd/mm/yyyy) */
input::placeholder,
textarea::placeholder {
    color: #9ca3af;              /* xám sáng */
    opacity: 1;
}

/* Bảng dữ liệu (Studies Index) */
table,
.table {
    background-color: #000000;
    border-color: #4b5563;       /* đường kẻ */
    color: #e5e7eb;
}

.table thead th {
    border-bottom: 2px solid #4b5563;
    color: #f9fafb;
}

.table tbody tr {
    border-bottom: 1px solid #374151;
}

/* Khi hover dòng trong bảng, dễ nhìn hơn */
.table tbody tr:hover {
    background-color: #111827;
}

/* Nút primary vẫn giữ màu xanh Bootstrap,
   chỉ đảm bảo chữ rõ trên nền tối */
.btn-primary {
    color: #ffffff;
}

/* Đảm bảo viewer vẫn dùng style của chính nó */
.viewer-root {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--viewer-text-main);
}

/* ================================
   DARK UI OVERRIDES CHO TOÀN SITE
   (Login, Studies, v.v.)
   ================================ */

/* Nền & chữ mặc định */
html, body {
    background-color: #000000;
    color: #f3f4f6; /* Trắng xám, dễ đọc */
}

/* Tiêu đề */
h1, h2, h3, h4, h5, h6 {
    color: #f9fafb;        /* gần trắng */
    font-weight: 600;
}

/* Label & text thường */
label,
.control-label,
.form-label,
.table,
.table th,
.table td {
    color: #f3f4f6;
}

/* Input, select, textarea trên nền đen */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
    background-color: #111827;   /* xám rất đậm */
    color: #f9fafb;              /* chữ trắng */
    border: 1px solid #4b5563;   /* viền xám */
}

/* Hover + focus cho input để dễ thấy */
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;       /* xanh dương */
    box-shadow: 0 0 0 1px #3b82f6;
}

/* Placeholder trong ô input (vd: dd/mm/yyyy) */
input::placeholder,
textarea::placeholder {
    color: #9ca3af;              /* xám sáng */
    opacity: 1;
}

/* Bảng dữ liệu (Studies Index) */
table,
.table {
    background-color: #000000;
    border-color: #4b5563;       /* đường kẻ */
    color: #e5e7eb;
}

.table thead th {
    border-bottom: 2px solid #4b5563;
    color: #f9fafb;
}

.table tbody tr {
    border-bottom: 1px solid #374151;
}

/* Khi hover dòng trong bảng, dễ nhìn hơn */
.table tbody tr:hover {
    background-color: #111827;
}

/* Nút primary vẫn giữ màu xanh Bootstrap,
   chỉ đảm bảo chữ rõ trên nền tối */
.btn-primary {
    color: #ffffff;
}

/* Đảm bảo viewer vẫn dùng style của chính nó */
.viewer-root {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--viewer-text-main);
}

/* =========================
   LOGIN PAGE CENTERED
   ========================= */

.login-page {
    min-height: 100vh; /* cao bằng chiều cao màn hình */
    display: flex;
    align-items: center; /* căn giữa theo chiều dọc */
    justify-content: center; /* căn giữa theo chiều ngang */
}

.login-card {
    background-color: #111827; /* xám đậm */
    padding: 24px 32px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    width: 20vw; /* ~1/5 chiều rộng màn hình */
    min-width: 320px; /* không nhỏ hơn 320px */
    max-width: 420px; /* không to hơn 420px */
}

/* Tiêu đề login */
.login-title {
    color: #f9fafb;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 24px;
}

/* Label & input bên trong card */
.login-card label {
    color: #e5e7eb;
    margin-bottom: 4px;
}

.login-card .form-control {
    background-color: #020617; /* rất đậm */
    color: #f9fafb;
    border: 1px solid #4b5563;
}

    .login-card .form-control:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 1px #3b82f6;
    }

/* Nút Đăng nhập full chiều ngang card */
.login-card .btn-primary {
    font-weight: 500;
    padding: 8px 0;
}
/* ================================
   FIX TABLE HEADER FOR DARK THEME
   (Studies Index)
   ================================ */

.table thead th {
    background-color: #1f2937 !important; /* xám đậm */
    color: #f9fafb !important; /* chữ trắng sáng */
    border-bottom: 2px solid #4b5563 !important;
}

/* Tăng độ tách bạch giữa header và body */
.table thead {
    background-color: #1f2937 !important;
}

/* Các cột body */
.table td {
    color: #e5e7eb !important; /* xám sáng */
    border-color: #374151 !important; /* đường kẻ */
}

/* Khi hover */
.table tbody tr:hover {
    background-color: #111827 !important;
}
/* thêm đoạn này lúc 10g55 ngày 28/11/2025*/
/* ================================
   TABLE DARK THEME BEAUTIFY
   ================================ */
.table {
    width: 100%;
    border-collapse: collapse;
    background-color: #0f0f0f; /* nền body */
}

    /* Header */
    .table thead th {
        background-color: #1f2937 !important;
        color: #f9fafb !important;
        padding: 12px 10px;
        font-weight: 600;
        border-bottom: 2px solid #374151 !important;
        text-align: center;
    }

    /* Body cell */
    .table tbody td {
        padding: 10px 10px;
        border-bottom: 1px solid #2d3748;
        color: #e5e7eb !important;
        vertical-align: middle;
    }

    /* Zebra rows */
    .table tbody tr:nth-child(even) {
        background-color: #111827;
    }

    .table tbody tr:nth-child(odd) {
        background-color: #0f172a;
    }

    /* Hover */
    .table tbody tr:hover {
        background-color: #1f2937 !important;
        cursor: pointer;
    }

    /* Căn giữa cho một số cột */
    .table tbody td:nth-child(1), /* StudyId */
    .table tbody td:nth-child(2), /* OrderNumber */
    .table tbody td:nth-child(5), /* Modality */
    .table tbody td:nth-child(7) /* Status */ {
        text-align: center;
    }

    /* BEAUTIFUL STATUS BADGE */
    .table .badge,
    .table .status-badge {
        padding: 4px 10px;
        border-radius: 6px;
        font-weight: 500;
        font-size: 0.85rem;
    }

        /* DONE */
        .table .badge.bg-success,
        .table .status-badge.success {
            background-color: #065f46 !important;
            color: #d1fae5 !important;
        }

        /* CANCELLED */
        .table .badge.bg-danger,
        .table .status-badge.cancelled {
            background-color: #7f1d1d !important;
            color: #fee2e2 !important;
        }


/* VIEW BUTTON BEAUTIFY */
.btn-view {
    background-color: #2563eb !important;
    border: none !important;
    padding: 4px 10px;
    border-radius: 6px;
    color: #fff !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    transition: 0.2s;
}

    .btn-view:hover {
        background-color: #1d4ed8 !important;
        transform: translateY(-1px);
    }


.modality {
    font-weight: 600;
    padding-left: 20px;
    position: relative;
}

    .modality::before {
        content: "";
        width: 12px;
        height: 12px;
        position: absolute;
        left: 4px;
        top: 50%;
        transform: translateY(-50%);
        border-radius: 2px;
        background-color: #3b82f6;
    }

    .modality.dx::before {
        background: #22c55e;
    }

    .modality.ct::before {
        background: #fbbf24;
    }

    .modality.mr::before {
        background: #a855f7;
    }
/* ================================
   STUDIES FILTER BAR
   ================================ */

.studies-filter {
    padding: 12px 12px 16px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.filter-field {
    display: flex;
    flex-direction: column;
    min-width: 160px;
}

    .filter-field label {
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #9ca3af;
        margin-bottom: 4px;
    }

/* Date pill đẹp hơn */
.date-pill .form-control {
    border-radius: 999px;
    padding-left: 14px;
    padding-right: 14px;
}

/* Nút Lọc + Xóa lọc */
.filter-actions {
    display: flex;
    gap: 8px;
}

.btn-filter-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
}

.btn-clear-filter {
    border-radius: 999px;
    padding: 6px 14px;
    background-color: #111827;
    border: 1px solid #4b5563;
    color: #e5e7eb;
}

    .btn-clear-filter:hover {
        background-color: #1f2937;
    }
.table-dark tbody tr:hover {
    background-color: #1e293b !important;
}
