body .filer-dropzone{
    min-height: 200px !important;
}

/* ---- Sidebar: highlight current model + scroll persistence ---- */
#nav-sidebar .current-model > a,
#nav-sidebar a.current-model {
    background: var(--selected-bg, #e0f0ff);
    color: var(--link-fg, #447e9b);
    font-weight: 600;
    border-left: 3px solid var(--link-selected-fg, #205067);
    padding-left: 5px;
}

html[data-theme="dark"] #nav-sidebar .current-model > a,
html[data-theme="dark"] #nav-sidebar a.current-model {
    background: #2a3947;
    color: #f5dd5d;
    border-left-color: #f5dd5d;
}

#nav-sidebar .current-app > caption,
#nav-sidebar caption.current-app {
    background: var(--primary, #79aec8);
    color: #fff;
}

/* ---- Theme toggle button in header ---- */
#theme-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1;
    margin-left: 12px;
}
#theme-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}
#theme-toggle .icon-sun { display: none; }
#theme-toggle .icon-moon { display: inline; }
html[data-theme="dark"] #theme-toggle .icon-sun { display: inline; }
html[data-theme="dark"] #theme-toggle .icon-moon { display: none; }

/* ---- Minimal dark theme (Django 3.2 has no built-in dark mode) ---- */
html[data-theme="dark"] {
    --primary: #264b5d;
    --secondary: #1b2a32;
    --accent: #f5dd5d;
    --primary-fg: #f7f7f7;
    --body-fg: #eeeeee;
    --body-bg: #121212;
    --body-quiet-color: #d0d0d0;
    --body-loud-color: #ffffff;
    --header-color: #ffffff;
    --header-branding-color: var(--accent);
    --header-bg: var(--secondary);
    --header-link-color: var(--primary-fg);
    --breadcrumbs-fg: #c8c8c8;
    --breadcrumbs-link-fg: var(--body-fg);
    --breadcrumbs-bg: #1a1a1a;
    --link-fg: #81d4fa;
    --link-hover-color: #4ac1ec;
    --link-selected-fg: #6f94c6;
    --hairline-color: #272727;
    --border-color: #353535;
    --error-fg: #e35d5d;
    --message-success-bg: #006b1b;
    --message-warning-bg: #583305;
    --message-error-bg: #570808;
    --darkened-bg: #1f1f1f;
    --selected-bg: #2b3a44;
    --selected-row: #1f3145;
    --button-fg: #ffffff;
    --button-bg: var(--primary);
    --button-hover-bg: #234654;
    --default-button-bg: var(--secondary);
    --default-button-hover-bg: #14222a;
    --close-button-bg: #5b5b5b;
    --close-button-hover-bg: #767676;
    --delete-button-bg: #ba2121;
    --delete-button-hover-bg: #a41515;
    --object-tools-fg: var(--button-fg);
    --object-tools-bg: var(--close-button-bg);
    --object-tools-hover-bg: var(--close-button-hover-bg);
    color-scheme: dark;
}
html[data-theme="dark"] body { background: var(--body-bg); color: var(--body-fg); }
html[data-theme="dark"] #header { background: var(--header-bg); color: var(--header-color); }
html[data-theme="dark"] #branding h1, html[data-theme="dark"] #branding h1 a:link, html[data-theme="dark"] #branding h1 a:visited { color: var(--header-branding-color); }
html[data-theme="dark"] #user-tools a { color: var(--header-link-color); border-bottom-color: rgba(255,255,255,0.25); }
html[data-theme="dark"] div.breadcrumbs { background: var(--breadcrumbs-bg); color: var(--breadcrumbs-fg); }
html[data-theme="dark"] div.breadcrumbs a { color: var(--breadcrumbs-link-fg); }
html[data-theme="dark"] .module, html[data-theme="dark"] .module caption, html[data-theme="dark"] .inline-group h2 { background: var(--darkened-bg); color: var(--body-fg); }
html[data-theme="dark"] .module h2, html[data-theme="dark"] .module caption { background: var(--primary); color: var(--header-color); }
html[data-theme="dark"] table thead th { background: var(--darkened-bg); color: var(--body-fg); border-bottom: 1px solid var(--border-color); }
html[data-theme="dark"] table tbody tr.row1 { background: #181818; }
html[data-theme="dark"] table tbody tr.row2 { background: #1d1d1d; }
html[data-theme="dark"] table tbody tr:hover { background: var(--selected-bg); }
html[data-theme="dark"] .form-row { border-bottom-color: var(--hairline-color); }
html[data-theme="dark"] input, html[data-theme="dark"] textarea, html[data-theme="dark"] select { background: #1e1e1e; color: var(--body-fg); border: 1px solid var(--border-color); }
html[data-theme="dark"] .button, html[data-theme="dark"] input[type=submit], html[data-theme="dark"] input[type=button], html[data-theme="dark"] .submit-row input, html[data-theme="dark"] a.button { background: var(--button-bg); color: var(--button-fg); }
html[data-theme="dark"] .button:hover, html[data-theme="dark"] input[type=submit]:hover, html[data-theme="dark"] input[type=button]:hover { background: var(--button-hover-bg); }
html[data-theme="dark"] .object-tools a { background: var(--object-tools-bg); color: var(--object-tools-fg); }
html[data-theme="dark"] .object-tools a:hover { background: var(--object-tools-hover-bg); }
html[data-theme="dark"] #nav-sidebar { background: #181818; border-right: 1px solid var(--border-color); }
html[data-theme="dark"] #nav-sidebar a { color: var(--link-fg); }
html[data-theme="dark"] #nav-sidebar caption { background: #222; color: var(--body-loud-color); }
html[data-theme="dark"] #nav-filter { background: #1e1e1e; color: var(--body-fg); border-color: var(--border-color); }
html[data-theme="dark"] .paginator a:link, html[data-theme="dark"] .paginator a:visited { background: var(--button-bg); color: var(--button-fg); }
html[data-theme="dark"] .selector-available, html[data-theme="dark"] .selector-chosen { background: var(--darkened-bg); }
html[data-theme="dark"] .selector-available h2, html[data-theme="dark"] .selector-chosen h2 { background: var(--primary); color: var(--header-color); }
html[data-theme="dark"] .help, html[data-theme="dark"] p.help, html[data-theme="dark"] .form-row p.help { color: var(--body-quiet-color); }
html[data-theme="dark"] fieldset.collapsed { background: var(--darkened-bg); }
html[data-theme="dark"] .calendar td, html[data-theme="dark"] .calendar th, html[data-theme="dark"] .calendarbox, html[data-theme="dark"] .clockbox { background: #1e1e1e; color: var(--body-fg); }
