:root {
    --bg: #eef3f8;
    --surface: #ffffff;
    --surface-soft: #f3f7fb;
    --surface-accent: #edf4fb;
    --line: #d9e3ef;
    --line-strong: #c7d5e4;
    --text: #172947;
    --text-soft: #60718a;
    --primary: #1f3c68;
    --primary-dark: #162d52;
    --accent: #f2c44d;
    --accent-soft: #fff4cf;
    --accent-orange: #ea8a36;
    --danger: #b53f3f;
    --danger-bg: #fdeceb;
    --success: #1f7a46;
    --success-bg: #ebf6ef;
    --shadow: 0 20px 42px rgba(21, 38, 67, 0.08);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

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

img {
    display: block;
    max-width: 100%;
    border-radius: 18px;
}

a {
    color: inherit;
}

.public-body {
    background:
        radial-gradient(circle at top, rgba(148, 182, 224, 0.3), transparent 34%),
        radial-gradient(circle at 78% 8%, rgba(242, 196, 77, 0.12), transparent 20%),
        linear-gradient(180deg, #edf4fb 0%, #f5f8fc 46%, #ffffff 100%);
}

.public-shell {
    min-height: 100vh;
    padding: 22px 16px 42px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.public-flow {
    width: 100%;
    max-width: 560px;
}

.public-topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.public-card,
.admin-card,
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.public-card {
    padding: 24px 20px;
}

.public-card-with-floating-logo {
    position: relative;
}

.pin-card {
    margin-top: clamp(48px, 16vh, 120px);
}

.brand-mark {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.brand-mark-floating-public {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 1;
    margin: 0;
    pointer-events: none;
}

.brand-logo-img {
    width: 100%;
    height: auto;
    border-radius: 0;
    filter: drop-shadow(0 12px 26px rgba(17, 34, 64, 0.12));
}

.brand-logo-public-pin {
    width: clamp(180px, 34vw, 240px);
}

.brand-logo-public-compact,
.brand-logo-public-success,
.brand-logo-admin-auth {
    width: clamp(170px, 32vw, 220px);
}

.brand-logo-admin {
    width: 176px;
    min-width: 176px;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    margin: 0 0 12px;
    line-height: 1.15;
    color: var(--text);
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(1.8rem, 3vw, 2.35rem);
}

p {
    margin: 0;
}

.field {
    margin-top: 18px;
}

.field-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.input,
.select,
.textarea,
.file-input,
.button {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-radius: 18px;
    font: inherit;
}

.input,
.select,
.textarea,
.file-input {
    padding: 15px 16px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.input:focus,
.select:focus,
.textarea:focus,
.file-input:focus {
    outline: none;
    border-color: rgba(31, 60, 104, 0.72);
    box-shadow:
        0 0 0 4px rgba(242, 196, 77, 0.16),
        0 0 0 1px rgba(31, 60, 104, 0.08);
}

.input::placeholder,
.textarea::placeholder {
    color: #8b9bb0;
}

.input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    min-height: 58px;
}

.pin-input {
    min-height: 72px;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.45rem;
    text-align: center;
}

.textarea {
    min-height: 104px;
    resize: none;
    overflow-y: hidden;
}

.file-input {
    padding: 13px 16px;
}

.photo-upload-card {
    padding: 16px;
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    background: linear-gradient(180deg, #f8fbff 0%, var(--surface-accent) 100%);
}

.photo-upload-card-head {
    margin-bottom: 14px;
}

.photo-upload-card-title {
    margin-bottom: 4px;
    font-size: 1rem;
    font-weight: 700;
}

.photo-slot-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.photo-slot {
    position: relative;
}

.photo-slot-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.photo-slot-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 108px;
    padding: 12px 10px;
    border: 1px dashed rgba(31, 60, 104, 0.2);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.photo-slot:focus-within .photo-slot-label,
.photo-slot-label:hover {
    border-color: rgba(31, 60, 104, 0.4);
    box-shadow: 0 0 0 4px rgba(242, 196, 77, 0.12);
}

.photo-slot.has-file .photo-slot-label {
    border-style: solid;
    border-color: rgba(31, 60, 104, 0.28);
    background: linear-gradient(180deg, #ffffff 0%, #f7fafe 100%);
}

.photo-slot-top {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 8px;
}

.photo-slot-index {
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
}

.photo-slot-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0 0 3px;
    border-radius: 14px;
    background: rgba(31, 60, 104, 0.08);
    color: var(--primary-dark);
    font-size: 1.9rem;
    line-height: 1;
    font-weight: 500;
}

.photo-slot.has-file .photo-slot-action {
    background: var(--accent-soft);
    color: var(--primary);
}

.photo-slot-name {
    color: var(--text-soft);
    width: 100%;
    font-size: 0.7rem;
    line-height: 1.3;
    text-align: center;
    overflow: hidden;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.photo-slot-name:empty {
    display: none;
}

.photo-slot.has-file .photo-slot-name {
    color: var(--text);
    font-weight: 600;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    min-height: 58px;
    margin-top: 18px;
    padding: 14px 22px;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(180deg, #244472 0%, #183159 100%);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 14px 28px rgba(22, 45, 82, 0.16);
    transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.button:hover,
.button:focus {
    background: linear-gradient(180deg, #1c3763 0%, #142a4d 100%);
    box-shadow: 0 16px 30px rgba(22, 45, 82, 0.2);
}

.button:focus-visible {
    outline: none;
    box-shadow:
        0 16px 30px rgba(22, 45, 82, 0.2),
        0 0 0 4px rgba(242, 196, 77, 0.2);
}

.button:disabled,
.button.is-loading {
    opacity: 0.7;
    cursor: wait;
}

.button-secondary {
    background: #e8eef6;
    color: var(--primary-dark);
    box-shadow: none;
}

.button-secondary:hover,
.button-secondary:focus {
    background: #dde7f2;
    box-shadow: none;
}

.button-secondary:focus-visible {
    box-shadow: 0 0 0 4px rgba(242, 196, 77, 0.18);
}

.text-link {
    color: var(--primary-dark);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.16s ease;
}

.text-link:hover,
.text-link:focus {
    color: var(--accent-orange);
    text-decoration: underline;
}

.admin-shortcut {
    display: inline-block;
    margin-top: 18px;
}

.muted {
    color: var(--text-soft);
}

.small {
    font-size: 0.9rem;
}

.alert {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 0.95rem;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
}

.error-list {
    margin: 0;
    padding-left: 20px;
}

.welcome-row {
    margin-bottom: 8px;
}

.public-card-header {
    position: relative;
}

.public-card-header-with-logo {
    min-height: clamp(120px, 24vw, 160px);
    padding-right: clamp(180px, 38vw, 260px);
}

.public-card-header-pin {
    width: calc(100% - clamp(180px, 38vw, 260px));
    padding-right: 0;
    text-align: center;
}

.public-card-header-pin .eyebrow {
    display: block;
}

.public-card-header-with-logo h1:last-child,
.public-card-header-with-logo .welcome-row h1:last-child {
    margin-bottom: 0;
}

.public-card-header-report {
    min-height: clamp(92px, 18vw, 126px);
}

.public-card-header-report .welcome-row {
    margin-bottom: 0;
}

.public-heading-centered-by-logo {
    width: calc(100% - clamp(180px, 38vw, 260px));
    text-align: center;
}

.public-card-header-success {
    text-align: left;
}

.char-counter {
    margin-top: 8px;
    text-align: right;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.success-panel {
    text-align: center;
    margin-top: clamp(34px, 10vh, 84px);
}

.success-points {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.report-code {
    margin: 18px 0;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #f8fbff 0%, var(--surface-accent) 100%);
    color: var(--primary-dark);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.admin-body {
    background: linear-gradient(180deg, #eef3f8 0%, #f5f8fb 100%);
}

.admin-shell {
    position: relative;
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

.admin-top {
    margin-bottom: 6px;
}

.admin-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-header {
    display: block;
}

.admin-heading {
    flex: 1 1 auto;
}

.admin-heading h1 {
    margin-bottom: 0;
}

.admin-brand-panel {
    position: absolute;
    top: 8px;
    right: 16px;
    width: 192px;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 6px;
}

.admin-side-logo {
    display: flex;
    justify-content: flex-end;
    width: 176px;
    transform: translate(-82px, -34px);
}

.admin-meta {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    color: var(--text-soft);
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
}

.admin-nav-link {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    text-decoration: none;
    font-weight: 700;
    color: var(--text-soft);
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.admin-nav-link:hover,
.admin-nav-link:focus {
    background: var(--surface-soft);
    border-color: var(--line-strong);
    color: var(--primary-dark);
}

.admin-nav-link.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 12px 24px rgba(22, 45, 82, 0.16);
}

.stack {
    display: grid;
    gap: 18px;
}

.split-grid {
    display: grid;
    gap: 18px;
}

.admin-card {
    padding: 20px;
}

.filters-grid,
.form-grid,
.detail-grid {
    display: grid;
    gap: 14px;
}

.table-wrap {
    overflow: hidden;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    font-size: 0.9rem;
    color: var(--primary-dark);
    background: var(--surface-soft);
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
}

.status-new {
    background: #ecf5ff;
    color: #1c5da6;
}

.status-reviewing {
    background: #fff5e8;
    color: #9c5a07;
}

.status-aqd_opened {
    background: #f3ebff;
    color: #6b3bb0;
}

.status-closed {
    background: #e9f7ef;
    color: #1f7a46;
}

.card-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.card-actions .button {
    margin-top: 0;
}

.table-section-header {
    padding: 18px 20px 0;
    margin-bottom: 0;
}

.thumb-link {
    display: inline-block;
    width: fit-content;
    text-decoration: none;
}

.thumb {
    max-width: 420px;
    border: 1px solid var(--line);
    cursor: zoom-in;
}

.empty-state {
    padding: 24px;
    color: var(--text-soft);
}

.empty-state-inline {
    padding: 14px 0 0;
}

.inline-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-weight: 600;
}

.public-summary-card {
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fbff 0%, var(--surface-accent) 100%);
}

.public-summary-label {
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 700;
}

.public-summary-value {
    margin-top: 4px;
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.03em;
}

.history-section {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.compact-table th,
.compact-table td {
    padding: 12px 14px;
}

.point-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
}

.point-pending {
    background: #eef2f7;
    color: #5d6d82;
}

.point-awarded {
    background: #e9f7ef;
    color: #1f7a46;
}

.point-rejected {
    background: #fdeceb;
    color: #b53f3f;
}

.textarea-compact {
    min-height: 92px;
}

.user-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.user-detail-name {
    margin-bottom: 4px;
}

.user-detail-points {
    font-size: clamp(1.7rem, 3vw, 2.35rem);
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.04em;
}

.badge-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--primary-dark);
    font-weight: 800;
}

.count-badge-muted {
    background: #eef2f7;
    color: #5d6d82;
}

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

[data-inline-form] {
    margin: 0;
}

.text-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary-dark);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.text-button:hover,
.text-button:focus {
    color: var(--accent-orange);
    text-decoration: underline;
}

.danger-link {
    color: var(--danger);
}

@media (min-width: 680px) {
    .photo-slot-label {
        min-height: 116px;
        padding: 14px 12px;
    }

    .photo-slot-index {
        font-size: 0.95rem;
    }

    .photo-slot-name {
        font-size: 0.82rem;
    }
}

@media (min-width: 860px) {
    .photo-slot-grid {
        gap: 12px;
    }

    .public-card {
        padding: 30px;
    }

    .split-grid {
        grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
    }

    .filters-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .filters-grid-wide {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .form-grid,
    .detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 859px) {
    .admin-main {
        gap: 16px;
    }

    .admin-brand-panel {
        position: static;
        width: auto;
        margin-top: 8px;
        align-items: flex-start;
    }

    .brand-logo-admin {
        width: 164px;
        min-width: 164px;
    }

    .admin-side-logo {
        width: 164px;
        justify-content: flex-start;
        transform: none;
    }

    .admin-meta {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 760px) {
    #report_date {
        font-size: 1.08rem;
        font-weight: 600;
    }

    .brand-mark-floating-public {
        top: 16px;
        right: 16px;
    }

    .public-card-header-with-logo {
        min-height: 112px;
        padding-right: 170px;
    }

    .public-card-header-report {
        min-height: 94px;
    }

    .public-card-header-pin {
        width: calc(100% - 170px);
        padding-right: 0;
    }

    .public-heading-centered-by-logo {
        width: calc(100% - 170px);
    }

    .table-scroll {
        overflow: visible;
    }

    .data-table,
    .data-table thead,
    .data-table tbody,
    .data-table th,
    .data-table td,
    .data-table tr {
        display: block;
        width: 100%;
    }

    .data-table thead {
        display: none;
    }

    .data-table tr {
        padding: 12px 14px;
        border-bottom: 1px solid var(--line);
    }

    .data-table tr:last-child {
        border-bottom: 0;
    }

    .data-table td {
        padding: 6px 0;
        border: 0;
    }

    .data-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 2px;
        color: var(--text-soft);
        font-size: 0.82rem;
        font-weight: 700;
    }
}
