/* ===== KasirMurah.biz.id — Purple Design System ===== */

:root {
    --primary: #6C5CE7;
    --primary-dark: #5A4BD1;
    --primary-light: #A29BFE;
    --primary-bg: #F0EEFF;
    --success: #00B894;
    --warning: #FDCB6E;
    --danger: #E17055;
    --info: #74B9FF;
    --dark: #2D3436;
    --gray: #636E72;
    --gray-light: #B2BEC3;
    --bg: #F7F8FC;
    --white: #FFFFFF;
    --border: #EAEAF0;
    --shadow: 0 2px 16px rgba(108,92,231,.10);
    --shadow-md: 0 4px 24px rgba(108,92,231,.15);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 8px;
}

/* ----- Base ----- */
* { box-sizing: border-box; }
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--dark);
    padding-bottom: 70px;
    margin: 0;
}
@media (min-width: 992px) { body { padding-bottom: 0; } }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ----- Navbar ----- */
.navbar {
    background: var(--primary) !important;
    box-shadow: 0 2px 16px rgba(108,92,231,.25);
    padding: 0 16px;
    min-height: 58px;
}
@media (min-width: 992px) {
    .navbar { height: 58px; overflow: visible; }
}
.navbar-brand {
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -.3px;
    color: #fff !important;
}
.navbar-nav .nav-link {
    color: rgba(255,255,255,.85) !important;
    font-weight: 500;
    font-size: 14px;
    padding: 6px 12px !important;
    border-radius: var(--radius-xs);
    transition: background .15s;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    background: rgba(255,255,255,.15);
    color: #fff !important;
}
.navbar-nav .nav-link.text-warning { color: #FDCB6E !important; }
.navbar-toggler { border: none; }
.navbar-toggler-icon {
    filter: brightness(0) invert(1) !important;
    width: 24px;
    height: 24px;
}
.dropdown-menu {
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: 8px;
    min-width: 180px;
}
.dropdown-item {
    border-radius: var(--radius-xs);
    font-size: 14px;
    padding: 8px 12px;
    font-weight: 500;
}
.dropdown-item:hover { background: var(--primary-bg); color: var(--primary); }

/* Hide dropdown menu on mobile */
@media (max-width: 991px) {
    .desktop-only {
        display: none !important;
    }
}

/* ----- Mobile Bottom Navigation ----- */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    z-index: 1040;
    height: 62px;
    box-shadow: 0 -4px 20px rgba(0,0,0,.07);
}
.mobile-bottom-nav .nav-item { flex: 1; }
.mobile-bottom-nav .nav-link {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    height: 62px; color: var(--gray-light);
    font-size: 9px; font-weight: 600;
    padding: 4px 0; gap: 2px;
    transition: color .15s;
}
.mobile-bottom-nav .nav-link i { font-size: 20px; }
.mobile-bottom-nav .nav-link.active,
.mobile-bottom-nav .nav-link:hover { color: var(--primary); }
@media (max-width: 991px) { .mobile-bottom-nav { display: flex; } }

/* ----- Cards ----- */
.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    background: var(--white);
}
.card-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
    font-size: 15px;
    border-radius: var(--radius) var(--radius) 0 0 !important;
    padding: 16px 20px;
    color: var(--dark);
}

