:root {
    --ink: #0a0a0a;
    --muted: #5c5c5c;
    --paper: #f4f4f4;
    --panel: #ffffff;
    --line: #e3e3e3;
    --accent: #f15a24;
    --accent-dark: #c94818;
    --brand-orange: #f15a24;
    --brand-soft: #fff0e8;
    --leaf: #f15a24;
    --leaf-soft: #fff0e8;
    --header-bg: #0a0a0a;
    --shadow: 0 24px 70px rgba(0, 0, 0, .08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "Avenir Next", "Trebuchet MS", Verdana, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(241, 90, 36, .08), transparent 28rem),
        linear-gradient(180deg, #f8f8f8, var(--paper));
}

a {
    color: inherit;
}

.shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 56px;
}

.site-header {
    background: var(--header-bg);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 16px;
    padding-bottom: 16px;
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -.03em;
}

.brand-logo {
    display: block;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    object-fit: contain;
}

.brand-name {
    font-size: clamp(1.15rem, 2.4vw, 1.45rem);
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1;
    color: #ffffff;
}

.brand-accent {
    color: var(--brand-orange);
}

.nav-dark a,
.nav-dark button {
    background: rgba(255, 255, 255, .08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, .12);
}

.nav-dark a:hover,
.nav-dark button:hover {
    background: rgba(241, 90, 36, .18);
    border-color: rgba(241, 90, 36, .35);
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 16px;
    background: var(--ink);
    color: white;
    box-shadow: 0 12px 28px rgba(23, 33, 27, .18);
}

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

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

.nav a,
.nav button,
.btn,
.btn-secondary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.nav a,
.btn-secondary {
    background: rgba(255, 255, 255, .72);
    color: var(--ink);
    border: 1px solid var(--line);
}

.btn {
    background: var(--accent);
    color: white;
    box-shadow: 0 14px 30px rgba(241, 90, 36, .28);
}

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

.btn-danger {
    background: var(--header-bg);
    color: #fff;
}

.card {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow);
}

.card-pad {
    padding: clamp(22px, 4vw, 36px);
}

.hero {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 26px;
    align-items: stretch;
}

.login-hero {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 26px;
    align-items: stretch;
    max-width: none;
    margin: 0;
}

.login-page .site-header {
    display: none;
}

.login-page .topbar {
    display: none;
}

.login-page .shell {
    width: min(920px, calc(100% - 32px));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 28px 0 40px;
}

.login-page .alert {
    margin-bottom: 18px;
}

.login-page-wrap {
    width: 100%;
}

.login-panel {
    overflow: hidden;
    border-radius: 28px;
    background: rgba(255, 255, 255, .94);
    box-shadow:
        0 28px 80px rgba(41, 33, 20, .12),
        0 2px 0 rgba(255, 255, 255, .8) inset;
}

.login-logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 34px 32px 28px;
    background: var(--header-bg);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.login-panel-logo {
    display: block;
    width: min(220px, 58vw);
    height: auto;
    object-fit: contain;
}

.login-panel-body {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    align-items: stretch;
}

.login-panel-brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    padding: clamp(28px, 4vw, 42px);
    background:
        radial-gradient(circle at top left, rgba(241, 90, 36, .1), transparent 18rem),
        linear-gradient(180deg, #fafafa, #ffffff);
    border-right: 1px solid var(--line);
}

.login-panel-brand h1 {
    max-width: 14ch;
    font-size: clamp(1.85rem, 3.4vw, 2.65rem);
    line-height: 1.02;
}

.login-panel-brand .lead {
    max-width: 34ch;
    margin: 0;
    color: #55635a;
    font-size: 1rem;
    line-height: 1.55;
}

.login-feature-list {
    display: grid;
    gap: 10px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.login-feature-list li {
    position: relative;
    padding-left: 22px;
    color: #3f4d44;
    font-size: .92rem;
    font-weight: 700;
    line-height: 1.4;
}

.login-feature-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .45em;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    box-shadow: 0 0 0 3px rgba(241, 90, 36, .14);
}

