:root {
    --bg: #f3f6fb;
    --panel: #ffffff;
    --line: #dbe3ef;
    --text: #172033;
    --muted: #657289;
    --primary: #235a9f;
    --primary-dark: #17477f;
    --soft: #eef5ff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: #0f243d;
    color: white;
    padding: 24px 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 34px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #ffffff;
    color: #0f243d;
    font-weight: 800;
    font-size: 22px;
}

.brand strong { display: block; font-size: 15px; }
.brand span { display: block; color: #b9c7d8; font-size: 13px; margin-top: 3px; }

.menu { display: grid; gap: 6px; }
.menu a {
    color: #dce8f7;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
}
.menu a.active, .menu a:hover { background: rgba(255,255,255,.11); color: white; }

.notice-small {
    position: absolute;
    bottom: 20px;
    left: 18px;
    width: 240px;
    color: #b9c7d8;
    font-size: 12px;
    line-height: 1.45;
}

.content { padding: 28px; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.eyebrow {
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .08em;
    margin: 0 0 6px;
}

h1 { margin: 0; font-size: 28px; }

.status {
    border: 1px solid var(--line);
    background: white;
    padding: 9px 12px;
    border-radius: 999px;
    font-size: 13px;
    color: var(--muted);
}

.document-layout {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(23,32,51,.06);
}

.document-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px;
    border-bottom: 1px solid var(--line);
}

.file-icon {
    width: 54px;
    height: 64px;
    border-radius: 8px;
    background: var(--soft);
    border: 1px solid #cfe0f8;
    display: grid;
    place-items: center;
    color: var(--primary);
    font-weight: 800;
    font-size: 14px;
}

.document-info h2 { margin: 0 0 6px; font-size: 19px; }
.document-info p { margin: 0; color: var(--muted); }
.document-info .meta { margin-top: 6px; font-size: 13px; }

.open-document {
    margin-left: auto;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
}
.open-document:hover { background: var(--primary-dark); }
.open-document:disabled { opacity: .7; cursor: default; }

.access-note {
    margin: 18px 22px 0;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.viewer {
    margin: 18px 22px 22px;
    height: 68vh;
    min-height: 460px;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
}
.viewer iframe {
    width: 100%;
    height: calc(100% - 38px);
    border: 0;
    background: white;
}
.viewer.locked {
    display: grid;
    place-items: center;
}
.viewer-placeholder {
    display: grid;
    gap: 6px;
    text-align: center;
    color: var(--muted);
}
.viewer-placeholder strong { color: var(--text); }

.fallback {
    height: 38px;
    padding: 10px 12px;
    font-size: 12px;
    color: var(--muted);
    background: #f8fafc;
    border-top: 1px solid var(--line);
}

.result {
    display: none;
    margin-top: 16px;
    background: #eefdf3;
    border: 1px solid #c7f0d2;
    color: #166534;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
}

@media (max-width: 860px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .notice-small { position: static; width: auto; margin-top: 24px; }
    .topbar { align-items: flex-start; gap: 14px; flex-direction: column; }
    .document-info { align-items: flex-start; flex-wrap: wrap; }
    .open-document { width: 100%; margin-left: 0; }
    .viewer { height: 62vh; }
}
