/* Basic styles for the toast container */
#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050; /* Higher than modals */
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    width: 90%;
    max-width: 400px;
}

.toast {
    background-color: #FF5733;
    color: white;
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 5px;
    opacity: 0.95;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    text-align: center;
    width: 100%;
    transform: translateY(-20px);
}
.toast.show-toast {
    opacity: 0.95;
    transform: translateY(0);
}

.toast.hidden {
    opacity: 0;
    transform: translateY(-20px);
}

.form-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f2f5;
    padding: 20px;
    box-sizing: border-box;
}

.form-card {
    background-color: white;
    padding: 2.5rem; /* Increased padding */
    border-radius: 8px;
    /* START: UI Change - Darker shadow and bigger layout */
    box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
    width: 100%;
    max-width: 460px; /* Increased width */
    /* END: UI Change */
}

/* START: UI Change - New styles for login tabs */
.login-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1.5rem; /* More space below tabs */
}

.login-tab-button {
    flex-grow: 1;
	margin-right: 20px;
	margin-left: 20px;
    padding: 1rem 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

.login-tab-button:hover {
    color: #eee;
}

.login-tab-button.active {
    color: #fff;
    font-weight: 600;
    border-bottom-color: #4f46e5;
}

.login-panel {
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
/* END: UI Change */

.form-card input,
.form-card select,
.form-card textarea,
.filter-bar input,
.filter-bar select,
.modal-content form input,
.modal-content form select,
.modal-content form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
}
.phone-input-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 10px;
}
.phone-input-container select {
    width: auto;
    flex-shrink: 0;
    margin-bottom: 0;
}
.phone-input-container input[type="tel"] {
    flex-grow: 1;
    margin-bottom: 0;
}
#register-form .phone-input-container {
    margin-bottom: 20px;
}


.form-card button {
    width: 100%;
    padding: 12px;
    background-color: #4f46e5;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 1rem;
    margin-top: 5px;
}

.form-card button:hover {
    background-color: #4338ca;
}

.admin-layout { display: flex; flex-direction: column; min-height: 100vh; }

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 5px; /* Reduced padding */
    background-color: #ffffff;
    color: #1f2937;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    flex-wrap: nowrap;
    position: sticky;
    top: 0;
    z-index: 600;
    min-height: 30px; /* Optional: sets a minimum height */
}

.header-left p {
    margin-left: -16px; /* Adjust as needed */
    font-size: 25px;    /* Reduced font size */
    font-weight: 500;
    font-family: 'Biome', sans-serif;
    line-height: 1.2;   /* Tighter line height */
}

.menu-toggle-button img {
    height: 32px;       /* Make the icon smaller */
    width: 32px;
    margin-bottom: 0;
    margin-left: -6px;
	text-decoration: none;
}

.profile-avatar {
    width: 32px;        /* Smaller avatar */
    height: 32px;
    font-size: 16px;
}

@media (min-width: 640px) { .admin-header { padding: 10px 20px; } }
.header-left { display: flex; align-items: center; }
.admin-header .logo { font-size: 1.25rem; font-weight: bold; color: #1f2937; padding-left: 10px; }
@media (min-width: 640px) { .admin-header .logo { font-size: 1.5rem; padding-left: 15px; } }
.header-right { display: flex; align-items: center; }
.profile-avatar {
    width: 32px; height: 32px; border-radius: 50%; background-color: #4f46e5;
    color: white; display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 1rem; cursor: pointer; margin-left: 15px;
    text-transform: uppercase; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
@media (min-width: 640px) { .profile-avatar { width: 36px; height: 36px; font-size: 1.1rem; } }
.admin-content { display: flex; flex-grow: 1; flex-direction: column; }
.left-pane {
    position: fixed; top: 0; padding-top: 60px; left: -260px; width: 260px;
    height: 100%; background-color: #1f2937; color: white; box-sizing: border-box;
    transition: left 0.3s ease; z-index: 500; overflow-y: auto;
}
.left-pane.open { left: 0; }
.mobile-nav-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5); z-index: 499; display: none;
}
.mobile-nav-overlay.show { display: block; }
.left-pane ul { list-style: none; padding: 20px; margin: 0; }
.left-pane ul li { margin-bottom: 15px; display: flex; align-items: center; }
.left-pane ul li a {
    color: #d1d5db; text-decoration: none; font-size: 1.1rem;
    transition: color 0.3s ease; display: flex; align-items: center;
    padding: 8px 5px; width: 100%;
}
.left-pane ul li a:hover { color: #ffffff; }
.left-pane ul li i { margin-right: 12px; font-size: 1.2rem; width: 24px; text-align: center; }
.right-pane {
    width: 100%; padding: 25px;
    background-color: #f3f4f6; /* NEW: A modern, slightly darker gray for better contrast */
    box-sizing: border-box; overflow-y: auto; flex-grow: 1;
}
@media (min-width: 768px) { .right-pane { padding: 20px; } }
.menu-toggle-button {
    background: none; border: none; color: #1f2937; cursor: pointer;
    font-size: 1.5rem; padding: 8px; border-radius: 4px;
    transition: background-color 0.3s ease; margin-right: 10px;
}

.menu-toggle-button:hover { background-color: #fff; }


@media (min-width: 768px) {
    .admin-content { flex-direction: row; }
    .left-pane {
        position: static; left: auto; padding-top: 20px;
        width: 70px;
        height: auto; transition: width 0.3s ease, padding 0.3s ease; overflow-x: hidden;
    }
    .left-pane.expanded { width: 240px; }
    .left-pane.collapsed ul { padding: 20px 0; }
    .left-pane.collapsed ul li a { justify-content: center; }
    .left-pane.collapsed ul li i { margin-right: 0; }
    .left-pane.collapsed ul li span { display: none; }
    .left-pane.expanded ul li i { margin-right: 10px; }
    .left-pane.expanded ul li span { display: inline; opacity: 1; }
    .mobile-nav-overlay { display: none !important; }
}
#user-management-content, #dashboard-content, #scheduler-content, #drive-content, #notes-content, #logs-content, #prd-content, #support-content { display: none; } /* Added #support-content */
.card {
    background-color: #FFFFFF;
    padding: 15px; border-radius: 12px; /* Slightly larger radius */
    /* NEW: Deeper, more modern shadow for a "lifted" effect */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    margin-top: 20px; position: relative;
    border: none; /* Remove the border for a cleaner look */
}
@media (min-width: 640px) { .card { padding: 20px; } }
.table-responsive-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 1rem; }
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6); display: flex;
    justify-content: center; align-items: center; z-index: 1000;
    visibility: hidden; opacity: 0; transition: visibility 0s linear 0.3s, opacity 0.3s ease-in-out;
    padding: 15px; box-sizing: border-box;
}
.modal.show { visibility: visible; opacity: 1; transition-delay: 0s; }
.modal-content {
    background-color: white; padding: 20px; border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); width: 100%;
    max-width: 500px; max-height: 90vh; overflow-y: auto;
    position: relative; transform: scale(0.95); transition: transform 0.3s ease-in-out;
    border: 1px solid #d1d5db; /* Added border to modal content */
}
.modal.show .modal-content { transform: scale(1); }
@media (min-width: 640px) { .modal-content { padding: 30px; } }

/* Specific modal styling for document viewer */
#document-viewer-modal .modal-content {
    max-width: 80vw; /* Allow wider modal for documents */
    width: auto;
    height: 90vh; /* Taller modal */
    display: flex; /* Enable flex for internal layout */
    flex-direction: column;
    padding: 0; /* Remove padding from modal-content itself, apply to inner divs */
    border: none; /* Remove border for this specific modal for better visual */
}
#document-viewer-modal .modal-content #viewer-content-area {
    flex-grow: 1; /* Allow content area to take available space */
    overflow: auto; /* Scroll content if needed */
    background-color: #4a4a4a; /* Darker background for viewer area */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem; /* Padding inside the content area */
}
#document-viewer-modal .modal-content #viewer-content-area img,
#document-viewer-modal .modal-content #viewer-content-area iframe,
#document-viewer-modal .modal-content #viewer-content-area embed,
#document-viewer-modal .modal-content #viewer-content-area pre {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* For images */
}
#document-viewer-modal .modal-content #viewer-content-area iframe,
#document-viewer-modal .modal-content #viewer-content-area embed {
    width: 100%;
    height: 100%;
    border: none;
}
#document-viewer-modal .modal-content #viewer-content-area pre {
    background-color: #f5f5f5;
    color: #333;
    padding: 1rem;
    border-radius: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: monospace;
    font-size: 0.9em;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}


