html.dark {
    color-scheme: dark;
}

html.dark select,
html.dark select option,
html.dark select optgroup {
    background-color: #0f172a !important;
    color: #e5e7eb !important;
}

html.dark select:focus {
    outline: 2px solid rgba(124, 58, 237, 0.45);
    outline-offset: 1px;
}

.related-widget-wrapper-link,
.related-widget-wrapper a.related-widget-wrapper-link,
.related-widget-wrapper .related-widget-wrapper-link {
    display: none !important;
}

.related-widget-wrapper {
    gap: 0 !important;
}

.related-widget-wrapper > div,
.related-widget-wrapper select,
.related-widget-wrapper input,
.related-widget-wrapper textarea {
    width: 100% !important;
}

form#lead_form > div.flex > #messages-group {
    order: 80;
}

form#lead_form > div.flex > fieldset.lead-system-section {
    order: 90;
}

.business-time-presets {
    margin-top: 0.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.business-time-presets__label {
    font-size: 0.82rem;
    font-weight: 600;
    opacity: 0.9;
}

.business-time-presets__select {
    min-width: 230px;
    border: 1px solid #334155;
    border-radius: 0.5rem;
    padding: 0.3rem 0.5rem;
    background-color: #0f172a !important;
    color: #e5e7eb !important;
    color-scheme: dark;
}

html.dark .business-time-presets__select option,
html.dark .business-time-presets__select optgroup {
    background-color: #0f172a !important;
    color: #e5e7eb !important;
}

.datetimeshortcuts,
.clockbox {
    display: none !important;
}

.crm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.3rem;
    padding: 0.5rem 0.95rem;
    border-radius: 0.55rem;
    border: 1px solid transparent;
    font-weight: 600;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.crm-btn--primary {
    background: #7c3aed !important;
    border-color: #6d28d9 !important;
    color: #ffffff !important;
}

.crm-btn--primary:hover {
    background: #6d28d9 !important;
    border-color: #5b21b6 !important;
}

.crm-btn--neutral {
    background: rgba(15, 23, 42, 0.4);
    border-color: #4b5563;
    color: #e5e7eb !important;
}

.crm-btn--neutral:hover {
    background: rgba(30, 41, 59, 0.65);
}

.crm-btn--soft {
    background: rgba(124, 58, 237, 0.14);
    border-color: rgba(124, 58, 237, 0.45);
    color: #ddd6fe !important;
}

.crm-btn--soft:hover {
    background: rgba(124, 58, 237, 0.24);
}

.admin-sidebar-account-btn {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    margin: 0 12px 12px;
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.96));
    color: #e2e8f0 !important;
    text-decoration: none !important;
}

.admin-sidebar-account-btn:hover {
    border-color: rgba(99, 102, 241, 0.42);
    background: linear-gradient(180deg, rgba(30, 41, 59, 1), rgba(17, 24, 39, 1));
}

.admin-sidebar-account-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.16);
    color: #c7d2fe;
    flex-shrink: 0;
}

.admin-sidebar-account-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-sidebar-account-title {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}

.admin-sidebar-account-subtitle {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.35;
}

.crm-quick-panel {
    margin-bottom: 1rem;
    border-left: 3px solid #7c3aed;
}

.crm-quick-panel__row {
    padding: 0.8rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}

.crm-muted-text {
    opacity: 0.85;
}

.crm-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.crm-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.62rem;
    border: 1px solid #334155;
    border-radius: 9999px;
    text-decoration: none !important;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.22);
    font-size: 0.86rem;
}

.crm-chip:hover {
    background: rgba(51, 65, 85, 0.35);
}

#content-main table[class*="rounded-default"],
#content-main table[class*="rounded-default"] caption {
    border-color: #334155 !important;
}

#content-main table[class*="rounded-default"] {
    background: rgba(15, 23, 42, 0.78) !important;
    border: 1px solid #334155 !important;
    border-radius: 16px !important;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.18);
}

#content-main table[class*="rounded-default"] caption {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.18), rgba(139, 92, 246, 0.12)) !important;
    color: #f8fafc !important;
    font-weight: 800 !important;
    letter-spacing: -0.01em;
    padding: 14px 16px !important;
}

#content-main table[class*="rounded-default"] table {
    background: transparent !important;
}

#content-main table[class*="rounded-default"] th,
#content-main table[class*="rounded-default"] td {
    border-color: rgba(148, 163, 184, 0.12) !important;
}

#content-main table[class*="rounded-default"] a {
    color: #c7d2fe !important;
}

#content-main table[class*="rounded-default"] a:hover {
    color: #ffffff !important;
}

#content-main table[class*="rounded-default"] tr:hover {
    background: rgba(30, 41, 59, 0.65) !important;
}

table.border.border-base-400\/10.border-spacing-none.border-separate.rounded-default.overflow-hidden.shadow-xs.w-full.dark\:border-base-800 {
    background: rgba(15, 23, 42, 0.80) !important;
    border: 1px solid rgba(51, 65, 85, 0.95) !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.18) !important;
}

table.border.border-base-400\/10.border-spacing-none.border-separate.rounded-default.overflow-hidden.shadow-xs.w-full.dark\:border-base-800 > caption.font-semibold.mb-3.text-base-900.text-left.dark\:text-base-100 {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.18), rgba(139, 92, 246, 0.12)) !important;
    color: #f8fafc !important;
    font-weight: 800 !important;
    letter-spacing: -0.01em !important;
    padding: 14px 16px !important;
    margin-bottom: 0 !important;
}

table.border.border-base-400\/10.border-spacing-none.border-separate.rounded-default.overflow-hidden.shadow-xs.w-full.dark\:border-base-800 td,
table.border.border-base-400\/10.border-spacing-none.border-separate.rounded-default.overflow-hidden.shadow-xs.w-full.dark\:border-base-800 th {
    border-color: rgba(148, 163, 184, 0.12) !important;
}

table.border.border-base-400\/10.border-spacing-none.border-separate.rounded-default.overflow-hidden.shadow-xs.w-full.dark\:border-base-800 a {
    color: #c7d2fe !important;
}

table.border.border-base-400\/10.border-spacing-none.border-separate.rounded-default.overflow-hidden.shadow-xs.w-full.dark\:border-base-800 a:hover {
    color: #ffffff !important;
}
