/* E-POS Pet Shop - UI Style */
:root {
    --sidebar-width: 260px;
    --primary: #17a2b8;
    --primary-dark: #138496;
    --sidebar-bg: #ffffff;
    --body-bg: #f4f6f9;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --success-bg: #d4edda;
    --success-text: #155724;
    --danger-bg: #f8d7da;
    --danger-text: #721c24;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--body-bg);
    margin: 0;
    color: #333;
    font-size: 14px;
}

a { text-decoration: none; color: inherit; }

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-color);
}

.btn-sidebar-close {
    margin-left: auto;
    background: #f4f6f9;
    border: 1px solid var(--border-color);
    color: #555;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
.btn-sidebar-close:hover {
    background: #e8f7fa;
    color: var(--primary);
    border-color: var(--primary);
}

.sidebar-brand .logo {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffc107, #28a745);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}

.sidebar-brand .brand-text {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.3;
}

.sidebar-menu { padding: 12px 0; }

.menu-label {
    padding: 12px 20px 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #555;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.menu-item:hover { background: #f8f9fa; color: var(--primary); }
.menu-item.active {
    color: var(--primary);
    background: #e8f7fa;
    border-left-color: var(--primary);
    font-weight: 600;
}

.menu-item i { font-size: 16px; width: 20px; text-align: center; }

/* ===== MAIN WRAPPER ===== */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.main-wrapper.sidebar-collapsed {
    margin-left: 0;
}

/* ===== TOPBAR ===== */
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 900;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }

.btn-toggle {
    background: none; border: none;
    font-size: 20px; cursor: pointer;
    color: #555; padding: 4px 8px;
    border-radius: 8px;
    line-height: 1;
}
.btn-toggle:hover {
    background: #f4f6f9;
    color: var(--primary);
}

.topbar-right {
    display: flex; align-items: center; gap: 20px;
    font-size: 13px;
}

.topbar-info { color: var(--text-muted); }
.topbar-info strong { color: #333; display: block; font-size: 12px; }

.badge-role {
    display: flex; align-items: center; gap: 6px;
    background: #e8f7fa; color: var(--primary);
    padding: 4px 12px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
}

.user-dropdown {
    display: flex; align-items: center; gap: 10px;
    cursor: pointer; position: relative;
}

.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
}

/* ===== CONTENT ===== */
.content-area { padding: 24px; flex: 1; }

.page-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #333;
}

/* ===== ALERTS ===== */
.alert-custom {
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
}

.alert-success { background: var(--success-bg); color: var(--success-text); border: 1px solid #c3e6cb; }
.alert-danger { background: var(--danger-bg); color: var(--danger-text); border: 1px solid #f5c6cb; }
.alert-info { background: #e8f7fa; color: #0c5460; border: 1px solid #bee5eb; }

.alert-custom .alert-icon { font-size: 20px; margin-top: 1px; }
.alert-custom .alert-body strong { display: block; margin-bottom: 2px; }
.alert-custom .alert-close {
    position: absolute; right: 14px; top: 12px;
    background: none; border: none; font-size: 18px;
    cursor: pointer; opacity: 0.6;
}

/* ===== CARDS ===== */
.card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body { padding: 20px; }

/* ===== STAT CARDS ===== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
}

.stat-icon.blue { background: #e3f2fd; color: #1976d2; }
.stat-icon.green { background: #e8f5e9; color: #388e3c; }
.stat-icon.orange { background: #fff3e0; color: #f57c00; }
.stat-icon.teal { background: #e0f7fa; color: #00838f; }

.stat-info .stat-value { font-size: 22px; font-weight: 700; }
.stat-info .stat-label { font-size: 12px; color: var(--text-muted); }

/* ===== TABLE ===== */
.table-responsive { overflow-x: auto; }

table.data-table {
    width: 100%;
    border-collapse: collapse;
}

table.data-table th {
    background: #f8f9fa;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 2px solid var(--border-color);
}

table.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

table.data-table tr:hover { background: #fafbfc; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: #28a745; color: #fff; }
.btn-success:hover { background: #218838; }
.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #c82333; }
.btn-outline { background: #fff; border: 1px solid var(--border-color); color: #555; }
.btn-outline:hover { background: #f8f9fa; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 13px; }
.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23,162,184,0.15); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-warning { background: #fff3cd; color: #856404; }

/* ===== POS ===== */
.pos-layout { display: grid; grid-template-columns: 1fr 380px; gap: 20px; }

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.product-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.product-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.product-card .product-name { font-weight: 600; font-size: 13px; margin: 8px 0 4px; }
.product-card .product-price { color: var(--primary); font-weight: 700; }
.product-card .product-stock { font-size: 11px; color: var(--text-muted); }

.cart-panel {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
}

.cart-header { padding: 14px 18px; border-bottom: 1px solid var(--border-color); font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.cart-items { flex: 1; overflow-y: auto; padding: 12px 18px; }
.cart-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px solid #f0f0f0;
}
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 13px; }
.cart-item-price { font-size: 12px; color: var(--text-muted); }
.cart-qty { display: flex; align-items: center; gap: 6px; }
.cart-qty button {
    width: 26px; height: 26px;
    border: 1px solid var(--border-color);
    background: #fff; border-radius: 4px;
    cursor: pointer; font-size: 14px;
}
.cart-qty button:hover { background: #f0f0f0; }

.cart-footer { padding: 14px 18px; border-top: 1px solid var(--border-color); }
.cart-total { display: flex; justify-content: space-between; font-size: 18px; font-weight: 700; margin-bottom: 12px; }

.search-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.search-bar .form-control { max-width: 280px; }

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 14px;
    color: var(--text-muted);
    font-size: 12px;
    border-top: 1px solid var(--border-color);
    background: #fff;
}

/* ===== LOGIN ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0f7fa 0%, #f4f6f9 100%);
}

.login-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo .logo {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffc107, #28a745);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 32px; margin-bottom: 12px;
}

.login-logo h2 { font-size: 20px; margin: 0; }
.login-logo p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
    .pos-layout { grid-template-columns: 1fr; }
}

@media (max-width: 576px) {
    .form-row { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* Modal overlay */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff;
    border-radius: 10px;
    width: 90%; max-width: 480px;
    padding: 24px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: 12px; display: block; }

/* Category tabs POS */
.category-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.category-tab {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: #fff;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    transition: all 0.2s;
    white-space: nowrap;
}

.category-tab:hover { border-color: var(--primary); color: var(--primary); }
.category-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.product-icon { font-size: 28px; margin-bottom: 4px; }

/* Quick cash buttons */
.quick-cash {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.quick-cash button {
    padding: 4px 12px;
    border: 1px solid var(--border-color);
    background: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.quick-cash button:hover { background: #e8f7fa; border-color: var(--primary); color: var(--primary); }

.rupiah-field {
    display: flex;
    align-items: stretch;
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.rupiah-field:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.15);
}
.rupiah-field-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: #f8f9fa;
    color: #555;
    font-weight: 600;
    font-size: 13px;
    border-right: 1px solid #ced4da;
    white-space: nowrap;
}
.rupiah-field-input {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    flex: 1;
    text-align: right;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.rupiah-field-input:focus {
    outline: none;
    box-shadow: none !important;
}

.held-orders-card { margin-bottom: 16px; }
.held-order-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}
.held-order-row:last-child { border-bottom: none; }
.held-order-info { min-width: 140px; flex: 1; }
.held-order-meta { font-size: 12px; color: #888; margin-top: 2px; }
.held-order-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.cart-customer { padding: 10px 18px 0; }
.cart-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

.discount-type-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 6px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    overflow: hidden;
}
.discount-type-tab {
    flex: 1;
    padding: 6px 8px;
    border: none;
    background: #f8f9fa;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    color: #555;
}
.discount-type-tab + .discount-type-tab { border-left: 1px solid #ced4da; }
.discount-type-tab.active {
    background: var(--primary);
    color: #fff;
}

.cash-balance-card {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 55%, #2dd4bf 100%);
    color: #fff;
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: 16px;
    box-shadow: 0 8px 20px rgba(13, 148, 136, 0.25);
}
.cash-balance-label { font-size: 13px; opacity: 0.9; }
.cash-balance-value { font-size: 32px; font-weight: 800; letter-spacing: 0.02em; margin: 4px 0; }
.cash-balance-meta { font-size: 12px; opacity: 0.85; }