.login-panel-form {
    display: grid;
    gap: 16px;
    align-content: center;
    padding: clamp(28px, 4vw, 42px);
    background: #fff;
}

.login-card-heading h2 {
    margin-top: 4px;
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
}

.login-remember {
    margin-top: -2px;
}

.login-submit {
    width: 100%;
    min-height: 48px;
    margin-top: 4px;
    font-size: 1rem;
}

.hero-copy {
    padding: clamp(28px, 6vw, 54px);
}

.login-copy {
    padding: clamp(28px, 6vw, 54px);
}

.login-copy h1 {
    max-width: none;
    font-size: clamp(2rem, 4.2vw, 3.2rem);
    line-height: .98;
}

.login-copy .lead {
    max-width: none;
    margin-top: 0;
}

.login-card {
    display: grid;
    gap: 18px;
    min-height: auto;
    padding: clamp(22px, 4vw, 36px);
    border-radius: 30px;
}

.login-card-heading {
    margin-bottom: 6px;
}

.login-card-heading .muted {
    margin: 10px 0 0;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--leaf);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    margin: 0;
    letter-spacing: -.045em;
    line-height: .98;
}

h1 {
    font-size: clamp(1.9rem, 3.6vw, 3rem);
}

h2 {
    font-size: clamp(1.4rem, 2.4vw, 2rem);
}

h3 {
    font-size: 1.25rem;
}

.lead {
    color: var(--muted);
    font-size: clamp(.95rem, 1.4vw, 1.08rem);
    line-height: 1.7;
}

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

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

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

.stat {
    padding: 22px;
    border-radius: 24px;
    background: var(--panel);
    border: 1px solid var(--line);
}

.stat strong {
    display: block;
    margin-top: 8px;
    font-size: 2rem;
    letter-spacing: -.05em;
}

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

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

.field {
    display: grid;
    gap: 8px;
}

label {
    color: #38443c;
    font-size: .88rem;
    font-weight: 800;
}

input,
textarea,
select {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #ded2bf;
    border-radius: 16px;
    background: #fffdf8;
    color: var(--ink);
    font: inherit;
}

input[type="checkbox"] {
    width: 20px;
    min-height: 20px;
    height: 20px;
    padding: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.check-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    color: #38443c;
    cursor: pointer;
}

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

input:focus,
textarea:focus,
select:focus {
    outline: 3px solid rgba(241, 90, 36, .18);
    border-color: var(--accent);
}

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

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

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

th {
    color: var(--muted);
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--leaf-soft);
    color: var(--leaf);
    font-weight: 800;
}

.badge.used {
    background: #ffe8df;
    color: var(--accent-dark);
}

.nfc-helper-card {
    background: linear-gradient(180deg, #fff0e8, rgba(255, 255, 255, .96));
}

.nfc-steps {
    display: grid;
    gap: 8px;
    margin: 16px 0 20px;
    padding-left: 20px;
    color: #4a574f;
    line-height: 1.5;
}

.nfc-export-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 14px;
    align-items: end;
}

.url-cell a {
    display: inline-block;
    max-width: 28rem;
    word-break: break-all;
}

.copy-url-btn {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: .78rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.copy-url-btn:hover {
    border-color: var(--leaf);
    color: var(--leaf);
}

.alert {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--leaf-soft);
    border: 1px solid #c9e0d2;
}

.alert.error {
    background: #fff0ec;
    border-color: #f3c4b5;
    color: #8d341f;
}

.pet-photo {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 30px;
    background: var(--sky);
}

.profile-card {
    max-width: 720px;
    margin: 0 auto;
}

.profile-rescue {
    display: grid;
    gap: 20px;
}

.profile-hero-card {
    display: grid;
    grid-template-columns: minmax(280px, .9fr) minmax(0, 1.1fr);
    gap: clamp(18px, 4vw, 34px);
    align-items: stretch;
    overflow: hidden;
    border: 1px solid rgba(231, 221, 204, .88);
    border-radius: 38px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .93), rgba(255, 250, 241, .82)),
        radial-gradient(circle at 10% 10%, rgba(241, 90, 36, .12), transparent 22rem);
    box-shadow: var(--shadow);
}

