/* RAHA admin theme overrides on top of django-unfold.
   Titles: Impact. Body: Arial. Highlights: brand gold (#FFD000). */

:root {
    --raha-gold: #ffd000;
    --raha-navy: #12213d;
    --raha-navy-deep: #0d1830;
    --raha-rink: #1b2d4f;
    --raha-frost: #8fa4b8;
    --raha-green: #009e4f;
}

/* Body copy in Arial across the admin shell. */
body,
.unfold,
input,
select,
textarea,
button {
    font-family: Arial, Helvetica, "Liberation Sans", sans-serif;
}

/* Titles/headings in Impact (with graceful condensed fallbacks). */
h1, h2, h3,
.unfold h1, .unfold h2, .unfold h3,
#site-name,
a.text-font-important-light,
.text-font-important-light,
.font-title {
    font-family: Impact, "Haettenschweiler", "Arial Narrow Bold", "Franklin Gothic Bold", sans-serif;
    letter-spacing: 0.3px;
}

/* Site header wordmark reads like the app's masthead. */
#site-name,
header #site-name a {
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Gold accent rule under the top header, echoing the app masthead. */
header.sticky,
header[class*="border-b"] {
    border-bottom: 2px solid var(--raha-gold) !important;
}

/* Gold highlight on the active sidebar item and hovers. */
.unfold a[aria-current="page"],
nav a[aria-current="page"] {
    box-shadow: inset 3px 0 0 var(--raha-gold);
}

/* Section headings and fieldset legends get a gold underline. */
fieldset .border-b h2,
.module h2,
fieldset > h2 {
    border-bottom: 2px solid var(--raha-gold);
    padding-bottom: 4px;
}

/* Buttons keep navy primary (Unfold COLORS.primary) but the default/secondary
   call-to-action links get a gold accent border for visual "pizzaz". */
a.button.default,
.submit-row a.default {
    border: 1px solid var(--raha-gold);
}

/* Custom views render bare Django forms (form.as_p); give those widgets an
   Unfold-like look so the compose/wizard screens match the reskin. */
.raha-form p {
    margin: 0 0 16px;
}

.raha-form label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}

.raha-form input[type="text"],
.raha-form input[type="url"],
.raha-form input[type="number"],
.raha-form input[type="email"],
.raha-form input[type="datetime-local"],
.raha-form input[type="date"],
.raha-form input[type="time"],
.raha-form select,
.raha-form textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    background: #fff;
    color: #111827;
}

.raha-form input:focus,
.raha-form select:focus,
.raha-form textarea:focus {
    outline: none;
    border-color: var(--raha-navy);
    box-shadow: 0 0 0 2px rgba(255, 208, 0, 0.35);
}