.modal-close-button {
    position: absolute; top: 10px; right: 10px; font-size: 1.8rem; font-weight: bold;
    color: #aaa; background: none; border: none; cursor: pointer; z-index: 1010; padding: 5px;
}
#document-viewer-modal .modal-close-button { /* Specific styling for viewer close */
    top: 0.75rem; /* Adjust for new header padding */
    right: 1rem;
    color: #6b7280; /* gray-500 */
}
#document-viewer-modal .modal-close-button:hover { color: #1f2937; }


.modal-content h3 { margin-bottom: 20px; font-size: 1.25rem; }
@media (min-width: 640px) { .modal-content h3 { font-size: 1.5rem; } }

.modal-content form button {
    width: 100%; padding: 12px; background-color: #4f46e5; color: white;
    border: none; border-radius: 4px; cursor: pointer;
    transition: background-color 0.3s ease; margin-top: 10px; font-size: 1rem;
}
.modal-content form button:hover { background-color: #4338ca; }
.toggle-switch { position: relative; display: inline-block; width: 48px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc; transition: .4s; border-radius: 24px;
}
.slider:before {
    position: absolute; content: ""; height: 16px; width: 16px;
    left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: #4f46e5; }
input:focus + .slider { box-shadow: 0 0 1px #4f46e5; }
input:checked + .slider:before { transform: translateX(24px); }
.hidden { display: none !important; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0;
}
#users-table th, #users-table td, 
#logs-table th, #logs-table td, 
#drive-table th, #drive-table td, 
#prd-table th, #prd-table td,
#support-tickets-table th, #support-tickets-table td /* Added support table */
{
    padding: 0.75rem; text-align: left; font-size: 0.875rem; border-bottom: 1px solid #e5e7eb;
}
#users-table th, #logs-table th, #drive-table th, #prd-table th, #support-tickets-table th /* Added support table */
{
    background-color: #f9fafb; font-weight: 600; color: #374151;
}
#users-table .user-avatar-sm {
    width: 32px; height: 32px; border-radius: 50%; background-color: #6366f1;
    color: white; display: inline-flex; align-items: center; justify-content: center;
    font-weight: 500; font-size: 0.875rem; margin-right: 0.75rem;
}
#users-table .status-dot {
    height: 0.75rem; width: 0.75rem; border-radius: 50%;
    display: inline-block; margin-right: 0.5rem;
}
#users-table .status-dot.active { background-color: #10b981; }
#users-table .status-dot.inactive { background-color: #ef4444; }

#users-table .action-button-stack button, 
#drive-table .action-button-stack button, 
#prd-table .action-button-stack button,
#support-tickets-table .action-button-stack button /* Added support table */
{
    display: flex; align-items: center; width: auto; text-align: left;
    padding: 0.375rem 0.75rem; font-size: 0.875rem; border-radius: 0.375rem;
    margin-right: 0.25rem; transition: background-color 0.2s ease;
    color: #374151; background-color: #f3f4f6; border: 1px solid #d1d5db;
}
#users-table .action-button-stack button:hover, 
#drive-table .action-button-stack button:hover, 
#prd-table .action-button-stack button:hover,
#support-tickets-table .action-button-stack button:hover /* Added support table */
{ background-color: #e5e7eb; }

#users-table .action-button-stack button i, 
#drive-table .action-button-stack button i, 
#prd-table .action-button-stack button i,
#support-tickets-table .action-button-stack button i /* Added support table */
{ margin-right: 0.375rem; width: 14px; text-align: center; }

#users-table .action-button-stack { display: flex; flex-direction: column; gap: 0.25rem;}
#drive-table .action-button-stack { display: flex; flex-direction: row; gap: 0.5rem; flex-wrap: wrap;}
#prd-table .action-button-stack { display: flex; flex-direction: row; gap: 0.5rem; flex-wrap: wrap;}
#support-tickets-table .action-button-stack { display: flex; flex-direction: row; gap: 0.5rem; flex-wrap: wrap;} /* Added support table */


#user-tags-modal .modal-content, #user-permissions-modal .modal-content,
#user-status-modal .modal-content, #user-message-modal .modal-content { max-width: 600px; }
#tags-list-container .tag-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.5rem; background-color: #e0e7ff; border-radius: 0.25rem; margin-bottom: 0.5rem;
}
#tags-list-container .tag-item span { color: #4338ca; }
#tags-list-container .tag-item button {
    background: none; border: none; color: #ef4444; cursor: pointer; font-size: 0.875rem;
}
#user-permissions-modal .permission-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.75rem 0; border-bottom: 1px solid #e5e7eb;
}
#user-permissions-modal .permission-item:last-child { border-bottom: none; }
#user-message-modal textarea { min-height: 120px; }
#user-message-modal .message-send-buttons { display: flex; gap: 0.75rem; margin-top: 1rem; }
#user-message-modal .message-send-buttons button { flex-grow: 1; }

/* Notes Screen Specific Styles */
.note-card-full {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    margin-bottom: 1.5rem;
    overflow: hidden;
    border: 1px solid #e0e0e0; /* Added a subtle light border for definition */
}
.note-card-header-clickable {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.note-card-header-clickable:hover {
    background-color: #f3f4f6;
}
.note-subject-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}
.note-toggle-icon {
    transition: transform 0.3s ease;
    color: #6b7280;
}
.note-content-collapsible {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, padding 0.5s ease-out;
    background-color: #ffffff;
}
.note-content-collapsible.expanded {}

.comments-list {
    flex-grow: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    margin-bottom: 1rem;
    min-height: 100px;
}
.comment-item {
    display: flex;
    margin-bottom: 0.75rem;
}

.comment-bubble {
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
    position: relative;
}

