/* =====================
   RESET & BASE
===================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Poppins", sans-serif;
    background: #f9fafc;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    min-height: calc(100vh - 160px);
}

/* =====================
   HEADER
===================== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 14px 20px;
    background: linear-gradient(90deg, #1E4A03, #006C47);
    color: #fff;

    position: sticky;
    top: 0;
    z-index: 10;
}

/* Left */
.header-left h1 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #fff;
    white-space: nowrap;
}

/* Center */
.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.search-bar {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 320px;
}

.search-bar input {
    flex: 1;
    padding: 8px 10px;
    border-radius: 6px;
    border: none;
    outline: none;
}

.search-bar button {
    padding: 8px 14px;
    border: none;
    background: #0077cc;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-bar button:hover {
    background: #005fa3;
}

/* Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-greeting {
    font-size: 13px;
    color: #eaeaea;
    white-space: nowrap;
}

.btn-logout {
    padding: 6px 12px;
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #ff6b6b;
    color: #fff;
}

/* button monitor */

.btn-monitor {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background-color: #4e73df;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    white-space: nowrap;
}

.btn-monitor:hover {
    background-color: #375acb;
    color: #fff;
    transform: translateY(-1px);
    text-decoration: none;
}

.btn-monitor:active {
    transform: translateY(0);
}

.btn-monitor svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.header-divider {
    width: 1px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.3);
}

/* =====================
   CONTAINER
===================== */
.container {
    width: 100%;
    flex: 1;
}

/* =====================
   PRODUCT GRID (DESKTOP)
===================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
}

/* =====================
   PRODUCT CARD
===================== */
.product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-info {
    padding: 1rem;
}

.product-info h2 {
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
}

.price {
    color: #0077cc;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.desc {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.8rem;
}

.btn-detail {
    display: inline-block;
    background: #0077cc;
    color: #fff;
    text-decoration: none;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-detail:hover {
    background: #005fa3;
}

/* =====================
   PAGINATION
===================== */
.pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    align-items: center;
    font-size: 0.95rem;
    position: relative;
}

.page-link {
    background: #fff;
    border: 1px solid #ddd;
    color: #333;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

.page-link:hover {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.page-link.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
    font-weight: 600;
}

.page-link.prev,
.page-link.next {
    font-weight: 600;
    background: #f9f9f9;
}

.page-link.prev:hover,
.page-link.next:hover {
    background: #007bff;
    color: #fff;
}

.dots {
    padding: 0 6px;
    color: #777;
}

/* =====================
   FOOTER
===================== */
.footer {
    background: #fff;
    text-align: center;
    padding: 1rem;
    font-size: 0.85rem;
    color: #777;
    border-top: 1px solid #eee;
}

/* monitor jm */
/* ── Reuse style dari halaman produk, tambah style khusus monitor ── */

.monitor-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* Page title bar */
.monitor-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.monitor-titlebar h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.monitor-titlebar h2 svg {
    width: 20px;
    height: 20px;
    color: #4e73df;
    flex-shrink: 0;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background-color: transparent;
    color: #4e73df;
    border: 1.5px solid #4e73df;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-back:hover {
    background-color: #4e73df;
    color: #fff;
    text-decoration: none;
}

/* ── Spreadsheet banner ── */
.spreadsheet-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #eef3ff;
    border: 1px solid #c5d2f6;
    border-left: 4px solid #4e73df;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.spreadsheet-banner-icon {
    width: 36px;
    height: 36px;
    background: #4e73df;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.spreadsheet-banner-icon svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

.spreadsheet-banner-text {
    flex: 1;
    min-width: 160px;
}

.spreadsheet-banner-text strong {
    display: block;
    font-size: 0.88rem;
    color: #2d3748;
    margin-bottom: 2px;
}

.spreadsheet-banner-text span {
    font-size: 0.78rem;
    color: #718096;
}

.btn-open-sheet {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: #4e73df;
    color: #fff;
    border-radius: 6px;
    font-size: 0.83rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color 0.2s, transform 0.1s;
}

.btn-open-sheet:hover {
    background-color: #375acb;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-open-sheet svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

/* ── Search card ── */
.monitor-search-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.monitor-search-card label {
    display: block;
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 6px;
    font-weight: 500;
}

.monitor-search-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.monitor-search-row input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 9px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 7px;
    font-size: 0.9rem;
    color: #2d3748;
    outline: none;
    transition: border-color 0.2s;
}

.monitor-search-row input[type="text"]:focus {
    border-color: #4e73df;
}

.monitor-search-row input[type="text"]::placeholder {
    color: #a0aec0;
}

.btn-search {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background-color: #4e73df;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.btn-search:hover {
    background-color: #375acb;
}

.btn-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    background-color: transparent;
    color: #718096;
    border: 1.5px solid #e2e8f0;
    border-radius: 7px;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}

