:root {
    color-scheme: dark;
    --bg: #040705;
    --surface: #0b100d;
    --surface-muted: #101812;
    --surface-raised: #121d16;
    --ink: #ecfdf3;
    --muted: #8ca595;
    --line: #213128;
    --accent: #22c55e;
    --accent-dark: #16a34a;
    --danger: #f87171;
    --success: #34d399;
    --warning: #facc15;
    --shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(34, 197, 94, 0.12), transparent 34rem),
        linear-gradient(180deg, #07100a 0%, var(--bg) 42%);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
}

.page-shell {
    width: min(1480px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 48px;
}

.public-shell,
.detail-shell {
    width: min(1040px, calc(100% - 32px));
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

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

h1,
h2,
h3,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0;
    max-width: 760px;
    font-size: clamp(2rem, 5vw, 4.2rem);
    line-height: 0.95;
    letter-spacing: 0;
}

h2 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: 0;
}

h3 {
    margin: 10px 0 8px;
    font-size: 1rem;
    line-height: 1.25;
    letter-spacing: 0;
}

.header-copy {
    max-width: 720px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 1rem;
}

.admin-link,
.primary-button,
.secondary-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid transparent;
    padding: 10px 16px;
    font-size: 0.94rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.admin-link,
.secondary-button {
    background: #0f1812;
    border-color: var(--line);
    color: var(--ink);
}

.primary-button {
    background: var(--accent);
    color: #021006;
}

.primary-button:hover {
    background: var(--accent-dark);
}

.full-width {
    width: 100%;
}

.ticket-form,
.detail-panel,
.update-panel {
    background: rgba(11, 16, 13, 0.96);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.ticket-form {
    display: grid;
    gap: 22px;
    padding: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

label {
    display: grid;
    gap: 7px;
    min-width: 0;
}

label span {
    color: var(--ink);
    font-size: 0.86rem;
    font-weight: 800;
}

label em {
    color: var(--muted);
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #060a08;
    color: var(--ink);
    font: inherit;
    padding: 10px 12px;
}

textarea {
    min-height: 150px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
    outline: none;
}

input::placeholder,
textarea::placeholder {
    color: #617466;
}

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

.notice {
    display: grid;
    gap: 6px;
    margin-bottom: 18px;
    border-radius: 8px;
    border: 1px solid;
    padding: 14px 16px;
}

.notice ul {
    margin: 0;
    padding-left: 18px;
}

.success {
    background: #052e18;
    border-color: #14532d;
    color: var(--success);
}

.error {
    background: #3b0a0a;
    border-color: #7f1d1d;
    color: var(--danger);
}

.board {
    display: grid;
    grid-template-columns: repeat(4, minmax(260px, 1fr));
    gap: 16px;
    align-items: start;
}

.board-column {
    min-height: 520px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(16, 24, 18, 0.96);
}

.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
}

.column-header span {
    display: inline-flex;
    min-width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #07100a;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 800;
}

.ticket-stack {
    display: grid;
    gap: 12px;
    padding: 12px;
}

.ticket-card {
    display: block;
    min-height: 172px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    background: var(--surface-raised);
    padding: 14px;
    text-decoration: none;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}

.ticket-card:hover {
    border-color: #2f5a3a;
    transform: translateY(-1px);
}

.ticket-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.card-topline,
.card-meta,
.evidence-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.badge,
.submitter,
.evidence-row span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}

.badge {
    max-width: 140px;
    overflow: hidden;
    padding: 7px 9px;
    background: #052e18;
    color: var(--accent);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.submitter {
    max-width: 140px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-meta {
    margin-top: 18px;
    color: var(--muted);
    font-size: 0.8rem;
}

.evidence-row {
    justify-content: flex-start;
    margin-top: 12px;
}

.evidence-row span {
    padding: 6px 8px;
    background: #1a2e12;
    color: #bef264;
}

.empty-state {
    margin: 0;
    border: 1px dashed #2b3d31;
    border-radius: 8px;
    padding: 18px 12px;
    color: var(--muted);
    text-align: center;
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
}

.detail-panel,
.update-panel {
    padding: 22px;
}

.detail-section + .detail-section {
    margin-top: 26px;
}

.description {
    margin: 12px 0 0;
    color: #d7f6df;
}

.facts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.facts-grid div {
    min-height: 82px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #07100a;
    padding: 12px;
}

.facts-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.facts-grid strong {
    display: block;
    margin-top: 6px;
    overflow-wrap: anywhere;
}

.evidence-detail {
    display: grid;
    gap: 14px;
    margin-top: 12px;
}

.evidence-detail img {
    display: block;
    width: 100%;
    max-height: 520px;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: contain;
    background: #020403;
}

.update-panel {
    position: sticky;
    top: 18px;
}

.update-panel form {
    display: grid;
    gap: 16px;
    margin-top: 16px;
}

@media (max-width: 1180px) {
    .board {
        grid-template-columns: repeat(2, minmax(260px, 1fr));
    }
}

@media (max-width: 760px) {
    .page-shell {
        width: min(100% - 20px, 720px);
        padding-top: 20px;
    }

    .page-header,
    .board-header {
        display: grid;
    }

    h1 {
        font-size: 2.35rem;
        line-height: 1;
    }

    .admin-link,
    .primary-button,
    .secondary-button {
        width: 100%;
    }

    .form-grid,
    .board,
    .detail-grid,
    .facts-grid {
        grid-template-columns: 1fr;
    }

    .ticket-form,
    .detail-panel,
    .update-panel {
        padding: 16px;
    }

    .board-column {
        min-height: 240px;
    }

    .update-panel {
        position: static;
    }
}