.comment-text { font-size: 0.875rem; word-break: break-word; }
.comment-meta { font-size: 0.75rem; color: #9ca3af; margin-top: 0.25rem; display: flex; justify-content: space-between; align-items: center;}

.delete-comment-btn {
    background: none; border: none; color: #9ca3af;
    cursor: pointer; font-size: 0.75rem;
    opacity: 0; transition: opacity 0.2s ease;
    margin-left: 8px;
}
.comment-bubble:hover .delete-comment-btn { opacity: 1; }
.comment-item.current-user .delete-comment-btn { color: #e5e7eb; }
.comment-item.current-user .delete-comment-btn:hover { color: #fee2e2; }
.comment-item:not(.current-user) .delete-comment-btn:hover { color: #ef4444; }


.comment-input-area { display: flex; gap: 0.5rem; flex-shrink: 0; }
.comment-input-area textarea {
    flex-grow: 1; padding: 0.5rem 0.75rem; border: 1px solid #d1d5db;
    border-radius: 0.375rem; font-size: 0.875rem; resize: none;
}
.comment-input-area button {
    padding: 0.5rem 1rem; background-color: #4f46e5; color: white;
    border: none; border-radius: 0.375rem; cursor: pointer; transition: background-color 0.2s ease;
    font-size: 0.875rem;
}
.comment-input-area button:hover { background-color: #4338ca; }

.attachments-list {
    flex-grow: 1;
    overflow-y: auto;
    min-height: 100px;
}
.attachment-list-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.5rem 0; border-bottom: 1px solid #e5e7eb;
}
.attachment-list-item:last-child { border-bottom: none; }
.attachment-info { display: flex; align-items: center; }
.attachment-thumbnail {
    width: 32px; height: 32px; border-radius: 0.25rem;
    background-color: #e5e7eb; color: #6b7280;
    display: flex; align-items: center; justify-content: center;
    margin-right: 0.75rem; font-size: 1rem;
}
.attachment-filename { font-size: 0.875rem; color: #3b82f6; text-decoration: none; }
.attachment-filename:hover { text-decoration: underline; }
.attachment-date { font-size: 0.75rem; color: #6b7280; }
.delete-attachment-btn {
    background: none; border: none; color: #ef4444;
    cursor: pointer; font-size: 0.875rem;
}
.delete-attachment-btn:hover { color: #dc2626; }
.add-attachment-button-container {
    margin-top: 0.75rem;
    flex-shrink: 0;
}
.add-attachment-button {
    display: inline-flex; align-items: center;
    padding: 0.5rem 0.75rem;
    color: white; border: none; border-radius: 0.375rem; cursor: pointer;
    font-size: 0.875rem;
}
.add-attachment-button:hover { background-color: #059669; }
.add-attachment-button i { margin-right: 0.5rem; }

.note-content-tabs {
    display: flex;
    border-bottom: 1px solid #d1d5db;
    padding: 0.5rem 0.5rem 0 0.5rem;
    background-color: #ffffff;
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
}
.tab-button {
    flex-grow: 1;
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.tab-button:hover {
    color: #4f46e5;
    border-bottom-color: #a5b4fc;
}
.tab-button.active {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
}
.tab-button i { margin-right: 0.375rem; }
.comment-count-badge, .attachment-count-badge {
    margin-left: 0.25rem;
    background-color: #e5e7eb;
    color: #4b5563;
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
}
.tab-content-container { padding: 0; }
.tab-pane {
    display: none;
    background-color: #ffffff;
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    min-height: 200px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}
.tab-pane.active { display: flex; }
.tab-pane .comments-list, .tab-pane .attachments-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.75rem;
}
.tab-pane .comment-input-area, .tab-pane .add-attachment-button-container {
    margin-top: auto;
    padding: 0.75rem;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}
.tab-pane .comment-input-area textarea {
    width: calc(100% - 80px);
    margin-right: 0.5rem;
}
.tab-pane .comment-input-area button { width: 70px; }
.tooltip {
    position: relative;
    display: inline-block;
}
.tooltip .tooltiptext {
    visibility: hidden;
    width: max-content;
    max-width: 250px;
    background-color: #555;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.75rem;
    line-height: 1.4;
}
.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}
.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}
.tooltip .tooltiptext p { margin-bottom: 4px; }
.tooltip .tooltiptext p:last-child { margin-bottom: 0; }
.tooltip .tooltiptext strong { font-weight: 600; }

.long-login-indicator {
    color: #ef4444;
    margin-left: 4px;
    font-weight: bold;
}
.filter-bar {
    background-color: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0; /* Added a subtle light border for definition */
}
.filter-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
}
@media (min-width: 640px) {
    .filter-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .filter-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1280px) {
    .filter-grid { grid-template-columns: repeat(4, 1fr); }
}
.filter-bar label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}
.filter-bar input[type="date"],
.filter-bar input[type="text"],
.filter-bar select {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0;
}
.filter-buttons {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-start;
    gap: 0.75rem;
    margin-top: 0.5rem;
}
.filter-buttons button {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
}
.filter-buttons button.apply-filters-btn {
    background-color: #4f46e5;
    color: white;
}
.filter-buttons button.apply-filters-btn:hover {
    background-color: #4338ca;
}
.filter-buttons button.clear-filters-btn {
    background-color: #e5e7eb;
    color: #374151;
}
.filter-buttons button.clear-filters-btn:hover {
    background-color: #d1d5db;
}
/* Drive Specific Styles */
#drive-navigation-bar .breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    padding: 0 0.5rem;
    color: #6b7280; /* gray-500 */
}
#drive-table .item-icon {
    width: 1.5rem; /* 24px */
    height: 1.5rem;
    text-align: center;
    color: #4f46e5; /* Default icon color */
}
#drive-table .item-icon.folder { color: #fbbf24; } /* amber-400 for folders */
#drive-table .item-icon.image { color: #3b82f6; } /* blue-500 for images */
#drive-table .item-icon.document { color: #10b981; } /* green-500 for documents */
#drive-table .item-icon.archive { color: #a855f7; } /* purple-500 for archives */
#drive-table .item-icon.unknown { color: #6b7280; } /* gray-500 for unknown */

#drive-upload-area.dragover {
    border-color: #4f46e5; /* indigo-600 */
    background-color: #eef2ff; /* indigo-50 */
}
.drive-upload-progress-item {
    background-color: #f3f4f6; /* gray-100 */
    padding: 0.5rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.drive-upload-progress-item .file-name {
    font-size: 0.875rem;
    color: #374151; /* gray-700 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}
.drive-upload-progress-item .progress-bar-container {
    flex-grow: 1;
    height: 8px;
    background-color: #e5e7eb; /* gray-200 */
    border-radius: 4px;
    margin: 0 0.75rem;
    overflow: hidden;
}
.drive-upload-progress-item .progress-bar {
    height: 100%;
    background-color: #4f46e5; /* indigo-600 */
    width: 0%;
    transition: width 0.1s linear;
}
.drive-upload-progress-item .progress-status {
    font-size: 0.75rem;
    color: #6b7280; /* gray-500 */
    width: 50px;
    text-align: right;
}

/* Scheduler Styles */
#scheduler-content .card {
    height: calc(95vh - 120px);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent calendar from overflowing card */
}
#calendar-container {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: auto repeat(6, 1fr); /* Header row + up to 6 weeks for days */
    gap: 1px;
    background-color: #e5e7eb; /* Grid lines */
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    overflow: hidden; /* Clip overflowing day cells */
}
.calendar-header-cell, .calendar-day-cell {
    background-color: white;
    padding: 0.25rem; /* Smaller padding for more space */
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch; /* Stretch items for event display */
    position: relative;
    overflow: hidden; /* Hide overflow within cell */
    min-height: 60px; /* Minimum height for day cells */
}
@media (min-width: 768px) {
    .calendar-header-cell, .calendar-day-cell {
        padding: 0.5rem;
        min-height: 80px;
    }
}
.calendar-header-cell {
    font-weight: 600;
    color: #374151;
    padding: 0.75rem 0.25rem;
}
.calendar-day-cell .day-number {
    font-weight: 500;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
    z-index: 1; /* Keep day number on top of events */
    align-self: flex-start; /* Align to top-left */
    padding: 2px 4px;
}
@media (min-width: 768px) {
    .calendar-day-cell .day-number { font-size: 0.875rem; }
}
.calendar-day-cell.today {
    background-color: #eef2ff; /* Light indigo */
}
.calendar-day-cell.today .day-number {
    color: white;
    background-color: #4f46e5; /* Indigo */
    border-radius: 50%;
    padding: 2px 6px;
    font-weight: bold;
}
.calendar-day-cell.other-month .day-number {
    color: #9ca3af; /* Gray-400 */
}
.calendar-day-cell .events-container {
    flex-grow: 1;
    overflow-y: auto; /* Scroll if many events */
    font-size: 0.75rem;
    text-align: left;
    width: 100%;
}
.calendar-day-cell .event-item {
    background-color: #c7d2fe; /* Lighter indigo for events */
    color: #3730a3; /* Darker indigo text */
    padding: 2px 4px;
    border-radius: 3px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}
.calendar-day-cell .event-item:hover {
    background-color: #a5b4fc;
}

.calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    margin-bottom: 0.5rem;
    flex-shrink: 0; /* Prevent shrinking */
}
.calendar-navigation button {
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
}
.calendar-navigation button:hover {
    background-color: #e5e7eb;
}
#current-month-year {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}
#scheduler-add-event-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: #4f46e5;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 700; /* Above calendar grid */
}
#scheduler-add-event-btn:hover {
    background-color: #4338ca;
}

#create-event-modal .modal-content {
    max-width: 600px;
}
#create-event-modal .tag-input-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
#create-event-modal .tag-input-container input {
    flex-grow: 1;
    margin-bottom: 0 !important;
}
#create-event-modal .tag-input-container button {
    width: auto !important;
    margin-top: 0 !important;
    padding: 10px 15px !important; /* Ensure consistent padding */
    background-color: #2563eb !important; /* blue-600 */
}
#create-event-modal .tag-input-container button:hover {
    background-color: #1d4ed8 !important; /* blue-700 */
}
#create-event-modal #event-tags-list-container .tag-item {
    display: inline-flex;
    align-items: center;
    background-color: #e0e7ff;
    color: #3730a3;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}
#create-event-modal #event-tags-list-container .tag-item button {
    background: none !important;
    border: none !important;
    color: #4f46e5 !important;
    margin-left: 0.5rem !important;
    font-size: 0.75rem !important;
    cursor: pointer !important;
    padding: 0 !important;
    width: auto !important; /* Override general modal button styles */
    margin-top: 0 !important; /* Override general modal button styles */
}
#create-event-modal #event-tags-list-container .tag-item button:hover {
    color: #3730a3 !important;
}
#create-event-modal #event-assign-users {
    height: auto; /* Allow select to grow with multiple options */
    min-height: 40px; /* Default single line height */
}

/* PRD Specific Styles */
.prd-card-full {
    background-color: #FFFFFF; /* White for the main PRD card */
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    margin-bottom: 1.5rem;
    overflow: hidden;
    border: 1px solid #e0e0e0; /* Added a subtle light border for definition */
}
.prd-card-header-clickable {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.prd-card-header-clickable:hover {
    background-color: #f3f4f6;
}
.prd-title-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}
.prd-toggle-icon {
    transition: transform 0.3s ease;
    color: #6b7280;
}
.prd-content-collapsible {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, padding 0.5s ease-out;
    background-color: #ffffff;
}
.prd-content-collapsible.expanded {}

