:root {
    --bs-primary: #10b981;
    --bs-primary-rgb: 16, 185, 129;
    --bs-body-font-family: 'Inter', sans-serif;
    --mintea-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --mintea-gradient-hover: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* Bootstrap Overrides for Color Consistency */
.text-primary {
    color: #10b981 !important;
}

.bg-primary {
    background-color: #10b981 !important;
}

.border-primary {
    border-color: #10b981 !important;
}

/* List Group Active override */
.list-group-item.active {
    background-color: #10b981;
    border-color: #10b981;
    color: white;
    z-index: 2;
}

/* Button Outline Primary override */
.btn-outline-primary {
    color: #10b981;
    border-color: #10b981;
}

.btn-outline-primary:hover,
.btn-outline-primary:active,
.btn-outline-primary:focus,
.btn-outline-primary.active {
    background-color: #10b981;
    border-color: #10b981;
    color: white;
}

body {
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
    /* Ensure base font size is consistent */
    font-size: 1rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography & Utilities */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Standardized Font Sizes */
.text-xs {
    font-size: 0.75rem !important;
    /* 12px */
}

.text-sm {
    font-size: 0.875rem !important;
    /* 14px */
}

.text-base {
    font-size: 1rem !important;
    /* 16px */
}

.text-lg {
    font-size: 1.125rem !important;
    /* 18px */
}

.text-xl {
    font-size: 1.25rem !important;
    /* 20px */
}

.fw-semibold {
    font-weight: 600 !important;
}

.fw-bold {
    font-weight: 700 !important;
}

.fw-extrabold {
    font-weight: 800 !important;
}

/* Buttons */
.btn-primary {
    background: var(--mintea-gradient);
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background: var(--mintea-gradient-hover) !important;
    border: none !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3) !important;
}

/* Override bootstrap active/focus states to keep the style */
.btn-primary:active:focus {
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3) !important;
}

/* Forms */
.form-control {
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    padding: 0.75rem 1rem;
    background-color: #fff;
    transition: all 0.2s ease-in-out;
}

.form-control:focus {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    background-color: #fff;
    outline: none;
}

.form-select:focus {
    border-color: #10b981;
    outline: 0;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.form-floating>.form-control {
    height: 3.5rem;
    line-height: 1.25;
}

.form-floating>label {
    padding-left: 1rem;
}

/* Navbar */
.navbar.bg-mintea {
    background: var(--mintea-gradient) !important;
}

.navbar-divider {
    height: 24px;
    width: 1px;
    background-color: rgba(255, 255, 255, 0.25);
    margin: 0 1.25rem;
}

/* Cards & Containers */
.card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .05);
}

/* Utilities */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3) !important;
}

.bg-gradient-primary {
    background: var(--mintea-gradient) !important;
}

.text-mintea {
    color: #10b981 !important;
}

.rounded-xl {
    border-radius: 1rem !important;
}

.rounded-lg {
    border-radius: 0.75rem !important;
}

.rounded-lg-start {
    border-top-left-radius: 0.75rem !important;
    border-bottom-left-radius: 0.75rem !important;
}

.rounded-lg-end {
    border-top-right-radius: 0.75rem !important;
    border-bottom-right-radius: 0.75rem !important;
}

.shadow-soft {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05) !important;
}

.text-shadow-sm {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Custom Decorative Elements */
.decoration-circle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float-bubbles 18s ease-in-out infinite;
}

body.animations-disabled .decoration-circle {
    animation: none !important;
}

.setup-decoration-1 {
    top: -10%;
    right: -10%;
    width: 300px;
    height: 300px;
    animation-delay: -2s;
}

.setup-decoration-2 {
    bottom: -5%;
    left: -5%;
    width: 200px;
    height: 200px;
    animation-delay: -7s;
}

.decoration-circle.subtle {
    pointer-events: none;
    transition: all 0.5s ease;
}

.decoration-circle.subtle-green {
    background: rgba(16, 185, 129, 0.1) !important;
}

