:root {
    --ink: #171512;
    --muted: #6f6a63;
    --line: #ded8ce;
    --panel: #ffffff;
    --soft: #f7f3ec;
    --accent: #9b1c1f;
    --accent-dark: #741316;
    --gold: #b9892f;
    --green: #137245;
    --green-soft: #e9f6ef;
    --warning: #8a5a00;
    --warning-soft: #fff5d8;
    --danger: #a62020;
    --danger-soft: #fde8e8;
    --shadow: 0 16px 38px rgba(29, 22, 12, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--soft);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
    letter-spacing: 0;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}

button,
input,
textarea {
    font: inherit;
}

.login-body,
.verify-body {
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(155, 28, 31, 0.1), rgba(185, 137, 47, 0.14)),
        var(--soft);
}

.login-panel,
.verify-card,
.content-panel,
.stat-card {
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.login-panel {
    width: min(100%, 430px);
    padding: 34px;
    border-radius: 8px;
}

.login-logo {
    display: block;
    width: 132px;
    margin: 0 auto 12px;
}

.login-panel h1,
.verify-card h1,
.page-heading h1,
.content-panel h2 {
    margin: 0;
    line-height: 1.15;
}

.login-panel h1 {
    text-align: center;
    font-size: 28px;
}

.login-panel p {
    margin: 10px 0 24px;
    color: var(--muted);
    text-align: center;
}

.admin-body {
    background: #f8f6f1;
}

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 18px;
    color: #fff;
    background: #171512;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

.brand img {
    width: 58px;
    height: 48px;
    object-fit: contain;
    padding: 4px;
    border-radius: 6px;
    background: #fff;
}

.nav-menu {
    display: grid;
    gap: 8px;
    margin-top: 34px;
}

.nav-menu a {
    display: block;
    padding: 11px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
}

.nav-menu a:hover,
.nav-menu a.active {
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.main-content {
    width: 100%;
    max-width: 1180px;
    padding: 34px;
}

.page-heading,
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.page-heading h1 {
    font-size: clamp(28px, 4vw, 42px);
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    min-height: 118px;
    padding: 20px;
    border-radius: 8px;
}

.stat-card span,
.muted,
.panel-header p {
    color: var(--muted);
}

.stat-card strong {
    display: block;
    margin-top: 12px;
    font-size: 36px;
    line-height: 1;
}

.content-panel {
    padding: 24px;
    border-radius: 8px;
}

.panel-header h2,
.content-panel h2 {
    font-size: 22px;
}

.panel-header p,
.content-panel > p {
    margin: 8px 0 0;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

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

th {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.actions {
    display: flex;
    gap: 8px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 11px 18px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    background: #fff;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.button:hover {
    border-color: #c6baaa;
    background: #faf8f3;
}

.button.primary {
    border-color: #8f161a;
    color: #fff;
    background: linear-gradient(180deg, #b21d24, #8f161a);
    box-shadow: 0 12px 22px rgba(155, 28, 31, 0.18);
}

.button.primary:hover {
    border-color: var(--accent-dark);
    background: linear-gradient(180deg, #a81920, #741316);
}

.button.small {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 14px;
}

.button.full {
    width: 100%;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.form-stack {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-weight: 700;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 11px 12px;
    color: var(--ink);
    background: #fff;
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(185, 137, 47, 0.18);
}

.flash {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    font-weight: 700;
}

.flash.success {
    border-color: #b9dec9;
    color: var(--green);
    background: var(--green-soft);
}

.flash.error {
    border-color: #efb8b8;
    color: var(--danger);
    background: var(--danger-soft);
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 180px;
    gap: 12px;
    border: 1px dashed #cfc5b7;
    border-radius: 8px;
    background: #fcfaf5;
    text-align: center;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.status-pill.verified {
    color: var(--green);
    border: 1px solid rgba(19, 114, 69, 0.16);
    background: linear-gradient(180deg, #f4fbf7, var(--green-soft));
}

.status-pill.waiting {
    color: var(--warning);
    border: 1px solid rgba(138, 90, 0, 0.16);
    background: linear-gradient(180deg, #fffaf0, var(--warning-soft));
}

.create-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
    gap: 20px;
}

.qr-panel {
    display: grid;
    gap: 18px;
}

.qr-card {
    display: grid;
    justify-items: center;
    gap: 12px;
    width: min(100%, 380px);
    margin: 0 auto;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    text-align: center;
}

.qr-logo {
    width: 125px;
}

#qr-code {
    width: 240px;
    height: 240px;
}

#qr-code canvas,
#qr-code img {
    width: 240px;
    height: 240px;
}

.qr-card span {
    max-width: 100%;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 13px;
}

.qr-actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.warning-text {
    color: var(--warning);
    font-weight: 700;
}

.verify-shell {
    width: min(100%, 820px);
}

.verify-card {
    position: relative;
    overflow: hidden;
    padding: 42px 44px;
    border-radius: 8px;
    border-color: rgba(185, 137, 47, 0.32);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 252, 246, 0.94)),
        #fff;
    box-shadow: 0 24px 58px rgba(29, 22, 12, 0.13);
}

.verify-header {
    display: flex;
    align-items: center;
    gap: 22px;
    padding-bottom: 24px;
    margin-bottom: 28px;
    border-bottom: 1px solid rgba(185, 137, 47, 0.28);
}

.verify-header img {
    width: 104px;
    padding: 8px;
    border: 1px solid rgba(185, 137, 47, 0.24);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 26px rgba(29, 22, 12, 0.08);
}

.verify-header span {
    color: var(--muted);
    font-size: 19px;
}

.ownership-panel {
    position: relative;
    overflow: hidden;
    margin: 0 0 22px;
    border: 1px solid rgba(185, 137, 47, 0.34);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 249, 238, 0.76)),
        #fff;
    box-shadow:
        0 14px 34px rgba(29, 22, 12, 0.07),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.ownership-panel > *:not(.data-watermark) {
    position: relative;
    z-index: 1;
}

.data-watermark {
    position: absolute;
    inset: 50% auto auto 50%;
    width: 430px;
    max-width: 78%;
    opacity: 0.14;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.ownership-data {
    display: grid;
    gap: 0;
    margin: 0;
    overflow: hidden;
}

.ownership-data div {
    display: grid;
    grid-template-columns: minmax(180px, 0.34fr) 1fr;
    gap: 22px;
    min-height: 72px;
    padding: 17px 24px;
    background: rgba(255, 255, 255, 0.66);
}

.ownership-data div + div {
    border-top: 1px solid rgba(185, 137, 47, 0.22);
}

.ownership-data dt {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}

.ownership-data dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: #0e0d0b;
    font-size: 18px;
    font-weight: 500;
}

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

.owner-form {
    padding: 24px;
}

.owner-form h2 {
    margin: 0;
    font-size: 22px;
}

.owner-form > p {
    margin: -8px 0 0;
}

.center {
    text-align: center;
}

@media (max-width: 860px) {
    .admin-shell {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .nav-menu {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-top: 18px;
    }

    .main-content {
        padding: 22px;
    }

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

@media (max-width: 640px) {
    .login-body,
    .verify-body {
        align-items: start;
        padding: 12px;
    }

    .login-panel,
    .verify-card,
    .content-panel {
        padding: 20px;
    }

    .page-heading,
    .panel-header,
    .verify-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .verify-shell {
        width: 100%;
    }

    .verify-card {
        padding: 24px 16px;
        border-radius: 8px;
    }

    .verify-header {
        align-items: center;
        gap: 13px;
        padding-bottom: 22px;
        margin-bottom: 18px;
        text-align: center;
    }

    .verify-header img {
        width: 110px;
        margin: 0 auto;
    }

    .verify-header div {
        width: 100%;
    }

    .verify-card h1 {
        font-size: clamp(28px, 9vw, 38px);
    }

    .verify-header span {
        display: block;
        margin-top: 6px;
        font-size: 17px;
    }

    .nav-menu {
        grid-template-columns: 1fr;
    }

    .ownership-panel {
        margin-bottom: 18px;
        border-color: rgba(185, 137, 47, 0.42);
    }

    .data-watermark {
        width: 320px;
        max-width: 92%;
        opacity: 0.16;
    }

    .ownership-data {
        gap: 9px;
        padding: 10px;
    }

    .ownership-data div {
        grid-template-columns: 1fr;
        gap: 7px;
        min-height: 0;
        padding: 14px 14px;
        border: 1px solid rgba(185, 137, 47, 0.18);
        border-radius: 7px;
        background: rgba(255, 255, 255, 0.72);
        box-shadow: 0 8px 16px rgba(29, 22, 12, 0.04);
    }

    .ownership-data div + div {
        border-top: 1px solid rgba(185, 137, 47, 0.18);
    }

    .ownership-data dt {
        font-size: 12px;
    }

    .ownership-data dd {
        font-size: 17px;
    }

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

    .owner-form {
        padding: 16px;
    }

    .button.full {
        min-height: 54px;
        padding-inline: 12px;
        text-align: center;
    }

    .actions {
        flex-wrap: wrap;
    }
}

@media print {
    body {
        background: #fff;
    }

    .sidebar,
    .page-heading,
    .content-panel:first-child,
    .qr-actions,
    .flash {
        display: none !important;
    }

    .admin-shell,
    .create-layout {
        display: block;
    }

    .main-content,
    .content-panel {
        max-width: none;
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .qr-card {
        width: 90mm;
        margin: 0 auto;
        box-shadow: none;
    }
}
