:root {
    --bg: #f3f7fb;
    --panel: #ffffff;
    --panel-2: #f8fbfd;
    --text: #122033;
    --muted: #64758a;
    --line: #dfe7ef;
    --brand: #0f5fb8;
    --brand-dark: #0b4382;
    --brand-soft: #eaf4ff;
    --accent: #11a0a5;
    --gold: #d0a648;
    --danger: #b42318;
    --warning: #a15c07;
    --shadow: 0 14px 34px rgba(18, 32, 51, .08);
    --radius: 14px;
}

[data-theme="dark"] {
    --bg: #0f1722;
    --panel: #16202d;
    --panel-2: #111a25;
    --text: #edf3fb;
    --muted: #9eb0c8;
    --line: #253448;
    --brand: #2dd4bf;
    --brand-dark: #1eb6a2;
    --brand-soft: rgba(45, 212, 191, .14);
    --danger: #ff7a72;
    --warning: #ffb454;
    --shadow: 0 20px 40px rgba(0, 0, 0, .25);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(17, 160, 165, .09), transparent 28%),
        linear-gradient(135deg, rgba(15, 95, 184, .06), transparent 32%),
        linear-gradient(180deg, #fbfdff 0%, var(--bg) 100%);
    color: var(--text);
    font-family: "Inter", sans-serif;
}

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

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

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
}

.skip-link:focus {
    left: 16px;
    top: 16px;
    z-index: 10;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--panel);
}

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

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
    height: 100vh;
    overflow-y: auto;
    padding: 22px 16px;
    background:
        linear-gradient(160deg, rgba(0, 188, 212, .14), transparent 32%),
        linear-gradient(180deg, #111d2e 0%, #0c1727 58%, #111827 100%);
    color: #f3fbff;
}

.brand-card {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .05));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}

.brand-card h1 {
    margin: 0;
    font-size: 19px;
    line-height: 1.2;
    white-space: nowrap;
    letter-spacing: .02em;
}

.brand-card p {
    margin: 4px 0 0;
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 166px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #087f8c, #f59e0b);
    color: #fff;
    font-weight: 800;
}

.brand-mark-logo {
    object-fit: contain;
    padding: 5px;
    background: #fff;
}

.nav-menu {
    display: grid;
    gap: 7px;
}

.nav-link {
    padding: 10px 12px;
    border-radius: 10px;
    color: rgba(255, 255, 255, .82);
    font-size: 14px;
    font-weight: 700;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.nav-link:hover,
.nav-link.active {
    background: linear-gradient(90deg, rgba(21, 84, 209, .75), rgba(0, 188, 212, .28));
    color: #fff;
    transform: translateX(2px);
}

.sidebar-note {
    margin-top: auto;
    padding: 14px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
    line-height: 1.6;
}

.sidebar-note strong,
.sidebar-note span,
.logout-link {
    display: block;
}

.sidebar-note strong {
    color: #fff;
}

.sidebar-note span {
    margin: 4px 0 10px;
    color: rgba(255, 255, 255, .68);
    font-size: 12px;
}

.logout-link {
    margin-bottom: 12px;
    color: #9ee7e5;
    font-weight: 700;
}

.main-panel {
    display: flex;
    flex-direction: column;
    padding: 20px;
}

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

.topbar h2 {
    margin: 0;
    font-size: 23px;
}

.topbar-text {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.theme-toggle {
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
    box-shadow: var(--shadow);
}

.app-footer {
    margin-top: auto;
    padding: 28px 8px 4px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.flash {
    padding: 14px 16px;
    border-left: 4px solid var(--brand);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.flash.warning {
    border-left-color: var(--warning);
}

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

.stat-card,
.panel-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .72)),
        var(--panel);
    box-shadow: var(--shadow);
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    position: absolute;
    right: -28px;
    top: -32px;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: rgba(0, 188, 212, .12);
    content: "";
}

.stat-card span,
.stat-card small {
    color: var(--muted);
}

.stat-card strong {
    font-size: 28px;
}

.stat-card.accent {
    background: linear-gradient(135deg, var(--brand), #172033);
    color: #fff;
}

.stat-card.accent span,
.stat-card.accent small {
    color: rgba(255, 255, 255, .82);
}

.content-grid.two-col {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 20px;
}

.dashboard-visuals {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 20px;
    margin-bottom: 22px;
}

.chart-card {
    min-height: 280px;
}

.status-chart {
    display: grid;
    gap: 18px;
}

.chart-row {
    display: grid;
    gap: 8px;
}

.chart-label {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.chart-label strong {
    color: var(--text);
}

.chart-track,
.category-meter {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8eef4;
}

.chart-track span,
.category-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), var(--accent));
}