/* PRD Detail Modal */
#prd-detail-modal .modal-content {
    width: 95vw;
    max-width: 95vw;
    height: 95vh;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    padding: 0px;
    border: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

#prd-detail-modal .modal-close-button { /* Specific styling for PRD modal close */
    top: 0.5rem;
    right: 0.75rem;
    font-size: 2.5rem; /* Larger icon */
    color: #ef4444; /* Red color */
    font-weight: normal; /* Can make it bolder if needed */
    padding: 0px;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
}

#prd-detail-modal .modal-close-button:hover {
    color: #dc2626; /* Darker red on hover */
    transform: scale(1.1);
}


#prd-detail-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    background-color: #f3f4f6; /* Lighter background for modal header */
}

#prd-detail-modal .modal-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: grid; /* Use grid for main sections */
    grid-template-columns: 1fr;
    gap: 1.5rem; /* Space between sections */
    background-color: #f0f2f5; /* Very light background for the modal body */
}

@media (min-width: 1024px) { /* Adjust layout for larger screens */
    #prd-detail-modal .modal-body {
        grid-template-columns: 2fr 1fr; /* Two columns: details wide, others narrower */
         /* Title row, details row, assigned+tags row, attachments row, comments row */
        grid-template-rows: auto 1fr auto auto auto;
    }
    #prd-detail-modal .prd-title-card {
        grid-column: 1 / -1; /* Span all columns */
    }
    #prd-detail-modal .prd-details-card {
        grid-column: 1 / 2; /* Main content column */
        grid-row: 2 / 3; /* Details take the second row, first column */
    }
    #prd-detail-modal .prd-assigned-to-card {
        grid-column: 2 / 3; /* Side column */
        grid-row: 2 / 3; /* Assigned To in second row, second column */
    }
    #prd-detail-modal .prd-tags-card {
        grid-column: 2 / 3; /* Side column */
        grid-row: 3 / 4; /* Tags in third row, second column */
    }
	
    #prd-detail-modal .prd-attachments-section {
        grid-column: 2 / 3; /* Second column (right pane) */
        grid-row: 4 / 5; /* Or adjust this to fit with existing content */
        /* You might want to make this span more rows or share with tags based on desired height */
    }	
	
    #prd-detail-modal .prd-comments-section {
        grid-column: 1 / 2; /* Comments below attachments */
        grid-row: 4 / 5;
    }
}


#prd-detail-modal .modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex; /* Use flexbox for alignment */
    justify-content: flex-start; /* Align items to the start (left) */
    flex-shrink: 0;
    background-color: #f3f4f6; /* Lighter background for modal footer */
}

/* Card styling for sections inside the modal */
#prd-detail-modal .prd-section-card {
    background-color: #FFFFFF; /* White for inner PRD cards to contrast with modal body */
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); /* Slightly softer shadow for inner cards */
    padding: 1rem;
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e0e0; /* Subtle border for inner cards */
}
#prd-detail-modal .prd-section-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

/* Title Section */
#prd-detail-modal .prd-title-input-container {
    width: 100%; /* Full width within its card */
}
/* No specific half-width applied to title input, but its card will be full width on small/medium, half on large */

/* Details Section (Quill Editor) */
#prd-detail-modal #prd-details-editor {
    min-height: 250px; /* Increased height */
    max-height: 500px; /* Max height to allow scrolling */
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background-color: #ffffff;
    padding: 0; /* Remove padding, Quill adds its own */
    overflow-y: auto;
    flex-grow: 1; /* Allows Quill to take up available height in its card */
}
#prd-detail-modal .ql-toolbar.ql-snow {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    border-bottom: 1px solid #d1d5db; /* Add border to toolbar bottom */
}
#prd-detail-modal .ql-container.ql-snow {
    border: none; /* Remove default quill border, editor has its own */
    min-height: inherit; /* Inherit min-height */
}


/* Tags & Assigned Users Sections */
#prd-detail-modal .prd-user-search-input-container,
#prd-detail-modal .tag-input-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    position: relative; /* For absolute positioning of search results */
}
#prd-detail-modal #prd-assign-user-input, /* New ID for text input */
#prd-detail-modal .tag-input-container input,
#prd-detail-modal .tag-input-container select {
    flex-grow: 1;
    margin-bottom: 0 !important;
}

/* Remove Add button for assign user, it's handled by selecting from search results */
#prd-detail-modal #prd-add-assigned-user-btn {
    display: none;
}

#prd-detail-modal .tag-input-container button {
    width: auto !important;
    margin-top: 0 !important;
    padding: 8px 12px !important; /* Adjusted padding */
    font-size: 0.875rem !important; /* Adjusted font size */
    background-color: #2563eb !important;
}
#prd-detail-modal .tag-input-container button:hover {
    background-color: #1d4ed8 !important;
}

#prd-user-search-results {
    position: absolute;
    top: 100%; /* Position below the input */
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 150px;
    overflow-y: auto;
    z-index: 10; /* Ensure it's above other elements in the card */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
#prd-user-search-results .user-search-item {
    padding: 8px 12px;
    font-size: 0.875rem;
    cursor: pointer;
}
#prd-user-search-results .user-search-item:hover {
    background-color: #f3f4f6; /* Tailwind gray-100 */
}


#prd-detail-modal #prd-tags-list-container,
#prd-detail-modal #prd-assigned-users-list-container {
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background-color: #f9fafb; /* Light background for lists within inner cards */
    min-height: 60px;
    max-height: 120px;
    overflow-y: auto;
    flex-grow: 1; /* Allows list containers to fill space within their cards */
}

#prd-detail-modal #prd-tags-list-container .tag-item,
#prd-detail-modal #prd-assigned-users-list-container .assigned-user-item { /* Updated class name */
    display: inline-flex;
    align-items: center;
    background-color: #e0e7ff;
    color: #3730a3;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    white-space: nowrap; /* Prevent wrapping in pills */
}
#prd-detail-modal #prd-tags-list-container .tag-item button,
#prd-detail-modal #prd-assigned-users-list-container .assigned-user-item button { /* Updated class name */
    background: none !important;
    border: none !important;
    color: #4f46e5 !important;
    margin-left: 0.5rem !important;
    font-size: 0.75rem !important;
    cursor: pointer !important;
    padding: 0 !important;
    width: auto !important;
    margin-top: 0 !important;
}
#prd-detail-modal #prd-tags-list-container .tag-item button:hover,
#prd-detail-modal #prd-assigned-users-list-container .assigned-user-item button:hover { /* Updated class name */
    color: #3730a3 !important;
}


/* Attachments Section */
#prd-detail-modal .prd-attachments-section {
    min-height: 150px;
    max-height: 250px;
    display: flex;
    flex-direction: column;
    background-color: #FFFFFF; /* Ensure card background */
}
#prd-detail-modal #prd-attachments-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.75rem;
    background-color: #f9fafb; /* Light background for list area */
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}
#prd-detail-modal #prd-attachments-list .attachment-list-item {
    padding: 0.5rem 0;
}
#prd-detail-modal #prd-attachments-section .add-attachment-button-container {
    padding: 0;
    flex-shrink: 0;
    text-align: left; /* Align button to the left */
}
#prd-detail-modal #prd-attachments-section .add-attachment-button {
    background-color: #000000; /* Black background */
    width: auto; /* Make button fit content */
    padding: 0.375rem 0.75rem; /* Smaller padding */
    font-size: 0.875rem; /* Smaller font size */
    display: inline-flex; /* Allow left alignment */
}
#prd-detail-modal #prd-attachments-section .add-attachment-button:hover {
    background-color: #333333; /* Slightly lighter black on hover */
}

/* Comments Section */
#prd-detail-modal .prd-comments-section {
    min-height: 200px;
    max-height: 350px;
    display: flex;
    flex-direction: column;
    background-color: #FFFFFF; /* Ensure card background */
}
#prd-detail-modal #prd-comments-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.75rem;
    background-color: #f9fafb; /* Light background for list area */
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}
#prd-detail-modal #prd-comments-section .comment-input-area {
    border-top: 1px solid #e5e7eb;
    padding: 0.75rem;
    flex-shrink: 0;
    display: flex; /* Ensure it's a flex container */
    gap: 0.5rem;
}
#prd-detail-modal #prd-comment-input {
    flex-grow: 1;
    margin-bottom: 0 !important;
    border-radius: 0.375rem !important; /* Match design */
}
#prd-detail-modal #prd-add-comment-btn {
    width: auto !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
    margin-left: 0.5rem !important; /* Space from textarea */
    margin-top: 0 !important;
}

