:root {
    --bg-body: #0c0f14;
    --bg-surface: #12161d;
    --bg-surface-2: #171c24;
    --bg-surface-3: #1d2430;
    --bg-input: #0f1319;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #f5f7fb;
    --text-soft: #a3aebd;
    --text-muted: #788395;
    --accent: #67e8f9;
    --accent-strong: #22d3ee;
    --accent-soft: rgba(34, 211, 238, 0.16);
    --accent-blue: #60a5fa;
    --accent-blue-soft: rgba(96, 165, 250, 0.16);
    --accent-amber: #fbbf24;
    --accent-amber-soft: rgba(251, 191, 36, 0.16);
    --accent-violet: #a78bfa;
    --accent-violet-soft: rgba(167, 139, 250, 0.16);
    --success-bg: rgba(72, 187, 120, 0.14);
    --success-border: rgba(72, 187, 120, 0.28);
    --danger-bg: rgba(255, 107, 107, 0.14);
    --danger-border: rgba(255, 107, 107, 0.3);
    --warning-bg: rgba(245, 158, 11, 0.14);
    --warning-border: rgba(245, 158, 11, 0.28);
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    --radius-lg: 10px;
    --radius-md: 8px;
    --radius-sm: 6px;
    --sidebar-width: 260px;
    --topbar-height: 78px;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg-body);
    color: var(--text);
    font-family: "Sen", "Segoe UI", Arial, sans-serif;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

textarea {
    resize: vertical;
}

.screen-shell {
    min-height: 100vh;
    padding: 24px;
}

.auth-center-layout {
    min-height: calc(100vh - 48px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-panel-single {
    width: 100%;
    max-width: 430px;
}

.panel-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    box-shadow: var(--shadow);
}

.panel-card-compact {
    padding: 32px;
}

.panel-header {
    margin-bottom: 28px;
}

.panel-header-centered {
    text-align: center;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
}

.brand-mark svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.brand-mark-large {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.panel-header h2 {
    margin: 16px 0 10px;
    font-size: 1.85rem;
    line-height: 1.1;
}

.panel-header p,
.page-subtitle,
.section-kicker,
.table-muted,
.field-hint,
.sidebar-user-label,
.sidebar-user span,
.sidebar-user small,
.metric-tile span,
.quick-link-card span,
.qr-card-copy p,
.empty-state p {
    color: var(--text-soft);
}

.auth-form,
.billboard-form {
    display: grid;
    gap: 20px;
}

.field-block {
    display: grid;
    gap: 10px;
}

.field-block label,
.field-topline label {
    font-size: 0.94rem;
    font-weight: 600;
}

.field-topline,
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.form-row-single {
    justify-content: flex-start;
}

.input-shell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    transition: border-color 150ms ease, background 150ms ease;
}

.input-shell:focus-within {
    border-color: rgba(34, 211, 238, 0.34);
    background: #12171f;
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08);
}

.input-shell input,
.input-shell select,
.input-shell textarea {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.input-shell textarea {
    padding: 14px 0;
    min-height: 88px;
}

.textarea-shell {
    align-items: flex-start;
}

.select-shell select {
    appearance: none;
    color-scheme: dark;
    background-color: transparent;
    color: var(--text);
}

.select-shell option {
    background: #11151c;
    color: var(--text);
}

.input-shell input::placeholder,
.input-shell textarea::placeholder {
    color: var(--text-muted);
}

.input-shell input[readonly],
.input-shell textarea[readonly] {
    cursor: default;
    color: var(--text-soft);
}

.input-icon {
    display: inline-flex;
    width: 18px;
    color: var(--text-muted);
}

.input-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.check-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-soft);
}

.check-row input {
    width: 16px;
    height: 16px;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface-2);
    color: var(--text);
    cursor: pointer;
    transition: background 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.primary-button,
.secondary-button,
.danger-button {
    min-height: 48px;
    padding: 0 18px;
    font-weight: 700;
}

