/* MICE365 Admin — 화이트 테마 (CSS 변수 기반, 다크모드 고정)
   Django 5.x admin은 색을 CSS 변수로 테마링한다. 변수만 덮어쓰고
   OS 다크모드에서도 항상 라이트가 되도록 고정한다. */

:root,
html[data-theme="light"],
html[data-theme="auto"],
html[data-theme="dark"] {
    color-scheme: light;

    --primary: #0066cc;
    --secondary: #0066cc;
    --accent: #e7f0fb;
    --primary-fg: #ffffff;

    --body-fg: #1f2933;
    --body-bg: #ffffff;
    --body-quiet-color: #5a6573;
    --body-loud-color: #0b1f33;

    --header-color: #0b5cad;
    --header-branding-color: #0b5cad;
    --header-bg: #ffffff;
    --header-link-color: #0b5cad;

    --breadcrumbs-fg: #5a6573;
    --breadcrumbs-link-fg: #0066cc;
    --breadcrumbs-bg: #f3f6fa;

    --link-fg: #0066cc;
    --link-hover-color: #0052a3;
    --link-selected-fg: #0b5cad;

    --hairline-color: #e7ebf0;
    --border-color: #dfe3e8;

    --button-bg: #0066cc;
    --button-fg: #ffffff;
    --button-hover-bg: #0052a3;
    --default-button-bg: #0066cc;
    --default-button-hover-bg: #0052a3;
    --close-button-bg: #6b7280;
    --close-button-hover-bg: #4b5563;
    --delete-button-bg: #dc3545;
    --delete-button-hover-bg: #c82333;

    --object-tools-fg: #ffffff;
    --object-tools-bg: #0066cc;
    --object-tools-hover-bg: #0052a3;

    --darkened-bg: #eef2f7;
    --selected-bg: #eef2f7;
    --selected-row: #fff7e0;

    /* 알림 메시지 배경(저장 info / 거부 error 가독성) — 라이트 고정 */
    --message-success-bg: #e6f4ea;
    --message-warning-bg: #fff8e1;
    --message-error-bg: #fdecea;
}

/* OS가 다크모드여도 라이트 고정 (Django 다크 변수 무력화) */
@media (prefers-color-scheme: dark) {
    :root,
    html[data-theme="auto"] {
        color-scheme: light;
        --body-bg: #ffffff; --body-fg: #1f2933; --body-quiet-color: #5a6573;
        --header-bg: #ffffff; --header-color: #0b5cad; --header-link-color: #0b5cad;
        --breadcrumbs-bg: #f3f6fa; --breadcrumbs-link-fg: #0066cc;
        --link-fg: #0066cc; --link-hover-color: #0052a3;
        --primary: #0066cc; --secondary: #0066cc;
        --hairline-color: #e7ebf0; --border-color: #dfe3e8;
        --darkened-bg: #eef2f7; --selected-row: #fff7e0;
        --button-bg: #0066cc; --default-button-bg: #0066cc; --object-tools-bg: #0066cc;
        --message-success-bg: #e6f4ea; --message-warning-bg: #fff8e1; --message-error-bg: #fdecea;
    }
}

/* 섹션/표/접힘 헤더: 컬러 바 대신 밝은 회색 (화이트 테마 일관성) */
.module h2,
.module caption,
.inline-group h2,
fieldset.collapse summary,
details > summary,
thead th {
    background: var(--darkened-bg) !important;
    color: #2a3340 !important;
    border-bottom: 1px solid var(--border-color) !important;
}
.module h2 a,
thead th a,
fieldset.collapse summary a {
    color: #0b5cad !important;
}

/* 헤더 상단 포인트 라인 */
#header {
    border-top: 3px solid #0066cc;
}

/* 헤더 텍스트 또렷하게 (Django는 브랜딩에 옅은 --accent를 써서 흐려짐) */
#branding h1,
#branding h1 a:link,
#branding h1 a:visited,
#site-name a:link,
#site-name a:visited {
    color: #0b5cad !important;
}
#user-tools,
#user-tools a:link,
#user-tools a:visited {
    color: #4b5563 !important;
}
#user-tools a:hover {
    color: #0066cc !important;
}