.donut-wrap {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 22px;
    align-items: center;
}

.donut-chart {
    display: grid;
    place-items: center;
    width: 172px;
    height: 172px;
    border-radius: 50%;
    background:
        radial-gradient(circle, var(--panel) 0 53%, transparent 54%),
        conic-gradient(var(--brand) var(--value), #e8eef4 0);
    box-shadow: inset 0 0 0 1px var(--line);
}

.donut-chart strong {
    margin-top: 18px;
    color: var(--text);
    font-size: 30px;
}

.donut-chart span {
    margin-top: -42px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.metric-stack div {
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel-2);
}

.metric-stack span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.metric-stack strong {
    display: block;
    margin-top: 4px;
    color: var(--text);
    font-size: 24px;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.vendor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 16px;
}

.service-card {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-2);
}

.vendor-card {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(21, 84, 209, .06), transparent 42%),
        var(--panel-2);
}

.service-card-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: start;
}

.vendor-card-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
}

.service-card h3 {
    margin: 10px 0 0;
}

.vendor-card h3 {
    margin: 10px 0 0;
}

.vendor-gstin {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.assistant-layout {
    display: grid;
    gap: 16px;
    max-width: 1050px;
}

.assistant-hero {
    display: grid;
    gap: 8px;
    background:
        linear-gradient(135deg, rgba(15, 95, 184, .09), rgba(17, 160, 165, .08)),
        var(--panel);
}

.assistant-hero h3,
.assistant-result h3 {
    margin: 10px 0 6px;
    font-size: 22px;
}

.assistant-card {
    background: var(--panel);
}

.assistant-result {
    display: grid;
    gap: 16px;
}

.assistant-result-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.assistant-note {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-2);
}

.assistant-note strong {
    display: block;
    margin-bottom: 6px;
}

.assistant-note p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.assistant-checks {
    display: grid;
    gap: 10px;
}

.assistant-checks div {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-2);
}

.assistant-checks span {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 800;
}

.assistant-checks strong {
    color: var(--text);
    line-height: 1.45;
}

.credential-list {
    display: grid;
    gap: 10px;
}

.credential-list div {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
}

.credential-list span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.credential-list strong {
    display: block;
    margin-top: 4px;
    color: var(--text);
    overflow-wrap: anywhere;
}

.panel-card {
    padding: 18px;
}

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

.toolbar-actions,
.search-form,
.action-group,
.form-actions,
.inline-form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.badge,
.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge {
    padding: 7px 10px;
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.badge.muted {
    background: var(--panel-2);
    color: var(--muted);
}

.status-pill {
    padding: 6px 10px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    white-space: nowrap;
}

.timeline,
.mini-list {
    display: grid;
    gap: 14px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 14px 1fr;
    gap: 12px;
    align-items: start;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--brand);
}

.timeline-item p,
.timeline-item small,
.empty-text {
    margin: 4px 0 0;
    color: var(--muted);
}

.mini-row {
    display: flex;
    justify-content: space-between;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-2);
}

.search-form input,
.form-field input,
.form-field textarea,
.form-field select,
.filter-form select,
.inline-form-grid input,
.inline-form-grid select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-2);
    color: var(--text);
}

.search-form input {
    min-width: 320px;
}

.filter-form {
    align-items: center;
}

.filter-form select {
    width: auto;
    min-width: 170px;
}

.list-toolbar {
    align-items: flex-start;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 13px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand), #0d7ee7);
    color: #fff;
}

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

.btn-soft {
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--text);
}

.btn-danger {
    background: #ffe7e5;
    color: var(--danger);
}

.asset-workspace {
    overflow: hidden;
}

.quick-add-panel {
    margin-bottom: 22px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(21, 84, 209, .07), transparent 44%),
        var(--panel-2);
}

.panel-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
}

.compact-form {
    padding-top: 4px;
}

.required-mark {
    color: var(--danger);
    font-weight: 800;
}

.category-meter {
    height: 7px;
    margin-top: -9px;
}

.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 18px;
}

.asset-card {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(8, 127, 140, .06), transparent 42%),
        var(--panel-2);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.asset-card:hover {
    border-color: rgba(8, 127, 140, .28);
    box-shadow: 0 18px 36px rgba(16, 48, 64, .1);
    transform: translateY(-2px);
}

