:root {
    --kh-primary: #008C6A;
    --kh-secondary: #005B9E;
    --kh-surface: #f5f7fa;
    --kh-card: #ffffff;
    --kh-border: #e0e4ea;
    --kh-text: #333333;
    --kh-muted: #777777;

    --kh-status-pending: #FFB74D;
    --kh-status-approved: #008C6A;
    --kh-status-rejected: #D84343;
}

body {
    background: var(--kh-surface);
    font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--kh-text);
}

.ih-admin-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.ih-admin-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--kh-primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.ih-admin-title {
    font-weight: 700;
    color: #0a2137;
}

.ih-admin-subtitle {
    font-size: 12px;
    color: #4b5563;
}

.ih-admin-nav {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 6px;
}

.ih-admin-nav a {
    color: var(--kh-text);
    text-decoration: none;
    font-weight: 700;
}

.ih-admin-nav a:hover {
    text-decoration: underline;
}

#header {
    background: var(--kh-primary);
    border-bottom: 1px solid var(--kh-primary);
    box-shadow: 0 6px 18px rgba(14, 63, 88, 0.14);
}

#header #user-tools {
    color: #ffffff;
}

#header a:link, #header a:visited {
    color: #ffffff;
}

#content {
    background: transparent;
    padding-top: 12px;
}

.module {
    border: 1px solid #d6dde7;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(14, 63, 88, 0.08);
    background: var(--kh-card);
}

.module caption, .module h2, .inline-group h2 {
    background: transparent;
    color: var(--kh-text);
    padding: 10px 12px;
    font-weight: 700;
}

.button, input[type=submit], input[type=button], .submit-row input, a.button {
    background: var(--kh-primary);
    border-color: var(--kh-primary);
    color: #fff;
    border-radius: 8px;
    padding: 8px 14px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 140, 106, 0.18);
}

.button:hover, input[type=submit]:hover, input[type=button]:hover, .submit-row input:hover, a.button:hover {
    background: #007356;
    border-color: #007356;
    color: #fff;
}

table {
    border-color: var(--kh-border);
}

th, td {
    padding: 10px 12px;
    color: var(--kh-text);
}

th {
    font-weight: 700;
    color: #0b2540;
}

tr:nth-child(even) {
    background: #f8fafc;
}

.breadcrumbs {
    background: #e9f6f0;
    color: var(--kh-text);
    margin: 12px 0;
    border-radius: 10px;
    padding: 8px 12px;
    font-weight: 600;
}

.breadcrumbs a {
    color: var(--kh-secondary);
    text-decoration: none;
}

.breadcrumbs a:hover,
.breadcrumbs a:focus {
    text-decoration: underline;
}

fieldset.module aligned {
    color: var(--kh-text);
}

.form-row input[type="text"], .form-row input[type="password"], .form-row textarea, .form-row select {
    border-radius: 8px;
    border: 1px solid var(--kh-border);
}

.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
    border-color: var(--kh-primary);
    box-shadow: 0 0 0 3px rgba(10, 140, 106, 0.16);
    outline: none;
}

/* Improve focus outlines for keyboard users */
a:focus, button:focus, .button:focus {
    outline: 3px solid rgba(0, 140, 106, 0.18);
    outline-offset: 2px;
}

#container {
    background: transparent;
}

#content-main {
    background: var(--kh-card);
    border: 1px solid var(--kh-border);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 6px 18px rgba(14, 63, 88, 0.08);
}

#content-related {
    background: var(--kh-card);
    border: 1px solid var(--kh-border);
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 6px 18px rgba(14, 63, 88, 0.08);
}

#content-related .module h2 {
    background: transparent;
    color: var(--kh-text);
    padding: 4px 0 8px;
}

#content-related .module ul.actionlist li {
    border-bottom: 1px dashed var(--kh-border);
    padding: 6px 0;
}

#content-related .module ul.actionlist li:last-child {
    border-bottom: none;
}

.object-tools {
    margin-top: 10px;
}

.object-tools a {
    border-radius: 10px !important;
}



.paginator {
    margin-top: 10px;
    border-top: 1px solid var(--kh-border);
    padding-top: 8px;
}

.help, .form-row .help, p.help {
    color: #4b5563;
}

/* Improve overall admin headings and list contrast for readability */
#content h1, .app-list h2, .module caption, .module h2, .inline-group h2 {
    color: #0b2540; /* darker navy for headings */
    opacity: 1;
    font-weight: 800;
}

/* App list section headings (e.g. "Accounts", "Images") */
.app-list .module h2, .app-list h2 {
    color: #092033;
    background: transparent;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 12px;
}

/* Make model labels (rows) more legible when they appear muted */
.app-list .model, .app-list .module .module-row, .app-list .model a {
    color: #162b3a;
}

/* If any admin elements were using very low-opacity text, ensure minimum contrast */
*[class*="muted"], .muted, .module .small {
    color: #5b6b75 !important;
}

