/* Audit System - Global styles */

:root {
    --audit-primary: #0b6e4f;
    --audit-accent: #f2a900;
}

/* FluentUI cards default to height:100% (var(--card-height) fallback), which
   stretches the search card to fill the whole content area and creates a big
   empty gap before the results grid. Collapse to content height by default. */
fluent-card {
    --card-height: auto;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', 'Segoe UI Variable Text', Tahoma, Arial, sans-serif;
}

body {
    margin: 0;
    background-color: #f5f6f8;
}

[dir="rtl"] body,
[dir="rtl"] .fluent-body-content {
    font-family: 'Segoe UI', 'Cairo', 'Tahoma', Arial, sans-serif;
}

/* Page title */
.page-title {
    font-size: 20px;
    font-weight: 600;
    color: #24292e;
    margin: 0;
}

.page-subtitle {
    color: #6e7781;
    font-size: 13px;
    margin: 0 0 16px 0;
}

.section-card {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(27,31,35,0.04);
}

/* ==================================================================
   Login page — split institutional brand panel + floating glass card
   ================================================================== */

.login-shell {
    min-height: 100vh;
    width: 100%;
    display: flex;
    box-sizing: border-box;
}

/* ---- Brand panel (deep institutional green) ---- */
.login-brand {
    position: relative;
    flex: 0 0 46%;
    max-width: 46%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    padding: 60px 48px 36px;
    overflow: hidden;
    color: #ffffff;
    background:
        linear-gradient(214deg, rgba(242,169,0,0.18) 0%, rgba(242,169,0,0) 36%),
        linear-gradient(158deg, #0b3d2e 0%, #0b6e4f 52%, #14532d 100%);
}

.login-brand::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(120deg, rgba(255,255,255,0.035) 25%, transparent 25%) 0 0 / 44px 44px,
        linear-gradient(120deg, transparent 25%, rgba(255,255,255,0.035) 25%) 0 0 / 44px 44px,
        linear-gradient(60deg, rgba(255,255,255,0.03) 25%, transparent 25%) 0 0 / 44px 44px,
        linear-gradient(60deg, transparent 25%, rgba(255,255,255,0.03) 25%) 0 0 / 44px 44px;
}

.login-brand__glow {
    position: absolute;
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 560px;
    height: 560px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(242,169,0,0.34) 0%, rgba(242,169,0,0) 60%);
    pointer-events: none;
}

.login-brand__pattern {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.9;
    pointer-events: none;
}

.login-brand__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 430px;
    margin: auto;
}

.login-brand__logo-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 92px;
    height: 92px;
    margin-bottom: 26px;
    border-radius: 22px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.20);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 10px 30px rgba(0,0,0,0.22);
}

.login-brand__logo {
    height: 62px;
    width: auto;
    border-radius: 10px;
}

.login-brand__title {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #ffffff;
    line-height: 1.25;
}

.login-brand__subtitle {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    color: rgba(255,255,255,0.84);
    line-height: 1.4;
}

.login-brand__divider {
    width: 58px;
    height: 3px;
    margin: 28px auto 26px;
    border-radius: 3px;
    background: linear-gradient(90deg, #f2a900 0%, rgba(242,169,0,0.20) 100%);
}

.login-brand__bullets {
    display: grid;
    gap: 14px;
    width: 100%;
    max-width: 350px;
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: start;
}

.login-brand__bullet {
    display: flex;
    align-items: center;
    gap: 13px;
    font-size: 14px;
    color: rgba(255,255,255,0.94);
}

.login-brand__bullet-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(242,169,0,0.16);
    border: 1px solid rgba(242,169,0,0.38);
    color: #f2a900;
}

.login-brand__footer {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: 12.5px;
    letter-spacing: 0.4px;
    color: rgba(255,255,255,0.55);
}

/* ---- Form side ---- */
.login-form-side {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 44px 40px;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 18%, rgba(11,110,79,0.07), transparent 40%),
        radial-gradient(circle at 84% 74%, rgba(242,169,0,0.11), transparent 38%),
        #f5f6f8;
}

.login-form-side__blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(30px);
    opacity: 0.55;
    pointer-events: none;
}

.login-form-side__blob--one {
    inset-inline-start: -160px;
    bottom: -150px;
    width: 430px;
    height: 430px;
    background: rgba(11,110,79,0.16);
}