.decoration-circle.subtle-grey {
    background: rgba(107, 114, 128, 0.07) !important;
}

@keyframes float-bubbles {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(40px, -60px) scale(1.05);
    }

    66% {
        transform: translate(-30px, 30px) scale(0.95);
    }
}

.bg-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
    opacity: 1;
}

.logo-wrapper {
    width: 100px;
    height: 100px;
    background-color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
}

.mw-600 {
    max-width: 600px;
}

/* Refactored Inline Styles */
.logo-offset {
    transform: translateX(4px);
}

.icon-lg {
    width: 80px;
    height: 80px;
}

.min-h-150px {
    min-height: 150px;
}

.text-pre-wrap {
    white-space: pre-wrap;
}

/* Dashboard Gradients */
.bg-gradient-warning {
    background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%) !important;
    color: white;
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%) !important;
    color: white;
}

.card-stats-title {
    font-size: 0.75rem;
    /* text-xs */
    letter-spacing: 1px;
    opacity: 0.9;
}

.cursor-pointer {
    cursor: pointer;
}

/* Admin Settings */
.sticky-offset {
    position: sticky;
    top: 2rem;
}

.w-40px {
    width: 40px;
}

.color-preview-circle {
    width: 20px;
    height: 20px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Avatar Circle in Navbar */
/* Consolidated duplicate definition */
.avatar-circle {
    width: 32px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    /* text-sm */
    font-weight: 600;
    color: white;
    transition: background-color 0.2s ease;
}

.nav-link:hover .avatar-circle {
    background-color: rgba(255, 255, 255, 0.3);
}

.navbar-nav .nav-link {
    font-weight: 500;
}

/* Tabs adjustment */
.nav-pills .nav-link.active,
.nav-pills .show>.nav-link {
    background-color: #10b981;
}

/* Pagination Overrides for Datatables */
.page-link {
    color: #10b981;
}

.page-link:hover {
    color: #059669;
}

.page-item.active .page-link {
    background-color: #10b981;
    border-color: #10b981;
    color: white;
}

.page-link:focus {
    box-shadow: 0 0 0 0.25rem rgba(16, 185, 129, 0.25);
}

/* Radio Buttons and Checkbox overrides */
.form-check-input:checked {
    background-color: #10b981;
    border-color: #10b981;
}

.form-check-input:focus {
    border-color: #10b981;
    outline: 0;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

/* =========================================
   Ticket Detail Refactoring
   ========================================= */

/* Header Section */
.ticket-header-card {
    background: #fff;
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    /* Soft premium shadow */
    border: 1px solid #f0f2f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.ticket-header-title h3 {
    margin-bottom: 0.25rem;
    font-weight: 800;
    color: #1f2937;
}

.ticket-header-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.875rem;
    /* text-sm */
}

/* Chat / Conversation Area */
.ticket-chat-container {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    padding: 10px; /* Small padding so content/scrollbar is always within the radius of the corners */
    position: relative;
    overflow: hidden;
}

.ticket-chat-area {
    max-height: 700px;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    /* Standard scrollbar behavior - radius issues are now solved by container padding */
}

.chat-bubble-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
}

