/* MLKH SOP and Minutes Library Styles */
:root {
    --brand-primary: #131358;
    --brand-dark: #0b0b38;
    --brand-accent: #23238a;
    --brand-gold: #e6c619;
    --bg-light: #f4f7fb;
}

body {
    background-color: var(--bg-light);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.bg-mlkh-primary {
    background-color: #131358 !important;
}

.text-mlkh-primary {
    color: #131358 !important;
}

.border-mlkh-primary {
    border-color: #131358 !important;
}

.btn-mlkh-primary {
    background-color: #131358;
    border-color: #131358;
    color: #ffffff;
}

.btn-mlkh-primary:hover, .btn-mlkh-primary:focus {
    background-color: #0b0b38;
    border-color: #0b0b38;
    color: #ffffff;
}

.btn-mlkh-gold {
    background-color: #facc15;
    border-color: #facc15;
    color: #131358;
    font-weight: 700;
}

.btn-mlkh-gold:hover, .btn-mlkh-gold:focus {
    background-color: #eab308;
    border-color: #eab308;
    color: #0b0b38;
}

.navbar-custom {
    background: linear-gradient(90deg, #0d0d42 0%, #131358 60%, #1c1c78 100%) !important;
    border-bottom: 3px solid #facc15;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: -0.3px;
}

.navbar-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 50%;
    padding: 3px;
    margin-right: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    margin-right: 12px;
    font-weight: bold;
}

.main-content {
    flex: 1;
    padding-top: 1.75rem;
    padding-bottom: 3rem;
}

/* Landing Page Hero with AI Hospital Corridor */
.hero-corridor {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background-image:
        linear-gradient(105deg, rgba(11, 11, 56, 0.93) 0%, rgba(19, 19, 88, 0.84) 52%, rgba(19, 19, 88, 0.45) 100%),
        url('/static/hospital_corridor.jpg');
    background-size: cover;
    background-position: center;
    color: #ffffff;
    box-shadow: 0 18px 40px rgba(19, 19, 88, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-crest-box {
    background: rgba(255, 255, 255, 0.96);
    border-radius: 22px;
    padding: 1.35rem;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
    border: 3px solid #facc15;
    display: inline-block;
}

.hero-crest-img {
    width: 150px;
    height: 150px;
    object-fit: contain;
}

.motto-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(250, 204, 21, 0.18);
    border: 1px solid rgba(250, 204, 21, 0.65);
    color: #fde047;
    font-weight: 700;
    letter-spacing: 0.8px;
    font-size: 0.78rem;
    text-transform: uppercase;
    padding: 0.4rem 0.95rem;
    border-radius: 999px;
}

/* Dashboard Welcome Banner */
.dashboard-banner {
    background:
        linear-gradient(110deg, rgba(13, 13, 66, 0.95) 0%, rgba(19, 19, 88, 0.9) 60%, rgba(28, 28, 118, 0.82) 100%),
        url('/static/hospital_corridor.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 18px;
    color: #ffffff;
    border-bottom: 4px solid #facc15;
    box-shadow: 0 10px 25px rgba(19, 19, 88, 0.16);
}

.dashboard-crest {
    width: 76px;
    height: 76px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 50%;
    padding: 5px;
    border: 2px solid #facc15;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* KPI Stat Cards */
.stat-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(19, 19, 88, 0.1);
    color: inherit;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
}

.card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(19, 19, 88, 0.1);
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    font-weight: 600;
    border-top-left-radius: 14px !important;
    border-top-right-radius: 14px !important;
}

.badge-role {
    font-size: 0.8rem;
    padding: 0.4em 0.7em;
    border-radius: 6px;
}

.footer {
    background-color: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 1.25rem 0;
    font-size: 0.9rem;
    color: #64748b;
}

/* --- Anti-Screenshot, Anti-PrintScreen, Anti-Print Page & Watermark Shield --- */
.protected-content {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.protected-content input,
.protected-content textarea,
.protected-content select,
.protected-content .allow-select {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.security-watermark {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1040;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    align-items: center;
    justify-items: center;
    opacity: 0.055;
}

.security-watermark span {
    transform: rotate(-24deg);
    font-size: 0.92rem;
    font-weight: 800;
    color: #131358;
    letter-spacing: 0.8px;
    white-space: nowrap;
    text-transform: uppercase;
}

body.capture-shield-active main,
body.capture-shield-active nav,
body.capture-shield-active footer,
body.capture-shield-active .modal {
    filter: blur(22px) brightness(0.25);
    transition: filter 0.05s ease;
}

body.devtools-docked-active iframe,
body.devtools-docked-active .docx-preview-container,
body.devtools-docked-active .protected-doc-viewer {
    filter: blur(16px) brightness(0.35) !important;
    pointer-events: none !important;
    transition: filter 0.15s ease;
}

#captureShieldBanner {
    display: none;
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    background: #991b1b;
    color: #ffffff;
    border: 2px solid #facc15;
    border-radius: 12px;
    padding: 0.9rem 1.4rem;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
    font-weight: 700;
    max-width: 92vw;
    text-align: center;
}

.print-blocked-notice {
    display: none;
}

@media print {
    body:not(.allow-print) * {
        display: none !important;
        visibility: hidden !important;
    }
    html, body {
        background: #ffffff !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    body:not(.allow-print) .print-blocked-notice {
        display: block !important;
        visibility: visible !important;
        padding: 4rem 2rem !important;
        text-align: center !important;
        font-family: Arial, sans-serif !important;
        color: #991b1b !important;
        border: 4px solid #991b1b !important;
        margin: 2rem !important;
    }
    body:not(.allow-print) .print-blocked-notice * {
        display: block !important;
        visibility: visible !important;
    }

    /* Authorized Hospital Report Print Styles */
    body.allow-print {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
        color: #0f172a !important;
        font-size: 9pt !important;
    }
    body.allow-print .navbar,
    body.allow-print .footer,
    body.allow-print .no-print,
    body.allow-print .btn,
    body.allow-print .security-watermark,
    body.allow-print #captureShieldBanner,
    body.allow-print .print-blocked-notice,
    body.allow-print .alert {
        display: none !important;
    }
    body.allow-print .main-content {
        padding: 0 !important;
    }
    body.allow-print .report-print-container {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 10px 15px !important;
        margin: 0 !important;
    }
    body.allow-print .report-header {
        border-bottom: 2px solid #131358 !important;
        padding-bottom: 12px !important;
        margin-bottom: 18px !important;
    }
    body.allow-print .report-header img {
        height: 65px !important;
        width: auto !important;
    }
    body.allow-print table {
        width: 100% !important;
        border-collapse: collapse !important;
        page-break-inside: auto !important;
        font-size: 8.5pt !important;
    }
    body.allow-print tr {
        page-break-inside: avoid !important;
        page-break-after: auto !important;
    }
    body.allow-print th, body.allow-print td {
        border: 1px solid #cbd5e1 !important;
        padding: 5px 6px !important;
        text-align: left !important;
    }
    body.allow-print th {
        background-color: #f1f5f9 !important;
        color: #131358 !important;
        font-weight: 700 !important;
    }
    body.allow-print .signoff-block {
        margin-top: 40px !important;
        page-break-inside: avoid !important;
    }
}