/* Save PRD Button */
#prd-detail-modal #save-prd-button {
    width: auto; 
    padding: 0.85rem 2rem; /* Slightly larger padding */
    font-size: 1rem;
    background-color: #000000; /* Black background */
    color: white;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
    border: none;
}
#prd-detail-modal #save-prd-button:hover {
    background-color: #333333; /* Slightly lighter black on hover */
}


/* NEW/UPDATED: Style for individual thumbnail items */
.prd-attachment-thumbnail-item {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #e2e8f0; /* light gray/blue for background */
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1 / 1; /* Keep a square aspect ratio */
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

/* --- Support Ticket Modal Styles --- */
#support-ticket-modal .modal-content.support-ticket-modal-content {
    width: 95vw;
    max-width: 95vw; /* Ensure it doesn't exceed viewport */
    height: 95vh;
    max-height: 95vh; /* Ensure it doesn't exceed viewport */
    display: flex;
    flex-direction: column;
    padding: 0; /* Remove padding from modal-content, apply to inner divs */
    box-shadow: 0 10px 30px rgba(0,0,0,0.25); /* Darker shadow for the modal itself */
}

#support-ticket-modal .support-ticket-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem; /* Tailwind p-4 md:p-6 */
    border-bottom: 1px solid #e5e7eb; /* Tailwind border-gray-200 */
    flex-shrink: 0;
    background-color: #f9fafb; /* Tailwind gray-50 */
}
#support-ticket-modal .support-ticket-modal-header h3 {
    margin-bottom: 0; /* Override general modal h3 margin */
}


#support-ticket-modal .support-ticket-modal-body {
    flex-grow: 1;
    overflow-y: auto; /* Enable vertical scroll for the body */
    padding: 1.5rem; /* Tailwind p-6 */
    display: grid;
    grid-template-columns: 1fr; /* Single column by default for mobile */
    gap: 1.5rem; /* Tailwind gap-6 */
    background-color: #f0f2f5; /* Very light background for the modal body */
}

@media (min-width: 1024px) { /* lg breakpoint */
    #support-ticket-modal .support-ticket-modal-body {
        grid-template-columns: 2fr 1fr; /* Two columns: main content and sidebar */
        grid-template-rows: auto 1fr; /* Auto for main content height, 1fr for comments to take remaining space */
    }
    #support-ticket-modal .support-ticket-main-content {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }
    #support-ticket-modal .support-ticket-sidebar {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }
    #support-ticket-modal .support-ticket-comments-section-full {
        grid-column: 1 / -1; /* Span both columns */
        grid-row: 2 / 3; /* Comments section below main and sidebar */
    }
}


#support-ticket-modal .support-ticket-section-card {
    background-color: #FFFFFF;
    border-radius: 8px; /* Tailwind rounded-lg */
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); /* Darker shadow for inner cards */
    padding: 1rem; /* Tailwind p-4 */
    display: flex;
    flex-direction: column;
    border: 1px solid #d1d5db; /* Tailwind border-gray-300 */
}
#support-ticket-modal .support-ticket-section-card h4 {
    font-size: 1rem; /* Tailwind text-base */
    font-weight: 600; /* Tailwind font-semibold */
    color: #374151; /* Tailwind text-gray-700 */
    margin-bottom: 0.75rem; /* Tailwind mb-3 */
    padding-bottom: 0.5rem; /* Tailwind pb-2 */
    border-bottom: 1px solid #e5e7eb; /* Tailwind border-gray-200 */
}
#support-ticket-modal .support-ticket-quill-editor {
    min-height: 300px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background-color: #ffffff;
}
#support-ticket-modal .support-ticket-quill-editor .ql-toolbar.ql-snow {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    border-bottom: 1px solid #d1d5db;
}
#support-ticket-modal .support-ticket-quill-editor .ql-container.ql-snow {
    border: none;
    min-height: calc(300px - 42px); /* Adjust for toolbar height */
}

#support-ticket-modal .attachment-icons {
    display: flex;
    align-items: center; /* Vertically align icons */
    gap: 0.75rem; /* Tailwind space-x-3 */
}
#support-ticket-modal .attachment-icon-button {
    padding: 0.5rem; 
    border-radius: 50%; 
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-size: 1rem; 
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent; /* Base border */
}
/* Specific colors for icons */
#support-ticket-modal label[for="support-ticket-file-attachment"].attachment-icon-button { /* Target the label */
    background-color: #e0e7ff; /* Light blue bg */
    color: #3730a3; /* Dark blue icon */
    border-color: #a5b4fc;
}
#support-ticket-modal label[for="support-ticket-file-attachment"].attachment-icon-button:hover {
    background-color: #c7d2fe;
    color: #312e81;
}
#support-ticket-modal #support-ticket-audio-attachment.attachment-icon-button {
    background-color: #fee2e2; /* Light red bg */
    color: #991b1b; /* Dark red icon */
    border-color: #fca5a5;
}
#support-ticket-modal #support-ticket-audio-attachment.attachment-icon-button:hover {
    background-color: #fecaca;
    color: #7f1d1d;
}


#support-ticket-modal .attachments-preview-container {
    margin-top: 0.75rem; 
    padding: 0.5rem;
    border: 1px dashed #d1d5db;
    border-radius: 4px;
    min-height: 50px; /* It will grow if there's content */
    background-color: #f9fafb;
    max-height: 150px; /* Add max-height for scrollability if many files */
    overflow-y: auto; /* Enable scroll if content exceeds max-height */
}
#support-ticket-modal .attachment-preview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem; 
    padding: 0.35rem 0.5rem; /* Slightly reduced padding */
    background-color: #eef2ff; 
    border-radius: 4px;
    color: #4338ca; 
    margin-bottom: 0.25rem; /* Space between items */
}
#support-ticket-modal .attachment-preview-item .attachment-file-info {
    display: flex;
    align-items: center;
    flex-grow: 1; /* Allow file info to take space */
    margin-right: 0.5rem; /* Space before delete button */
    overflow: hidden; /* For text ellipsis */
}
#support-ticket-modal .attachment-preview-item .attachment-file-info span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#support-ticket-modal .attachment-preview-item .remove-attachment-btn,
#support-ticket-modal .attachment-preview-item .remove-new-attachment-btn,
#support-ticket-modal .attachment-preview-item .remove-server-attachment-btn {
    background: none;
    border: none;
    color: #ef4444; 
    cursor: pointer;
    font-size: 0.8rem; /* Smaller delete icon/button */
    padding: 0.1rem 0.25rem; /* Smaller padding */
    line-height: 1; /* Ensure button doesn't take too much vertical space */
}
#support-ticket-modal .attachment-preview-item .remove-attachment-btn:hover,
#support-ticket-modal .attachment-preview-item .remove-new-attachment-btn:hover,
#support-ticket-modal .attachment-preview-item .remove-server-attachment-btn:hover {
    color: #dc2626; 
}


#support-ticket-modal .user-search-input-container,
#support-ticket-modal .tag-input-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    position: relative;
}
#support-ticket-modal #support-ticket-assign-user-input,
#support-ticket-modal .tag-input-container input {
    flex-grow: 1;
    margin-bottom: 0 !important;
}
#support-ticket-modal #support-ticket-user-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 150px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
#support-ticket-modal #support-ticket-user-search-results .user-search-item {
    padding: 8px 12px;
    font-size: 0.875rem;
    cursor: pointer;
}
#support-ticket-modal #support-ticket-user-search-results .user-search-item:hover {
    background-color: #f3f4f6;
}

#support-ticket-modal .assigned-items-list-container {
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background-color: #f9fafb;
    min-height: 60px;
    max-height: 120px; 
    overflow-y: auto;
}
#support-ticket-modal .assigned-items-list-container .assigned-user-item,
#support-ticket-modal .assigned-items-list-container .tag-item {
    display: inline-flex;
    align-items: center;
    background-color: #e0e7ff; 
    color: #3730a3; 
    padding: 0.25rem 0.75rem; 
    border-radius: 9999px; 
    font-size: 0.875rem; 
    margin-right: 0.5rem; 
    margin-bottom: 0.5rem; 
    white-space: nowrap;
}
#support-ticket-modal .assigned-items-list-container .assigned-user-item button,
#support-ticket-modal .assigned-items-list-container .tag-item button {
    background: none !important;
    border: none !important;
    color: #4f46e5 !important; 
    margin-left: 0.5rem !important; 
    font-size: 0.75rem !important; 
    cursor: pointer !important;
    padding: 0 !important;
    width: auto !important;
    margin-top: 0 !important;
}
#support-ticket-modal .assigned-items-list-container .assigned-user-item button:hover,
#support-ticket-modal .assigned-items-list-container .tag-item button:hover {
    color: #3730a3 !important; 
}


