/*
=================================
LIMS App Stylesheet (style.css)
=================================
*/

/* --- (1) Global & Typography --- */
:root {
    --primary-color: #0d6efd;
    /* Bootstrap Primary */
    --secondary-color: #6c757d;
    /* Bootstrap Secondary */
    --danger-color: #dc3545;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --bg-light: #f8f9fa;
    --bg-dark: #212529;
    --sidebar-bg: #343a40;
    --sidebar-width: 260px;
    --border-color: #dee2e6;
    --text-light: #f8f9fa;
    --text-dark: #212529;
    --text-muted: #6c757d;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-size-sm: 0.8rem;
    /* 14px */
    --font-size-base: 0.9rem;
    /* 15px */
    --border-radius: 0.375rem;
    /* 6px */
}

body.body-logged-out {
    background-image: url('/assets/bg.jpg');
    /* Example subtle background */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    background-color: var(--bg-light);
    margin: 0;
    padding: 0;
    color: var(--text-dark);
    line-height: 1.5;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- (2) Buttons --- */
.btn {
    font-size: var(--font-size-sm);
    font-weight: 600;
    padding: 0.3rem 0.85rem;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #fff;
}

.btn-secondary:hover {
    background-color: #5c636a;
    border-color: #565e64;
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: #fff;
}

.btn-info {
    background-color: var(--info-color);
    border-color: var(--info-color);
    color: var(--text-dark);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-icon {
    padding: 0.35rem 0.6rem;
    font-size: var(--font-size-base);
}

.btn-icon .bi {
    line-height: 0;
}

/* --- (3) Layout & Sidebar --- */
#sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--sidebar-bg);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-header h3 {
    color: #fff;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-info {
    padding: 0.75rem 0rem;
    margin-bottom: 1.5rem;
}

.user-role-logout {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

.user-info .user-info-child {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

/* NEW: Style for the user's name */
.user-info #user-name-display {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
}

/* MODIFIED: Make email smaller */
.user-info #user-email-display {
    display: block;
    font-size: 12px;
    color: var(--text-light);
}

/* NEW: Style for the Dept/Center line */
#user-affiliation-display {
    display: none;
    /* Hidden by default, shown by JS */
    font-size: 11px;
    color: #959595;
}

#user-affiliation-display span {
    display: inline;
    /* Make them sit side-by-side */
}

/* MODIFIED: Style role as a badge */
.role-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 12px;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    align-self: center;
    /* Vertically center the badge */
}

/* NEW: Add a specific admin role style */
.role-badge.role-admin {
    background-color: #fef2e2;
    /* Light orange */
    color: #d97706;
    /* Dark orange */
}