.login-form-side__blob--two {
    inset-inline-end: -130px;
    top: -130px;
    width: 380px;
    height: 380px;
    background: rgba(242,169,0,0.18);
}

/* ---- Form card ---- */
.login-card {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: 100%;
    max-width: 440px;
    padding: 44px 44px 40px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.75);
    background: rgba(255,255,255,0.97);
    box-shadow:
        0 34px 70px -22px rgba(13,45,34,0.30),
        0 8px 20px rgba(13,45,34,0.05);
    animation: login-card-rise 0.55s cubic-bezier(0.22, 0.8, 0.32, 1) both;
}

.login-card__head {
    text-align: center;
    margin-bottom: 28px;
}

.login-card__logo {
    height: 52px;
    width: auto;
    margin-bottom: 18px;
    border-radius: 9px;
}

.login-card__greeting {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 650;
    color: #16382b;
    line-height: 1.3;
}

.login-card__hint {
    margin: 0;
    font-size: 13.5px;
    color: #6b7280;
    line-height: 1.5;
}

/* ---- Error alert ---- */
.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #f1c1c0;
    background: #fdf1f0;
    color: #b3261e;
    font-size: 13.5px;
    line-height: 1.5;
    animation: login-fade-in 0.3s ease both;
}

.login-alert svg {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

/* ---- Form fields ---- */
.login-card {
    --focus-ring-color: #0b6e4f;
    --focus-ring-width: 2px;
    --focus-ring-corner-radius: 8px;
    --accent-fill-rest: #0b6e4f;
    --accent-fill-hover: #0a6347;
    --accent-fill-active: #095c41;
    --accent-foreground-rest: #ffffff;
    --accent-foreground-hover: #ffffff;
    --accent-foreground-active: #ffffff;
}

.login-card fluent-text-field,
.login-field {
    width: 100%;
    --control-corner-radius: 8;
}

.login-card fluent-button,
.login-submit {
    width: 100%;
    --control-corner-radius: 10;
}

.login-field__validation {
    display: block;
    margin-top: 2px;
    color: #b3261e;
    font-size: 12.5px;
    line-height: 1.4;
}

.login-field--password {
    direction: ltr;
}

.login-remember {
    font-size: 13.5px;
}

.login-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 0 6px;
}

.login-forgot {
    color: #0b6e4f;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.login-forgot:hover {
    color: #084635;
    text-decoration: underline;
}

.login-submit {
    min-height: 44px;
    margin-top: 4px;
    font-weight: 600;
}

/* ---- Motion ---- */
@keyframes login-card-rise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}

@keyframes login-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .login-card,
    .login-alert {
        animation: none;
    }
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .login-shell {
        flex-direction: column;
    }

    .login-brand {
        flex: 0 0 auto;
        max-width: none;
        width: 100%;
        min-height: 0;
        justify-content: center;
        padding: 38px 24px 32px;
    }

    .login-brand__bullets,
    .login-brand__divider,
    .login-brand__footer {
        display: none;
    }

    .login-brand__glow {
        width: 380px;
        height: 380px;
        top: -160px;
    }

    .login-brand__logo-wrap {
        width: 66px;
        height: 66px;
        margin-bottom: 16px;
        border-radius: 16px;
    }

    .login-brand__logo {
        height: 44px;
    }

    .login-brand__title {
        font-size: 22px;
    }

    .login-brand__subtitle {
        font-size: 13.5px;
    }

    .login-form-side {
        padding: 36px 20px 48px;
    }
}

@media (max-width: 480px) {
    .login-brand {
        padding: 28px 18px 24px;
    }

    .login-form-side {
        padding: 26px 12px 36px;
    }

    .login-card {
        padding: 30px 22px 30px;
        border-radius: 16px;
    }
}

/* RTL helpers */
[dir="rtl"] .text-left { text-align: right; }
[dir="rtl"] .text-right { text-align: left; }

/* Table convenience */
.grid-number { text-align: right; }
[dir="rtl"] .grid-number { text-align: left; }

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.badge-underprocess { background: #e7f5ec; color: #0b6e4f; }
.badge-released { background: #e8f0fe; color: #1a56db; }
.badge-rejected { background: #fdecec; color: #c62828; }
.badge-voided { background: #f3f4f6; color: #374151; }

/* Report preview */
.report-viewer iframe {
    width: 100%;
    height: 78vh;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    background: #fff;
}