#support-ticket-modal .comments-list-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0.75rem;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    min-height: 100px; 
    max-height: 250px; 
}
#support-ticket-modal .support-ticket-comments-section-full .comment-input-area {
    border-top: 1px solid #e5e7eb;
    padding-top: 0.75rem;
    display: flex; /* Added for alignment */
    align-items: center; /* Align items vertically */
}
#support-ticket-modal #support-ticket-comment-input {
    flex-grow: 1; /* Textarea takes more space */
    margin-right: 0.5rem; /* Space between textarea and button */
}
#support-ticket-modal #support-ticket-add-comment-btn {
    padding: 0.5rem 0.75rem; /* Smaller padding for send button */
    font-size: 0.875rem; /* Smaller font size */
    flex-shrink: 0; /* Prevent button from shrinking too much */
    width: auto; /* Adjust width based on content */
    min-width: 80px; /* Ensure a minimum width */
}


#support-ticket-modal .support-ticket-modal-footer {
    padding: 1rem 1.5rem; 
    border-top: 1px solid #e5e7eb; 
    display: flex;
    justify-content: flex-start; /* Align button to the left */
    flex-shrink: 0;
    background-color: #f3f4f6; 
}

#support-ticket-modal #create-support-ticket-submit-button {
    background-color: #000000; 
    color: white;
    padding: 0.5rem 1rem; /* Smaller padding */
    border-radius: 0.375rem; 
    font-size: 0.875rem; /* Smaller font size */
    font-weight: 500; /* Tailwind font-medium */
    transition: background-color 0.2s ease;
}
#support-ticket-modal #create-support-ticket-submit-button:hover {
    background-color: #333333; 
}

/* Clickable table cell for Ticket ID */
#support-tickets-table .ticket-id-clickable {
    cursor: pointer;
    color: #3b82f6; /* Tailwind blue-500 */
    text-decoration: none;
}
#support-tickets-table .ticket-id-clickable:hover {
    text-decoration: underline;
    color: #2563eb; /* Tailwind blue-600 */
}

#user-management-content, #dashboard-content, #scheduler-content, #drive-content, #notes-content, #logs-content, #prd-content, #support-content, #operations-content { display: none; }

/* ... existing styles ... */

#operations-content, /* Add if not already there from previous step */
#user-management-content, 
#dashboard-content, 
#scheduler-content, 
#drive-content, 
#notes-content, 
#logs-content, 
#prd-content, 
#support-content { display: none; }

/* Operations Table action buttons */
.operations-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem; /* Tailwind py-2 px-3 */
    border-radius: 0.375rem; /* Tailwind rounded-md */
    font-size: 0.875rem; /* Tailwind text-sm */
    font-weight: 500; /* Tailwind font-medium */
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    width: auto; /* Adjust width as needed */
    margin-bottom: 0.25rem; /* For stacking */
}

.open-task-button {
    background-color: #3b82f6; /* Tailwind blue-500 */
    color: white;
    border-color: #2563eb; /* Tailwind blue-600 */
}
.open-task-button:hover {
    background-color: #2563eb; /* Tailwind blue-600 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.modify-task-button {
    background-color: #f59e0b; /* Tailwind amber-500 */
    color: white;
	margin-left: 10px;
    border-color: #d97706; /* Tailwind amber-600 */
}
.modify-task-button:hover {
    background-color: #d97706; /* Tailwind amber-600 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
	margin-left: 10px;
}


/* Operations App Link Modal Styles */
#operations-app-link-modal .modal-content.operations-app-link-modal-content {
    width: 95vw;
    max-width: 95vw;
    height: 95vh;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    padding: 0; /* Remove padding from modal-content, apply to inner divs */
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border-radius: 0.5rem; /* Tailwind rounded-lg */
    overflow: hidden; /* Important for iframe and header */
}

#operations-app-link-modal .operations-app-link-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem; /* Adjusted padding */
    border-bottom: 1px solid #e5e7eb; /* Tailwind border-gray-200 */
    flex-shrink: 0;
    background-color: #f9fafb; /* Tailwind gray-50 */
}
#operations-app-link-modal .operations-app-link-modal-header h3 {
    margin-bottom: 0;
    font-size: 1.125rem; /* Tailwind text-lg */
}

#operations-app-link-modal-close-button { /* Style for the close button */
    position: static; /* Override absolute if it was inherited */
    font-size: 2rem;  /* Larger size */
    font-weight: bold; /* Bold */
    color: #ef4444; /* Solid Red (Tailwind red-500) */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem; /* Small padding around the icon */
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
}
#operations-app-link-modal-close-button:hover {
    color: #dc2626; /* Darker Red (Tailwind red-600) */
    transform: scale(1.1);
}

#operations-app-link-modal .operations-app-link-iframe-container {
    flex-grow: 1; /* Take remaining space */
    background-color: #777; /* Placeholder background for iframe area */
    overflow: hidden; /* Ensure iframe fits */
}

#operations-app-link-modal #operations-app-link-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Ensure toggle switch styles are present if not already globally available */
.toggle-switch { position: relative; display: inline-block; width: 48px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc; transition: .4s; border-radius: 24px;
}
.slider:before {
    position: absolute; content: ""; height: 16px; width: 16px;
    left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: #4f46e5; } /* Main toggle color */
input:focus + .slider { box-shadow: 0 0 1px #4f46e5; }
input:checked + .slider:before { transform: translateX(24px); }


/* Table style for Operations screen (similar to other tables) */
#operations-tasks-table th, 
#operations-tasks-table td {
    padding: 0.75rem; 
    text-align: left; 
    font-size: 0.875rem; 
    border-bottom: 1px solid #e5e7eb;
}
#operations-tasks-table th {
    background-color: #f9fafb; 
    font-weight: 600; 
    color: #374151;
}


.delete-task-button {
    margin-left: 10px;
	background-color: #ef4444; /* Tailwind red-500 */
    color: white;
    border-color: #dc2626; /* Tailwind red-600 */
}
.delete-task-button:hover {
	margin-left: 10px;
    background-color: #dc2626; /* Tailwind red-600 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* --- Orders Screen Styles --- */
#orders-content .card {
    box-shadow: 0 6px 16px rgba(0,0,0,0.12); /* Slightly darker shadow as requested */
    border: 1px solid #e0e0e0; /* Keep subtle border for definition */
}

#create-new-order-button {
    background-color: #000000; /* Black button */
    transition: background-color 0.2s ease;
}
#create-new-order-button:hover {
    background-color: #333333; /* Darker gray on hover */
}

/* Order Modal specific styles */
#order-modal .modal-content {
    max-width: 4xl; /* Tailwind class for 896px. Or use fixed px: max-width: 900px; */
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}


/* Quill Editor in Order Modal */
#order-details-editor {
    background-color: white; /* Ensure background for editor area */
}
#order-details-editor .ql-toolbar.ql-snow {
    border-top-left-radius: 0.25rem;
    border-top-right-radius: 0.25rem;
    border-bottom: 1px solid #d1d5db; /* Tailwind gray-300 */
}
#order-details-editor .ql-container.ql-snow {
    border-bottom-left-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
    border: 1px solid #d1d5db; /* Match input border */
    border-top: none; /* Avoid double border with toolbar */
    font-size: 1rem; /* Match form input font size */
    min-height: 180px;
}
#order-details-editor .ql-editor {
    min-height: 180px; /* Ensure typing area is sufficient */
    padding: 10px; /* Match form input padding */
}


/* Enhanced Attachments Display in Modal */
#order-existing-attachments-preview-area,
#order-new-attachments-preview-area {
    min-height: 60px; 
    max-height: 250px; /* Increased max height for better scrolling */
    overflow-y: auto;
    padding: 0.5rem; /* Padding inside the grid container */
    border-radius: 0.375rem; /* rounded-md */
    background-color: #f9fafb; /* gray-50 */
}

/* Styling for individual attachment cards */
.attachment-card-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Pushes actions to bottom if card has fixed height or enough content */
    padding: 0.5rem; /* p-2 */
    border: 1px solid #e5e7eb; /* border-gray-200 */
    border-radius: 0.375rem; /* rounded-md */
    background-color: #ffffff; /* bg-white */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
    transition: box-shadow 0.2s ease-in-out;
}
.attachment-card-item:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); /* shadow-md */
}
.attachment-card-item .file-info .truncate {
    max-width: 120px; /* Adjust as needed based on card width */
}
.attachment-card-item .text-xxs { /* Custom smaller text for file size */
    font-size: 0.65rem; /* ~10px */
    line-height: 0.85rem;
}
.attachment-card-item.new-attachment {
    background-color: #f0f9ff; /* Tailwind sky-50 for new attachments */
    border-color: #bae6fd; /* Tailwind sky-200 */
}