.primary-button {
    width: 100%;
    background: rgba(34, 211, 238, 0.16);
    border-color: rgba(34, 211, 238, 0.24);
    color: #dffbff;
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.ghost-button:hover,
.icon-button:hover,
.nav-link:hover,
.quick-link-card:hover {
    background: #202733;
    border-color: var(--border-strong);
}

.primary-button:hover {
    background: rgba(34, 211, 238, 0.22);
    border-color: rgba(34, 211, 238, 0.38);
}

.ghost-button {
    min-height: 34px;
    padding: 0 12px;
    color: var(--text-soft);
}

.icon-button {
    width: 42px;
    height: 42px;
    padding: 0;
    color: var(--accent);
    background: rgba(34, 211, 238, 0.12);
    border-color: rgba(34, 211, 238, 0.22);
}

.icon-button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.icon-button:hover {
    background: rgba(34, 211, 238, 0.18);
    border-color: rgba(34, 211, 238, 0.34);
}

.icon-button:disabled {
    cursor: wait;
    opacity: 0.9;
}

.icon-button.is-loading svg {
    animation: spin 0.85s linear infinite;
}

.danger-button {
    background: #2a171a;
    border-color: rgba(255, 107, 107, 0.2);
}

.compact-button {
    min-height: 40px;
    padding: 0 14px;
    font-size: 0.92rem;
}

.button-loading {
    display: none;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.primary-button.is-loading {
    opacity: 0.75;
    pointer-events: none;
}

.primary-button.is-loading .button-label {
    display: none;
}

.primary-button.is-loading .button-loading {
    display: inline;
}

.alert {
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

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

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

.alert-title {
    margin: 0;
    font-weight: 700;
}

.alert-list {
    margin: 10px 0 0;
    padding-left: 18px;
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    padding: 24px 18px;
    background: #11151c;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 24px;
    z-index: 30;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 8px;
}

.sidebar-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: rgba(34, 211, 238, 0.14);
    color: var(--accent);
    font-weight: 800;
}

.sidebar-brand strong,
.sidebar-brand span {
    display: block;
}

.sidebar-brand span {
    margin-top: 4px;
    color: var(--text-soft);
    font-size: 0.92rem;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-soft);
}

.nav-link.is-active {
    background: rgba(34, 211, 238, 0.14);
    color: var(--text);
    border-color: rgba(34, 211, 238, 0.2);
}

.nav-link-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--text-muted);
}

.nav-link.is-active .nav-link-dot {
    background: var(--accent-strong);
}

.sidebar-user {
    margin-top: auto;
    padding: 16px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
}

.sidebar-user-label {
    margin: 0 0 10px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.sidebar-user strong,
.sidebar-user span,
.sidebar-user small {
    display: block;
}

.sidebar-user span,
.sidebar-user small {
    margin-top: 6px;
}

.app-topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(12, 15, 20, 0.96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
    z-index: 20;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.topbar-caption {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.app-topbar h1 {
    margin: 0;
    font-size: 1.2rem;
}

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

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: var(--text);
}

.app-content {
    margin-left: var(--sidebar-width);
    padding: calc(var(--topbar-height) + 26px) 28px 32px;
}

.page-header {
    margin-bottom: 24px;
}

.page-kicker,
.section-kicker {
    margin: 0 0 10px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.page-header h2,
.section-heading h3,
.empty-state h3,
.qr-card-copy h3 {
    margin: 0;
    font-size: 1.6rem;
}

.page-subtitle {
    margin: 10px 0 0;
    max-width: 760px;
    line-height: 1.6;
}

.overview-metrics,
.content-grid,
.quick-links,
.qr-grid {
    display: grid;
    gap: 18px;
}

.overview-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 24px;
}

.metric-tile,
.content-card,
.quick-link-card,
.qr-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    box-shadow: var(--shadow);
}

.metric-tile {
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.metric-tile::before,
.quick-link-card::before,
.qr-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    opacity: 0.9;
}

.metric-tile:nth-child(1)::before,
.quick-link-card:nth-child(1)::before,
.qr-card:nth-child(4n + 1)::before {
    background: var(--accent-strong);
}

.metric-tile:nth-child(2)::before,
.quick-link-card:nth-child(2)::before,
.qr-card:nth-child(4n + 2)::before {
    background: var(--accent-blue);
}

.metric-tile:nth-child(3)::before,
.quick-link-card:nth-child(3)::before,
.qr-card:nth-child(4n + 3)::before {
    background: var(--accent-amber);
}

.metric-tile:nth-child(4)::before,
.qr-card:nth-child(4n + 4)::before {
    background: var(--accent-violet);
}

.metric-tile p,
.metric-tile strong,
.metric-tile span {
    display: block;
}

.metric-tile strong {
    margin: 12px 0 8px;
    font-size: 2rem;
    line-height: 1;
}

.metric-tile:nth-child(1) strong {
    color: var(--accent);
}

.metric-tile:nth-child(2) strong {
    color: var(--accent-blue);
}

.metric-tile:nth-child(3) strong {
    color: #7dd3a7;
}

.metric-tile:nth-child(4) strong {
    color: var(--accent-violet);
}

.content-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.35fr);
    align-items: start;
}

