/* ===== Books page: card list ===== */

.bk-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.bk-stat {
    padding: 12px 8px;
    text-align: center;
    background: #ffffff;
    border: 1px solid #e3ebe6;
    border-radius: 12px;
}

.bk-stat b {
    display: block;
    font-size: 20px;
    color: #1b2a22;
}

.bk-stat span {
    font-size: 11px;
    color: #667a6f;
    white-space: nowrap;
}

.bk-stat.bk-stat-warn b {
    color: #b4232f;
}

/* Search + filter chips: stay visible while scrolling */

.bk-sticky {
    position: sticky;
    top: var(--mobile-header-h, 0px);
    z-index: 50;
    padding: 8px 0 10px;
    background: #f4f7f5;
}

.bk-sticky input[type="search"] {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    margin-bottom: 10px;
    border: 1px solid #d8e1db;
    border-radius: 12px;
    background: #ffffff;
    color: #1b2a22;
    font: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.bk-sticky input[type="search"]:focus {
    outline: none;
    border-color: #258458;
    box-shadow: 0 0 0 3px rgba(37, 132, 88, 0.12);
}

.bk-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.bk-chips::-webkit-scrollbar {
    display: none;
}

.bk-chip {
    flex: none;
    padding: 8px 14px;
    border: 1px solid #d8e1db;
    border-radius: 999px;
    background: #ffffff;
    color: #1b2a22;
    font: inherit;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}

.bk-chip.on {
    background: #176b45;
    border-color: #176b45;
    color: #ffffff;
}

.bk-count {
    margin: 4px 2px 10px;
    font-size: 12px;
    color: #667a6f;
}

/* Cards */

.bk-list {
    display: grid;
    gap: 10px;
}

.bk-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e3ebe6;
    border-radius: 14px;
}

.bk-side {
    flex: none;
    width: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.bk-cover {
    width: 46px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
}

.bk-code {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 600;
    color: #667a6f;
}

.bk-body {
    flex: 1;
    min-width: 0;
}

.bk-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6px;
}

.bk-title {
    padding: 0;
    border: 0;
    background: none;
    color: #1b2a22;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.bk-meta {
    margin: 3px 0 8px;
    font-size: 12px;
    color: #667a6f;
}

.bk-price-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
}

.bk-sale {
    font-size: 15px;
    font-weight: 700;
    color: #1b2a22;
}

.bk-buy {
    font-size: 12px;
    color: #667a6f;
}

.bk-badge {
    margin-left: auto;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.bk-ok {
    background: #e6f4ec;
    color: #176b45;
}

.bk-low {
    background: #fff3dd;
    color: #a8600a;
}

.bk-out {
    background: #fdeaea;
    color: #b4232f;
}

/* Share + 3-dots menu */

.bk-actions {
    display: flex;
    flex: none;
    align-items: center;
    gap: 2px;
}

.bk-menu-wrap {
    position: relative;
    flex: none;
}

.bk-dots {
    width: 32px;
    height: 32px;
    margin: -4px -6px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #55685d;
    cursor: pointer;
}

.bk-share {
    margin-right: 0;
}

.bk-dots:hover {
    background: #eef3ef;
}

.bk-menu {
    position: absolute;
    top: 30px;
    right: 0;
    z-index: 60;
    min-width: 130px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #d8e1db;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(16, 60, 40, 0.18);
}

.bk-menu[hidden] {
    display: none;
}

.bk-menu button {
    display: block;
    width: 100%;
    padding: 11px 14px;
    border: 0;
    border-bottom: 1px solid #eef2ef;
    background: #ffffff;
    color: #1b2a22;
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.bk-menu button:last-child {
    border-bottom: 0;
}

.bk-menu button:hover {
    background: #eef6f1;
}

.bk-menu .bk-menu-delete {
    color: #b4232f;
}

.bk-empty {
    padding: 24px 12px;
    text-align: center;
    color: #667a6f;
}

/* Floating + button */

.bk-fab {
    position: fixed;
    right: 18px;
    bottom: 28px;
    z-index: 80;
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #176b45;
    color: #ffffff;
    font-size: 32px;
    line-height: 1;
    box-shadow: 0 6px 18px rgba(23, 107, 69, 0.4);
    cursor: pointer;
}

.bk-fab:hover {
    background: #105638;
}

@media (max-width: 768px) {
    /* bottom navigation ke upar */
    .bk-fab {
        bottom: calc(86px + env(safe-area-inset-bottom, 0px));
    }
}

@media (min-width: 769px) {
    .bk-list {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    }
}

/* ===== Product type filter row (only shown when there is more than one type) ===== */

.bk-type-chips {
    margin-top: 8px;
}

.bk-type-chips[hidden] {
    display: none;
}

.bk-type-chips .bk-chip {
    padding: 6px 12px;
    font-size: 12px;
}

.bk-type-chips .bk-chip small {
    margin-left: 5px;
    opacity: 0.7;
}

/* Product type dropdown inside the edit form */

#books-edit-form .edit-book-field select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 11px 13px;
    border: 1px solid #d8e1db;
    border-radius: 8px;
    background: #fbfcfb;
    color: #24372b;
    font: inherit;
    font-size: 14px;
}

#books-edit-form .edit-book-field select:focus {
    outline: none;
    border-color: #258458;
    box-shadow: 0 0 0 3px rgba(37, 132, 88, 0.11);
    background: #ffffff;
}

/* ===== Product type picture (replaces the old coloured initials box) ===== */

.bk-cover svg {
    width: 28px;
    height: 28px;
}

/* ===== Laptop: table instead of cards ===== */

@media (min-width: 900px) {
    .bk-list.bk-list-table {
        display: block;
    }
}

.bk-table-wrap {
    overflow-x: auto;
    background: #ffffff;
    border: 1px solid #e3ebe6;
    border-radius: 14px;
}

.bk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.bk-table th {
    padding: 12px 10px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #667a6f;
    background: #f6f9f7;
    border-bottom: 1px solid #e3ebe6;
    white-space: nowrap;
}

.bk-table td {
    padding: 10px 10px;
    vertical-align: middle;
    color: #1b2a22;
    border-bottom: 1px solid #eef3f0;
}

.bk-table tbody tr {
    cursor: pointer;
}

.bk-table tbody tr:hover {
    background: #f4faf6;
}

.bk-table tbody tr:last-child td {
    border-bottom: 0;
}

.bk-col-num {
    text-align: right !important;
    white-space: nowrap;
}

.bk-col-act {
    text-align: right !important;
    white-space: nowrap;
}

.bk-muted {
    color: #667a6f !important;
}

.bk-col-details {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #4d6157 !important;
}

.bk-item-box {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 170px;
}

.bk-row-icon {
    flex: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #ffffff;
}

.bk-row-icon svg {
    width: 22px;
    height: 22px;
}

.bk-item-name {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.bk-item-name b {
    font-size: 15px;
    line-height: 1.35;
}

.bk-item-name small {
    font-size: 12px;
    color: #667a6f;
}

.bk-where {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #667a6f;
}

.bk-row-btn {
    margin-left: 4px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 600;
    color: #176b45;
    background: #ffffff;
    border: 1px solid #cfe0d6;
    border-radius: 8px;
    cursor: pointer;
}

.bk-row-btn:hover {
    background: #eaf5ee;
}

.bk-row-btn.bk-row-delete {
    color: #b4232f;
    border-color: #f0cfd2;
}

.bk-row-btn.bk-row-delete:hover {
    background: #fdecee;
}

.bk-list.bk-list-table {
    padding-bottom: 80px; /* room for the + button */
}