.role-badge.role-staff {
    background-color: #eef2f9;
    /* Light blue */
    color: #0a4a9f;
    /* Dark blue */
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.nav-links li a {
    display: block;
    color: var(--text-light);
    padding: 0.4rem 0rem;
    margin-bottom: 0.25rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
}

.nav-links li a:hover,
.nav-links li a.active {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-links li a .bi {
    font-size: 1.1rem;
    line-height: 0;
}

.sidebar-footer {
    padding-top: 1rem;
}

#main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    height: 100vh;
    overflow-y: auto;
}

.page-container {
    padding: 1.5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* --- (4) Login Page --- */
.login-container {
    max-width: 400px;
    margin: 10vh auto;
    padding: 2.5rem;
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-container p {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.error-message {
    color: var(--danger-color);
    font-size: var(--font-size-sm);
    text-align: center;
    margin-top: 1rem;
}

/* --- (5) Page Structure --- */
.page {
    display: none;
    /* JS will show the active page */
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    gap: 20px;
}

.page-header h3 {
    margin-bottom: 0;
}

/* --- (6) Forms --- */
.form-container {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.form-container h3 {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.form-section-header {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
}

.form-group label {
    font-weight: 600;
    font-size: var(--font-size-sm);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    padding: 0.4rem 0.6rem;
    font-size: var(--font-size-base);
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}

textarea {
    resize: vertical;
}

.form-actions {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
}

/* --- (7) Tables --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

thead {
    background-color: var(--bg-light);
}

th,
td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: var(--font-size-sm);
    vertical-align: middle;
}

th {
    font-weight: 700;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.actions {
    text-align: right;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.status {
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    box-sizing: unset;
}

.status-pending {
    background-color: #ffc107;
    color: var(--text-dark) !important;
}

.status-in-progress {
    background-color: #0dcaf0;
    color: var(--text-dark) !important;
}

.status-completed {
    background-color: #198754;
    color: #fff !important;
}

.status-on-hold {
    background-color: #6c757d;
    color: #fff !important;
}

/* --- (8) Dashboard --- */
.stat-card-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.stat-card .bi {
    font-size: 2.5rem;
    color: var(--primary-color);
    opacity: 0.8;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.stat-label {
    font-size: var(--font-size-base);
    color: var(--text-muted);
}

/* --- (9) File & Analysis Sections --- */
.file-upload-form {
    background-color: var(--bg-light);
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid #e9ecef;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.file-upload-form .form-row {
    gap: 1rem;
}

.file-upload-form button {
    margin-top: 0.5rem;
}

.small-table table {
    font-size: var(--font-size-sm);
}

.small-table th,
.small-table td {
    padding: 0.6rem 0.85rem;
}

.detail-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    padding: 1.5rem 2rem;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem 1.5rem;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    font-size: var(--font-size-base);
}

.detail-grid div {
    padding: 0.5rem 0;
}

.detail-grid strong {
    color: var(--text-muted);
    min-width: 100px;
    display: inline-block;
}

.login-logo {
    width: 100%;
    max-width: 280px;
    /* Adjust this size as needed */
    height: auto;
    margin-bottom: 1.5rem;
}

.login-logo-container {
    display: flex;
    justify-content: center;
}

/* --- (13) Rich Text Editor Styles --- */
.ql-toolbar.ql-snow {
    border: 1px solid var(--border-color);
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    background: #f9f9f9;
}

.ql-container.ql-snow {
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
}

.ql-editor {
    font-size: 13px;
    min-height: 150px;
}

.abc-value p {
    margin-bottom: 0;
}

.file-list,
.analysis-files-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

div#detail-sample-files,
.analysis-files-list {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.ql-insertTable::before {
    content: '🧱';
    font-size: 16px;
}

.file-item {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.1rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: var(--font-size-sm);
}

.file-item .bi {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.file-item a {
    font-weight: 600;
}

.file-item em {
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.analysis-entry {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.analysis-header {
    background-color: var(--bg-light);
    padding: 0.85rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.analysis-header strong {
    font-size: 0.9rem;
}

.analysis-header span {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.analysis-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.small-title-headers {
    font-size: 1rem;
    font-weight: 600;
}

/* --- (10) Spinner --- */
.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem;
    gap: 1rem;
}

/* --- Add to end of style.css --- */
.details-full-width {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.details-full-width .detail-item p {
    white-space: pre-wrap;
    /* Respects line breaks in textareas */
}

.detail-item p {
    font-weight: 600;
}

.detail-item {
    flex: 1 0 180px;
}


.dg-child.child-po0,
.dg-child.child-po1 {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.sidebar-header .sidebar-logo {
    width: 100%;
    max-width: 180px;
    /* Adjust this value as needed */
    height: auto;
    padding: 5px 0;
    /* Give it some vertical breathing room */
}

.sample-name-header {
    margin-bottom: 30px;
}

/* --- (12) Search/Filter Styles --- */
.search-wrapper {
    position: relative;
    display: flex;
    margin-bottom: 20px;
}

.search-wrapper .form-control {
    padding-right: 40px;
    /* Make space for the button */
}

.search-wrapper #applicant-clear-button {
    position: absolute;
    right: 6px;
    top: 6px;
    height: calc(100% - 12px);
    /* Match padding */
    padding: 0 10px;
    border: none;
    background: none;
    color: #777;
}

.search-wrapper #applicant-clear-button:hover {
    background: var(--secondary-color);
    color: #333;
}

/* --- (14) Modal Styles --- */
.modal-overlay {
    display: none;
    /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* Semi-transparent black */
    justify-content: center;
    align-items: center;
}

table.quill-better-table {
    width: 100% !important;
}

.modal-overlay.visible {
    display: flex;
    /* Show the modal */
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 320px;
}

.modal-content h4 {
    margin-top: 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* --- (15) Find Sample Page --- */
#find-sample-results-container {
    display: none;
    /* Hidden by default */
    margin-top: 1.5rem;
}

button#btn-add-sample-file {
    align-self: end;
    height: auto;
}

#find-sample-results-container .loading {
    font-style: italic;
    color: var(--text-light);
}

#find-sample-results-container .error {
    font-weight: 600;
    color: var(--danger-color);
}

button#add-table-btn {
    width: 150px;
    border: 1px solid #bbbbbb;
    border-radius: 3px;
    font-size: 0.8rem;
}

.tool-links {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    margin-top: 10px;
    border-radius: 5px;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
}

.tool-links a {
    color: var(--text-light);
    font-size: 1rem;
    padding: 5px;
    border-radius: 4px;
    transition: color 0.2s ease;
    flex: 0 0 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #6c757d4d;
}

.tool-links a:hover {
    color: #76b600;
    /* Icon color on hover */
}

/* --- (17) Assets Page --- */
.asset-folders-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    /* Responsive grid */
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.asset-folder-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

.asset-folder-card:hover {
    box-shadow: var(--shadow-md);
}

.asset-folder-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.asset-folder-card h4 i {
    font-size: 1.3rem;
}

.asset-folder-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.asset-folder-actions a.btn {
    /* Style link as button */
    text-decoration: none;
}

/* Styles for the permissions checkboxes */
.checkbox-group {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 5px;
    background-color: #fff;
}

.checkbox-group label {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 8px;
}

/* ... (existing asset styles) ... */

/* --- ADD STYLES FOR EMBED VIEW --- */
#asset-embed-container {
    margin-top: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    /* Keep iframe inside borders */
    background-color: var(--card-bg);
    box-shadow: var(--shadow-md);
}

.embed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: #eef2f9;
    /* Light blue header */
    border-bottom: 1px solid var(--border-color);
}

.embed-header h4 {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1rem;
    margin-bottom: 0px;
}

#asset-embed-iframe {
    width: 100%;
    height: 60vh;
    /* Adjust height as needed */
    display: block;
    /* Remove potential bottom space */
}

/* --- END ADD --- */

/* ... (existing embed styles) ... */

/* --- ADD STYLES FOR VIEW TOGGLE --- */
.embed-header {
    /* Add gap for spacing */
    gap: 1rem;
}



.embed-view-toggle .btn {
    padding: 0.25rem 0.5rem;
    /* Smaller padding */
    font-size: 0.9rem;
    /* Slightly smaller icon */
    border-radius: 0;
    /* Remove individual radius */
    border-color: var(--border-color);
    /* Match border */
}

.embed-view-toggle .btn:first-child {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.embed-view-toggle .btn:last-child {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    border-left-width: 0;
    /* Avoid double border */
}

.embed-view-toggle .btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.embed-view-toggle .btn:not(.active):hover {
    background-color: var(--secondary-color);
}

/* --- END ADD --- */

/* --- (18) Publish Report Page --- */
#publish-form-element .form-control[readonly] {
    background-color: #f8f8f8;
    /* Differentiate read-only fields */
    cursor: not-allowed;
}

div#published-list-container {
    margin-top: 10px;
}

.modal-lg {
    max-width: 800px;
    max-height: 90%;
    overflow-y: auto;
}

.recipient-selector {
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

.recipient-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.recipient-tabs button {
    flex: 1;
    padding: 10px;
    border: none;
    background: #f9f9f9;
    cursor: pointer;
    font-weight: 500;
}

.recipient-tabs button.active {
    background: #fff;
    border-bottom: 2px solid var(--primary-color);
}

.recipient-tab-content {
    padding: 15px;
}

#recipient-individual-select {
    height: 150px;
}

.attachment-list {
    list-style: none;
    padding-left: 0;
    margin-top: 10px;
    font-size: 12px;
}

.attachment-list li {
    display: flex;
    justify-content: space-between;
    padding: 5px;
    background: #f8f8f8;
    border-radius: 3px;
    margin-bottom: 5px;
}

.attachment-list li button {
    border: none;
    background: none;
    color: var(--danger-color);
    cursor: pointer;
}

.comm-list-container {
    display: flex;
    flex-direction: column;
}

.comm-list-item,
.comm-post,
.comm-comment-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.comm-list-item:last-child,
.comm-comment-item:last-child {
    border-bottom: none;
}

.comm-list-item:hover {
    background-color: #fcfcfc;
    cursor: pointer;
}

.comm-item-header,
.comm-post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comm-item-header h5,
.comm-post-header h5 {
    margin: 0;
    font-size: 1rem;
}

.comm-item-header span,
.comm-post-header span {
    font-size: 12px;
    color: #4a4a4a;
}

.comm-item-subject {
    font-weight: 600;
    font-size: 1rem;
    color: var(--primary-color);
}

.comm-item-preview {
    font-size: 0.8rem;
}

.comm-post-body,
.comm-comment-body {
    font-size: 14px;
    line-height: 1.6;
}

.comm-comment-form {
    border-top: 1px solid var(--border-color);
    background: #fdfdfd;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comm-comment-form .form-row {
    gap: 10px;
}

.comm-comment-form button {
    align-self: flex-end;
}

.comm-attachments-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
    padding: 15px;
}

.comm-attachments-section strong {
    display: block;
    margin-bottom: 5px;
}

.comm-attachments-section .file-item {
    font-size: 13px;
}

select#recipient-individual-select {
    font-size: 0.85rem;
}

input#comm-file-url {
    font-size: 0.85rem;
}