.raha-form .helptext {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* Radio/checkbox groups (audience, mode) read as a tidy vertical list.
   Do NOT target SmartWizard's step-anchor — that must stay horizontal. */
.raha-form ul:not(.step-anchor):not(.nav) {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.raha-form ul:not(.step-anchor):not(.nav) li {
    margin-bottom: 4px;
}

.raha-form ul li label {
    display: inline;
    font-weight: 400;
}

/* Wizard step indicator. */
.raha-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.raha-step {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    color: #6b7280;
}

.raha-step.is-active {
    border-color: var(--raha-navy);
    background: var(--raha-navy);
    color: #fff;
}

.raha-step.is-done {
    border-color: var(--raha-gold);
    color: var(--raha-navy);
}

.raha-step .raha-step-num {
    font-weight: 700;
}

/* Brand section marker: "// UPPERCASE" in brand green — no pill. */
.raha-marker {
    display: block;
    font-family: Arial, Helvetica, "Liberation Sans", sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--raha-green);
    background: none;
    margin: 0 0 1rem;
    padding: 0;
    border-radius: 0;
    line-height: 1.2;
}

/* Default copy / UI chrome in rink navy; gold stays for markers & accents.
   Unfold utilities (text-font-*, text-important, text-base-*) must be forced —
   they otherwise win over plain `color` rules. */
html body,
html body .unfold,
html body .text-font-default-light,
html body .text-font-important-light,
html body .text-font-subtle-light,
html body .text-important,
html body .text-default,
html body .text-subtle,
html body .text-base-900,
html body .text-base-800,
html body .text-base-700,
html body .text-base-600,
html body .text-base-500,
html body .text-base-400,
html body .dark\:text-font-default-dark,
html body .dark\:text-font-important-dark,
html body .dark\:text-font-subtle-dark,
html body h1,
html body h2,
html body h3,
html body h4,
html body p,
html body label,
html body td,
html body th,
html body li,
html body span:not(.material-symbols-outlined):not(.raha-marker),
html body a:not(.raha-create-btn) {
    color: var(--raha-rink);
}

/* Keep intentional exceptions. */
html body .raha-marker {
    color: var(--raha-green) !important;
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

html body [class*="--raha-gold"] {
    color: var(--raha-gold) !important;
}

html body .text-green-700,
html body .text-green-800,
html body .bg-green-100 {
    /* status chips keep their own text via child rules below */
}
html body .bg-green-100,
html body .text-green-800 {
    color: #166534 !important;
}
html body .text-green-700 {
    color: #15803d !important;
}
html body .bg-red-100,
html body .text-red-800,
html body .text-red-700 {
    color: #991b1b !important;
}
html body .bg-yellow-100,
html body .text-yellow-800,
html body .text-yellow-700 {
    color: #a16207 !important;
}
html body .bg-blue-100,
html body .text-blue-800 {
    color: #1e40af !important;
}

html body [class*="--raha-frost"] {
    color: var(--raha-frost) !important;
}

html body [class*="--raha-navy"]:not(.raha-create-btn):not([class*="bg-[var(--raha-navy)]"]) {
    color: var(--raha-navy) !important;
}

/* White text must win over the --raha-navy class match on navy buttons. */
html body .text-white,
html body .raha-create-btn,
html body .raha-create-btn * {
    color: #fff !important;
}

/* Dark surfaces (monitoring masthead) keep light text. */
html body .raha-monitor-masthead,
html body .raha-monitor-masthead p,
html body .raha-monitor-masthead h1,
html body .raha-monitor-masthead h2,
html body .raha-monitor-masthead span:not(.raha-marker):not(.material-symbols-outlined) {
    color: #fff !important;
}

html body .raha-monitor-masthead a,
html body .raha-monitor-masthead [class*="--raha-gold"] {
    color: var(--raha-gold) !important;
}

html body .raha-monitor-masthead [class*="--raha-frost"] {
    color: var(--raha-frost) !important;
}

html body .raha-monitor-masthead .raha-marker {
    color: var(--raha-green) !important;
    background: none !important;
    padding: 0 !important;
}

/* Material icons → brand green across the admin shell. */
.material-symbols-outlined,
span.material-symbols-outlined,
nav .material-symbols-outlined,
.unfold .material-symbols-outlined {
    color: var(--raha-green) !important;
}

/* Standalone navy CTA (also used on push confirm, not only home create form). */
button.raha-create-btn,
.raha-create-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 42px;
    padding: 0 20px;
    border: 1px solid var(--raha-gold);
    border-radius: 8px;
    background: var(--raha-navy);
    color: #fff !important;
    font-weight: 700;
    font-family: Arial, Helvetica, "Liberation Sans", sans-serif;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
}

button.raha-create-btn:hover,
.raha-create-btn:hover {
    filter: brightness(1.08);
}

/* Create form on the home page — explicit styles so Unfold/Tailwind
   arbitrary bg/text utilities can't leave an empty invisible button. */
.raha-create-form {
    align-items: flex-end;
}

.raha-create-form .raha-create-select,
.raha-create-form .raha-create-btn {
    box-sizing: border-box;
    height: 42px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.25;
    margin: 0;
}

.raha-create-form .raha-create-select {
    display: block;
    width: 100%;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: var(--raha-rink);
    appearance: auto;
}

.raha-create-form .raha-create-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border: 1px solid var(--raha-gold);
    background: var(--raha-navy);
    color: #fff !important;
    font-weight: 700;
    font-family: Arial, Helvetica, "Liberation Sans", sans-serif;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
}

.raha-create-form .raha-create-btn:hover {
    filter: brightness(1.08);
}

.raha-create-form .raha-create-select:focus {
    outline: none;
    border-color: var(--raha-navy);
    box-shadow: 0 0 0 2px rgba(255, 208, 0, 0.35);
}

.raha-home-kpi {
    border-top: 3px solid var(--raha-gold);
}

/* Monitoring hub masthead — navy plane with gold accent. */
.raha-monitor-masthead {
    background: linear-gradient(135deg, var(--raha-navy) 0%, var(--raha-rink) 55%, var(--raha-navy-deep) 100%);
    border-left: 4px solid var(--raha-gold);
    color: #fff;
}

.raha-monitor-masthead a {
    color: var(--raha-gold);
}

/* Drill-down tiles on the overview. */
.raha-drill-card {
    display: block;
    padding: 1rem 1.1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.raha-drill-card:hover {
    border-color: var(--raha-gold);
    box-shadow: 0 4px 14px rgba(18, 33, 61, 0.08);
    transform: translateY(-1px);
}

/* Metric snapshot cards. */
.raha-metric-card {
    display: block;
    padding: 1rem 1.1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    border-top: 3px solid var(--raha-gold);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.raha-metric-card:hover {
    box-shadow: 0 4px 14px rgba(18, 33, 61, 0.08);
}

.raha-metric-warn {
    border-top-color: #eab308;
    background: #fffbeb;
}

/* Attention rows. */
.raha-attention-row {
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.raha-attention-row:hover {
    box-shadow: 0 2px 10px rgba(18, 33, 61, 0.06);
}

.raha-attention-high {
    border-left: 3px solid #dc2626;
}

.raha-attention-medium {
    border-left: 3px solid #eab308;
}