.btn-reset:hover {
    border-color: #cbd5e0;
    background-color: #f7fafc;
    color: #4a5568;
    text-decoration: none;
}

/* ── Result card ── */
.monitor-result-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.monitor-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    flex-wrap: wrap;
    gap: 8px;
}

.monitor-result-header>span:first-child {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 6px;
}

.monitor-result-header svg {
    width: 16px;
    height: 16px;
    color: #4e73df;
}

.badge-total {
    display: inline-flex;
    align-items: center;
    background: #4e73df;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
}

.badge-preview {
    display: inline-flex;
    align-items: center;
    background: #f0f4ff;
    color: #4e73df;
    border: 1px solid #c5d2f6;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}

.monitor-result-body {
    padding: 20px;
}

/* ── Preview notice ── */
.preview-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0f4ff;
    border: 1px solid #c5d2f6;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 0.83rem;
    color: #3a5bbf;
}

.preview-notice svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ── Info bar ── */
.info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: #718096;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 6px;
}

.info-bar .page-info {
    background: #f0f4ff;
    color: #4a5568;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
}

/* ── States ── */
.state-center {
    text-align: center;
    padding: 48px 20px;
}

.state-center svg {
    width: 48px;
    height: 48px;
    color: #cbd5e0;
    margin-bottom: 12px;
}

.state-center h5 {
    font-size: 1rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px;
}

.state-center p {
    font-size: 0.88rem;
    color: #718096;
    margin: 0;
}

/* ── Error ── */
.alert-error {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-left: 4px solid #e53e3e;
    color: #742a2a;
    border-radius: 8px;
    padding: 16px 18px;
    font-size: 0.88rem;
    line-height: 1.6;
}

.alert-error svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
    color: #e53e3e;
}

.alert-tips {
    margin-top: 14px;
    background: #fffbeb;
    border: 1px solid #f6e05e;
    border-left: 4px solid #d69e2e;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 0.84rem;
    color: #744210;
    line-height: 1.7;
}

.alert-tips strong {
    display: block;
    margin-bottom: 6px;
}

.alert-tips ol {
    margin: 0;
    padding-left: 18px;
}

.alert-tips ol li {
    margin-bottom: 4px;
}

.alert-tips code {
    background: #fef3c7;
    border: 1px solid #f6e05e;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 0.82rem;
    font-family: monospace;
}

/* ── Table ── */
.monitor-table-wrap {
    overflow-x: auto;
}

.monitor-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    color: #2d3748;
}

.monitor-table thead th {
    background: #f0f4ff;
    color: #4a5568;
    font-weight: 700;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 2px solid #dce3f0;
    white-space: nowrap;
}

.monitor-table thead th:first-child {
    width: 48px;
    text-align: center;
}

.monitor-table tbody tr {
    border-bottom: 1px solid #edf2f7;
    transition: background 0.15s;
}

.monitor-table tbody tr:hover {
    background: #f7f9ff;
}

.monitor-table tbody td {
    padding: 9px 14px;
    vertical-align: middle;
}

.monitor-table tbody td:first-child {
    text-align: center;
    color: #a0aec0;
    font-size: 0.8rem;
}

.monitor-table mark {
    background: #fef08a;
    color: #713f12;
    padding: 1px 2px;
    border-radius: 3px;
}

/* ── Pagination ── */
.monitor-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #edf2f7;
    flex-wrap: wrap;
    gap: 10px;
}

.monitor-pagination p {
    font-size: 0.82rem;
    color: #718096;
    margin: 0;
}

.pagination-links {
    display: flex;
    gap: 4px;
    align-items: center;
}

.pagination-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.83rem;
    color: #4a5568;
    text-decoration: none;
    background: #fff;
    transition: all 0.15s;
}

.pagination-links a:hover {
    border-color: #4e73df;
    color: #4e73df;
}

.pagination-links a.active {
    background: #4e73df;
    border-color: #4e73df;
    color: #fff;
    font-weight: 700;
}

.pagination-links a.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 600px) {
    .monitor-titlebar h2 {
        font-size: 1.1rem;
    }

    .monitor-result-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =====================
   MOBILE MODE
===================== */
@media (max-width: 768px) {

    /* Header */
    .header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px;
    }

    .header-left {
        text-align: center;
    }

    .header-center {
        justify-content: center;
    }

    .search-bar {
        max-width: 100%;
    }

    .header-right {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Product list horizontal */
    .product-grid {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .product-card {
        flex-direction: row;
        align-items: center;
    }

    .product-card img {
        width: 40%;
        height: 100%;
        padding: 4px;
    }

    .product-info {
        width: 60%;
        padding: 1rem;
    }

    .product-info h2 {
        font-size: 0.95rem;
        line-height: 1.2;
    }

    .desc {
        font-size: 0.8rem;
        margin-bottom: 6px;
    }

    .btn-detail {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}