.comm-post-header {
    padding: 5px 15px;
    margin-bottom: 0px;
}

.comm-post-body.ql-snow {
    margin-top: 0px;
    border-top: 1px solid #ccc;
}

.card.comments-card {
    margin-top: 10px;
}

span.comment-section-header {
    display: flex;
    gap: 10px;
    align-items: center;
}

input#comm-comment-file-url {
    font-size: 0.85rem;
}

div#communication-list-container p.error {
    padding: 15px;
}

textarea#comm-comment-textarea {
    font-size: 0.85rem;
}

.card.comments-card h5 {
    font-size: 1rem;
    margin-bottom: 0px;
}

.card.card-inboxes-section h5 {
    margin-bottom: 0px;
    font-size: 1rem;
}

span.sender-name {
    font-size: 0.8rem;
    font-weight: 600;
}

div#comm-detail-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

h6.comm-sender-name {
    margin-bottom: 0px;
    font-size: 0.9rem;
}

.comm-comment-body {
    font-size: 0.8rem;
}

.comm-item-header {
    margin-bottom: 0px;
}

p.no-comm-msg {
    padding: 15px;
    margin-bottom: 0px;
}

input#comm-file-upload,
input#comm-comment-file-upload {
    font-size: 0.85rem;
}

/* --- (20) Assign Task Page --- */
.task-list-container {
    display: flex;
    flex-direction: column;
}