.reveal-item {
    animation: card-rise .54s cubic-bezier(.22, 1, .36, 1) both;
    animation-delay: var(--delay, 0ms);
}

.asset-sticker {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    aspect-ratio: 1 / 1;
    min-height: 190px;
    padding: 20px 16px 12px;
    overflow: hidden;
    border: 1px solid #e6ebf1;
    border-radius: 16px;
    background:
        linear-gradient(145deg, rgba(8, 127, 140, .12), rgba(245, 158, 11, .08) 58%, #fff 100%);
    box-shadow: 0 18px 34px rgba(15, 23, 42, .12), inset 0 0 0 1px rgba(255, 255, 255, .7);
    color: #15243c;
    transform: perspective(900px) rotateY(-4deg) rotateZ(-.5deg);
    transition: transform .34s cubic-bezier(.22, 1, .36, 1), box-shadow .34s ease;
}

.asset-sticker:hover {
    box-shadow: 0 24px 42px rgba(15, 23, 42, .18), inset 0 0 0 1px rgba(255, 255, 255, .9);
    transform: perspective(900px) rotateY(0deg) rotateZ(0deg) translateY(-5px);
}

.asset-sticker::after {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, transparent 50%, rgba(8, 127, 140, .12) 51%);
    content: "";
}

.sticker-gloss {
    position: absolute;
    inset: -40% auto auto -80%;
    width: 70%;
    height: 190%;
    background: rgba(255, 255, 255, .5);
    transform: rotate(24deg);
    animation: sticker-shine 3.8s ease-in-out infinite;
}

.sticker-brand {
    display: grid;
    justify-items: center;
    gap: 0;
    width: 100%;
}

.sticker-brand img {
    width: 132px;
    height: 48px;
    object-fit: contain;
}

.sticker-qr {
    width: 98px;
    height: 98px;
    position: static;
    padding: 6px;
    border-radius: 12px;
    background: #fff;
    object-fit: contain;
    image-rendering: pixelated;
}

.sticker-number {
    max-width: 100%;
    overflow-wrap: anywhere;
    text-align: center;
    align-self: center;
    max-width: 100%;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0;
}

.sticker-property {
    max-width: 100%;
    padding: 5px 7px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .78);
    color: #506475;
    text-align: center;
    width: 100%;
    font-size: 8px;
    font-weight: 800;
    line-height: 1.2;
}

.asset-card-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.asset-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.asset-card h3 {
    margin: 0;
    font-size: 20px;
}

.asset-card p {
    margin: 5px 0 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.asset-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.asset-meta div {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
}

.asset-meta span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.asset-meta strong {
    overflow-wrap: anywhere;
    font-size: 14px;
}

.assign-box {
    padding: 14px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: var(--panel);
    animation: soft-open .22s ease both;
}

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

.asset-list-wrap {
    border: 1px solid var(--line);
    border-radius: 12px;
}

.asset-list-table th,
.asset-list-table td {
    background: var(--panel);
}

.asset-list-table tbody tr {
    transition: background .18s ease, transform .18s ease;
}

.asset-list-table tbody tr:hover td {
    background: var(--panel-2);
}

.serial-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 800;
}

.asset-list-title {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 12px;
    align-items: center;
    min-width: 220px;
}

.asset-list-title img {
    width: 54px;
    height: 42px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    object-fit: contain;
}

.asset-list-title strong,
.asset-list-title span,
.asset-list-title small {
    display: block;
}

.asset-list-title strong {
    color: var(--text);
    font-size: 14px;
}

.asset-list-title span {
    margin-top: 3px;
    color: var(--muted);
}

.asset-list-title small,
.muted-text {
    color: var(--muted);
}

.clamp-cell {
    max-width: 240px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

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

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

table th {
    color: var(--muted);
    font-size: 12px;
}

.empty-cell,
.empty-state {
    color: var(--muted);
    text-align: center;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 42px 12px;
}

.form-panel {
    max-width: 1100px;
}

.narrow-panel {
    max-width: 720px;
}

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

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

.form-field label {
    font-weight: 700;
}

.full-span {
    grid-column: 1 / -1;
}

.helper-text,
.error-text {
    color: var(--muted);
}

.settings-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-2);
}

.po-form-panel {
    max-width: 1180px;
}

.po-form-section {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-top: 6px;
    border-top: 1px solid var(--line);
}

.po-form-section h3 {
    margin: 0;
}

