/* ============================================ */
/* LALAPAN POS - THEME MERAH                    */
/* ============================================ */

:root {
    --merah-utama: #DC2626;
    --merah-gelap: #B91C1C;
    --merah-terang: #EF4444;
    --merah-muda: #FEE2E2;
    --orange: #F97316;
    --biru: #3B82F6;
    --hijau: #22C55E;
    --bg: #F8F9FA;
    --putih: #FFFFFF;
    --abu-muda: #F3F4F6;
    --abu: #9CA3AF;
    --abu-gelap: #6B7280;
    --teks: #1F2937;
    --shadow: 0 2px 10px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 20px rgba(220,38,38,0.15);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--teks);
    min-height: 100vh;
}

/* ============================================ */
/* LOGIN PAGE                                    */
/* ============================================ */
.login-page {
    background: linear-gradient(135deg, #DC2626 0%, #991B1B 50%, #7F1D1D 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-box {
    background: var(--putih);
    border-radius: 20px;
    padding: 40px 35px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo i {
    font-size: 48px;
    color: var(--merah-utama);
    background: var(--merah-muda);
    padding: 20px;
    border-radius: 50%;
    margin-bottom: 15px;
}

.login-logo-img {
    max-height: 100px;
    width: auto;
    border-radius: 8px;
}

.login-logo h1 {
    font-size: 28px;
    color: var(--merah-utama);
    font-weight: 800;
    letter-spacing: 2px;
}

.login-logo p {
    color: var(--abu-gelap);
    font-size: 14px;
    margin-top: 5px;
}

.login-form .form-group {
    margin-bottom: 18px;
}

.login-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--teks);
    margin-bottom: 6px;
}

.login-form label i {
    color: var(--merah-utama);
    margin-right: 5px;
}

.login-form input,
.login-form select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
    background: var(--abu-muda);
}

.login-form input:focus,
.login-form select:focus {
    outline: none;
    border-color: var(--merah-utama);
    background: var(--putih);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.1);
}

.checkbox-group {
    margin: 10px 0;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-weight: 400 !important;
    cursor: pointer;
    color: var(--abu-gelap) !important;
    font-size: 13px !important;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--merah-utama);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--merah-utama);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 1px;
}

.btn-login:hover {
    background: var(--merah-gelap);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220,38,38,0.4);
}

.login-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #E5E7EB;
}

.login-footer a {
    color: var(--abu-gelap);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s;
}

.login-footer a:hover {
    color: var(--merah-utama);
}

.alert {
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 13px;
}

.alert-error {
    background: var(--merah-muda);
    color: var(--merah-gelap);
    border: 1px solid #FECACA;
}

/* ============================================ */
/* NAVBAR                                       */
/* ============================================ */
.navbar {
    background: var(--putih);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    color: var(--merah-utama);
    text-decoration: none;
    font-size: 20px;
    font-weight: 800;
}

.nav-brand i {
    margin-right: 8px;
}

.nav-logo, .pos-nav-logo {
    height: 40px;
    width: auto;
    vertical-align: middle;
    border-radius: 6px;
}

.nav-user {
    font-size: 14px;
    color: var(--abu-gelap);
}

.nav-user i {
    color: var(--merah-utama);
    font-size: 18px;
    vertical-align: middle;
    margin-right: 5px;
}

.nav-user small {
    display: block;
    font-size: 11px;
    color: var(--abu);
}

.btn-logout {
    background: var(--merah-muda);
    color: var(--merah-utama);
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: var(--merah-utama);
    color: white;
}

/* ============================================ */
/* POS NAVBAR - TOP HEADER                      */
/* ============================================ */
.pos-navbar {
    background: var(--putih);
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 12px;
}

.pos-nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pos-nav-brand {
    color: var(--merah-utama);
    text-decoration: none;
    font-size: 18px;
    font-weight: 800;
}

.pos-nav-brand i { margin-right: 6px; }

.pos-nav-user {
    font-size: 13px;
    color: var(--abu-gelap);
}

.pos-nav-user i {
    color: var(--merah-utama);
    margin-right: 4px;
}

.pos-nav-center {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pos-nav-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    background: var(--abu-muda);
    color: var(--teks);
}

.pos-nav-btn:hover {
    transform: translateY(-1px);
}

