/* Shared Limitless-inspired component skin. Keep Django widgets and semantics. */
:root {
    --ui-ink: #28313e;
    --ui-muted: #647184;
    --ui-border: #dde3eb;
    --ui-surface: #fff;
    --ui-soft: #f4f6f9;
    --ui-accent: #92702f;
    --ui-focus: #b58b40;
    --ui-danger: #ab3939;
    --ui-radius: 12px;
}
#content { color: var(--ui-ink); }
#content h1 { font-size: clamp(23px, 2vw, 32px); line-height: 1.25; }
#content h2, #content h3 { letter-spacing: -.015em; }
#content :is(input, textarea, select, button, a):focus-visible,
.select2-container--admin.select2-container--focus .select2-selection {
    outline: 2px solid var(--ui-focus) !important;
    outline-offset: 3px;
}
#content :is(input:not([type]), input[type=text], input[type=password], input[type=email], input[type="url"], input[type=number], input[type=search], input[type=date], input[type=datetime-local], input[type=time], select, textarea) {
    min-height: 40px;
    padding: 9px 12px !important;
    max-width: 100%;
    border: 1px solid var(--ui-border) !important;
    border-radius: 9px !important;
    background: var(--ui-surface) !important;
    color: var(--ui-ink) !important;
    font: 400 13px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    transition: border-color .18s, box-shadow .18s;
}
#content textarea { min-height: 130px; resize: vertical; }
#content :is(input, select, textarea):disabled { opacity: .65; cursor: not-allowed; background: var(--ui-soft) !important; }
#content input[readonly], #content textarea[readonly] { background: var(--ui-soft) !important; }
#content input[type=file] { max-width: 100%; padding: 7px; font-size: 12px; }
#content input[type=file]::file-selector-button { padding: 9px 14px; margin-right: 12px; border: 0; border-radius: 7px; background: #ebe3d2; color: #5d4825; cursor: pointer; }
#content input[type=checkbox] {
    appearance: none;
    position: relative;
    display: inline-grid;
    place-content: center;
    width: 19px; height: 19px; min-width: 19px;
    padding: 0 !important; margin: 0 5px 0 0;
    vertical-align: middle;
    border: 1px solid #a4afbd !important; border-radius: 5px !important;
    background: #fff !important; cursor: pointer;
}
#content input[type=checkbox]:checked { background: #947132 !important; border-color: #947132 !important; }
#content input[type=checkbox]:checked::after { content: ""; width: 8px; height: 4px; border: solid #fff; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg); }
#content input[type=checkbox]:indeterminate { background: #947132 !important; }
#content input[type=checkbox]:indeterminate::after { content: ""; width: 9px; height: 2px; background: #fff; }
#content input[type=radio] { width: 18px; height: 18px; margin-right: 7px; vertical-align: middle; accent-color: #947132; }
#content :is(.button, input[type=submit], input[type=button], button[type=submit], .object-tools a) {
    min-height: 38px; padding: 10px 16px !important;
    border-radius: 8px !important; font-size: 12px; font-weight: 600;
    line-height: 1.4; letter-spacing: .01em; text-transform: none;
    cursor: pointer; transition: box-shadow .18s, filter .18s;
}
#content :is(.button, input[type=submit], button[type=submit]):hover { filter: brightness(1.06); box-shadow: 0 6px 18px #84652a26; }
#content .object-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
#content .object-tools li { height: auto; padding: 0; }
#content .object-tools a { display: inline-flex; align-items: center; background: #8c6c32 !important; color: #fff !important; }
#content :is(.deletelink, .deletelink-box a) { color: var(--ui-danger) !important; background: #fff0f0 !important; border: 1px solid #eac9c9 !important; box-shadow: none !important; border-radius: 8px; padding: 10px 16px; }
#content .cancel-link { display: inline-block; padding: 10px 16px; border-radius: 8px; background: #e9edf3; color: #3e4c60; }