.task-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.task-list-item:last-child {
    border-bottom: none;
}

.task-list-item-info {
    font-size: 12px;
    color: var(--text-light);
}

.task-list-item-info strong {
    font-size: 1.1rem;
    color: var(--text-color);
    display: block;
    margin-bottom: 4px;
}

.task-list-item .status {
    font-size: 12px;
    margin-left: 10px;
    color: #222;
    border: 1px solid;
}

span.task-title {
    color: #222;
    font-weight: 600;
    padding: 5px;
    border-radius: 3px;
    white-space: nowrap;
    border: 1px solid #efefef;
}

.task-list-item-info {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

span.task-comm-details {
    display: flex;
    align-items: center;
    gap: 10px;
}

span.task-dated {
    color: #222;
    background: #b4e8d1;
    padding: 5px;
    border-radius: 3px;
}

span.task-info {
    color: #222;
    background: #efefef;
    padding: 5px;
    border-radius: 3px;
    white-space: nowrap;
}

/* Staff Search */
.search-results-dropdown {
    display: none;
    /* Hidden by default */
    position: absolute;
    width: calc(100% - 40px);
    /* Match parent modal */
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #ccc;
    border-top: none;
    background: #fff;
    z-index: 1002;
    /* Above modal */
}

.search-result-item {
    padding: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.search-result-item:hover {
    background: #f0f0f0;
}

.search-result-item small {
    font-size: 11px;
    color: #777;
}

.search-selected-item {
    background: #eef2f9;
    color: var(--primary-color);
    padding: 10px;
    border-radius: 5px;
    margin-top: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-selected-item button {
    border: none;
    background: none;
    color: var(--danger-color);
    cursor: pointer;
}

/* Task Detail Modal */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h4 {
    margin: 0;
}

.modal-body {
    padding-top: 1rem;
    max-height: 70vh;
    overflow-y: auto;
}

.task-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.task-detail-grid .detail-item p {
    white-space: pre-wrap;
}

select#assign-task-type {
    font-size: 0.9rem;
}

textarea#assign-task-remarks {
    font-size: 0.9rem;
}

textarea#task-comment-textarea,
select#task-status-select {
    font-size: 0.9rem;
}