.nav-menu { background: #F3E8FF; color: #7C3AED; }
.nav-menu:hover { background: #E9D5FF; }

.nav-simpan { background: #E5E7EB; color: var(--teks); }
.nav-simpan:hover { background: #D1D5DB; }

.nav-tersimpan,
.nav-histori { background: #DBEAFE; color: #2563EB; }
.nav-tersimpan:hover,
.nav-histori:hover { background: #BFDBFE; }
.nav-transaksi { background: #FEF3C7; color: #D97706; }
.nav-transaksi:hover { background: #FDE68A; }

.pos-nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pos-cup-stock {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    white-space: nowrap;
}

.pos-cup-stock-item {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
    color: white;
    box-shadow: none;
}

.pos-cup-stock-item.is-low {
    background: var(--merah-utama);
    animation: cupFlash 1.05s ease-in-out infinite;
}

.pos-cup-stock-item.is-ok {
    background: var(--hijau);
}

.pos-cup-alert-icon {
    width: auto;
    height: auto;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.pos-cup-stock-item.is-low .pos-cup-alert-icon {
    background: transparent;
    color: white;
}

.pos-cup-stock-item.is-ok .pos-cup-alert-icon {
    background: transparent;
    color: white;
}

.pos-cup-label {
    line-height: 1;
    font-weight: 800;
}

.pos-cup-stock input {
    width: 42px;
    height: 24px;
    border: none;
    border-radius: 6px;
    padding: 0 5px;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    outline: none;
    background: rgba(255,255,255,0.95);
    color: var(--teks);
}

.pos-cup-stock input:focus {
    border-color: white;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.25);
}

.pos-cup-balance {
    min-width: 18px;
    height: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    background: transparent;
    color: inherit;
    border: none;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.pos-cup-balance.is-minus {
    color: inherit;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

@keyframes cupFlash {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220,38,38,0.45);
        filter: brightness(1);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(220,38,38,0.18), 0 0 14px rgba(220,38,38,0.35);
        filter: brightness(1.08);
    }
}

.pos-cup-stock-save {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 8px;
    background: #2563EB;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.pos-cup-stock-save:hover {
    background: #1D4ED8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}

.pos-cup-stock-save:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.pos-nav-cart {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    color: white;
    padding: 7px 14px;
    background: var(--biru);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    letter-spacing: 0.3px;
}
.pos-nav-cart:hover {
    background: #2563EB;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(59,130,246,0.3);
}

.pos-nav-cart i { font-size: 16px; }

.pos-nav-badge {
    background: white;
    color: var(--biru);
    padding: 1px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.nav-logout { background: #F3F4F6; color: #9CA3AF; }
.nav-logout:hover { background: var(--merah-utama); color: white; transform: translateY(-1px); box-shadow: 0 3px 10px rgba(220,38,38,0.3); }

.pos-nav-logout {
    color: var(--abu-gelap);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pos-nav-logout:hover {
    background: var(--merah-muda);
    color: var(--merah-utama);
}

/* ============================================ */
/* DASHBOARD                                    */
/* ============================================ */
.dashboard-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

.dashboard-hero {
    background: linear-gradient(135deg, var(--merah-utama), var(--merah-gelap));
    border-radius: var(--radius);
    padding: 40px;
    color: white;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.hero-content h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.hero-content p {
    opacity: 0.9;
    font-size: 14px;
}

.hero-tagline {
    font-style: italic;
    margin-top: 8px;
    font-size: 13px !important;
    opacity: 0.8 !important;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--putih);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
}

.stat-red .stat-icon { background: var(--merah-utama); }
.stat-orange .stat-icon { background: var(--orange); }
.stat-blue .stat-icon { background: var(--biru); }
.stat-green .stat-icon { background: var(--hijau); }

.stat-info h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 2px;
}

.stat-info p {
    font-size: 12px;
    color: var(--abu-gelap);
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.menu-card {
    background: var(--putih);
    border-radius: var(--radius);
    padding: 25px 15px;
    text-align: center;
    text-decoration: none;
    color: var(--teks);
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.menu-card:hover {
    border-color: var(--merah-utama);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.menu-card i {
    font-size: 36px;
    margin-bottom: 10px;
    display: block;
}

.menu-card span {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
}

.menu-penjualan i { color: var(--merah-utama); }
.menu-produk i { color: var(--biru); }
.menu-histori i { color: var(--orange); }
.menu-pembayaran i { color: var(--hijau); }
.menu-jurnal i { color: #8B5CF6; }
.menu-grafik i { color: #06B6D4; }
.menu-setting i { color: #6B7280; }
.menu-kasir i { color: #8B5CF6; }
.menu-kasir:hover {
    background: #F3E8FF;
    border-color: #8B5CF6;
}
.menu-logout i { color: var(--merah-utama); }

.menu-logout:hover {
    background: #FEE2E2;
    border-color: var(--merah-utama);
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.action-card {
    background: var(--putih);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--teks);
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.action-card:hover {
    background: var(--merah-muda);
    transform: translateX(3px);
}

.action-card i {
    font-size: 24px;
    color: var(--merah-utama);
}

.action-card span {
    font-size: 14px;
    font-weight: 600;
}

/* ============================================ */
/* POS CONTAINER - FULL WIDTH                   */
/* ============================================ */
.pos-container {
    display: flex;
    height: calc(100vh - 56px);
    overflow: hidden;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
}

/* LEFT: PRODUK */
.pos-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 10px 14px 10px 14px;
    min-width: 0;
}

.pos-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.pos-search {
    display: flex;
    align-items: center;
    background: var(--putih);
    border-radius: 10px;
    padding: 0 14px;
    border: 2px solid #E5E7EB;
    transition: all 0.3s;
    flex: 1;
    max-width: 360px;
}

.pos-search:focus-within {
    border-color: var(--merah-utama);
}

.pos-search i {
    color: var(--abu);
    margin-right: 8px;
    font-size: 14px;
}

.pos-search input {
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: 14px;
    width: 100%;
    outline: none;
}

.pos-filter {
    display: flex;
    gap: 8px;
}

.pos-filter select {
    padding: 9px 12px;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    font-size: 13px;
    background: var(--putih);
    outline: none;
    cursor: pointer;
    transition: border-color 0.3s;
}

.pos-filter select:focus {
    border-color: var(--merah-utama);
}

.pos-btn-reset {
    padding: 9px 14px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    background: var(--merah-utama);
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.pos-btn-reset:hover {
    background: var(--merah-gelap);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220,38,38,0.3);
}

.pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
    align-content: start;
}

/* Responsive grid */
@media (min-width: 1600px) {
    .pos-grid { grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 16px; }
}
@media (max-width: 900px) {
    .pos-grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 10px; }
}
@media (max-width: 600px) {
    .pos-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
}

.pos-grid::-webkit-scrollbar {
    width: 5px;
}
.pos-grid::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

.pos-card {
    background: var(--putih);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    user-select: none;
}

.pos-card:hover {
    border-color: var(--merah-utama);
    box-shadow: 0 3px 15px rgba(220,38,38,0.12);
    transform: translateY(-1px);
}

.pos-card:active {
    transform: scale(0.97);
}

.pos-card-img {
    height: 100px;
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.pos-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pos-card-img i {
    font-size: 36px;
    color: var(--abu);
}

.pos-card-info {
    padding: 10px 10px 12px;
}

.pos-card-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pos-card-price {
    color: var(--merah-utama);
    font-weight: 700;
    font-size: 14px;
}

.pos-card-stok {
    font-size: 10px;
    color: var(--abu);
    margin-top: 3px;
}
.stok-habis { color: #EF4444; font-weight: 700; }
.pos-card-habis { opacity: 0.6; cursor: not-allowed; }
.pos-card-habis:hover { border-color: transparent; box-shadow: none; transform: none; }
.pos-card-habis:active { transform: none; }

.no-product {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--abu);
}

/* Favorite badge on product card */
.pos-card-fav {
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 2;
    line-height: 1;
}
.pos-card-fav i {
    color: #F59E0B;
    font-size: 16px;
    background: white;
    border-radius: 50%;
    padding: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* Qty Selector & Cart Button */
.pos-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}
.pos-qty-selector {
    display: flex;
    align-items: center;
    gap: 2px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    padding: 2px;
    background: var(--putih);
}
.pos-qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.pos-qty-minus { color: var(--merah-utama); }
.pos-qty-minus:hover { background: #FEE2E2; }
.pos-qty-plus { color: var(--hijau); }
.pos-qty-plus:hover { background: #D1FAE5; }
.pos-qty-val {
    min-width: 24px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--teks);
}
.pos-cart-add {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--merah-utama);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.pos-cart-add:hover {
    background: var(--merah-gelap);
    transform: scale(1.05);
}
.pos-cart-add:active {
    transform: scale(0.95);
}
.no-product i {
    font-size: 50px;
    margin-bottom: 12px;
    display: block;
}

/* ============================================ */
/* RIGHT: CART                                  */
/* ============================================ */
.pos-right {
    width: 28%;
    min-width: 280px;
    max-width: 420px;
    flex-shrink: 0;
    border-left: 1px solid #E5E7EB;
    background: var(--putih);
    display: flex;
    flex-direction: column;
}

.pos-cart {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pos-cart-header {
    padding: 14px 18px;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.pos-cart-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--teks);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pos-cart-title i {
    color: var(--merah-utama);
}

.pos-cart-badge {
    background: var(--merah-utama);
    color: white;
    padding: 1px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
}

.pos-cart-clear {
    background: none;
    border: none;
    color: var(--abu);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}
.pos-cart-clear:hover {
    background: var(--merah-muda);
    color: var(--merah-utama);
}

.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 6px 10px 6px 14px;
}

.pos-cart-items::-webkit-scrollbar {
    width: 6px;
}
.pos-cart-items::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}
.pos-cart-items::-webkit-scrollbar-track {
    background: transparent;
}

.pos-cart-empty {
    text-align: center;
    padding: 50px 10px;
    color: var(--abu);
}
.pos-cart-empty i {
    font-size: 40px;
    margin-bottom: 10px;
    display: block;
}

/* Cart Items */
.cart-item {
    padding: 10px 0;
    border-bottom: 1px solid #F3F4F6;
}
.cart-item:last-child {
    border-bottom: none;
}
.cart-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.cart-item-name {
    font-size: 13px;
    font-weight: 600;
}
.cart-item-del {
    background: none;
    border: none;
    color: var(--abu);
    cursor: pointer;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
}
.cart-item-del:hover {
    background: var(--merah-muda);
    color: var(--merah-utama);
}
.cart-item-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cart-qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #E5E7EB;
    background: var(--putih);
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cart-qty-btn:hover {
    background: var(--merah-muda);
    border-color: var(--merah-utama);
    color: var(--merah-utama);
}
.cart-qty-val {
    font-weight: 700;
    font-size: 15px;
    min-width: 24px;
    text-align: center;
}
.cart-item-sub {
    margin-left: auto;
    font-weight: 700;
    font-size: 13px;
    color: var(--merah-utama);
}

/* Cart Footer */
.pos-cart-footer {
    border-top: 2px solid #E5E7EB;
    padding: 14px 18px 16px;
    flex-shrink: 0;
}

.pos-cart-ringkasan {
    margin-bottom: 12px;
}

.ringkasan-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--abu-gelap);
    margin-bottom: 4px;
}

.ringkasan-total {
    font-size: 16px;
    font-weight: 700;
    color: var(--teks);
    padding-top: 6px;
    border-top: 1px solid #E5E7EB;
}

.total-nilai {
    color: var(--merah-utama);
    font-size: 20px;
    font-weight: 800;
}

.pos-cart-actions {
    display: flex;
    gap: 8px;
}

.pos-btn {
    flex: 1;
    padding: 12px 8px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.pos-btn-simpan {
    background: #2563EB;
    color: white;
    box-shadow: 0 3px 10px rgba(37,99,235,0.25);
}
.pos-btn-simpan:hover {
    background: #1D4ED8;
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(37,99,235,0.35);
}

.pos-btn-primary {
    background: var(--merah-utama);
    color: white;
}
.pos-btn-primary:hover {
    background: var(--merah-gelap);
}

.pos-btn-bayar {
    flex: 1.5;
}

/* ============================================ */
/* MODAL BAYAR - PROFESIONAL                   */
/* ============================================ */
.modal-bayar-box {
    max-width: 520px;
    width: 95%;
}

.modal-bayar-box .modal-body {
    padding: 28px 30px;
}

.modal-bayar-box .modal-header {
    padding: 18px 28px;
}

.modal-bayar-box .modal-footer {
    padding: 16px 28px 20px;
}

.bayar-total-info {
    text-align: center;
    margin-bottom: 18px;
}

.bayar-total-info p {
    color: var(--abu-gelap);
    font-size: 13px;
    margin-bottom: 4px;
}

.bayar-nominal {
    font-size: 32px;
    color: var(--merah-utama);
    font-weight: 800;
}

.bayar-prediksi {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.prediksi-btn {
    flex: 1;
    min-width: 72px;
    padding: 10px 8px;
    border-radius: 10px;
    border: 2px solid #E5E7EB;
    background: var(--putih);
    color: var(--teks);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.prediksi-btn:hover {
    border-color: var(--merah-utama);
    background: #FFF5F5;
    color: var(--merah-utama);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(220,38,38,0.12);
}

.prediksi-btn.active {
    border-color: var(--merah-utama);
    background: var(--merah-utama);
    color: white;
    box-shadow: 0 3px 12px rgba(220,38,38,0.25);
    transform: translateY(-2px);
}
.prediksi-btn.active:hover {
    background: var(--merah-gelap);
    color: white;
}

.bayar-metode {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.metode-opt {
    flex: 1;
    text-align: center;
    padding: 12px 6px;
    border-radius: 10px;
    border: 2px solid #E5E7EB;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
    font-weight: 600;
}

.metode-opt:hover {
    border-color: var(--merah-utama);
}

.metode-opt.active {
    border-color: var(--merah-utama);
    background: var(--merah-muda);
    color: var(--merah-utama);
}

.metode-opt input { display: none; }

.metode-opt i {
    display: block;
    font-size: 22px;
    margin-bottom: 4px;
}

.bayar-konsumen {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    margin-top: 12px;
    background: var(--putih);
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    gap: 12px;
}

.bayar-input-manual {
    width: auto;
    min-width: 0;
    flex: none;
    padding: 0;
    font-size: 20px;
    font-weight: 800;
    border: none;
    border-radius: 0;
    text-align: right;
    outline: none;
    background: transparent;
    color: var(--hijau);
    line-height: 1.2;
    height: auto;
    font-family: inherit;
}

.bayar-kembalian {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    margin-top: 12px;
    background: var(--merah-muda);
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
}

.kembali-nilai {
    font-size: 20px;
    color: var(--merah-utama);
    font-weight: 800;
    animation: flashKembali 1s ease-in-out infinite;
}

@keyframes flashKembali {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

.bayar-non-info {
    text-align: center;
    padding: 20px;
}
.bayar-non-info p {
    font-size: 15px;
    margin-bottom: 4px;
}
.bayar-non-harga {
    font-size: 24px !important;
    font-weight: 800;
    color: var(--merah-utama);
    margin-top: 8px !important;
}

/* MODAL SUKSES */
.modal-sukses-box {
    max-width: 400px;
}

/* MODAL SUKSES ACTIONS */
/* MODAL RECEIPT */
.modal-receipt-box {
    max-width: 380px;
    max-height: 85vh;
}

.receipt-scroll-wrapper {
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.receipt-scroll-header {
    flex-shrink: 0;
    padding: 35px 30px 0;
    text-align: center;
}

.receipt-scroll-items {
    text-align: left;
    overflow-y: auto;
    padding: 0 30px;
    flex: 1 1 auto;
    min-height: 0;
}

.receipt-scroll-items::-webkit-scrollbar {
    width: 5px;
}
.receipt-scroll-items::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}
.receipt-scroll-items::-webkit-scrollbar-track {
    background: transparent;
}

.receipt-scroll-footer {
    flex-shrink: 0;
    padding: 0 30px 25px;
    text-align: center;
}

.receipt-header h2 {
    font-size: 18px;
    color: var(--teks);
    margin-bottom: 2px;
}
.receipt-header p {
    font-size: 12px;
    color: var(--abu);
}

.receipt-info {
    margin: 12px 0;
}
.receipt-info p {
    font-size: 14px;
    color: var(--teks);
}

.receipt-line {
    border-top: 1px dashed #D1D5DB;
    margin: 10px 0;
}

.receipt-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
}

.receipt-item-no {
    color: var(--abu);
    font-size: 11px;
    width: 20px;
}

.receipt-item-info {
    flex: 1;
}

.receipt-item-name {
    display: block;
    font-weight: 600;
}

.receipt-item-detail {
    display: block;
    font-size: 11px;
    color: var(--abu-gelap);
}

.receipt-item-sub {
    font-weight: 700;
    color: var(--merah-utama);
    white-space: nowrap;
}

.receipt-total {
    font-size: 20px;
    font-weight: 800;
    color: var(--merah-utama);
    text-align: center;
}

.receipt-actions {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.receipt-actions button {
    flex: 1;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.25s;
}

.receipt-actions .btn-batal {
    background: #F3F4F6;
    color: #6B7280;
    border: 1px solid #E5E7EB;
}
.receipt-actions .btn-batal:hover {
    background: #E5E7EB;
    color: var(--teks);
}

.receipt-actions .btn-bayar-sekarang {
    background: var(--hijau);
    color: white;
    box-shadow: 0 3px 12px rgba(34,197,94,0.3);
}
.receipt-actions .btn-bayar-sekarang:hover {
    background: #16A34A;
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(34,197,94,0.4);
}

.sukses-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 8px;
}

.sukses-actions button {
    flex: 1;
    max-width: 200px;
    padding: 13px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    border: none;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* MODAL FOOTER BUTTONS */
.modal-footer {
    padding: 16px 28px 20px;
    border-top: 1px solid #E5E7EB;
    display: flex;
    gap: 12px;
}

.modal-footer button {
    flex: 1;
    padding: 14px 12px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    border: none;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-batal {
    background: var(--merah-utama);
    color: white;
    box-shadow: 0 4px 14px rgba(220,38,38,0.3);
}
.btn-batal:hover {
    background: var(--merah-gelap);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220,38,38,0.4);
}

.btn-bayar-sekarang {
    background: var(--hijau) !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(34,197,94,0.35);
}
.btn-bayar-sekarang:hover {
    background: #16A34A !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34,197,94,0.45);
}
.btn-bayar-sekarang:active {
    transform: translateY(0);
}

.btn-split {
    background: #F97316 !important;
    color: white !important;
    box-shadow: 0 4px 14px rgba(249,115,22,0.35);
}
.btn-split:hover {
    background: #EA580C !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249,115,22,0.45);
}
.btn-split:active {
    transform: translateY(0);
}

/* Confirm dialog buttons (shared) */
.modal-hapus-box {
    max-width: 380px;
}
.btn-batal-hapus {
    flex: 1;
    padding: 13px 12px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.25s;
    background: var(--hijau);
    color: white;
    box-shadow: 0 4px 14px rgba(34,197,94,0.35);
}
.btn-batal-hapus:hover {
    background: #16A34A;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34,197,94,0.45);
}
.btn-ya-hapus {
    flex: 1;
    padding: 13px 12px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.25s;
    background: var(--merah-utama);
    color: white;
    box-shadow: 0 4px 14px rgba(220,38,38,0.3);
}
.btn-ya-hapus:hover {
    background: var(--merah-gelap);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220,38,38,0.4);
}

/* MODAL SIMPAN - CANTIK */
.modal-simpan-box {
    max-width: 460px;
    border-radius: 18px;
    overflow: hidden;
}

.modal-simpan-box .modal-header {
    background: linear-gradient(135deg, var(--merah-utama), var(--merah-gelap));
    padding: 18px 24px;
}
.modal-simpan-box .modal-header h2 {
    color: white;
    font-size: 17px;
}
.modal-simpan-box .modal-header .modal-close {
    color: rgba(255,255,255,0.8);
}
.modal-simpan-box .modal-header .modal-close:hover {
    color: white;
}

/* Ringkasan */
.simpan-ringkasan {
    background: linear-gradient(135deg, #FFF5F5, #FFF1F2);
    border: 1px solid #FECACA;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.simpan-ringkasan-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--merah-utama);
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #FECACA;
    display: flex;
    align-items: center;
    gap: 6px;
}

.simpan-ringkasan-header i { font-size: 15px; }

.simpan-ringkasan-items {
    max-height: 180px;
    overflow-y: auto;
    margin-bottom: 10px;
    padding-right: 6px;
}

.simpan-ringkasan-items::-webkit-scrollbar { width: 6px; }
.simpan-ringkasan-items::-webkit-scrollbar-thumb { background: #FECACA; border-radius: 10px; }
.simpan-ringkasan-items::-webkit-scrollbar-thumb:hover { background: #FCA5A5; }
.simpan-ringkasan-items::-webkit-scrollbar-track { background: transparent; }

.simpan-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 4px 7px 0;
    font-size: 12px;
    border-bottom: 1px dashed #FECACA;
}
.simpan-item-row:last-child { border-bottom: none; }

.simpan-item-name {
    flex: 1;
    font-weight: 600;
    color: var(--teks);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.simpan-item-qty {
    color: var(--abu-gelap);
    font-size: 11px;
    white-space: nowrap;
    background: var(--putih);
    padding: 2px 8px;
    border-radius: 10px;
}

.simpan-item-sub {
    font-weight: 700;
    color: var(--merah-utama);
    min-width: 80px;
    text-align: right;
    font-size: 13px;
    padding-right: 2px;
}

.simpan-ringkasan-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 14px;
    padding-top: 10px;
    border-top: 2px solid #FECACA;
    margin-top: 2px;
}

.simpan-ringkasan-nilai {
    color: var(--merah-utama);
    font-size: 18px;
}

/* Form */
.simpan-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.simpan-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--teks);
}

.simpan-field label i {
    color: var(--merah-utama);
    margin-right: 5px;
}

.simpan-field .required {
    color: #EF4444;
    font-size: 14px;
}

.simpan-field input,
.simpan-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    font-family: inherit;
    background: #FAFAFA;
}

.simpan-field input:focus,
.simpan-field textarea:focus {
    border-color: var(--merah-utama);
    background: white;
    box-shadow: 0 0 0 3px rgba(220,38,38,0.08);
}

.simpan-field textarea {
    resize: none;
    font-size: 13px;
    line-height: 1.5;
}

/* ============================================ */
/* PAGINATION - POS                             */
/* ============================================ */
.pos-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 10px 0 4px;
    flex-shrink: 0;
}

.page-btn {
    padding: 8px 20px;
    border-radius: 10px;
    background: var(--putih);
    color: var(--merah-utama);
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid var(--merah-utama);
    transition: all 0.25s;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.5px;
}

.page-btn:hover {
    background: var(--merah-utama);
    color: white;
    box-shadow: 0 3px 12px rgba(220,38,38,0.25);
    transform: translateY(-1px);
}

.page-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
    border-color: var(--abu);
    color: var(--abu);
}

.page-info {
    font-size: 13px;
    color: var(--abu-gelap);
    font-weight: 600;
    background: var(--abu-muda);
    padding: 6px 16px;
    border-radius: 20px;
}

/* ============================================ */
/* TOAST - TOP RIGHT                            */
/* ============================================ */
.toast-container {
    position: fixed;
    top: 68px;
    right: 386px;
    left: auto;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}

.toast {
    background: var(--merah-utama);
    color: white;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(220,38,38,0.3);
    animation: toastSlide 0.25s ease;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.toast i { margin-right: 7px; }
.toast small { opacity: 0.85; margin-left: 5px; }

@keyframes toastSlide {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============================================ */
/* MODAL                                        */
/* ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-box {
    background: var(--putih);
    border-radius: 16px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 17px;
    color: var(--merah-utama);
}

.modal-header h2 i { margin-right: 8px; }

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--abu);
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}
.modal-close:hover { color: var(--merah-utama); }

.modal-body {
    padding: 24px;
}

/* ============================================ */
/* RESPONSIVE                                   */
/* ============================================ */
@media (max-width: 1200px) {
    .pos-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
}
@media (max-width: 768px) {
    .pos-container {
        flex-direction: column;
        position: static;
        height: auto;
    }
    .pos-navbar {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 12px;
        gap: 6px;
    }
    .pos-nav-center {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    .pos-nav-right {
        width: 100%;
        justify-content: flex-end;
        gap: 8px;
    }
    .pos-cup-stock {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 6px;
    }
    .pos-cup-stock-item {
        min-height: 34px;
        padding: 6px 8px;
        font-size: 12px;
    }
    .pos-cup-balance {
        min-width: 16px;
        height: auto;
        font-size: 12px;
    }
    .pos-cup-stock input {
        width: 34px;
        height: 22px;
    }
    .pos-nav-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    .pos-nav-left .pos-nav-user {
        display: none;
    }
    .pos-right {
        width: 100%;
        min-width: unset;
        border-left: none;
        border-top: 1px solid #E5E7EB;
    }
    .pos-cart {
        height: auto;
    }
    .pos-cart-items {
        max-height: 250px;
    }
    .pos-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    .toast-container {
        right: 20px;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .menu-grid {
        grid-template-columns: 1fr 1fr;
    }

    .navbar {
        padding: 10px 15px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .nav-center {
        order: 3;
        width: 100%;
        text-align: center;
    }

    .login-box {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .menu-grid {
        grid-template-columns: 1fr 1fr;
    }

    .modal-box {
        width: 95%;
    }
    .modal-bayar-box .modal-body { padding: 20px; }
    .bayar-metode { flex-direction: column; }
}

/* ============================================ */
/* CHAT FEATURE                                  */
/* ============================================ */
.nav-chat {
    background: #EFF6FF;
    color: #2563EB;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}
.nav-chat:hover {
    background: #DBEAFE;
    transform: translateY(-1px);
}

.chat-unread-badge {
    position: absolute;
    top: -5px;
    right: -6px;
    background: var(--merah-utama);
    color: #fff;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #fff;
    line-height: 1;
    animation: chatBadgePulse 1.2s ease-in-out infinite;
}

@keyframes chatBadgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.chat-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1100;
    backdrop-filter: blur(2px);
}

.chat-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1101;
    width: 420px;
    max-width: 95vw;
    height: 560px;
    max-height: 90vh;
    background: var(--putih);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: chatPopIn 0.22s cubic-bezier(.34,1.56,.64,1);
}

@keyframes chatPopIn {
    from { opacity: 0; transform: translate(-50%,-50%) scale(0.88); }
    to   { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}

.chat-header {
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 16px;
}

.chat-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #facc15;
    transition: background 0.4s;
}

.chat-close {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}
.chat-close:hover { background: rgba(255,255,255,0.28); }

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #F0F4FF;
    scroll-behavior: smooth;
}

.chat-loading {
    text-align: center;
    color: var(--abu-gelap);
    font-size: 13px;
    padding: 20px 0;
}

.chat-bubble-wrap {
    display: flex;
    flex-direction: column;
}
.chat-bubble-wrap.mine { align-items: flex-end; }
.chat-bubble-wrap.theirs { align-items: flex-start; }

.chat-bubble {
    max-width: 78%;
    padding: 8px 12px 6px;
    border-radius: 16px;
    font-size: 14px;
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    word-break: break-word;
}

.bubble-mine {
    background: #2563EB;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.bubble-theirs {
    background: var(--putih);
    color: var(--teks);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.chat-sender-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--merah-utama);
    margin-bottom: 1px;
}

.chat-msg-text {
    line-height: 1.45;
    white-space: pre-wrap;
}

.chat-msg-time {
    font-size: 10px;
    opacity: 0.6;
    align-self: flex-end;
    margin-top: 2px;
}

.chat-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--putih);
    border-top: 1px solid #E5E7EB;
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 14px;
    outline: none;
    transition: border 0.2s;
    background: #F9FAFB;
    color: var(--teks);
}
.chat-input:focus { border-color: #2563EB; background: #fff; }

.chat-send-btn {
    background: #2563EB;
    color: #fff;
    border: none;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
}
.chat-send-btn:hover { background: #1D4ED8; transform: scale(1.07); }
.chat-send-btn:active { transform: scale(0.96); }

@media (max-width: 480px) {
    .chat-popup { width: 98vw; height: 80vh; border-radius: 14px; }
}

/* ============================================ */
/* KASIR CHAT POPUP (Pemilik ↔ Kasir)           */
/* ============================================ */
.nav-pemilik-chat {
    background: #FEE2E2;
    color: #DC2626;
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
}
.nav-pemilik-chat:hover { background: #FECACA; transform: translateY(-1px); }

.pemilik-unread-badge {
    position: absolute;
    top: -5px;
    right: -6px;
    background: var(--merah-utama);
    color: #fff;
    border-radius: 50px;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    animation: chatBadgePulse 1.2s ease-in-out infinite;
}

.dash-kc-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--merah-utama);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    animation: chatBadgePulse 1.2s ease-in-out infinite;
}

/* === Panel & Overlay === */
.kc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(2px);
    z-index: 8900;
}
.kc-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    width: 420px;
    max-width: 96vw;
    height: 580px;
    max-height: 92vh;
    background: #fff;
    border-radius: 18px;
    z-index: 8901;
    box-shadow: 0 24px 64px rgba(0,0,0,0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: kcPopIn 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes kcPopIn {
    from { transform: translate(-50%,-48%) scale(0.93); opacity: 0; }
    to   { transform: translate(-50%,-50%) scale(1);    opacity: 1; }
}

/* === Screen layout === */
.kc-screen {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* === Header === */
.kc-header {
    background: linear-gradient(135deg, #DC2626 0%, #991B1B 100%);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.kc-head-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}
.kc-head-info > i { font-size: 20px; }
.kc-head-name { font-weight: 700; font-size: 15px; color: white; line-height: 1.2; }
.kc-head-sub  { font-size: 11px; color: rgba(255,255,255,0.75); }
.kc-close-btn {
    background: rgba(255,255,255,0.18);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    transition: background 0.15s;
}
.kc-close-btn:hover { background: rgba(255,255,255,0.3); }
.kc-back-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
    transition: background 0.15s;
}
.kc-back-btn:hover { background: rgba(255,255,255,0.2); }

/* === Kasir List === */
.kc-list-body {
    flex: 1;
    overflow-y: auto;
}
.kc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid #F3F4F6;
    cursor: pointer;
    transition: background 0.12s;
}
.kc-item:hover { background: #FEF2F2; }
.kc-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, #DC2626, #EF4444);
    color: white;
    font-weight: 700;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.kc-info { flex: 1; min-width: 0; }
.kc-info-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 3px;
}
.kc-info-name  { font-weight: 600; font-size: 14px; color: #1F2937; }
.kc-info-time  { font-size: 11px; color: #9CA3AF; white-space: nowrap; margin-left: 6px; }
.kc-info-bot   { display: flex; align-items: center; gap: 6px; }
.kc-info-bot > span:not(.kc-badge) { font-size: 13px; color: #6B7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.kc-no-msg     { color: #D1D5DB !important; font-style: italic; }
.kc-badge {
    background: #DC2626;
    color: white !important;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    width: auto !important;
    flex: none !important;
    text-align: center;
    flex-shrink: 0;
    line-height: 1.4;
}

/* === Chat Body === */
.kc-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    background: #F0F4FF;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Date separator */
.kc-date-sep {
    text-align: center;
    margin: 10px 0;
}
.kc-date-sep span {
    background: #E5E7EB;
    color: #6B7280;
    font-size: 11px;
    padding: 4px 14px;
    border-radius: 20px;
}

/* Message wrappers */
.kc-msg-wrap    { display: flex; flex-direction: column; margin-bottom: 3px; }
.kc-msg-mine    { align-items: flex-end; }
.kc-msg-theirs  { align-items: flex-start; }

/* Bubbles */
.kc-bubble {
    max-width: 76%;
    padding: 9px 13px;
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
    white-space: pre-wrap;
}
.kc-mine   { background: #DC2626; color: white; border-radius: 16px 16px 4px 16px; }
.kc-theirs { background: white; color: #1F2937; border-radius: 16px 16px 16px 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.kc-sender { font-size: 11px; color: #DC2626; font-weight: 700; margin-bottom: 2px; }
.kc-time   { font-size: 10px; color: #9CA3AF; margin-top: 2px; }
.kc-time-r { align-self: flex-end; }
.kc-time-l { align-self: flex-start; }

/* === Chat Footer === */
.kc-chat-foot {
    padding: 10px 14px;
    background: white;
    border-top: 1px solid #F3F4F6;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.kc-msg-inp {
    flex: 1;
    border: 1.5px solid #E5E7EB;
    border-radius: 24px;
    padding: 9px 16px;
    font-size: 14px;
    outline: none;
    background: #F9FAFB;
    font-family: inherit;
}
.kc-msg-inp:focus { border-color: #DC2626; }
.kc-send-btn {
    background: #DC2626;
    color: white;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background 0.15s;
}
.kc-send-btn:hover { background: #B91C1C; }

/* === States === */
.kc-loading { padding: 36px; text-align: center; color: #9CA3AF; }
.kc-empty   { padding: 40px 20px; text-align: center; color: #9CA3AF; font-size: 14px; line-height: 1.8; }

@media (max-width: 480px) {
    .kc-panel { width: 98vw; height: 86vh; border-radius: 14px; }
}

/* === Kasir floating chat (always on top, draggable, no overlay) === */
.pk-panel {
    z-index: 999999 !important;
    box-shadow: 0 8px 40px rgba(0,0,0,0.35), 0 2px 10px rgba(0,0,0,0.18);
    width: 360px;
    height: 520px;
}
.pk-panel .kc-header {
    cursor: grab;
    user-select: none;
}
.pk-panel .kc-header:active {
    cursor: grabbing;
}
@media (max-width: 480px) {
    .pk-panel { width: 94vw; height: 80vh; }
}