.po-items-editor table textarea,
.po-items-editor table input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
}

.po-screen {
    display: grid;
    gap: 16px;
}

.po-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.po-page {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 34px;
    border: none;
    border-radius: 0;
    background: #fff;
    color: #111;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .12);
}

.po-page::before {
    content: none;
}

.po-document {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-family: Arial, sans-serif;
    font-size: 13px;
    overflow: hidden;
    border: 2px solid #111;
    border-radius: 0;
}

.po-letterhead {
    display: grid;
    gap: 8px;
    justify-items: center;
    margin-bottom: 18px;
    padding: 0 12px 14px;
    border-bottom: 3px double #111;
    background: #fff;
    font-family: Arial, sans-serif;
    text-align: center;
}

.po-letterhead-logo {
    width: 260px;
    max-height: 78px;
    object-fit: contain;
}

.po-letterhead-copy,
.po-letterhead-copy strong,
.po-letterhead-copy span {
    display: block;
    width: 100%;
}

.po-letterhead-copy strong {
    margin: 3px 0 5px;
    color: #111;
    font-size: 22px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.po-letterhead-copy span {
    color: #111;
    font-size: 12px;
    line-height: 1.45;
}

.po-document th,
.po-document td {
    padding: 8px 9px;
    border: 1px solid #111;
    color: #111;
    vertical-align: top;
}

.po-document th {
    background: #e8e8e8;
    color: #111;
}

.po-title {
    padding: 14px;
    background: #111 !important;
    color: #fff !important;
    font-size: 22px;
    letter-spacing: .08em;
    text-align: center;
    text-transform: uppercase;
}

.po-center {
    text-align: center;
}

.po-right {
    text-align: right;
}

.po-address,
.po-description,
.po-terms {
    white-space: pre-line;
}

.po-meta-label {
    width: 90px;
    background: #f0f0f0;
    color: #111;
    font-weight: 700;
}

.po-grand-label {
    background: #e8e8e8 !important;
    color: #111 !important;
    text-align: left;
}

.po-grand-total {
    background: #e8e8e8;
    color: #111 !important;
    font-size: 15px;
}

.po-words {
    background: #f7f7f7;
    color: #111 !important;
    font-weight: 700;
}

.po-terms {
    min-height: 92px;
    background: #fff;
    line-height: 1.55;
}

.po-signature {
    height: 92px;
    padding-top: 18px !important;
    background: #fff;
    color: #111 !important;
    text-align: right;
    font-weight: 700;
}

.po-reference-header {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 28px;
    align-items: start;
    margin: -6px 0 38px;
    font-family: Arial, sans-serif;
}

.po-top-shade {
    position: absolute;
    inset: 0 0 auto;
    height: 156px;
    border-bottom-left-radius: 50% 18%;
    border-bottom-right-radius: 50% 18%;
    background: #f0f0f0;
    content: "";
}

.po-page::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 94px;
    border-top-left-radius: 50% 28%;
    border-top-right-radius: 50% 28%;
    background: #eeeeee;
    content: "";
    pointer-events: none;
}

.po-reference-logo {
    width: 240px;
    max-height: 72px;
    object-fit: contain;
}

.po-reference-company {
    display: grid;
    gap: 6px;
    justify-items: end;
    color: #171d2a;
    text-align: right;
}

