* {
    box-sizing: border-box;
}

:root {
    --bg: #F3EFE7;
    --card: #FFFFFF;
    --ink: #2A2A28;
    --muted: #706A60;
    --line: #E2D8C9;
    --accent: #7C6946;
    --accent-dark: #3B3428;
    --accent-soft: #F1E8DA;
    --danger: #A13B2B;
    --success: #276B4F;
    --shadow: 0 22px 70px rgba(59, 52, 40, 0.13);
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 0%, rgba(124,105,70,.13), transparent 34%),
        linear-gradient(135deg, #F8F5EE 0%, #EDE5D8 100%);
    line-height: 1.85;
}

a {
    color: inherit;
}

.container {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
}

.login-page {
    min-height: 100vh;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
}

.login-card {
    width: min(620px, 100%);
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(229,222,210,.9);
    border-radius: 28px;
    padding: clamp(28px, 5vw, 52px);
    box-shadow: var(--shadow);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

h1, h2, h3, h4, p {
    margin-top: 0;
}

h1 {
    font-size: clamp(24px, 4vw, 38px);
    line-height: 1.25;
    letter-spacing: .03em;
}

.login-card h2 {
    margin: 20px 0 10px;
    font-size: 42px;
    font-weight: 300;
    letter-spacing: .06em;
}

.lead {
    color: var(--muted);
    margin-bottom: 28px;
}

.login-form {
    display: grid;
    gap: 20px;
}

.admin-form {
    max-width: 640px;
}

label span {
    display: block;
    font-weight: 800;
    margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="file"] {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 16px;
    background: #fff;
}

small {
    display: block;
    color: var(--muted);
    margin-top: 6px;
}

button,
.logout-link {
    border: 0;
    border-radius: 999px;
    background: var(--accent-dark);
    color: #fff;
    padding: 13px 22px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    text-align: center;
}

button {
    font-size: 16px;
    width: 100%;
}

.button-like {
    width: auto;
}

.inline-form {
    margin: 0;
}

.alert,
.success {
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 20px;
    font-weight: 700;
}

.alert {
    color: var(--danger);
    background: #fff0ed;
}

.success {
    color: var(--success);
    background: #ecfdf3;
}

.site-header {
    padding: 34px 0 28px;
    background: rgba(255,255,255,.72);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-inner h1 {
    margin: 0;
}

.main-layout {
    padding: 36px 0 56px;
    display: grid;
    gap: 24px;
}

.amount-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    background: linear-gradient(135deg, #2E2A24 0%, #78633E 100%);
    color: #fff;
    border-radius: 28px;
    padding: clamp(24px, 4vw, 40px);
    box-shadow: var(--shadow);
}

.panel-label {
    margin: 0 0 8px;
    color: rgba(255,255,255,.72);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .12em;
}

.name {
    margin: 0;
    font-size: clamp(22px, 3vw, 34px);
    font-weight: 800;
}

.amount {
    font-size: clamp(32px, 6vw, 62px);
    font-weight: 900;
    letter-spacing: .02em;
    white-space: nowrap;
}

.content-card {
    background: rgba(255,255,255,.94);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: clamp(24px, 4vw, 42px);
    box-shadow: 0 16px 48px rgba(31, 41, 51, 0.08);
}

.content-card h2 {
    font-size: clamp(24px, 4vw, 36px);
    margin-bottom: 22px;
}

.content-card h3 {
    margin-top: 34px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.clean-list,
.check-list {
    padding-left: 0;
    list-style: none;
}

.clean-list li,
.check-list li {
    position: relative;
    padding-left: 28px;
    margin: 8px 0;
}

.clean-list li::before,
.check-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .75em;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--accent);
}

.notice {
    margin-top: 28px;
    padding: 20px;
    border-radius: 18px;
    background: #F8F5EE;
    border: 1px solid var(--line);
    font-weight: 700;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.pdf-list {
    display: grid;
    gap: 12px;
}

.pdf-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #FFFDF8;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease;
}

.pdf-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(31,41,51,.10);
}

.pdf-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #6F5633;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
}

.empty,
.help-text {
    color: var(--muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 18px;
    background: #FFFDF8;
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-weight: 700;
}

.stat-card strong {
    display: block;
    font-size: 34px;
    line-height: 1.2;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

th {
    background: #F8F5EE;
    font-size: 13px;
    letter-spacing: .04em;
}

td.ua {
    max-width: 420px;
    white-space: normal;
    word-break: break-word;
    color: var(--muted);
    font-size: 13px;
}

.site-footer {
    padding: 24px 0 42px;
    color: var(--muted);
}

@media (max-width: 760px) {
    .header-inner,
    .amount-panel,
    .section-title-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .amount {
        white-space: normal;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.badge {
    display: inline-block;
    min-width: 48px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    text-align: center;
}

.success-badge {
    color: #276B4F;
    background: #ecfdf3;
}

.failure-badge {
    color: #A13B2B;
    background: #fff0ed;
}

.multi-amount-panel {
    align-items: stretch;
}

.amount-person {
    min-width: 260px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.amount-stack {
    flex: 1;
    display: grid;
    gap: 10px;
    min-width: min(520px, 100%);
    align-content: center;
}

.amount-only-stack {
    justify-items: end;
}

.amount-only-stack .amount {
    display: block;
    line-height: 1.12;
}

@media (max-width: 760px) {
    .amount-only-stack {
        justify-items: start;
    }
}

.pdf-thumb {
    width: 74px;
    height: 92px;
    flex: 0 0 74px;
    display: block;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 6px 18px rgba(59, 52, 40, .12);
}

.pdf-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.admin-pdf-list {
    display: grid;
    gap: 12px;
}

.admin-pdf-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.admin-pdf-item .pdf-item {
    min-width: 0;
}

.is-hidden-file {
    opacity: .62;
}

.small-button {
    width: auto;
    padding: 9px 14px;
    font-size: 13px;
    background: var(--accent);
}

.pdf-toggle-form {
    display: flex;
    justify-content: flex-end;
}

.pagination-top {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 14px;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.pager a,
.pager span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
}

.pager a {
    color: var(--accent-dark);
}

.pager-bottom {
    margin-top: 16px;
}

@media (max-width: 760px) {
    .admin-pdf-item {
        grid-template-columns: 1fr;
    }

    .pdf-toggle-form {
        justify-content: flex-start;
    }

    .pagination-top {
        align-items: flex-start;
        flex-direction: column;
    }
}
