:root {
    --cyan: #0e7490;
    --cyan-dark: #155e75;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e6edf2;
    --sidebar: 244px;
    --bg: #f4f7f8;
}

* { box-sizing: border-box; }

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

a { color: var(--cyan-dark); }

.btn-primary {
    background: var(--cyan);
    border-color: var(--cyan);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--cyan-dark);
    border-color: var(--cyan-dark);
}

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

.sidebar {
    width: var(--sidebar);
    background: #fff;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.15rem 1rem 0.4rem;
    text-decoration: none;
    color: var(--ink);
}

.brand img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 4px;
}

.brand strong { display: block; font-size: 0.95rem; }
.brand small { color: var(--muted); }

.menu-label {
    margin: 1.1rem 1.15rem 0.35rem;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 0.65rem;
}

.menu a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    color: #334155;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
}

.menu a i {
    width: 1.1rem;
    text-align: center;
    color: #94a3b8;
}

.menu a:hover { background: #f8fafc; color: var(--cyan-dark); }
.menu a.is-active { background: #ecfeff; color: var(--cyan-dark); }
.menu a.is-active i { color: var(--cyan); }

.sidebar-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem;
    border-top: 1px solid var(--line);
}

.who { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.who strong, .who small { display: block; }
.who strong { font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.who small { color: var(--muted); font-size: 0.72rem; }

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #ecfeff;
    color: var(--cyan);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: 58px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.35rem;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-kicker { color: var(--muted); font-size: 0.85rem; }

.content { padding: 1.35rem; }

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.page-head h1 { margin: 0; font-size: 1.35rem; font-weight: 600; }
.page-head p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.875rem; }
.page-tools { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

.search {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 240px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.45rem 0.75rem;
    color: #94a3b8;
}

.search input {
    border: 0;
    outline: 0;
    width: 100%;
    background: transparent;
    color: var(--ink);
}

.panel, .table-card, .editor {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.panel { padding: 1.1rem 1.2rem; }
.panel + .panel, .table-card + .panel, .panel + .table-card { margin-top: 1rem; }

.panel-head, .editor {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.editor {
    margin-bottom: 1rem;
    padding: 1rem 1.1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.editor h2 { margin: 0 0 0.35rem; font-size: 0.95rem; }
.editor form { display: flex; gap: 0.6rem; align-items: flex-start; flex-wrap: wrap; width: 100%; }
.editor .form-control { max-width: 420px; }

.table-card { overflow: hidden; }
.table-card.is-busy { opacity: 0.55; }

.data-table { margin: 0; --bs-table-bg: transparent; }
.data-table thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    padding: 0.8rem 0.95rem;
}
.data-table tbody td {
    padding: 0.8rem 0.95rem;
    border-color: #f1f5f9;
    vertical-align: middle;
}
.data-table tbody tr:hover { background: #f8fafc; }

.col-no { width: 64px; text-align: center; }
.no-badge {
    display: inline-flex;
    min-width: 1.7rem;
    height: 1.7rem;
    padding: 0 0.4rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 600;
}
.clip { max-width: 240px; color: #475569; font-size: 0.875rem; }
.act { display: inline-flex; gap: 0.3rem; }

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.icon-btn:hover { background: #f8fafc; color: var(--cyan-dark); }
.icon-btn.danger:hover { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }

.pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.95rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.85rem;
}
.pager-nav { display: flex; gap: 0.4rem; }
.pager button {
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    padding: 0.3rem 0.7rem;
    font-size: 0.82rem;
}
.pager button:disabled { opacity: 0.45; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.stat {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
}
.stat:hover { border-color: #bae6fd; }
.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #ecfeff;
    color: var(--cyan);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.stat strong { display: block; font-size: 1.35rem; line-height: 1.1; }
.stat small { color: var(--muted); }

.bar-row {
    display: grid;
    grid-template-columns: 110px 1fr 28px;
    gap: 8px;
    align-items: center;
    margin-bottom: 6px;
}
.bar-track { background: #e0f7fa; height: 10px; border-radius: 999px; overflow: hidden; }
.bar-fill { background: var(--cyan); height: 100%; }
.bar-label, .bar-value { font-size: 0.82rem; color: #475569; }

.meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem 1rem;
    margin: 0 0 1rem;
}
.meta-grid div { min-width: 0; }
.meta-grid dt { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.meta-grid dd { margin: 0.15rem 0 0; }

.pdf-frame {
    width: 100%;
    height: 72vh;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}

.form-card { max-width: 920px; padding: 1.25rem; }

.modal-back {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4vh 1rem 2rem;
    overflow: auto;
    background: rgba(15, 23, 42, 0.46);
}
.modal-card {
    width: min(720px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}
.modal-card.is-wide { width: min(960px, 100%); }
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 1.05rem; }
.modal-body { padding: 1.1rem 1.15rem 1.25rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.4rem; }
.modal-body .pdf-frame.is-padat { height: 320px; }
.notice { margin-bottom: 1rem; }
.year-input { width: 110px; }

.guest-body {
    margin: 0;
    min-height: 100vh;
    background: #f3f7f8;
    font-family: "Figtree", "Segoe UI", sans-serif;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
}

.login-brand {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        linear-gradient(155deg, rgba(14, 116, 144, 0.92), rgba(21, 94, 117, 0.96)),
        radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.18), transparent 36%),
        radial-gradient(circle at 82% 78%, rgba(8, 47, 73, 0.35), transparent 42%),
        #0e7490;
    display: flex;
    align-items: center;
    padding: clamp(2rem, 5vw, 4.5rem);
}

.login-brand-inner {
    position: relative;
    z-index: 1;
    max-width: 34rem;
    animation: loginRise 0.7s ease both;
}

.login-logo {
    width: 78px;
    height: 78px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 18px;
    padding: 0.55rem;
    box-shadow: 0 10px 30px rgba(8, 47, 73, 0.18);
}

.login-kicker {
    margin: 1.4rem 0 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
}

.login-brand h1 {
    margin: 0;
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(2.4rem, 4.5vw, 3.6rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.login-lead {
    margin: 1rem 0 0;
    max-width: 28rem;
    font-size: 1.05rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.86);
}

.login-ornament {
    position: absolute;
    inset: auto -8% -18% auto;
    width: min(420px, 58vw);
    height: min(420px, 58vw);
    border-radius: 40% 60% 55% 45%;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.16), transparent 55%),
        rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transform: rotate(18deg);
    animation: loginFloat 8s ease-in-out infinite;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 3rem);
    background:
        linear-gradient(180deg, #ffffff 0%, #f4f8f9 100%);
}

.login-panel-inner {
    width: min(420px, 100%);
    animation: loginRise 0.7s ease 0.08s both;
}

.login-head h2 {
    margin: 0;
    font-family: "Fraunces", Georgia, serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.login-head p {
    margin: 0.45rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.login-form {
    margin-top: 1.75rem;
    display: grid;
    gap: 1rem;
}

.login-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
}

.login-input {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0 0.95rem;
    min-height: 3rem;
    background: #fff;
    border: 1px solid #d7e3e8;
    border-radius: 12px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.login-input:focus-within {
    border-color: var(--cyan);
    box-shadow: 0 0 0 4px rgba(14, 116, 144, 0.12);
}

.login-input i {
    color: #94a3b8;
    width: 1rem;
    text-align: center;
}

.login-input input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    min-width: 0;
    padding: 0.85rem 0;
    color: var(--ink);
    font: inherit;
}

.login-input input::placeholder {
    color: #94a3b8;
}

.login-input input.is-invalid {
    color: #b91c1c;
}

.login-error {
    margin-top: 0.4rem;
    color: #b91c1c;
    font-size: 0.82rem;
}

.login-submit {
    margin-top: 0.35rem;
    width: 100%;
    min-height: 3.05rem;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--cyan), var(--cyan-dark));
    color: #fff;
    font: inherit;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.login-submit:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.login-submit:disabled {
    opacity: 0.72;
    cursor: wait;
    transform: none;
}

.login-foot {
    margin: 1.6rem 0 0;
    color: #94a3b8;
    font-size: 0.78rem;
    text-align: center;
}

@keyframes loginRise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes loginFloat {
    0%, 100% { transform: rotate(18deg) translateY(0); }
    50% { transform: rotate(22deg) translateY(-10px); }
}

@media (max-width: 900px) {
    .login-shell { grid-template-columns: 1fr; }
    .login-brand {
        min-height: 42vh;
        padding: 2rem 1.35rem 2.4rem;
        align-items: flex-end;
    }
    .login-brand h1 { font-size: clamp(2rem, 9vw, 2.8rem); }
    .login-lead { font-size: 0.98rem; }
    .login-ornament { width: 240px; height: 240px; }
    .login-panel { padding: 1.6rem 1.25rem 2.2rem; }
}

.empty { text-align: center; color: var(--muted); padding: 2.2rem 1rem !important; }

@media (min-width: 992px) {
    .sidebar { position: sticky; top: 0; height: 100vh; }
}

@media (max-width: 991.98px) {
    .sidebar { display: none; }
    .sidebar.is-open {
        display: flex;
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1040;
        height: 100vh;
        box-shadow: 12px 0 40px rgba(15, 23, 42, 0.16);
    }
    .stat-grid, .meta-grid { grid-template-columns: 1fr; }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .stat-grid { grid-template-columns: 1fr 1fr; }
}