.content-card {
    padding: 22px;
}

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

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

.form-actions,
.table-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.detail-panel {
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border);
}

.detail-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(72, 187, 120, 0.34);
    background: rgba(72, 187, 120, 0.16);
    color: #9ae6b4;
    font-size: 0.88rem;
    font-weight: 700;
}

.record-detail-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
}

.record-meta {
    display: grid;
    gap: 14px;
}

.record-meta-item {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
}

.record-meta-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.record-qr-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
}

.qr-preview-link {
    display: inline-flex;
}

.qr-detail-image {
    width: 200px;
    height: 200px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #fff;
    padding: 8px;
}

.qr-placeholder-large {
    min-width: 200px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
}

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

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

.data-table th {
    color: var(--text-soft);
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.data-table td strong,
.table-muted {
    display: block;
}

.table-muted {
    margin-top: 6px;
    font-size: 0.92rem;
}

.empty-cell {
    color: var(--text-soft);
    text-align: center;
    padding: 26px 12px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 0.84rem;
    font-weight: 700;
}

.status-draft {
    background: #242a35;
}

.status-pending {
    background: var(--warning-bg);
    border-color: var(--warning-border);
}

.status-approved {
    background: var(--success-bg);
    border-color: var(--success-border);
}

.status-rejected {
    background: var(--danger-bg);
    border-color: var(--danger-border);
}

.qr-thumb {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #fff;
    padding: 4px;
}

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

.quick-link-card {
    padding: 18px;
    position: relative;
}

.quick-link-card strong,
.quick-link-card span {
    display: block;
}

.quick-link-card strong {
    margin-bottom: 8px;
}

.quick-link-card:nth-child(1) {
    background: linear-gradient(0deg, rgba(34, 211, 238, 0.06), rgba(34, 211, 238, 0.06)), var(--bg-surface);
}

.quick-link-card:nth-child(2) {
    background: linear-gradient(0deg, rgba(96, 165, 250, 0.06), rgba(96, 165, 250, 0.06)), var(--bg-surface);
}

.quick-link-card:nth-child(3) {
    background: linear-gradient(0deg, rgba(251, 191, 36, 0.06), rgba(251, 191, 36, 0.06)), var(--bg-surface);
}

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

.qr-card {
    padding: 18px;
    position: relative;
}

.qr-card-image {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #0f1319;
    margin-bottom: 16px;
}

.qr-card-image img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    background: #fff;
    padding: 8px;
    border-radius: var(--radius-sm);
}

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

.qr-card-copy {
    margin-bottom: 14px;
}

.qr-card-copy .section-kicker {
    margin-bottom: 8px;
    color: var(--accent);
}

.qr-card-copy h3 {
    margin-bottom: 8px;
}

.empty-state {
    padding: 28px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    text-align: center;
}

@media (max-width: 1280px) {
    .overview-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content-grid,
    .qr-grid {
        grid-template-columns: 1fr;
    }

    .record-detail-grid {
        grid-template-columns: 1fr;
    }

    .quick-links {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 180ms ease;
    }

    .app-shell.is-sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .app-topbar {
        left: 0;
    }

    .app-content {
        margin-left: 0;
    }

    .nav-toggle {
        display: inline-block;
    }

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

@media (max-width: 720px) {
    .screen-shell {
        padding: 12px;
    }

    .panel-card-compact {
        padding: 22px;
    }

    .app-topbar,
    .app-content {
        padding-left: 16px;
        padding-right: 16px;
    }

    .app-topbar {
        height: auto;
        min-height: var(--topbar-height);
        padding-top: 12px;
        padding-bottom: 12px;
        align-items: flex-start;
        flex-direction: column;
    }

    .app-content {
        padding-top: 112px;
    }

    .topbar-left,
    .topbar-right,
    .form-actions,
    .table-actions,
    .section-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .overview-metrics {
        grid-template-columns: 1fr;
    }
}