/* Stat cards */
.stat-card {
    border-radius: var(--radius);
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
}
.stat-card .stat-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.stat-card .stat-value {
    font-size: 26px; font-weight: 800; line-height: 1.1;
    color: var(--dark);
}
.stat-card .stat-label {
    font-size: 12px; font-weight: 600;
    color: var(--gray); text-transform: uppercase; letter-spacing: .5px;
}
.stat-card.purple .stat-icon { background: var(--primary-bg); color: var(--primary); }
.stat-card.green .stat-icon { background: #E6FAF5; color: var(--success); }
.stat-card.orange .stat-icon { background: #FFF4E0; color: #F0965A; }
.stat-card.red .stat-icon { background: #FFF0ED; color: var(--danger); }

/* Quick action buttons */
.quick-btn {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 8px; padding: 18px 12px;
    border-radius: var(--radius-sm);
    background: var(--primary-bg);
    color: var(--primary);
    border: none; font-weight: 600; font-size: 13px;
    transition: background .15s, transform .15s;
    cursor: pointer; text-decoration: none;
    width: 100%;
}
.quick-btn i { font-size: 22px; }
.quick-btn:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
    text-decoration: none;
}

/* ----- Tables ----- */
.table th {
    font-weight: 700; font-size: 12px;
    color: var(--gray); text-transform: uppercase;
    letter-spacing: .5px; border-bottom: 2px solid var(--border);
    background: transparent; padding: 12px 16px;
}
.table td { vertical-align: middle; font-size: 14px; padding: 12px 16px; border-color: var(--border); }
.table-hover tbody tr:hover { background: var(--primary-bg); }

/* Mobile table → card list */
@media (max-width: 767px) {
    .table-mobile-card thead { display: none; }
    .table-mobile-card tbody tr {
        display: block; background: var(--white);
        border-radius: var(--radius-sm); margin-bottom: 12px;
        padding: 12px 16px; box-shadow: var(--shadow); border: none;
    }
    .table-mobile-card td {
        display: flex; justify-content: space-between;
        align-items: center; padding: 8px 0;
        border: none; border-bottom: 1px solid var(--border); font-size: 13px;
    }
    .table-mobile-card td:last-child { border-bottom: none; padding-top: 10px; }
    .table-mobile-card td::before {
        content: attr(data-label);
        font-weight: 700; color: var(--gray);
        font-size: 11px; text-transform: uppercase;
        letter-spacing: .5px; min-width: 90px; flex-shrink: 0;
    }
}

/* ----- Forms ----- */
.form-control, .form-select {
    border-radius: var(--radius-xs);
    border: 1.5px solid var(--border);
    font-size: 15px; padding: 10px 14px;
    color: var(--dark);
    background: var(--white);
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108,92,231,.15);
    outline: none;
}
.form-label { font-weight: 600; font-size: 13px; color: var(--gray); margin-bottom: 6px; }
.form-control-sm { padding: 7px 11px; font-size: 13px; }

/* ----- Buttons ----- */
.btn { border-radius: var(--radius-xs); font-weight: 600; font-size: 14px; transition: all .15s; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-success:hover { background: #00a381; border-color: #00a381; }
.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }

/* ----- Badges ----- */
.badge { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px; }
.bg-primary { background: var(--primary) !important; }
.bg-success { background: var(--success) !important; }
.bg-warning { background: var(--warning) !important; }
.bg-danger { background: var(--danger) !important; }
.bg-info { background: var(--info) !important; }

/* ----- Alerts ----- */
.alert { border-radius: var(--radius-sm); border: none; font-size: 14px; }
.alert-info { background: var(--primary-bg); color: var(--primary); }
.alert-success { background: #E6FAF5; color: #00896E; }
.alert-danger { background: #FFF0ED; color: var(--danger); }
.alert-warning { background: #FFF9ED; color: #C07300; }

/* ----- Page Header ----- */
.page-header {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: 24px; flex-wrap: wrap; gap: 10px;
}
.page-header h1 {
    font-size: 22px; font-weight: 800;
    margin: 0; color: var(--dark);
    letter-spacing: -.3px;
}
@media (max-width: 575px) {
    .page-header h1 { font-size: 18px; }
    .page-header .btn { font-size: 13px; padding: 8px 14px; }
}

/* ----- POS Layout ----- */
.pos-wrapper { display: flex; height: calc(100vh - 58px); }
.pos-products { flex: 1; overflow-y: auto; padding: 16px; background: var(--bg); }
.pos-cart {
    width: 360px; min-width: 360px; background: var(--white);
    border-left: 1px solid var(--border);
    display: flex; flex-direction: column; overflow: hidden;
}
.pos-cart-header {
    padding: 16px 18px; border-bottom: 1px solid var(--border);
    font-weight: 800; font-size: 16px; background: var(--white);
    display: flex; align-items: center; justify-content: space-between;
}
.pos-cart-items { flex: 1; overflow-y: auto; padding: 4px 0; }
.pos-cart-footer { padding: 14px 18px; border-top: 1px solid var(--border); background: var(--bg); }
.cart-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 18px; border-bottom: 1px solid var(--border);
    gap: 12px;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-name { font-size: 13px; font-weight: 600; color: var(--dark); }
.cart-item-price { font-size: 12px; color: var(--gray); }

/* Product cards in POS */
.product-card {
    cursor: pointer;
    border-radius: var(--radius-sm);
    border: 2px solid transparent;
    transition: all .15s;
    background: var(--white);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.product-card:hover, .product-card:active {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}
.product-thumb {
    width: 100%; aspect-ratio: 1;
    background: var(--primary-bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; color: var(--primary-light);
}
.product-price { font-size: 14px; font-weight: 800; color: var(--primary); }

/* Product list row (for new list-view POS) */
.product-row {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 0; border-bottom: 1px solid var(--border);
}
.product-row:last-child { border-bottom: none; }
.product-row-thumb {
    width: 52px; height: 52px; flex-shrink: 0;
    border-radius: 12px;
    background: var(--primary-bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: var(--primary-light);
}
.product-row-info { flex: 1; min-width: 0; }
.product-row-name { font-size: 14px; font-weight: 600; color: var(--dark); line-height: 1.3; }
.product-row-sku { font-size: 11px; color: var(--gray-light); }
.product-row-price { font-size: 15px; font-weight: 800; color: var(--primary); }
.qty-ctrl { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.qty-btn {
    width: 30px; height: 30px; border-radius: 8px;
    border: none; font-size: 16px; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all .12s;
}
.qty-btn-minus { background: var(--border); color: var(--gray); }
.qty-btn-minus:hover { background: var(--danger); color: #fff; }
.qty-btn-plus { background: var(--primary); color: #fff; }
.qty-btn-plus:hover { background: var(--primary-dark); }
.qty-num {
    font-size: 15px; font-weight: 700;
    min-width: 20px; text-align: center; color: var(--dark);
}

/* Category tabs */
.cat-tabs {
    display: flex; gap: 8px;
    overflow-x: auto; padding: 0 0 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
    white-space: nowrap; padding: 7px 18px;
    border-radius: 30px; font-size: 13px; font-weight: 600;
    border: 1.5px solid var(--border);
    background: var(--white); color: var(--gray);
    cursor: pointer; transition: all .15s; flex-shrink: 0;
}
.cat-tab.active, .cat-tab:hover {
    background: var(--primary); color: #fff; border-color: var(--primary);
}

/* POS bottom action bar */
.pos-action-bar {
    position: fixed; bottom: 62px; left: 0; right: 0;
    background: var(--primary);
    padding: 14px 20px;
    display: flex; align-items: center; justify-content: space-between;
    z-index: 1025; color: #fff;
    box-shadow: 0 -4px 20px rgba(108,92,231,.3);
    cursor: pointer; border: none;
}
.pos-action-bar .pa-label { font-size: 15px; font-weight: 700; }
.pos-action-bar .pa-meta { font-size: 12px; opacity: .8; }
.pos-action-bar .pa-total { font-size: 18px; font-weight: 800; }
.pos-action-bar .pa-arrow { font-size: 20px; }

/* Mobile POS: stacked layout with cart drawer */
@media (max-width: 991px) {
    .pos-wrapper { flex-direction: column; height: auto; min-height: calc(100vh - 58px); }
    .pos-products { padding: 12px 12px 140px; }
    .pos-cart {
        width: 100%; min-width: unset; border-left: none; border-top: 2px solid var(--primary);
        position: fixed; bottom: 62px; left: 0; right: 0;
        max-height: 70vh; z-index: 1020;
        transform: translateY(100%); transition: transform .3s ease;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -8px 32px rgba(108,92,231,.2);
    }
    .pos-cart.cart-open { transform: translateY(0); }
    .pos-action-bar { display: flex !important; }
}
@media (min-width: 992px) {
    .pos-action-bar { display: none !important; }
    .pos-cart { display: flex !important; transform: none !important; }
    .pos-products { padding-bottom: 16px; }
}

/* ----- Auth pages ----- */
.auth-wrapper {
    min-height: 100vh; display: flex;
    align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #A29BFE 100%);
    padding: 20px;
}
.auth-card {
    width: 100%; max-width: 440px; background: var(--white);
    border-radius: 24px; padding: 40px 36px;
    box-shadow: 0 20px 60px rgba(108,92,231,.25);
}
.auth-logo {
    text-align: center; font-size: 26px; font-weight: 900;
    color: var(--primary); margin-bottom: 6px;
    letter-spacing: -.5px;
}
.auth-logo i { margin-right: 8px; }
.auth-subtitle {
    text-align: center; color: var(--gray);
    font-size: 14px; margin-bottom: 28px;
}
@media (max-width: 480px) { .auth-card { padding: 28px 20px; } }

/* ----- Misc ----- */
@media (max-width: 575px) {
    .container, .container-fluid { padding-left: 12px; padding-right: 12px; }
    h1 { font-size: 20px; }
}

/* Nav tabs */
.nav-tabs { border-bottom: 2px solid var(--border); gap: 4px; }
.nav-tabs .nav-link {
    border: none; border-bottom: 2px solid transparent;
    color: var(--gray); font-weight: 600; font-size: 14px;
    padding: 10px 16px; margin-bottom: -2px; border-radius: 0;
}
.nav-tabs .nav-link.active {
    color: var(--primary); border-bottom-color: var(--primary); background: none;
}
.nav-tabs .nav-link:hover { color: var(--primary); background: none; }

/* Trial/subscription banner */
.sub-banner {
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 20px;
}
.sub-banner.trial { background: var(--primary-bg); border-left: 4px solid var(--primary); }
.sub-banner.active { background: #E6FAF5; border-left: 4px solid var(--success); }
.sub-banner i { font-size: 20px; }
.sub-banner.trial i { color: var(--primary); }
.sub-banner.active i { color: var(--success); }

/* Mobile Logout Button */
.mobile-logout-btn {
    display: none;
    color: #fff !important;
    font-size: 20px;
    padding: 8px 12px;
    transition: all .15s;
    border: none;
    background: none;
}
.mobile-logout-btn:hover {
    color: #FDCB6E !important;
    transform: scale(1.1);
}
@media (max-width: 991px) {
    .mobile-logout-btn {
        display: inline-block !important;
    }
}
@media (min-width: 992px) {
    .mobile-logout-btn {
        display: none !important;
    }
}