/* Form cards, fieldsets and nested editing. */
#content fieldset.module, #content .inline-group { margin-bottom: 22px; border-color: var(--ui-border) !important; border-radius: var(--ui-radius) !important; overflow: visible; }
#content :is(fieldset.module > h2, fieldset.module > details > summary, .inline-group > h2, .inline-group > details > summary) {
    padding: 15px 20px; margin: 0; border-radius: 11px 11px 0 0;
    border-bottom: 1px solid var(--ui-border); background: var(--ui-soft) !important; color: #334155 !important;
    font-size: 13px; font-weight: 650;
}
#content fieldset summary { cursor: pointer; }
#content fieldset summary h2 { display: inline; background: transparent !important; color: inherit !important; }
#content .form-row { padding: 17px 20px !important; }
#content .form-row label { color: #445166; font-size: 12px; line-height: 1.6; }
#content .form-row label.required { color: #28313e; font-weight: 650; }
#content .help, #content p.help { color: var(--ui-muted); font-size: 11px; line-height: 1.65; }
#content .help a { color: #765824; text-decoration: underline; text-underline-offset: 3px; }
#content .readonly { color: #3e4b5e; line-height: 1.65; overflow-wrap: anywhere; }
#content .vLargeTextField { width: min(100%, 1000px); }
#content .inline-related h3 { background: #f0f3f7 !important; color: #475569; padding: 12px 18px; }
#content .inline-related .add-row { padding: 13px 18px; background: #f9fafc; }
#content .inline-related .add-row a { color: #795d2b; font-weight: 600; }
#content .submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px 20px; box-shadow: 0 8px 28px #2633440a; }
#content .submit-row > * { margin: 0; float: none; }
#content .submit-row .deletelink-box { margin-left: auto; }
#content .errornote, #content ul.errorlist { padding: 12px 16px; border: 1px solid #efc6c6; border-radius: 9px; background: #fff3f3; color: #9f3030; font-size: 12px; }
#content .errors :is(input, select, textarea) { border-color: #cb6262 !important; }

/* Registry toolbar, tables, filters and pagination. */
#content #changelist { border-radius: 14px !important; border-color: var(--ui-border) !important; }
#content #changelist #toolbar { padding: 14px 18px; background: #fff; border-bottom: 1px solid var(--ui-border); }
#content #changelist-search > div { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
#content #changelist-search #searchbar { width: min(420px, 55vw); }
#content #changelist .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 18px; color: var(--ui-muted); background: #f6f8fb; border-bottom: 1px solid var(--ui-border); }
#content #changelist .actions label { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12px; }
#content #changelist .actions select { min-width: 190px; height: auto; }
#content #changelist .actions .button { height: auto; }
#content #changelist .actions span { font-size: 11px; }
#content #result_list { width: 100%; }
#content #changelist thead th { background: #f0f3f8 !important; color: #526176 !important; font-size: 10px; font-weight: 700; letter-spacing: .06em; }
#content #changelist thead th a { color: inherit; }
#content #changelist tbody th, #content #changelist tbody td { font-size: 12px; line-height: 1.6; vertical-align: middle; }
#content #changelist tbody th a { color: #43536a; font-weight: 600; }
#content #changelist tbody tr:has(input.action-select:checked) { background: #faf3e3 !important; }
#content #changelist tbody td input[type=number] { min-width: 75px; }
#content #changelist-filter { background: #f8fafc; border-left: 1px solid var(--ui-border); }
#content #changelist-filter h2 { padding: 16px 18px; background: #eef2f7 !important; color: #3e4b5f !important; font-size: 12px; font-weight: 700; }
#content #changelist-filter details { padding: 10px 12px; border-bottom: 1px solid var(--ui-border); }
#content #changelist-filter summary { padding: 6px; color: #3f5068; font-size: 12px; font-weight: 650; cursor: pointer; }
#content #changelist-filter ul { margin: 0; padding: 4px 0; }
#content #changelist-filter li { padding: 0; margin: 3px 0; list-style: none; border: 0; }
#content #changelist-filter li a { display: block; padding: 7px 10px; border-radius: 7px; color: #5a687b; font-size: 11px; }
#content #changelist-filter li a:hover { background: #e9edf3; }
#content #changelist-filter li.selected a { background: #e9ddc3; color: #62491f; font-weight: 650; box-shadow: inset 3px 0 #a18043; }
#content .paginator { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 17px 18px; background: #fff; color: var(--ui-muted); font-size: 12px; }
#content .paginator :is(a, .this-page) { display: inline-grid; min-width: 33px; min-height: 33px; place-items: center; padding: 6px 10px; border: 1px solid var(--ui-border); border-radius: 8px; background: #f8fafc; color: #536176; }
#content .paginator .this-page { background: #344257; border-color: #344257; color: #fff; }