/* Tweak header brand contrast: make subtitle clearer */
.ih-admin-subtitle {
    color: rgba(255,255,255,0.92);
}

/* --- Dark mode support (prefers-color-scheme) --- */
@media (prefers-color-scheme: dark) {
    :root {
        --kh-surface: #0b1220;
        --kh-card: #0f1a27;
        --kh-border: #243140;
        --kh-text: #e6eef6;
        --kh-muted: #9fb0c2;
    }

    body {
        background: var(--kh-surface);
        color: var(--kh-text);
    }

    #header {
        background: #064f3f; /* a darker green for header in dark mode */
    }

    .module {
        background: var(--kh-card);
        border-color: var(--kh-border);
        box-shadow: none;
    }

    .app-list .module .module-row,
    .app-list .model, .app-list .model a,
    .module .module-row {
        /* keep module-row readable in dark mode */
        background: #0b2540;
        color: #ffffff;
    }

    .breadcrumbs {
        background: #071a1b;
        color: var(--kh-muted);
    }

    th {
        color: var(--kh-text);
    }

    .muted, *[class*="muted"], .module .small {
        color: var(--kh-muted) !important;
    }
}

/* Manual dark-mode class (toggle via JS if needed) */
.dark-mode {
    --kh-surface: #0b1220;
    --kh-card: #0f1a27;
    --kh-border: #243140;
    --kh-text: #e6eef6;
    --kh-muted: #9fb0c2;
}

/* Ensure app-list model descriptions always use readable color */
.app-list .model, .app-list .module .module-row, .app-list .model a {
    color: var(--kh-text) !important;
}


/* Replace very-dark module header bars with a softer dark-navy and improve spacing */
.app-list .module .module-row,
.app-list .model, .app-list .model a,
.module .module-row {
    background: #0b2540; /* dark navy */
    color: #ffffff;
}

.app-list .model a, .app-list .module .module-row a {
    color: #fff !important;
    font-weight: 700;
}

.app-list .module .module-row, .module .module-row {
    padding: 10px 14px;
    border-radius: 6px 6px 0 0;
}

/* Slightly enlarge admin title for better visibility */
.ih-admin-title {
    font-size: 18px;
}

/* Make admin subtitle slightly larger and brighter */
.ih-admin-subtitle {
    font-size: 13px;
    color: rgba(255,255,255,0.95);
}
table {
    border-color: var(--kh-border);
}

th, td {
    padding: 10px 12px;
    color: inherit;
}

th {
    font-weight: 700;
}

tr:nth-child(even) {
    background: transparent;
}

.breadcrumbs {
    background: transparent;
    color: inherit;
    margin: 12px 0;
    border-radius: 10px;
    padding: 8px 12px;
    font-weight: 600;
}

.breadcrumbs a {
    color: inherit;
    text-decoration: none;
}

.breadcrumbs a:hover,
.breadcrumbs a:focus {
    text-decoration: underline;
}

fieldset.module aligned {
    color: inherit;
}

.form-row input[type="text"], .form-row input[type="password"], .form-row textarea, .form-row select {
    border-radius: 8px;
    border: 1px solid var(--kh-border);
}

.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
    border-color: currentColor;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
    outline: none;
}

/* Improve focus outlines for keyboard users */
a:focus, button:focus, .button:focus {
    outline: 3px solid rgba(0,0,0,0.12);
    outline-offset: 2px;
}

#container {
    background: transparent;
}

#content-main, #content-related {
    background: transparent;
    border: 1px solid var(--kh-border);
    border-radius: 14px;
    padding: 12px;
}

#content-related .module h2 {
    background: transparent;
    color: inherit;
    padding: 4px 0 8px;
}

#content-related .module ul.actionlist li {
    border-bottom: 1px dashed var(--kh-border);
    padding: 6px 0;
}

#content-related .module ul.actionlist li:last-child {
    border-bottom: none;
}

.object-tools {
    margin-top: 10px;
}

.object-tools a {
    border-radius: 10px !important;
}

.paginator {
    margin-top: 10px;
    border-top: 1px solid var(--kh-border);
    padding-top: 8px;
}

.help, .form-row .help, p.help {
    color: inherit;
}

/* App list headings: keep layout but inherit colors */
#content h1, .app-list h2, .module caption, .module h2, .inline-group h2 {
    color: inherit;
    opacity: 1;
    font-weight: 800;
}

.app-list .module h2, .app-list h2 {
    color: inherit;
    background: transparent;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 12px;
}

.app-list .model, .app-list .module .module-row, .app-list .model a {
    color: inherit;
}

*[class*="muted"], .muted, .module .small {
    color: inherit !important;
}

/* Dark-mode support: don't override admin defaults; supply a helper class if site wants manual toggle */
.dark-mode {
    /* no forced colors; admin CSS should handle dark styling if present */
}