.chat-bubble {
    padding: 1.25rem 1.5rem;
    border-radius: 1.25rem;
    position: relative;
    max-width: 85%;
    line-height: 1.6;
    font-size: 1rem;
    /* Standard readable text size */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

/* Message from Customer/Original Poster (Left aligned) */
.chat-bubble-container.inbound {
    align-items: flex-start;
}

.chat-bubble-container.inbound .chat-bubble {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-top-left-radius: 0.25rem;
    color: #374151;
}

/* Message from Staff/Reply (Right aligned) */
.chat-bubble-container.outbound {
    align-items: flex-end;
}

.chat-bubble-container.outbound .chat-bubble {
    background-color: #ecfdf5;
    /* Very light mint */
    border: 1px solid #d1fae5;
    border-top-right-radius: 0.25rem;
    color: #065f46;
}

/* Internal Note (Distinct style) */
.chat-bubble-container.internal .chat-bubble {
    background-color: #fffbeb;
    /* Light yellow */
    border: 1px solid #fcd34d;
    color: #92400e;
    width: 100%;
    max-width: 100%;
}

.chat-meta {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-bubble-container.outbound .chat-meta {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 2px solid white;
    flex-shrink: 0;
}

.chat-avatar.customer { background: linear-gradient(135deg, #64748b 0%, #475569 100%); }
.chat-avatar.agent { background: var(--mintea-gradient); }
.chat-avatar.internal { background: #f59e0b; }

.chat-bubble-wrapper {
    display: flex;
    flex-direction: column;
}

.chat-bubble {
    padding: 1rem 1.25rem;
    border-radius: 1.25rem;
    position: relative;
    line-height: 1.6;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.chat-bubble-container.inbound .chat-bubble {
    background-color: #ffffff;
    border: 1px solid #f1f5f9;
    border-top-left-radius: 0.25rem;
    color: #1e293b;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.chat-bubble-container.outbound .chat-bubble {
    background-color: #ecfdf5;
    border: 1px solid #d1fae5;
    border-top-right-radius: 0.25rem;
    color: #064e3b;
}

.chat-bubble-container.internal .chat-bubble {
    background-color: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    color: #78350f;
    max-width: 100%;
}

.chat-bubble-container.internal {
    align-items: stretch;
    width: 100%;
}

/* System Log (Less noticeable) */
.chat-bubble-container.system {
    align-items: center;
}

.chat-bubble-container.system .chat-bubble {
    background-color: #f8f9fa;
    /* Lightest gray */
    border: 1px dashed #ced4da;
    /* Distinctive but subtle dashed border */
    color: #6c757d;
    /* Muted text */
    width: auto;
    min-width: 50%;
    max-width: 80%;
    text-align: center;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    box-shadow: none;
    /* Flat appearance */
}

.chat-bubble-container.system .chat-meta {
    text-align: center;
    font-size: 0.7rem;
    opacity: 0.7;
}

/* Sidebar Info */
.ticket-sidebar .card {
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.ticket-sidebar .card-header {
    background-color: #fff;
    border-bottom: 1px solid #f3f4f6;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.ticket-sidebar .list-group-item {
    border-color: #f3f4f6;
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    /* text-sm */
}

.status-select-container {
    background: #f9fafb;
    padding: 1.25rem;
    border-top: 1px solid #e5e7eb;
}

/* Editor / Reply Box */
.reply-box-card {
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.reply-box-header {
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    /* text-sm */
    font-weight: 600;
    color: #4b5563;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* Password Strength Meter */
.password-strength-meter {
    height: 4px;
    background-color: #e5e7eb;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.password-strength-meter-fill {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
}

.strength-weak {
    background-color: #ef4444;
    width: 25%;
}

.strength-fair {
    background-color: #f59e0b;
    width: 50%;
}

.strength-good {
    background-color: #3b82f6;
    width: 75%;
}

.strength-strong {
    background-color: #10b981;
    width: 100%;
}

.password-toggle-btn {
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    color: #6b7280;
    transition: color 0.3s ease;
}

.password-toggle-btn:hover {
    color: #10b981;
}

.input-group-text-transparent {
    background-color: transparent !important;
    border-left: none !important;
}

.form-control-with-toggle {
    border-right: none !important;
}

.input-group:focus-within .form-control,
.input-group:focus-within .input-group-text {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.input-group .form-control:focus {
    box-shadow: none !important;
}

/* Custom Buttons */
.btn-white {
    background: #ffffff;
    color: #374151;
    transition: all 0.3s ease;
}

.btn-white:hover {
    background: #ffffff;
    color: #10b981;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

/* Utilities for Inline Style Replacement */
.ls-sm {
    letter-spacing: 0.05em !important;
}

.ls-md {
    letter-spacing: 0.1em !important;
}

.resize-none {
    resize: none !important;
}

.d-none-important {
    display: none !important;
}

.fs-tiny {
    font-size: 0.8em !important;
}

/* Decoration Circles */
.decor-1 {
    width: 500px;
    height: 500px;
    top: -150px;
    left: -150px;
    animation-delay: 0s;
}

.decor-2 {
    width: 400px;
    height: 400px;
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

.decor-3 {
    width: 300px;
    height: 300px;
    top: 20%;
    right: -50px;
    animation-delay: -10s;
}

.decor-4 {
    width: 250px;
    height: 250px;
    bottom: 15%;
    left: 5%;
    animation-delay: -15s;
}

/* DataTables & Dashboard Specific */
div.dataTables_wrapper div.dataTables_filter input {
    border-radius: 0.375rem;
}

div.dataTables_wrapper div.dataTables_length select {
    border-radius: 0.375rem;
    padding-right: 2rem;
    /* Fix for arrow overlap */
}

.filter-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.filter-card:hover {
    transform: translateY(-3px);
}

.filter-card.active-filter {
    transform: translateY(-3px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15) !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
}

/* =========================================
   Dark Mode Overrides
   ========================================= */

[data-bs-theme="dark"] body {
    background-color: #0f172a;
    /* Slate 900 */
    color: #f1f5f9;
    /* Slate 100 */
}

/* Navbar */
[data-bs-theme="dark"] .navbar.bg-mintea {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%) !important;
}

/* Cards */
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .ticket-header-card,
[data-bs-theme="dark"] .reply-box-card {
    background-color: #1e293b;
    /* Slate 800 */
    border-color: #334155;
    /* Slate 700 */
    color: #f1f5f9;
}

[data-bs-theme="dark"] .reply-box-header {
    background-color: #0f172a;
    border-bottom-color: #334155;
    color: #94a3b8;
}

[data-bs-theme="dark"] .ticket-header-card {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* Headings */
[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6,
[data-bs-theme="dark"] .ticket-header-title h3 {
    color: #f1f5f9;
}

/* Text Muted Override */
[data-bs-theme="dark"] .text-muted {
    color: #94a3b8 !important;
    /* Slate 400 */
}

/* Inputs */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #0f172a;
    border-color: #10b981;
    color: #f1f5f9;
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #64748b;
}

/* List Groups & Sidebar */
[data-bs-theme="dark"] .list-group-item {
    background-color: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

[data-bs-theme="dark"] .list-group-item.disabled {
    background-color: #0f172a;
    color: #64748b;
}

[data-bs-theme="dark"] .ticket-sidebar .card-header {
    background-color: #1e293b;
    border-bottom-color: #334155;
}

[data-bs-theme="dark"] .status-select-container {
    background-color: #0f172a;
    border-top-color: #334155;
}

/* Ticket Chat Bubbles */
[data-bs-theme="dark"] .ticket-chat-container {
    background-color: #0f172a;
    border-color: #334155;
}

/* Inbound (User) */
[data-bs-theme="dark"] .chat-bubble-container.inbound .chat-bubble {
    background-color: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

/* Outbound (Agent) */
[data-bs-theme="dark"] .chat-bubble-container.outbound .chat-bubble {
    background-color: #064e3b;
    /* Dark Green */
    border-color: #065f46;
    color: #ecfdf5;
}

/* Internal Note */
[data-bs-theme="dark"] .chat-bubble-container.internal .chat-bubble {
    background-color: #451a03;
    /* Dark Amber/Brown */
    border-color: #78350f;
    color: #fef3c7;
}

/* System Log */
[data-bs-theme="dark"] .chat-bubble-container.system .chat-bubble {
    background-color: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

/* Tables */
[data-bs-theme="dark"] .table {
    color: #f1f5f9;
    border-color: #334155;
}

[data-bs-theme="dark"] .table> :not(caption)>*>* {
    background-color: transparent;
    color: #f1f5f9;
    border-bottom-color: #334155;
}

[data-bs-theme="dark"] .bg-light {
    background-color: #1e293b !important;
}

[data-bs-theme="dark"] .table-hover>tbody>tr:hover>* {
    background-color: #334155;
    color: #fff;
}

/* Modals */
[data-bs-theme="dark"] .modal-content {
    background-color: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
    border-color: #334155;
}

[data-bs-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Footer */
[data-bs-theme="dark"] footer.bg-white {
    background-color: #0f172a !important;
    border-top-color: #334155 !important;
}

/* Misc Utilities */
[data-bs-theme="dark"] .bg-white {
    background-color: #1e293b !important;
}

[data-bs-theme="dark"] .header-back-btn {
    background: #0f172a;
    border-color: #334155;
    color: #94a3b8;
}

[data-bs-theme="dark"] .header-back-btn:hover {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
}

[data-bs-theme="dark"] .dashed-underline-hover:hover {
    background-color: #334155;
}

/* Fix Status Badge Text Colors in Dark Mode */
[data-bs-theme="dark"] .bg-secondary-subtle {
    background-color: rgba(108, 117, 125, 0.2) !important;
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .bg-success-subtle {
    background-color: rgba(25, 135, 84, 0.2) !important;
    color: #75b798 !important;
}

[data-bs-theme="dark"] .bg-warning-subtle {
    background-color: rgba(255, 193, 7, 0.2) !important;
    color: #ffda6a !important;
}

[data-bs-theme="dark"] .bg-danger-subtle {
    background-color: rgba(220, 53, 69, 0.2) !important;
    color: #ea868f !important;
}

/* Dashboard Stat Cards */
[data-bs-theme="dark"] .bg-gradient-warning {
    background: linear-gradient(135deg, #854d0e 0%, #a16207 100%) !important;
}

[data-bs-theme="dark"] .bg-gradient-secondary {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%) !important;
}

/* DataTables Filter Input */
[data-bs-theme="dark"] div.dataTables_wrapper div.dataTables_filter input {
    background-color: #0f172a;
    border-color: #334155;
    color: white;
}

.cursor-help {
    cursor: help !important;
}

/* Footer Brand Icons Hover Effects */
footer a:hover .bi-gitlab {
    color: #fc6d26 !important;
    transition: color 0.2s ease;
}

footer a:hover .bi-github {
    color: #181717 !important;
    transition: color 0.2s ease;
}

/* GitHub light mode / dark mode handling */
[data-bs-theme="dark"] footer a:hover .bi-github {
    color: #ffffff !important;
}

footer a:hover .bi-discord {
    color: #5865F2 !important;
    transition: color 0.2s ease;
}

/* Quill.js Dark Mode Support */
[data-bs-theme="dark"] .ql-snow .ql-stroke {
    stroke: #f1f5f9;
}
[data-bs-theme="dark"] .ql-snow .ql-fill,
[data-bs-theme="dark"] .ql-snow .ql-stroke.ql-fill {
    fill: #f1f5f9;
}
[data-bs-theme="dark"] .ql-snow .ql-picker {
    color: #f1f5f9;
}
[data-bs-theme="dark"] .ql-snow .ql-picker-options {
    background-color: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}
[data-bs-theme="dark"] .ql-snow.ql-toolbar,
[data-bs-theme="dark"] .ql-snow .ql-toolbar {
    background-color: #1e293b;
    border-color: #334155;
}
[data-bs-theme="dark"] .ql-container.ql-snow {
    border-color: #334155;
    background-color: #0f172a;
}
[data-bs-theme="dark"] .ql-editor {
    color: #f1f5f9;
}
[data-bs-theme="dark"] .ql-snow .ql-picker-item:hover,
[data-bs-theme="dark"] .ql-snow .ql-picker-label:hover {
    color: #10b981;
}

/* Legal Page Content Styles */
.prose {
    line-height: 1.75;
    color: #374151; /* Gray 700 */
    white-space: pre-wrap;
}
.prose h1, .prose h2, .prose h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #111827; /* Gray 900 */
}
.prose p {
    margin-bottom: 1.25rem;
}
.prose ul, .prose ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}
.prose a {
    color: #10b981;
    text-decoration: none;
    border-bottom: 1px dashed rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
}
.prose a:hover {
    color: #059669;
    border-bottom-color: #059669;
}

[data-bs-theme="dark"] .prose {
    color: #d1d5db; /* Gray 300 */
}
[data-bs-theme="dark"] .prose h1, [data-bs-theme="dark"] .prose h2, [data-bs-theme="dark"] .prose h3 {
    color: #f3f4f6; /* Gray 100 */
}

/* Dark Mode Overhauled Chat History */
[data-bs-theme="dark"] .chat-bubble-container.inbound .chat-bubble {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

[data-bs-theme="dark"] .chat-bubble-container.outbound .chat-bubble {
    background: #064e3b;
    border-color: #065f46;
    color: #ecfdf5;
}

[data-bs-theme="dark"] .chat-bubble-container.internal .chat-bubble {
    background: #451a03;
    border-color: #78350f;
    border-left-color: #d97706;
}

[data-bs-theme="dark"] .chat-avatar {
    border-color: #1e293b;
}

/* =========================================
   Utility Classes for Inline Style Removal
   ========================================= */

.editor-bottom-radius {
    border-bottom-left-radius: 0.75rem !important;
    border-bottom-right-radius: 0.75rem !important;
}

.h-200px { height: 200px !important; }
.h-300px { height: 300px !important; }
.h-343px { height: 343px !important; }
.h-400px { height: 400px !important; }

.text-hint-xs {
    font-size: 0.65rem !important;
    font-style: italic !important;
    opacity: 0.6 !important;
}

.dropdown-min-auto {
    min-width: auto !important;
}

.iframe-full {
    width: 100%;
    height: 100%;
    border: none;
}

.overflow-hidden {
    overflow: hidden !important;
}

.bg-preview {
    background-color: #f8fafc !important;
}

[data-bs-theme="dark"] .bg-preview {
    background-color: #0f172a !important;
}

.dashed-underline-hover {
    border-bottom: 1px dashed #cbd5e1; /* slate-300 */
    padding-bottom: 1px;
    transition: all 0.2s ease;
}

.dashed-underline-hover:hover {
    border-bottom-color: #64748b; /* slate-500 */
    background-color: #f1f5f9; /* slate-100 */
    cursor: pointer;
}

.header-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #f8fafc;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.header-back-btn:hover {
    background: var(--bs-primary);
    color: white;
    border-color: var(--bs-primary);
    transform: translateX(-3px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

/* =========================================
   File Attachments System
   ========================================= */

.upload-zone {
    border: 2px dashed #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    background-color: #f8fafc;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-top: 1rem;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: #10b981;
    background-color: #ecfdf5;
}

.upload-zone i {
    font-size: 1.5rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
    display: block;
}

.attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.attachment-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.attachment-item .remove-btn {
    color: #ef4444;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.attachment-item .remove-btn:hover {
    opacity: 1;
}

.attachment-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.attachment-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
    aspect-ratio: 1;
}

.attachment-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-preview-item .file-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 10px;
    padding: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Chat Stream Attachments */
.chat-attachments {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.chat-attachment-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.03);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(0,0,0,0.05);
    margin-right: 5px;
    margin-bottom: 5px;
    transition: all 0.2s;
}

.chat-attachment-item:hover {
    background: rgba(0,0,0,0.06);
    transform: translateY(-1px);
}

/* Inlined Images */
.prose img {
    max-width: 100%;
    border-radius: 8px;
    margin: 10px 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    cursor: zoom-in;
}

/* File Upload Progress */
.upload-progress {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin-top: 5px;
    width: 100%;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    background: #10b981;
    width: 0%;
    transition: width 0.3s;
}