.po-reference-company strong {
    font-size: 18px;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.po-reference-company span,
.po-reference-info span,
.po-reference-info b {
    white-space: pre-line;
}

.po-reference-info {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 32px;
    margin-bottom: 24px;
    padding: 14px 16px;
    border-radius: 6px;
    background: rgba(245, 245, 245, .78);
    color: #171d2a;
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1.18;
}

.po-reference-address,
.po-reference-vendor {
    display: grid;
    gap: 4px;
}

.po-reference-info strong,
.po-reference-info b {
    margin-bottom: 2px;
    font-weight: 800;
}

.po-reference-title {
    position: relative;
    z-index: 1;
    margin: 0;
    color: #929292;
    font-family: Arial, sans-serif;
    font-size: 34px;
    font-weight: 400;
    line-height: 1.15;
}

.po-reference-rule {
    position: relative;
    z-index: 1;
    height: 16px;
    margin: 20px 0 32px;
    border-radius: 999px;
    background: #eeeeee;
}

.po-reference-table {
    position: relative;
    z-index: 1;
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    color: #171d2a;
    font-family: Arial, sans-serif;
    font-size: 15px;
}

.po-reference-table th,
.po-reference-table td {
    padding: 12px 10px;
    border: none;
    border-bottom: 1px solid #d8d8d8;
    vertical-align: top;
}

.po-reference-table th {
    border-bottom: 2px solid #9b9fa7;
    background: transparent;
    color: #171d2a;
    font-size: 15px;
    text-align: left;
}

.po-reference-table th:nth-child(1) {
    width: 58%;
}

.po-reference-table th:nth-child(2) {
    width: 12%;
}

.po-reference-table th:nth-child(3),
.po-reference-table th:nth-child(4) {
    width: 15%;
}

.po-reference-table tbody tr:nth-child(odd) td {
    background: #f3f4f6;
}

.po-reference-number {
    text-align: right;
}

.po-reference-summary {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 28px;
    margin-top: 26px;
    color: #171d2a;
    font-family: Arial, sans-serif;
}

.po-reference-terms {
    display: grid;
    gap: 8px;
    line-height: 1.45;
    white-space: pre-line;
}

.po-reference-summary table {
    width: 100%;
    border-collapse: collapse;
}

.po-reference-summary td,
.po-reference-summary th {
    padding: 9px 0;
    border-bottom: 1px solid #d8d8d8;
    text-align: right;
}

.po-reference-summary td:first-child,
.po-reference-summary th:first-child {
    text-align: left;
}

.po-reference-summary th {
    font-size: 16px;
}

.po-reference-words {
    position: relative;
    z-index: 1;
    margin: 18px 0 42px;
    color: #171d2a;
    font-family: Arial, sans-serif;
    font-weight: 800;
}

.po-reference-signature {
    position: relative;
    z-index: 1;
    margin-top: 92px;
    color: #171d2a;
    font-family: Arial, sans-serif;
    font-weight: 800;
    text-align: right;
}

.po-reference-footer {
    position: absolute;
    z-index: 1;
    right: 34px;
    bottom: 22px;
    left: 34px;
    display: grid;
    gap: 18px;
    justify-items: center;
    color: #323846;
    font-family: Arial, sans-serif;
    font-size: 13px;
}

.auth-body {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(8, 127, 140, .18), transparent 38%),
        linear-gradient(180deg, #f8fcfc, #e8f3f5);
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(440px, 100%);
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 24px 70px rgba(18, 48, 71, .16);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}

.auth-brand img {
    width: 86px;
    height: 58px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 8px;
}

.auth-brand h1 {
    margin: 0;
    font-size: 24px;
}

.auth-brand p {
    margin: 4px 0 0;
    color: var(--muted);
}

.auth-form {
    display: grid;
    gap: 14px;
}

.auth-form label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

.auth-form input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-2);
    color: var(--text);
}

.role-pill {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.role-pill.admin {
    background: #fff4db;
    color: #9a5a00;
}

.role-pill.user {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.bulk-summary {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 18px;
}

.bulk-summary div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-2);
}

.bulk-summary span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.bulk-summary strong {
    display: block;
    margin-top: 6px;
    font-size: 24px;
}

.column-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.column-list span {
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-2);
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
}

.error-panel {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid #ffd0cc;
    border-radius: 12px;
    background: #fff4f2;
    color: var(--danger);
}

.error-panel h4 {
    margin: 0 0 10px;
}

.error-panel p {
    margin: 6px 0;
}

.log-search-form {
    margin-bottom: 18px;
}

.report-filter {
    margin-bottom: 18px;
}

.log-asset-card {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(8, 127, 140, .08), transparent 55%),
        var(--panel-2);
}

.log-asset-card img {
    width: 72px;
    height: 54px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    object-fit: contain;
}

.log-asset-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.log-asset-card h3 {
    margin: 4px 0;
}

.log-asset-card p {
    margin: 0;
    color: var(--muted);
}

.log-timeline {
    display: grid;
    gap: 12px;
}

.log-item {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-2);
}

.log-dot {
    width: 12px;
    height: 12px;
    margin-top: 5px;
    border: 3px solid #cceeed;
    border-radius: 50%;
    background: var(--brand);
}

.log-item p {
    margin: 4px 0;
    color: var(--text);
}

.log-item span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

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

.muted-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.brand-logo,
.public-logo {
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 12px;
    background: #fff;
}

.brand-logo {
    width: 52px;
    height: 52px;
    padding: 6px;
}

.public-logo {
    width: 80px;
    height: 80px;
    padding: 8px;
    margin-bottom: 14px;
}