#order-attachments-preview-area, /* This ID seems to be from a previous context, ensure its use is intended or remove if #order-new-attachments-preview-area is the correct one */
#order-existing-attachments-preview-area {
    min-height: 60px; /* Ensure some height even when empty */
    max-height: 200px; /* Max height for attachments area */
    overflow-y: auto;
    background-color: #f9fafb; /* Light background for preview areas */
    padding: 0.75rem;
    border-radius: 0.375rem;
}
#order-attachments-preview-area p,
#order-existing-attachments-preview-area p { /* For placeholder text when empty */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%; /* Ensure it fills the container if it's the only child */
    color: #6b7280; /* gray-500 */
    font-style: italic;
}


/* Style for the table actions to be horizontal */
#orders-table .action-button-stack {
    display: flex;
    flex-direction: row; /* Horizontal layout */
    gap: 0.5rem; /* Space between buttons */
    align-items: center;
}

#orders-table .action-button-stack button {
    padding: 0.25rem 0.5rem; /* Smaller padding for compact buttons */
    font-size: 0.8rem; /* Smaller font */
    border-radius: 0.25rem;
    background-color: transparent;
    border: none;
    display: inline-flex; /* Align icon and text */
    align-items: center;
    color: #4B5563; /* Default text color for action buttons */
    transition: color 0.2s ease;
}
#orders-table .action-button-stack button:hover {
    color: #1D4ED8; /* Example hover color - blue-700 */
}
#orders-table .action-button-stack button i {
    margin-right: 0.25rem;
}

/* Orders Table - Details cell styling */
#orders-table td.order-details-cell {
    font-size: 0.8rem; /* Smaller font */
    color: #6b7280; /* Gray color */
}

/* Manage Order Attachments Modal */
#manage-order-attachments-modal .modal-content {
    max-width: 60rem; /* xl or 1024px for wider table */
}
#manage-order-attachments-modal table th, 
#manage-order-attachments-modal table td {
    padding: 0.5rem 0.75rem; /* Adjust padding for modal table */
    font-size: 0.875rem;
}
#manage-order-attachments-modal table .attachment-filename-link {
    color: #3b82f6; /* blue-500 */
    text-decoration: none;
    cursor: pointer;
}
#manage-order-attachments-modal table .attachment-filename-link:hover {
    text-decoration: underline;
    color: #2563eb; /* blue-600 */
}
#manage-order-attachments-modal table .delete-attachment-btn-modal {
    background: none;
    border: none;
    color: #ef4444; /* red-500 */
    cursor: pointer;
}
#manage-order-attachments-modal table .delete-attachment-btn-modal:hover {
    color: #dc2626; /* red-600 */
}

/* Status Change Modal (if you create one like the example in JS) */
#order-status-change-modal .modal-content {
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}


/* Add general selector for operations content if it's missing */
#user-management-content, 
#dashboard-content, 
#scheduler-content, 
#drive-content, 
#notes-content, 
#logs-content, 
#prd-content, 
#support-content,
#operations-content, /* Ensure operations is in this list */
#orders-content /* Add orders here */
{ 
    display: none; 
}


/* --- CRM Specific Styles --- */

/* Full-size CRM Modal (already defined, ensure it's working as intended) */
.crm-modal-full-size .modal-content {
    width: 95vw;
    max-width: 1280px; /* Max width can be set for very large screens */
    height: 95vh;
    max-height: 95vh;
    /* display: flex; flex-direction: column; already set in HTML via Tailwind */
    /* padding: 0; already set in HTML via Tailwind */
    box-shadow: 0 15px 40px rgba(0,0,0,0.35); /* Darker shadow */
    /* overflow: hidden; already set in HTML via Tailwind */
}

/* Styling for inner cards within the CRM Modal */
.crm-modal-card {
    background-color: #ffffff;
    border-radius: 0.375rem; /* rounded-md */
    padding: 1.25rem; /* p-5 */
    margin-bottom: 1.25rem; /* mb-5, form already has space-y-6 */
    box-shadow: 0 4px 12px rgba(0,0,0,0.12); /* Enhanced shadow for cards */
    border: 1px solid #e2e8f0; /* slate-200 for a subtle border */
}

.crm-modal-card-title {
    font-size: 0.9rem; /* Slightly larger text-sm */
    font-weight: 600; /* font-semibold */
    color: #334155; /* slate-700 */
    margin-bottom: 1rem; /* mb-4 */
    padding-bottom: 0.75rem; /* pb-3 */
    border-bottom: 1px solid #cbd5e1; /* slate-300 */
    text-transform: uppercase;
    letter-spacing: 0.025em; /* tracking-wide */
}

/* CRM Form Inputs - General Styling (can inherit from global .form-input if compatible) */
.crm-label {
    display: block;
    font-size: 0.875rem; /* text-sm */
    font-weight: 500; /* font-medium */
    color: #475569; /* slate-600 */
    margin-bottom: 0.25rem; /* mb-1 */
}

.crm-input {
    width: 100%;
    padding: 0.625rem 0.875rem; /* Slightly more padding */
    border: 1px solid #cbd5e1; /* slate-300 */
    border-radius: 0.375rem; /* rounded-md */
    font-size: 0.875rem;
    color: #334155; /* slate-700 */
    background-color: #f8fafc; /* slate-50, very light grey */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.crm-input:focus {
    border-color: #4f46e5; /* indigo-600 */
    background-color: #fff;
    outline: 0;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2); /* Focus ring */
}
.crm-input::placeholder {
    color: #94a3b8; /* slate-400 */
}

/* Specific styling for the phone input group within CRM modal */
.crm-phone-input-group {
    display: flex;
    gap: 0.5rem; /* space-x-2 */
    align-items: center;
}
.crm-phone-input-group .crm-input { /* Common for all parts */
    margin-bottom: 0 !important; /* Override any inherited margin */
}
.crm-phone-input-group .crm-phone-country-code {
    flex: 0 0 auto; /* Don't grow, don't shrink, auto basis */
    width: auto; /* Let content (flag + code) determine width */
    min-width: 90px; /* Ensure enough space for flag and code */
}
.crm-phone-input-group .crm-phone-number-input {
    flex: 1 1 auto; /* Grow and shrink as needed */
}
.crm-phone-input-group .crm-phone-type-select {
    flex: 0 0 auto;
    width: auto;
    min-width: 100px;
}

/* Quill Editor in CRM Modal */
.crm-quill-editor-container {
    min-height: 150px; /* Default min height */
    border: 1px solid #cbd5e1; /* slate-300 */
    border-radius: 0.375rem; /* rounded-md */
    background-color: #fff; /* Ensure it has a background */
}
.crm-quill-editor-container .ql-toolbar.ql-snow {
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
    border-bottom: 1px solid #cbd5e1; /* slate-300 */
    background-color: #f1f5f9; /* slate-100, for toolbar background */
}
.crm-quill-editor-container .ql-container.ql-snow {
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
    border: none; /* Border is on the container */
    font-size: 0.875rem;
    color: #334155; /* slate-700 */
}
.crm-quill-editor-container .ql-editor {
    min-height: 120px; /* Inner editor area height */
    padding: 0.75rem;
}

/* CRM Modal Attachments Area */
#crm-new-attachments-preview-area,
#crm-existing-attachments-preview-area {
    min-height: 70px; /* Increased min-height */
    max-height: 220px;
    /* background-color: #f8fafc; */ /* slate-50 - already in HTML*/
    /* padding: 0.75rem; */ /* p-3 - already in HTML */
    border-radius: 0.375rem; /* rounded-md */
}
#crm-new-attachments-preview-area p.italic,
#crm-existing-attachments-preview-area p.italic {
    min-height: 60px; /* Ensure placeholder text is centered */
}

/* Styling for individual attachment cards (if not covered by global .attachment-card-item) */
/* .crm-modal-card .attachment-card-item { ... add specific styles if needed ... } */

/* Status pills in CRM table - ensure these selectors are specific enough or add classes */
#crm-contacts-table .status-pill-new { background-color: #DBEAFE; color: #1E40AF; }
#crm-contacts-table .status-pill-contacted { background-color: #FEF3C7; color: #92400E; }
#crm-contacts-table .status-pill-qualified { background-color: #D1FAE5; color: #065F46; }
#crm-contacts-table .status-pill-follow-up-needed { background-color: #E0E7FF; color: #3730A3; }
/* ... add more as needed from your CRM_STATUSES list ... */
#crm-contacts-table .status-pill-default { background-color: #E5E7EB; color: #374151; }


