* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f3f4f6;
    color: #111827;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-size: 1.08rem;
}

 .topbar {
    background: linear-gradient(90deg, #020617, #111827);
    color: #f9fafb;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.5);
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 48px;
    padding: 0;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
}

.topbar h1 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-shadow: none;
}

.status-bar {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    font-size: 1.13rem;
}

.topbar-user {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 1.13rem;
}

.container {
    max-width: 1600px;
    min-width: 1024px;
    margin: 0 auto;
    padding: 0 2.5rem;
.container {
    max-width: 1400px;
    min-width: 900px;
    margin: 0 auto;
    padding: 0 1.8rem;
}

.page-main {
    margin: 1rem auto 2rem;
.page-main {
    margin: 1.2rem auto 1.5rem;
}

.app-footer {
    padding: 0.7rem 1rem 1rem;
    font-size: 0.92rem;
    color: #6b7280;
    text-align: center;
}

/* Layout khusus print untuk halaman tabel (termasuk bagging_scan) */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0;
        font-size: 0.85rem;
    }

    .topbar,
    .app-footer,
    .status-bar,
    .toolbar,
    #bagging-search {
        display: none !important;
    }

    .card {
        box-shadow: none !important;
        margin: 0;
        padding: 0;
        border-radius: 0;
    }

    .page-main {
        margin: 0;
        padding-top: 0.5rem;
    }

    .table-wrapper {
        max-height: none !important;
        overflow: visible !important;
    }

    table {
        page-break-inside: auto;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
}

.print-header {
    margin: 0 auto 1rem;
    padding: 0.5rem 0 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}

.print-header-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.print-logo {
    height: 32px;
    max-width: 120px;
    width: auto;
}

.print-header-text {
    display: flex;
    flex-direction: column;
}

.print-company-name {
    font-weight: 600;
    font-size: 1rem;
}

.print-company-motto {
    font-size: 0.8rem;
    color: #4b5563;
    font-style: italic;
}