.scanner-panel #reader {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.result-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 360px;
    padding: 20px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: var(--panel-2);
    text-align: center;
}

.detail-list {
    display: grid;
    width: 100%;
    gap: 12px;
    text-align: left;
}

.detail-list div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--panel);
}

.detail-list span {
    color: var(--muted);
}

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

.full-details .full-width {
    grid-column: 1 / -1;
}

.full-details div {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    border: 1px solid var(--line);
}

.full-details span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.full-details strong {
    color: var(--text);
    font-size: 15px;
    overflow-wrap: anywhere;
}

@keyframes card-rise {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes sticker-shine {
    0%,
    50% {
        left: -90%;
    }
    72%,
    100% {
        left: 135%;
    }
}

@keyframes gentle-float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

@keyframes soft-open {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

@media (max-width: 1200px) {
    .stats-grid,
    .dashboard-visuals,
    .content-grid.two-col,
    .form-grid,
    .bulk-summary {
        grid-template-columns: 1fr 1fr;
    }

    .asset-card {
        grid-template-columns: 170px 1fr;
    }

    .asset-meta {
        grid-template-columns: 1fr;
    }
}

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

    .sidebar,
    .main-panel {
        padding: 18px;
    }

    .sidebar {
        position: static;
        height: auto;
        min-height: auto;
        overflow: visible;
    }

    .brand-card,
    .nav-menu {
        max-width: none;
    }

    .nav-menu {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    }

    .sidebar-note {
        margin-top: 8px;
    }

    .stats-grid,
    .dashboard-visuals,
    .content-grid.two-col,
    .form-grid,
    .full-details,
    .bulk-summary {
        grid-template-columns: 1fr;
    }

    .toolbar,
    .topbar {
        align-items: stretch;
        flex-direction: column;
    }

    .search-form input {
        min-width: auto;
    }
}

@media (max-width: 620px) {
    .donut-wrap,
    .asset-grid {
        grid-template-columns: 1fr;
    }

    .asset-card {
        grid-template-columns: 1fr;
    }

    .asset-sticker {
        width: min(220px, 100%);
        margin: 0 auto;
    }

    .log-asset-card {
        grid-template-columns: 1fr;
    }
}

@media print {
    @page {
        size: A4;
        margin: 0;
    }

    html,
    body {
        width: 210mm;
        min-height: 297mm;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .sidebar,
    .topbar,
    .flash-stack,
    .po-toolbar,
    .app-footer,
    .skip-link {
        display: none !important;
    }

    .app-shell,
    .main-panel {
        display: block;
        width: 210mm;
        min-height: 0;
        margin: 0;
        padding: 0 !important;
        background: #fff !important;
    }

    .po-screen {
        display: block;
        width: 210mm;
        margin: 0;
        padding: 0;
    }

    .po-page {
        width: 210mm;
        min-height: 297mm;
        max-width: none;
        margin: 0;
        padding: 14mm 13mm 24mm;
        border: none;
        border-radius: 0;
        box-shadow: none;
        overflow: hidden;
        page-break-after: avoid;
    }

    .po-page::before,
    .po-document {
        content: none;
    }

    .po-top-shade {
        height: 50mm;
    }

    .po-page::after {
        height: 26mm;
    }

    .po-reference-header {
        grid-template-columns: 58mm 1fr;
        gap: 10mm;
        margin: 0 0 20mm;
    }

    .po-reference-logo {
        width: 52mm;
        max-height: 16mm;
    }

    .po-reference-company strong {
        font-size: 12pt;
    }

    .po-reference-company span {
        font-size: 10pt;
    }

    .po-reference-info {
        gap: 10mm;
        margin-bottom: 8mm;
        padding: 4mm 5mm;
        font-size: 9.5pt;
        line-height: 1.16;
    }

    .po-reference-title {
        font-size: 24pt;
    }

    .po-reference-rule {
        height: 4mm;
        margin: 7mm 0 12mm;
    }

    .po-reference-table {
        font-size: 10.5pt;
    }

    .po-reference-table th,
    .po-reference-table td {
        padding: 3.2mm 2.5mm;
    }

    .po-reference-summary {
        grid-template-columns: 1fr 62mm;
        gap: 10mm;
        margin-top: 8mm;
    }

    .po-reference-words {
        margin: 6mm 0 12mm;
    }

    .po-reference-signature {
        margin-top: 26mm;
    }

    .po-reference-footer {
        right: 13mm;
        bottom: 12mm;
        left: 13mm;
        gap: 0;
    }
}