.profile-photo-wrap {
    position: relative;
    min-height: 100%;
    padding: clamp(14px, 2vw, 20px);
}

.profile-photo {
    width: 100%;
    height: 100%;
    min-height: 380px;
    object-fit: cover;
    border-radius: 28px;
    background: var(--sky);
    box-shadow: 0 24px 60px rgba(23, 33, 27, .16);
}

.profile-photo-empty {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    padding: 28px;
    text-align: center;
}

.profile-photo-empty span {
    color: var(--muted);
}

.rescue-badge {
    position: absolute;
    left: clamp(26px, 4vw, 38px);
    bottom: clamp(26px, 4vw, 38px);
    display: inline-flex;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(23, 33, 27, .9);
    color: #fff;
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.profile-hero-copy {
    display: grid;
    align-content: center;
    gap: 20px;
    padding: clamp(24px, 5vw, 48px) clamp(22px, 5vw, 54px) clamp(28px, 5vw, 52px) 0;
}

.profile-hero-copy h1 {
    font-size: clamp(2rem, 4.2vw, 3.35rem);
}

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

.contact-strip > div,
.info-panel,
.profile-footer-card {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 16px 36px rgba(41, 33, 20, .08);
}

.contact-strip > div {
    padding: 16px;
    border-radius: 22px;
}

.contact-strip span,
.contact-strip strong {
    display: block;
}

.contact-strip strong {
    margin-top: 6px;
    overflow-wrap: anywhere;
    font-size: 1.1rem;
}

.rescue-actions {
    margin-top: 0;
}

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

.info-panel {
    padding: clamp(20px, 3vw, 28px);
    border-radius: 28px;
}

.important-panel {
    background: linear-gradient(135deg, #fff5ef, rgba(255, 255, 255, .86));
    border-color: #f1c9ba;
}

.panel-kicker {
    display: inline-flex;
    margin-bottom: 12px;
    color: var(--leaf);
    font-size: .74rem;
    font-weight: 900;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.detail-list {
    display: grid;
    gap: 12px;
    margin: 18px 0 0;
}

.detail-list div {
    display: grid;
    grid-template-columns: minmax(120px, .42fr) minmax(0, 1fr);
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.detail-list div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.detail-list dt {
    color: var(--muted);
    font-weight: 800;
}

.detail-list dd {
    margin: 0;
    font-weight: 800;
}

.panel-button {
    margin-top: 12px;
}

.rescue-steps {
    display: grid;
    gap: 10px;
    margin: 18px 0 0;
    padding-left: 1.2rem;
    color: var(--muted);
}

.rescue-steps li {
    padding-left: 4px;
}

.wide-panel {
    grid-column: 1 / -1;
}

.profile-footer-card {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 18px;
    border-radius: 26px;
}

.profile-footer-card span,
.profile-footer-card strong {
    display: block;
}

.profile-footer-card strong {
    margin-top: 4px;
    overflow-wrap: anywhere;
}

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

.print-sheet {
    overflow: hidden;
}

.print-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.print-title {
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: .95;
}

.print-hero .lead {
    max-width: 58ch;
}

.print-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
    flex-shrink: 0;
}

.print-actions a,
.print-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .76);
    color: var(--ink);
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.print-actions button {
    background: var(--ink);
    color: #fff;
    border-color: var(--ink);
}

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

.print-select-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, .72);
}

.select-btn {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.print-summary div {
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .9), rgba(255, 250, 241, .72));
}

.print-summary span,
.print-summary strong {
    display: block;
}

.print-summary span {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.print-summary strong {
    margin-top: 6px;
    font-size: 1.8rem;
    line-height: 1;
}

.label-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 210px;
    margin: 0 auto;
    padding: 14px 12px 12px;
    gap: 8px;
    border: 1px dashed rgba(23, 33, 27, .24);
    border-radius: 16px;
    background: #fff;
}

