/* ── Blazor framework ─────────────────────────────────────────────────────── */

h1:focus { outline: none; }

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid                             { outline: 1px solid #e50000; }
.validation-message                  { color: #e50000; font-size: 13px; margin-top: 2px; }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::after { content: "An error has occurred." }

/* ── Base ─────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    color: #222;
    background: #f5f6f8;
}

a { color: #1a56db; }

/* ── Login page ───────────────────────────────────────────────────────────── */

.login-box {
    max-width: 440px;
    margin: 80px auto;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,.1);
}

.login-box h1 {
    margin: 0 0 8px;
    font-size: 22px;
}

.login-box p { color: #555; margin: 0 0 20px; }

.field { margin-bottom: 16px; display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 13px; font-weight: 600; color: #444; }
.field input {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    width: 100%;
}
.field input:focus { outline: none; border-color: #1a56db; box-shadow: 0 0 0 3px rgba(26,86,219,.15); }
.field input:disabled { background: #f5f6f8; }

button[type=submit] {
    width: 100%;
    padding: 10px;
    background: #1a56db;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}
button[type=submit]:hover:not(:disabled) { background: #1447c0; }
button[type=submit]:disabled { opacity: 0.6; cursor: default; }

.org-picker { display: flex; flex-direction: column; gap: 8px; }
.org-picker-btn {
    width: 100%;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    color: #1a56db;
    text-align: left;
    cursor: pointer;
}
.org-picker-btn:hover { background: #eff6ff; border-color: #1a56db; }

.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 5px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: #1e40af;
    font-size: 14px;
    line-height: 1.5;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 5px;
    padding: 10px 14px;
    margin-bottom: 12px;
    color: #991b1b;
    font-size: 14px;
}

/* ── Portal shell ─────────────────────────────────────────────────────────── */

.portal-shell { min-height: 100vh; display: flex; flex-direction: column; }

.portal-header {
    background: #1a56db;
    color: #fff;
    padding: 0 24px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.portal-header-org  { font-weight: 700; font-size: 16px; }
.portal-header-member { font-size: 13px; opacity: .9; }
.portal-header a { color: #fff; }

.portal-nav {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 24px;
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.portal-nav a {
    display: block;
    padding: 12px 14px;
    color: #444;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.portal-nav a:hover  { color: #1a56db; }
.portal-nav a.active { color: #1a56db; border-bottom-color: #1a56db; }

.portal-content {
    max-width: 800px;
    margin: 32px auto;
    padding: 0 24px;
    width: 100%;
}

/* ── Detail card ──────────────────────────────────────────────────────────── */

.detail-card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin-bottom: 24px;
    overflow: hidden;
}
.detail-card-header {
    padding: 14px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6b7280;
}
.detail-grid {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 0;
}
.detail-label, .detail-value {
    padding: 10px 20px;
    font-size: 14px;
    border-bottom: 1px solid #f3f4f6;
}
.detail-label { color: #6b7280; font-weight: 500; }
.detail-value { color: #111; }
.detail-grid > *:nth-last-child(-n+2) { border-bottom: none; }

.btn-primary {
    display: inline-block;
    padding: 8px 18px;
    background: #1a56db;
    color: #fff;
    border: 1px solid #1a56db;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary:hover:not(:disabled) { background: #1447c0; }
.btn-primary:disabled { opacity: 0.6; cursor: default; }

.btn-secondary {
    display: inline-block;
    padding: 8px 18px;
    background: #fff;
    color: #1a56db;
    border: 1px solid #1a56db;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn-secondary:hover { background: #eff6ff; }

.member-number {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 20px;
}

.detail-hint {
    margin: 0;
    padding: 8px 20px 12px;
    font-size: 13px;
    color: #6b7280;
    background: #fff;
}

.detail-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.detail-field-note {
    font-size: 12px;
    font-weight: 400;
    color: #9ca3af;
    line-height: 1.4;
}

/* ── Edit request form ────────────────────────────────────────────────────── */

.edit-grid {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 0;
}
.edit-grid label, .edit-grid input {
    padding: 10px 20px;
    font-size: 14px;
    border-bottom: 1px solid #f3f4f6;
}
.edit-grid label {
    color: #6b7280;
    font-weight: 500;
    display: flex;
    align-items: center;
}
.edit-grid input {
    border: 1px solid #d1d5db;
    border-radius: 4px;
    margin: 6px 20px;
    padding: 6px 10px;
    font-size: 14px;
    width: calc(100% - 40px);
}
.edit-grid input:focus {
    outline: none;
    border-color: #1a56db;
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
.edit-grid > *:nth-last-child(-n+2) { border-bottom: none; }

/* ── Documents list ───────────────────────────────────────────────────────── */

.doc-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.doc-row {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #f3f4f6;
    gap: 16px;
}

.doc-row:last-child { border-bottom: none; }

.doc-info { flex: 1; }

.doc-label {
    font-size: 14px;
    font-weight: 500;
    color: #111;
    margin-bottom: 2px;
}

.doc-meta {
    font-size: 12px;
    color: #9ca3af;
}

.doc-action { display: flex; align-items: center; gap: 10px; }

.btn-download {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #1a56db;
    border-radius: 6px;
    background: transparent;
    color: #1a56db;
    cursor: pointer;
    white-space: nowrap;
}

.btn-download:hover { background: #eff6ff; }

.doc-downloading {
    font-size: 13px;
    color: #6b7280;
}

.doc-download-error {
    font-size: 13px;
    color: #dc2626;
}