/* Autocomplete, dual lists, related actions, date/time pickers. */
.select2-container--admin .select2-selection { min-height: 40px; border: 1px solid var(--ui-border) !important; border-radius: 9px !important; background: #fff !important; }
.select2-container--admin .select2-selection--single .select2-selection__rendered { line-height: 38px; color: #334155; }
.select2-container--admin .select2-selection--single .select2-selection__arrow { height: 38px; }
.select2-container--admin .select2-selection--multiple .select2-selection__choice { padding: 5px 9px; border: 0; border-radius: 6px; background: #eee5d2; color: #665029; }
.select2-dropdown { border-color: #d7dfe9 !important; border-radius: 9px !important; box-shadow: 0 14px 35px #27344726; }
.select2-container--admin .select2-results__option--highlighted[aria-selected] { background: #42546d; }
#content .related-widget-wrapper { max-width: 100%; }
#content .related-widget-wrapper-link { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px solid #e0e5ec; border-radius: 7px; background: #f5f7fa; vertical-align: middle; }
#content .selector { max-width: 100%; }
#content .selector h2 { border-radius: 9px 9px 0 0; padding: 13px; background: #eaf0f6 !important; color: #44536b !important; }
#content .selector select { border-radius: 0 0 9px 9px !important; }
#content .selector-filter { background: #f5f7fa; border-color: var(--ui-border); padding: 10px; }
.calendarbox, .clockbox { border: 1px solid #dbe1e9; border-radius: 12px; overflow: hidden; box-shadow: 0 18px 45px #28344526; background: #fff; }
.calendar caption, .clockbox h2 { background: #344257 !important; color: #fff !important; padding: 12px; }
.calendar td a { border-radius: 5px; color: #465971; padding: 8px; }
.calendar td.selected a, .calendar td a:hover { background: #ece0c7; color: #634b23; }
.timelist a { padding: 10px; color: #43536a; }
.calendar-cancel, .calendar-shortcuts { padding: 10px; background: #f1f4f8; }
#content progress { accent-color: #a9843f; width: min(100%, 420px); height: 9px; border-radius: 9px; overflow: hidden; }
#content pre { max-width: 100%; overflow: auto; padding: 16px; border: 1px solid #d9e1eb; border-radius: 10px; background: #f4f7fb; color: #35465d; font-size: 12px; }
#content [role=tablist] { display: flex; gap: 8px; border-bottom: 1px solid var(--ui-border); }
#content [role=tab] { padding: 11px 16px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ui-muted); cursor: pointer; }
#content [role=tab][aria-selected=true] { border-bottom-color: var(--ui-accent); color: var(--ui-accent); }
body.login #container { border: 1px solid #dde3eb; border-radius: 18px; box-shadow: 0 25px 80px #2530431c; overflow: hidden; }
#nav-sidebar #nav-filter { width: 100%; min-height: 37px; padding: 9px 12px; margin-bottom: 14px; border: 1px solid #465164 !important; border-radius: 8px !important; background: #303a49 !important; color: #f0f4fa !important; font-size: 11px; }
#nav-sidebar #nav-filter::placeholder { color: #b5c0d0; }
#content .premium-rte { border-color: var(--ui-border); border-radius: 12px; box-shadow: 0 8px 25px #2633440a; }
#content .premium-rte__bar { gap: 5px; padding: 10px; background: #f3f6fa; border-color: var(--ui-border); }
#content .premium-rte__bar button { min-height: 33px; padding: 6px 9px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #45566e; font-size: 12px; }
#content .premium-rte__bar button:hover { border-color: #d4dce7; background: #fff; }
#content .premium-rte__canvas:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: -3px; }
#content .premium-rte__foot { background: #f7f9fc; color: #65758a; border-color: var(--ui-border); }
.crm-toast-stack li.error { border-left: 4px solid #e17878; }
.crm-toast-stack li.warning { border-left: 4px solid #edc470; }
.crm-toast-stack li.success { border-left: 4px solid #69cba2; }
@media (max-width: 767px) {
    #content .form-row, #content .submit-row { padding: 14px !important; }
    #content .aligned label { width: auto; }
    #content #changelist .actions { gap: 8px; padding: 12px; }
    #content #changelist .actions select { min-width: 0; max-width: 100%; }
    #content .submit-row > input { flex: 1 1 auto; }
    #content .submit-row .deletelink-box { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { #content * { transition: none !important; } }
@media (forced-colors: active) { #content input[type=checkbox] { appearance: auto; } #content input[type=checkbox]::after { display: none; } }