/* Ensure this rule is at the end or has enough specificity to hide CRM content initially */
#user-management-content, 
#dashboard-content, 
#scheduler-content, 
#drive-content, 
#notes-content, 
#logs-content, 
#prd-content, 
#support-content,
#operations-content,
#orders-content,
#crm-content /* CRM added here */
{ 
    display: none; 
}


.dbcard {
  background-color: #636675;   /* Light background */
  border-radius: 12px;
  font-size:18px;
  font-weight:500;
  color: #fff;
  padding: 24px;
  margin: 16px 0;
  box-shadow: 0 5px 8px rgba(0,0,0,0.06);
  transition: background 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

/* Optional: Differentiate cards with alternate backgrounds */
.dbcard:nth-child(2) {
  background-color: #636675;
}

/* Hover effect for interactivity */
.dbcard:hover {
  background-color: #636aaa;  /* Slightly deeper light blue */
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}

.modal,
.modal-overlay {
    visibility: hidden;
    opacity: 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex; /* This is the key for centering */
    justify-content: center; /* This is the key for centering */
    align-items: center; /* This is the key for centering */
    z-index: 1000;
    padding: 15px;
    box-sizing: border-box;
    transition: visibility 0s linear 0.3s, opacity 0.3s ease-in-out;
}

.modal.show,
.modal-overlay.show {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}


.link-modal-content {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;        /* Use viewport height */
    max-height: 100vh;    /* Use viewport height */
    display: flex;
    flex-direction: column;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border-radius: 0.5rem;
    overflow-y: auto;     /* Enable vertical scroll */
    overflow-x: hidden;   /* Prevent horizontal scroll */
}

.link-modal-close {
  position: absolute;
  right: 22px;
  top: 22px;
  width: 50px;               /* Set width for circle */
  height: 50px;              /* Set height for circle */
  background: #fffddd;       /* Solid red (Tailwind's red-600) */
  color: #fff;               /* White font */
  border: none;
  border-radius: 50%;        /* Make it a circle */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;         /* Adjust as needed */
  cursor: pointer;
  z-index: 10001;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15); /* Optional: subtle shadow */
}


.link-modal-close-mtask {
  position: absolute;
  right: 22px;
  top: 22px;
  width: 50px;               /* Set width for circle */
  height: 50px;              /* Set height for circle */
  background: #f2e3fa;       /* Solid red (Tailwind's red-600) */
  color: #fff;               /* White font */
  border: none;
  border-radius: 50%;        /* Make it a circle */
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;         /* Adjust as needed */
  cursor: pointer;
  z-index: 10001;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15); /* Optional: subtle shadow */
}


.link-modal-close svg {
  display: block;
}

#modalIframe {
  width: 100vw;
  height: 100vh;
  border: none;
  flex: 1 1 auto;
}

/* ==========================================================================
   mTask Module - Revamped Modal Styles
   ========================================================================== */

#mtask-content { display: none; }

/* Main Tab styling */
#mtask-content .mtask-tab-button {
    color: #6b7280; /* gray-500 */
    border-color: transparent;
    transition: all 0.2s ease-in-out;
}
#mtask-content .mtask-tab-button.active-tab {
    color: #4f46e5; /* indigo-600 */
    border-color: #4f46e5;
    font-weight: 600;
}

/* New mTask Modal Layout */
.modal-content.mtask-modal-content-revamped {
    width: 95vw;
    max-width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    background-color: #f3f4f6;
    border-radius: 0.75rem;
    overflow: hidden;
}

.modal-body-scrollable-grid {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 1024px) {
    .modal-body-scrollable-grid {
        grid-template-columns: 2fr 1fr;
        padding: 1.5rem;
        gap: 1.5rem;
    }
}

.mtask-main-content, .mtask-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
@media (min-width: 1024px) {
    .mtask-main-content, .mtask-sidebar {
        gap: 1.5rem;
    }
}

/* Inner cards within the modal body */
.mtask-inner-card {
    background-color: #ffffff;
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

/* Form Label inside modal */
.mtask-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151; /* gray-700 */
}
.mtask-sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}


/* Tag Input and Display */
#mtask-tags-container {
    min-height: 40px;
}
.mtask-tag-item {
  display: flex;
  align-items: center;
  background: #e2e272;       /* Light background */
  color: #222;
  border-radius: 999px;
  padding: 0.25em 0.75em 0.25em 0.75em;
  font-size: 1em;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08); /* Subtle shadow */
  gap: 0.5em;
}

.remove-tag-btn {
  margin-left: auto;         /* Pushes button to the end */
  background: none;
  border: none;
  color: #e53e3e;            /* Red color for close icon */
  font-size: 1.1em;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.2em;
  border-radius: 50%;
  transition: background 0.2s;
}
.remove-tag-btn:hover {
  background: #ffe5e5;       /* Light red on hover */
}
/* Tag Input and Display */


/* ==========================================================================
   mTask Module - EDITABLE TEXTAREA UI FOR SUB-ITEMS
   ========================================================================== */

/* The container for the textarea and its delete button */
.sub-item-textarea-row {
    display: flex;
    align-items: flex-start; /* Align cross mark to the top */
    gap: 0.5rem; /* 8px */
    width: 100%;
}

/* The editable textarea for a sub-item */
.sub-item-textarea {
    flex-grow: 1; /* Allows the textarea to expand */
	rows:3;
    width: 0; /* CRUCIAL FIX: Allows flex-grow to work correctly on form elements */
    border: 1px solid #e5e7eb; /* gray-200 */
    background-color: #e0f4f6; 
    border-radius: 0.375rem; /* rounded-md */
    padding: 0.5rem 0.75rem; /* 8px 12px */
    font-size: 0.875rem; /* 14px */
    color: #1f2937; /* gray-800 */
    resize: none; /* Disable manual resize handle */
    overflow: hidden; /* Hide the scrollbar until needed */
    line-height: 1.5;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sub-item-textarea:focus {
    outline: none;
    border-color: #a5b4fc; /* indigo-300 */
    box-shadow: 0 0 0 2px #c7d2fe; /* indigo-200 */
    background-color: #ffffff;
}

/* The 'x' button to remove a sub-item */
.dynamic-remove-btn {
    width: 30px;
    background: none;
    border: none;
    color: #9ca3af; /* gray-400 */
    cursor: pointer;
    font-size: 1.5rem; /* 24px */
    font-weight: 600;
    line-height: 1;
    padding: 0.25rem; /* Add some clickable area */
    margin-top: 0.125rem;
    transition: color 0.2s ease;
}
.dynamic-remove-btn:hover {
    color: #ef4444; /* red-500 */
}


/* Attachment Button & Preview */
.mtask-attachment-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.mtask-attachment-upload-btn:hover {
    background-color: #f9fafb;
    border-color: #a5b4fc;
    color: #4f46e5;
}

.attachment-preview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.6rem;
    background-color: #f3f4f6;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}
.attachment-preview-item .truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
    margin-right: 0.5rem;
}
.attachment-preview-item.existing a {
    color: #3b82f6;
    text-decoration: none;
}
.attachment-preview-item.existing a:hover {
    text-decoration: underline;
}
.remove-new-attachment-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}

/* FIX: mTask Revamped Modal UI Corrections */
#mtask-sub-item-input,
#mtask-tag-input {
    width: auto !important;
    margin-bottom: 0 !important;
}
#mtask-add-sub-item-btn,
#mtask-add-tag-btn {
    width: 2.25rem !important;
    padding: 0 !important;
    margin-top: 0 !important;
}

.mtask-quill-card {
    display: flex;
    flex-direction: column;
}
.mtask-quill-card #mtask-quill-editor {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.mtask-quill-card #mtask-quill-editor .ql-container {
    flex-grow: 1;
}

.mtask-edit-btn {
  display: inline-block;
  align-items:center;
  padding: 10px;
  margin-right:20px;
  font-size: 0.95rem;
  font-weight: 700;
  color: blue; /* Indigo-600 */
  background: #e5e0f8; /* Light gray */
  border: none;
  border-radius: 5px; /* Pill shape */
  cursor: pointer;
}
.mtask-edit-btn:hover {
  background: #eee; /* Lighter indigo */
  color: #555; /* Indigo-900 */
}

.mtask-delete-btn {
  display: inline-block;
  align-items:center;
  padding: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: red; /* Indigo-600 */
  background: #e5e0f8; /* Light gray */
  border: none;
  border-radius: 5px; /* Pill shape */
  cursor: pointer;
}
.mtask-delete-btn:hover {
  background: #eee; /* Lighter indigo */
  color: #555; /* Indigo-900 */
}

