@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

body {
    font-family: 'Inter', sans-serif;
    background: #F9FAFB;
    color: #111827;
    font-size: 15px;
    line-height: 1.5;
}

/* ── Admin Banner ─────────────────────────────────────── */
.admin-banner {
    background: #FEF3C7;
    color: #92400E;
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}
.exit-view {
    margin-left: auto;
    background: #92400E;
    color: #fff;
    padding: 4px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}

/* ── Navbar ───────────────────────────────────────────── */
.navbar {
    background: #fff;
    border-bottom: 1px solid #E5E7EB;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 32px;
}
.nav-brand {
    font-weight: 700;
    font-size: 18px;
    color: #111827;
    letter-spacing: -0.3px;
}
.nav-links {
    display: flex;
    gap: 24px;
}
.nav-link {
    text-decoration: none;
    color: #6B7280;
    font-weight: 500;
    font-size: 14px;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
}
.nav-link:hover { color: #111827; }
.nav-link.active { color: #1D4ED8; border-bottom-color: #1D4ED8; }
.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
}
.nav-customer {
    font-size: 13px;
    color: #6B7280;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-logout {
    font-size: 13px;
    color: #6B7280;
    text-decoration: none;
}
.nav-logout:hover { color: #111827; }

/* ── Main Content ─────────────────────────────────────── */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ── Page Header ──────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}
.page-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
}
.page-count {
    font-size: 13px;
    color: #6B7280;
    background: #F3F4F6;
    padding: 2px 10px;
    border-radius: 999px;
}

/* ── Login ────────────────────────────────────────────── */
.login-wrap {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}
.login-card {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.login-header {
    text-align: center;
    margin-bottom: 32px;
}
.login-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
}
.login-header p {
    color: #6B7280;
    margin-top: 4px;
    font-size: 14px;
}
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}
.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    outline: none;
}
.form-group input:focus {
    border-color: #1D4ED8;
    box-shadow: 0 0 0 3px rgba(29,78,216,0.1);
}
.login-error {
    color: #DC2626;
    font-size: 13px;
    margin-bottom: 12px;
}

/* ── Buttons ──────────────────────────────────────────── */
.btn-primary {
    background: #1D4ED8;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    width: 100%;
    transition: background 0.15s;
}
.btn-primary:hover:not(:disabled) { background: #1E40AF; }
.btn-primary:disabled {
    background: #D1D5DB;
    color: #9CA3AF;
    cursor: not-allowed;
}
.btn-small {
    background: #F3F4F6;
    color: #374151;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
}
.btn-small:hover { background: #E5E7EB; }

/* ── Product Grid ─────────────────────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
@media (max-width: 900px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .product-grid { grid-template-columns: 1fr; } }

.product-card {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.product-info { flex: 1; }
.product-name {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-code {
    font-size: 12px;
    color: #9CA3AF;
    margin-top: 4px;
}
.product-price {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}
.price-uom {
    font-size: 13px;
    font-weight: 400;
    color: #6B7280;
}
.price-contact {
    font-size: 14px;
    font-weight: 400;
    color: #6B7280;
}

/* ── Qty Control ──────────────────────────────────────── */
.qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
}
.qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    background: #F9FAFB;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qty-btn:hover { background: #E5E7EB; }
.qty-input {
    width: 64px;
    text-align: center;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 6px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
}
.qty-input:focus { border-color: #1D4ED8; outline: none; }

/* ── Tables ───────────────────────────────────────────── */
.table-wrap {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    overflow: hidden;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table th {
    background: #F9FAFB;
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #E5E7EB;
}
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #F3F4F6;
    color: #111827;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.table-row { cursor: pointer; }
.table-row:hover td { background: #F9FAFB; }
.text-right { text-align: right; }
.order-name { font-weight: 600; color: #1D4ED8; }
.order-amount { font-weight: 600; }
.total-row td { padding-top: 16px; border-top: 2px solid #E5E7EB; }

/* ── Badges ───────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.badge-green { background: #DCFCE7; color: #16A34A; }
.badge-amber { background: #FEF3C7; color: #D97706; }
.badge-grey { background: #F3F4F6; color: #6B7280; }
.badge-red { background: #FEE2E2; color: #DC2626; }

/* ── Order Detail ─────────────────────────────────────── */
.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}
.order-header h2 {
    font-size: 22px;
    font-weight: 700;
}
.order-date {
    color: #6B7280;
    font-size: 14px;
    margin-top: 4px;
}

/* ── Misc ─────────────────────────────────────────────── */
.back-link {
    display: inline-block;
    color: #6B7280;
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 24px;
}
.back-link:hover { color: #111827; }
.muted { color: #6B7280; }
.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: #6B7280;
}
.empty-state p { margin-bottom: 8px; }
.error-wrap {
    text-align: center;
    padding: 64px 24px;
}
.error-wrap h2 {
    font-size: 20px;
    margin-bottom: 8px;
}
