:root {
    --pdip-red: #b00701;
    --pdip-dark: #8a0501;
    --pdip-light: #fef2f1;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    -webkit-font-smoothing: antialiased;
}

.header {
    background: linear-gradient(135deg, var(--pdip-red), var(--pdip-dark));
    color: white;
    padding: 24px 16px 32px;
    text-align: center;
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 0;
    right: 0;
    height: 32px;
    background: var(--gray-50);
    border-radius: 24px 24px 0 0;
}

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

.header-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.15);
    display: grid;
    place-items: center;
    font-size: 28px;
}

.header h1 {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.9;
    margin-bottom: 2px;
}

.header-iso {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    opacity: 0.75;
    margin-bottom: 8px;
}

.header h2 {
    font-size: 18px;
    font-weight: 700;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 16px 32px;
    position: relative;
    z-index: 1;
}

.badge-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--pdip-light);
    color: var(--pdip-red);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 16px;
    overflow: hidden;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--pdip-red);
    border-bottom: 1px solid var(--gray-100);
}

.card-body { padding: 16px; }

.info-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-item:first-child { padding-top: 0; }

.info-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.info-value {
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-900);
    word-break: break-word;
}

.info-value.muted {
    color: var(--gray-300);
    font-style: italic;
    font-weight: 400;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

.item-highlight {
    background: linear-gradient(135deg, var(--pdip-red), var(--pdip-dark));
    color: white;
    padding: 20px 16px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.item-highlight h3 {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.item-highlight .sub {
    font-size: 13px;
    opacity: 0.8;
    margin-top: 4px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.status-badge.yes { background: #fef3c7; color: #92400e; }
.status-badge.no { background: #d1fae5; color: #065f46; }

.foto-barang {
    width: 100%;
    border-radius: 8px;
    object-fit: cover;
    max-height: 400px;
}

.login-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gray-100);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--gray-500);
}

.login-notice i { color: var(--pdip-red); }

.footer-bar {
    text-align: center;
    padding: 24px 16px;
    color: var(--gray-500);
    font-size: 12px;
    line-height: 1.8;
}

.footer-bar a {
    color: var(--pdip-red);
    text-decoration: none;
    font-weight: 600;
}

.scanner-wrap {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: #000;
    min-height: 280px;
}

#qr-reader {
    width: 100%;
}

#qr-reader video {
    object-fit: cover;
}

.scanner-hint {
    font-size: 14px;
    color: var(--gray-500);
    line-height: 1.6;
    margin-bottom: 16px;
}

.scanner-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: var(--pdip-red);
    color: white;
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.alert {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
}

.not-found-card {
    text-align: center;
    padding: 48px 24px;
}

.not-found-card .icon {
    font-size: 48px;
    color: #f59e0b;
    margin-bottom: 16px;
}

@media (max-width: 400px) {
    .info-grid { grid-template-columns: 1fr; }
}

@media print {
    .admin-topbar, .admin-nav, .admin-actions, .admin-main .alert { display: none !important; }
    .qr-print-card { box-shadow: none; border: 1px solid #ddd; }
}
