/* ===== Portal MyICM — gaya global ===== */
:root {
    --icm-navy: #0B2D55;
    --icm-navy-2: #184A84;
    --icm-orange: #FF5A00;
    --icm-bg: #F4F6FA;
    --icm-text: #1E2A3A;
    --icm-muted: #5B6878;
    --icm-line: #E3E8EF;
}

html, body {
    margin: 0;
    background: var(--icm-bg);
    color: var(--icm-text);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1:focus { outline: none; }

/* Top bar */
.icm-appbar { border-bottom: 1px solid rgba(255, 255, 255, .08); }
.icm-appbar-logo { width: 34px; height: 34px; border-radius: 8px; background: #fff; padding: 2px; margin-left: 4px; }
.icm-appbar-title { font-weight: 600 !important; letter-spacing: .2px; }
.icm-user { display: flex; align-items: center; gap: 10px; }
.icm-user-text { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.icm-user-name { font-weight: 600; font-size: 14px; }
.icm-user-role { font-size: 12px; opacity: .75; }
@media (max-width: 600px) { .icm-user-text, .icm-appbar-title { display: none; } }

/* Menu samping */
.icm-drawer { border-right: 1px solid var(--icm-line); }
.icm-nav { padding-top: 8px; }
.icm-nav .mud-nav-link { border-radius: 8px; margin: 1px 8px; width: calc(100% - 16px); }
.icm-nav .mud-nav-link.active { background: rgba(255, 90, 0, .10) !important; font-weight: 600; }

/* Konten */
.icm-page-title { font-weight: 700 !important; color: var(--icm-navy); }
.icm-section-title { font-weight: 600 !important; color: var(--icm-muted); text-transform: uppercase; letter-spacing: .6px; font-size: 13px !important; margin-bottom: 10px; }
.icm-card { border: 1px solid var(--icm-line); border-radius: 14px !important; }

/* Kartu menu di dashboard */
.icm-tile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--icm-line);
    border-radius: 14px;
    color: var(--icm-text);
    text-decoration: none;
    transition: box-shadow .15s, border-color .15s, transform .15s;
}
.icm-tile:hover { border-color: rgba(11, 45, 85, .35); box-shadow: 0 6px 18px rgba(11, 45, 85, .10); transform: translateY(-1px); }
.icm-tile-icon {
    width: 42px; height: 42px; flex: 0 0 42px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(11, 45, 85, .08); color: var(--icm-navy);
}
.icm-tile-text { flex: 1; font-weight: 600; font-size: 15px; }
.icm-tile-arrow { color: var(--icm-muted); }

/* Halaman daftar data (pola sama untuk semua modul) */
.icm-list-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.icm-toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 16px 6px; }
.icm-toolbar .icm-search { max-width: 340px; }
.icm-title-cell { display: flex; align-items: flex-start; gap: 10px; }
.icm-thumb { width: 64px; height: 44px; border-radius: 8px; object-fit: cover; background: #EEF2F7; flex: 0 0 64px; }
.icm-strong { font-weight: 600; }
.icm-desc {
    color: var(--icm-muted); font-size: 13px; max-width: 460px; overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.icm-row-click { cursor: pointer; }
.icm-tabs .mud-tabs-panels { padding-top: 16px; }
.icm-stat-link { color: inherit; text-decoration: none; display: block; }
.icm-stat-link .icm-stat { transition: box-shadow .15s, border-color .15s; }
.icm-stat-link:hover .icm-stat { border-color: var(--icm-orange); box-shadow: 0 4px 14px rgba(11, 45, 85, .08); }
.icm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.icm-stat { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.icm-stat-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, currentColor 12%, transparent); }
.icm-stat-value { font-size: 24px; font-weight: 700; color: var(--icm-text); line-height: 1.1; }
.icm-stat-label { font-size: 13px; color: var(--icm-muted); }
.icm-tabs .mud-tabs-tabbar { background: transparent; border-bottom: 1px solid var(--icm-line); }
.icm-list-footer { padding: 10px 16px 14px; color: var(--icm-muted); font-size: 13px; border-top: 1px solid var(--icm-line); }
.icm-form-section { font-weight: 600; color: var(--icm-navy); margin: 18px 0 8px; }
.icm-form-actions {
    position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 12px;
    margin-top: 16px; padding: 12px 0; background: linear-gradient(to top, var(--icm-bg) 70%, transparent);
}

/* Utas percakapan (Report Issue / Prayer Request) */
.icm-thread { display: flex; flex-direction: column; gap: 12px; padding: 8px 0; }
.icm-msg { display: flex; }
.icm-msg.staff { justify-content: flex-end; }
.icm-msg-bubble { position: relative; max-width: min(640px, 85%); padding: 10px 14px 12px; border-radius: 14px; background: #fff; border: 1px solid var(--icm-line); }
.icm-msg.staff .icm-msg-bubble { background: #FFF3EB; border-color: #FFD7BF; }
.icm-msg-head { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; margin-bottom: 4px; padding-right: 22px; }
.icm-msg-name { font-weight: 600; font-size: 13.5px; color: var(--icm-navy); }
.icm-msg-date { font-size: 12px; color: var(--icm-muted); white-space: nowrap; }
.icm-msg-body { white-space: pre-wrap; word-break: break-word; font-size: 14.5px; }
.icm-msg-del { position: absolute !important; top: 2px; right: 2px; opacity: .55; }
.icm-msg-del:hover { opacity: 1; }
.icm-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 24px; }
.icm-detail-label { font-size: 12px; color: var(--icm-muted); }
.icm-detail-value { font-weight: 600; word-break: break-word; }

/* Upload gambar */
.icm-image-upload { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.icm-image-box {
    width: 220px; height: 140px; border-radius: 12px; overflow: hidden; background: #EEF2F7;
    border: 1px dashed #C9D3E0; display: flex; align-items: center; justify-content: center;
}
.icm-image-box img { width: 100%; height: 100%; object-fit: cover; }
.icm-image-missing { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--icm-muted); font-size: 12.5px; text-align: center; padding: 8px; }
.icm-image-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; }
.icm-image-name { word-break: break-all; }

/* Editor HTML */
.icm-html-editor .jodit-container { border-radius: 10px !important; border-color: #C9D3E0 !important; }
.icm-html-editor.disabled { opacity: .85; }

/* Keadaan kosong / akses ditolak */
.icm-empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 16px; }
.icm-center-loading { display: flex; justify-content: center; padding: 80px 0; }

/* Halaman mandiri (tidak ditemukan / error) */
.icm-standalone { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 16px; }
.icm-standalone img { border-radius: 18px; background: #fff; box-shadow: 0 6px 18px rgba(11, 45, 85, .12); }
.icm-standalone h1 { color: var(--icm-navy); font-size: 26px; margin: 22px 0 6px; }
.icm-standalone p { color: var(--icm-muted); margin: 4px 0; }
.icm-standalone .muted { font-size: 13px; }
.icm-standalone a { margin-top: 20px; color: #fff; background: var(--icm-orange); padding: 10px 22px; border-radius: 10px; text-decoration: none; font-weight: 600; }

/* Error Blazor */
#blazor-error-ui {
    background: #FFF4E5; color: #663C00; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    display: none; left: 0; padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 2000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

.blazor-error-boundary { background: #b32121; padding: 1rem; color: white; }
.blazor-error-boundary::after { content: "Terjadi kesalahan pada bagian ini."; }