.task-header-hh {
    font-size: 1rem;
    margin-bottom: 0px;
}

.card-splitter-cbpsr {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.card-splitter-cbpsr div {
    flex: 1;
}

.email-form {
    width: 100%;
}

.login-button-group {
    display: flex;
    gap: 10px;
    margin-top: 1.5rem;
}

.login-button-group .btn {
    flex: 1;
    /* Make buttons share space */
}

.login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #aaa;
    margin: 1.5rem 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #ddd;
}

.login-divider span {
    padding: 0 10px;
}

.btn-google {
    width: 100%;
    background-color: #fff !important;
    color: #444 !important;
    border: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-google:hover {
    background-color: #f8f8f8 !important;
}

.btn-google i {
    margin-right: 10px;
    color: #DB4437;
}

button#google-login-button {
    display: flex;
    justify-content: center;
}

button#btn-email-login {
    display: flex;
    justify-content: center;
}

input#sample-file-input {
    font-size: 0.9rem;
}

/* --- (21) File Viewer Modal & Links --- */

/* This makes a button look like a link */
.file-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--primary-color);
    cursor: pointer;
    text-align: left;
}

.file-link:hover {
    text-decoration: underline;
}

h4#file-viewer-title {
    font-size: 1.1rem;
}

/* ... (existing .file-link styles) ... */

/* --- ADD THESE STYLES --- */
#file-viewer-modal .modal-header {
    /* This makes it match the Asset Embed header */
    padding: 0.75rem 1rem;
    background-color: #f8f8f8;
}

#file-viewer-modal .modal-header h4 {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.modal-header-actions {
    display: flex;
    gap: 0.5rem;
    padding-left: 1rem;
}

/* --- END ADD --- */

.task-edit-btns {
    display: flex;
    gap: 15px;
}