.card {
    background: #ffffff;
    border-radius: 0.5rem;
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
.card {
    background: #ffffff;
    border-radius: 0.5rem;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card h2 {
    margin-top: 0;
.card h2 {
    margin-top: 0;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.38rem 1.05rem;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    background: #e5e7eb;
    color: #111827;
    font-size: 0.98rem;
    font-weight: 500;
    cursor: pointer;
    min-height: 2rem;
    gap: 0.28rem;
    transition: background 0.15s, color 0.15s;
}

.btn.primary {
    background: #2563eb;
    color: #fff;
}

/* Variasi warna tombol aksi manifest di halaman utama */
.btn.btn-use {
    background: #0ea5e9;
    color: #0f172a;
}

.btn.btn-print {
    background: #22c55e;
    color: #052e16;
}

.btn.btn-delete {
    background: #ef4444;
    color: #fef2f2;
}

.btn:hover {
    filter: brightness(0.97);
}

.btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.btn:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

input[type="text"],
input[type="password"],
input[type="file"],
input[type="datetime-local"],
select {
    padding: 0.38rem 0.8rem;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    font-size: 0.98rem;
    width: 100%;
    max-width: 400px;
    background-color: #ffffff;
    -webkit-appearance: none;
    appearance: none;
}

input[type="file"] {
    padding: 0.25rem 0.5rem;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="datetime-local"]:focus,
select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb33;
    outline: none;
}

.hint {
    font-size: 0.92rem;
    color: #6b7280;
}

.info {
    margin-left: 0.5rem;
    font-size: 0.92rem;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    height: 2.7rem;
    line-height: 1.2;
    font-family: inherit;
}

.feedback {
    margin-top: 0.5rem;
    padding: 0.4rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.9rem;
}

/* Popup / modal sederhana untuk sesi scan HID di bagging_scan */
.scan-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.scan-modal-content {
    background: #0b1120;
    color: #e5e7eb;
    max-width: 700px;
    width: 60%;
    padding: 2rem 2.5rem 2.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.5);
}

.scan-modal-content h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.scan-modal-counter,
.scan-modal-last {
    margin: 0.35rem 0;
}

.scan-modal-counter span {
    font-weight: 600;
}

.feedback.ok {
    background: #ecfdf3;
    color: #166534;
}

.feedback.warn {
    background: #fef9c3;
    color: #92400e;
}

.feedback.error {
    background: #fef2f2;
    color: #b91c1c;
}

.feedback.info {
    background: #eff6ff;
    color: #1d4ed8;
}

.stats {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    justify-content: space-between;
}

.stat-card {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.45rem 0.55rem;
    border-radius: 0.5rem;
    background: #f3f4f6;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem;
    white-space: nowrap;
}

.stat-label {
    font-size: 0.7rem;
    color: #6b7280;
}

.stat-value {
    font-size: 0.9rem;
    font-weight: 600;
}

.stat-total {
    background: #eff6ff;
    color: #1d4ed8;
}

.stat-scanned {
    background: #ecfdf3;
    color: #166534;
}

.stat-pending {
    background: #fef9c3;
    color: #92400e;
}

.table-wrapper {
    overflow-x: auto;
    margin-top: 0.7rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.05rem;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

th,
td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    text-align: left;
}
th,
td {
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    text-align: left;
}

th {
    background: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 1;
}

th:last-child,
td:last-child {
    border-right: none;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

tbody tr:hover {
    background-color: #e0f2fe;
}

.badge {
    display: inline-flex;
    padding: 0.25rem 0.9rem;
    border-radius: 999px;
    font-size: 1.05rem;
    font-weight: 600;
    background: #2563eb;
    color: #fff;
    letter-spacing: 0.01em;
}

.badge.offline {
    background: #fee2e2;
    color: #b91c1c;
}

.badge.online {
    background: #dcfce7;
    color: #15803d;
}

.status-pill {
    display: inline-flex;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
.hint {
    font-size: 1.05rem;
    color: #6b7280;
}
.status-pill.pending {
    background: #fef9c3;
    color: #92400e;
}

.status-pill.picked {
    background: #dcfce7;
    color: #166534;
}

.status-pill.problem {
    background: #fee2e2;
    color: #b91c1c;
}

.print-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: flex-end;
}

.print-form label {
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Form & layout helpers */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.field-group label {
    font-size: 0.97rem;
    font-weight: 500;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.7rem;
}

.toolbar .btn {
    flex: 1 1 auto;
}

.toolbar-compact {
    margin-top: 0;
    width: 100%;
    justify-content: center;
}

/* Scan-focused inputs for handheld device */
#process-name-input {
    font-size: 0.95rem;
}

#barcode-input {
    font-size: 1.1rem;
    padding: 0.6rem 0.75rem;
    border-width: 2px;
    border-color: #2563eb;
    background-color: #eff6ff;
}

#barcode-input::placeholder {
    color: #6b7280;
}

#barcode-input:focus {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 2px #bfdbfe;
}

/* Daftar NO SEAL yang belum discan (tampilan ringkas untuk device kecil) */
.pending-list {
    margin-top: 0.75rem;
    padding: 0.5rem 0.6rem;
    border-radius: 0.5rem;
    background: #f9fafb;
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.8rem;
}

.pending-list h3 {
    margin: 0 0 0.35rem 0;
    font-size: 0.85rem;
}

.pending-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pending-list li {
    padding: 0.25rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.pending-list li:last-child {
    border-bottom: none;
}



@media print {
    body {
        font-size: 0.8rem;
    }

    table {
        font-size: 0.7rem;
    }

    th,
    td {
        padding: 0.15rem 0.25rem;
        border: 1px solid #9ca3af;
    }

    th {
        position: static;
        background: #f3f4f6;
    }

    th:last-child,
    td:last-child {
        border-right: 1px solid #9ca3af;
    }

    tbody tr:last-child td {
        border-bottom: 1px solid #9ca3af;
    }

    tbody tr:nth-child(odd),
    tbody tr:nth-child(even) {
        background-color: #ffffff;
    }

    .table-wrapper {
        margin-top: 0.25rem;
    }

    .print-header {
        margin-bottom: 0.3rem;
        padding-bottom: 0.3rem;
    }

    .print-logo {
        height: 44px;
        max-width: 200px;
    }
}