.label-brand-logo {
    display: block;
    width: 56px;
    height: auto;
    margin: 0;
    object-fit: contain;
}

.label-qr-code {
    display: block;
    width: 100%;
    max-width: 168px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.qr-label {
    position: relative;
    break-inside: avoid;
    display: grid;
    gap: 10px;
    justify-items: stretch;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 20px;
    text-align: center;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 10px 28px rgba(41, 33, 20, .06);
    overflow: hidden;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.qr-label:hover {
    border-color: rgba(241, 90, 36, .28);
}

.qr-label.is-selected {
    border-color: rgba(241, 90, 36, .55);
    box-shadow: 0 0 0 2px rgba(241, 90, 36, .12), 0 14px 30px rgba(241, 90, 36, .1);
}

.qr-label-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(231, 221, 204, .9);
    background: linear-gradient(180deg, rgba(255, 250, 241, .9), rgba(255, 255, 255, .72));
}

.qr-label.is-used .qr-label-toolbar {
    background: linear-gradient(180deg, rgba(255, 241, 236, .95), rgba(255, 255, 255, .82));
}

.qr-label-select {
    margin: 0;
    font-size: .84rem;
    font-weight: 800;
}

.qr-status {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--leaf-soft);
    color: var(--leaf);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.qr-status.used {
    background: #ffe8df;
    color: var(--accent-dark);
}

.label-code-id {
    display: block;
    margin: 0;
    padding: 4px 8px;
    border-radius: 6px;
    background: #f4f7f5;
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: #3f4d44;
    line-height: 1.2;
}

.qr-label .label-preview {
    margin-top: 12px;
    margin-bottom: 12px;
}

.qr-label p {
    margin: 0;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 800;
}

.label-print-used {
    display: none;
    margin: 0;
    color: var(--accent-dark);
    font-size: .82rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* Dashboard */
.dashboard-page {
    display: grid;
    gap: 20px;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 20px;
    align-items: end;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

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

.metric-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 14px 34px rgba(41, 33, 20, .07);
}

.metric-green {
    background: linear-gradient(135deg, #fff0e8, rgba(255, 255, 255, .9));
    border-color: #f5c4ad;
}

.metric-orange {
    background: linear-gradient(135deg, #fff1eb, rgba(255, 255, 255, .9));
    border-color: #f2c6b4;
}

.metric-sand {
    background: linear-gradient(135deg, #fff7e8, rgba(255, 255, 255, .9));
    border-color: #e7d4a8;
}

.metric-card span,
.metric-card strong,
.metric-card small {
    display: block;
}

.metric-card span {
    color: var(--muted);
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.metric-card strong {
    margin-top: 8px;
    font-size: clamp(1.8rem, 4vw, 2.45rem);
    line-height: 1;
}

.metric-card small {
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.45;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.4fr .9fr .9fr;
    gap: 18px;
    align-items: stretch;
}

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

.insight-card {
    padding: clamp(18px, 3vw, 26px);
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 16px 38px rgba(41, 33, 20, .08);
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.panel-head h2 {
    font-size: clamp(1.25rem, 2.2vw, 1.75rem);
}

.mini-pill,
.view-link {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--leaf-soft);
    color: var(--leaf);
    font-size: .76rem;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.chart-box {
    position: relative;
    height: 220px;
}

.donut-box {
    height: 185px;
}

.compact-chart {
    height: 210px;
}

.legend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 12px;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 800;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border-radius: 999px;
}

.green-dot {
    background: var(--accent);
}

.sand-dot {
    background: #d4b896;
}

.coverage-list,
.rank-list,
.code-mini-list {
    display: grid;
    gap: 10px;
}

.coverage-list div,
.rank-list div,
.code-mini-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.coverage-list div:last-child,
.rank-list div:last-child,
.code-mini-list div:last-child {
    border-bottom: 0;
}

.coverage-list span,
.rank-list span,
.code-mini-list span {
    color: var(--muted);
    font-weight: 800;
}

.coverage-list strong,
.rank-list strong {
    font-size: 1.15rem;
}

.code-mini-list code,
.dashboard-table code {
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(231, 221, 204, .4);
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: .8rem;
}

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

.dashboard-table th {
    padding: 11px 12px;
    background: rgba(231, 221, 204, .2);
    color: var(--muted);
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.dashboard-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

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

.pagination {
    margin-top: 18px;
}

.pagination nav {
    display: grid;
    gap: 12px;
}

.pagination .flex {
    display: flex;
}

.pagination .justify-between {
    justify-content: space-between;
}

.pagination .items-center {
    align-items: center;
}

.pagination .hidden {
    display: none;
}

.pagination svg {
    width: 18px;
    height: 18px;
    max-width: 18px;
    max-height: 18px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 999px;
    color: var(--ink);
    font-size: .85rem;
    font-weight: 800;
    text-decoration: none;
}

.pagination a {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .75);
}

.pagination a:hover {
    border-color: var(--leaf);
    color: var(--leaf);
}

.pagination [aria-current="page"] span,
.pagination span[aria-current="page"] {
    background: var(--ink);
    color: #fff;
}

@media (max-width: 980px) {
    .dashboard-hero,
    .dashboard-grid,
    .lower-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-actions {
        justify-content: flex-start;
    }

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

    .print-hero {
        grid-template-columns: 1fr;
    }

    .print-actions {
        margin-top: 0;
        justify-content: flex-start;
    }
}

@media (max-width: 780px) {
    .topbar,
    .hero,
    .login-hero,
    .login-panel-body,
    .profile-hero-card,
    .profile-info-grid,
    .profile-footer-card,
    .grid-2,
    .grid-3,
    .contact-strip,
    .profile-actions {
        grid-template-columns: 1fr;
    }

    .profile-hero-copy {
        padding: 0 22px 28px;
    }

    .profile-photo {
        min-height: 300px;
    }

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

    .login-hero {
        margin-top: 4px;
    }

    .login-page .shell {
        min-height: auto;
        justify-content: flex-start;
        padding-top: 20px;
    }

    .login-panel-head {
        padding-top: 22px;
    }

    .login-panel-brand {
        border-right: 0;
        border-bottom: 1px solid rgba(231, 221, 204, .85);
    }

    .login-panel-brand h1 {
        max-width: none;
    }

    .login-copy,
    .login-card {
        min-height: auto;
    }

    .login-copy h1 {
        max-width: none;
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .detail-list div {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .topbar,
    .nav {
        align-items: stretch;
    }

    .print-hero,
    .print-actions {
        display: grid;
    }

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

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

    .topbar {
        display: grid;
    }

    .nav a,
    .nav button {
        width: 100%;
    }
}

@page {
    size: A4 portrait;
    margin: 4mm 5mm;
}

@media print {
    html,
    body {
        margin: 0;
        padding: 0;
        background: white;
    }

    .topbar,
    .no-print {
        display: none !important;
    }

    .shell {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .card,
    .print-sheet {
        margin: 0;
        padding: 0 !important;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
    }

    .qr-label:not(.print-selected) {
        display: none !important;
    }

    .qr-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 3mm;
        width: 100%;
    }

    .qr-label {
        display: block;
        padding: 1mm 1.5mm 1.2mm;
        border: 1px dashed #777;
        border-radius: 6px;
        box-shadow: none;
        background: #fff;
    }

    .label-preview {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 1mm;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .label-brand-logo {
        width: 14mm;
        height: auto;
        margin: 0;
        object-fit: contain;
    }

    .label-qr-code {
        width: 94%;
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .label-code-id {
        margin: 0;
        padding: 0;
        background: transparent;
        font-size: 6pt;
        font-weight: 700;
        letter-spacing: .03em;
        color: #222;
        line-height: 1;
    }

    .label-print-used {
        display: block;
        margin: 0;
        font-size: 6pt;
        line-height: 1;
    }

    .qr-label p.label-caption {
        margin: 0;
        padding: 0;
        font-size: 5.5pt;
        line-height: 1;
    }
}
