/* ========================================
   BNTM FRONTEND CSS - Mobile-First Design
   Version: 2.0
======================================== */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ── CSS Variables ── */
:root {
    --bntm-sidebar-width: 260px;
    --bntm-sidebar-collapsed: 64px;
    --bntm-topbar-height: 56px;
    --bntm-radius: 10px;
    --bntm-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --bntm-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --bntm-transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --bntm-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset ── */
html {
    margin-top: 0 !important;
    font-family: var(--bntm-font);
    font-size: 16px;
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body {
    margin: 0 !important;
    padding: 0 !important;
    background: #f1f5f9;
    color: #1e293b;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ========================================
   TOPBAR
======================================== */

.bntm-topbar {
    background: var(--bntm-primary);
    color: white;
    height: var(--bntm-topbar-height);
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

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

/* Hamburger (mobile sidebar toggle) */
.bntm-sidebar-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background var(--bntm-transition);
    margin-right: 4px;
}

.bntm-sidebar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: rgba(255,255,255,0.9);
    border-radius: 2px;
    transition: all var(--bntm-transition);
}

.bntm-sidebar-toggle:hover {
    background: rgba(255,255,255,0.12);
}

.bntm-sidebar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.bntm-sidebar-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.bntm-sidebar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.bntm-topbar-logo {
    width: 30px;
    object-fit: contain;
}

.bntm-topbar-title {
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.3px;
    white-space: nowrap;
}

.bntm-topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bntm-user-name {
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    display: none;
    font-weight: 500;
}

.bntm-settings-btn {
    padding: 6px 14px;
    background: rgba(255,255,255,0.12);
    color: white;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--bntm-transition);
    display: none;
}

.bntm-settings-btn:hover {
    background: rgba(255,255,255,0.22);
}

.bntm-logout-btn {
    padding: 6px 14px;
    background: rgba(239,68,68,0.85);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background var(--bntm-transition);
    font-family: var(--bntm-font);
}

.bntm-logout-btn:hover {
    background: #dc2626;
}

/* User Avatar Circle */
.bntm-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    border: 2px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
    cursor: pointer;
}

/* Mobile user menu dropdown */
.bntm-user-menu {
    position: relative;
}

.bntm-user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    min-width: 200px;
    overflow: hidden;
    z-index: 1000;
    animation: dropdownIn 0.18s ease;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.bntm-user-dropdown.open {
    display: block;
}

.bntm-dropdown-header {
    padding: 14px 16px 10px;
    border-bottom: 1px solid #f1f5f9;
}

.bntm-dropdown-name {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.bntm-dropdown-role {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

.bntm-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
    font-family: var(--bntm-font);
}

.bntm-dropdown-item:hover {
    background: #f8fafc;
    color: #1e293b;
}

.bntm-dropdown-item.danger {
    color: #ef4444;
}

.bntm-dropdown-item.danger:hover {
    background: #fef2f2;
}

/* ========================================
   LAYOUT SHELL (sidebar + main)
======================================== */

.bntm-layout {
    display: flex;
    min-height: calc(100vh - var(--bntm-topbar-height));
    position: relative;
}

/* ========================================
   SIDEBAR
======================================== */

.bntm-sidebar {
    width: var(--bntm-sidebar-width);
    background: white;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--bntm-topbar-height);
    left: 0;
    height: calc(100vh - var(--bntm-topbar-height));
    z-index: 150;
    transition: transform var(--bntm-transition), width var(--bntm-transition);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #e2e8f0 transparent;
}

.bntm-sidebar::-webkit-scrollbar {
    width: 4px;
}

.bntm-sidebar::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 4px;
}

/* Sidebar Nav */
.bntm-sidebar-nav {
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.bntm-nav-section-label {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 12px 12px 4px;
    white-space: nowrap;
    overflow: hidden;
}

.bntm-sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
}

.bntm-sidebar-link:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.bntm-sidebar-link.active {
    background: #eff6ff;
    color: var(--bntm-primary);
    font-weight: 600;
}

.bntm-sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 3px;
    background: var(--bntm-primary);
    border-radius: 0 3px 3px 0;
}

.bntm-sidebar-link svg {
    min-width: 20px;
    flex-shrink: 0;
}

.bntm-sidebar-label {
    transition: opacity var(--bntm-transition);
    overflow: hidden;
    white-space: nowrap;
}

/* Collapsed sidebar (desktop) */
.bntm-sidebar.collapsed {
    width: var(--bntm-sidebar-collapsed);
}

.bntm-sidebar.collapsed .bntm-sidebar-label,
.bntm-sidebar.collapsed .bntm-nav-section-label {
    opacity: 0;
    pointer-events: none;
    width: 0;
}

.bntm-sidebar.collapsed .bntm-sidebar-link {
    justify-content: center;
    padding: 10px;
}

.bntm-sidebar.collapsed .bntm-sidebar-link.active::before {
    display: none;
}

/* Mobile: sidebar hidden off-screen by default */
@media (max-width: 768px) {
    .bntm-sidebar {
        transform: translateX(-100%);
        width: var(--bntm-sidebar-width);
        box-shadow: none;
    }

    .bntm-sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.12);
    }
}

/* Desktop: sidebar always visible */
@media (min-width: 769px) {
    .bntm-sidebar {
        transform: translateX(0) !important;
    }
}

/* Sidebar overlay (mobile) */
.bntm-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.4);
    z-index: 140;
    backdrop-filter: blur(2px);
    animation: overlayIn 0.2s ease;
}

@keyframes overlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.bntm-sidebar-overlay.active {
    display: block;
}

/* ========================================
   MAIN CONTENT AREA
======================================== */

.bntm-main {
    flex: 1;
    min-width: 0;
    transition: margin-left var(--bntm-transition);
    margin-left: var(--bntm-sidebar-width);
}

.bntm-main.sidebar-collapsed {
    margin-left: var(--bntm-sidebar-collapsed);
}

@media (max-width: 768px) {
    .bntm-main {
        margin-left: 0 !important;
    }
}

/* ========================================
   CONTAINER
======================================== */

.bntm-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px;
}

@media (max-width: 768px) {
    .bntm-container {
        padding: 16px 14px;
    }
}

@media (max-width: 480px) {
    .bntm-container {
        padding: 12px 10px;
    }
}

/* ========================================
   PAGE HEADER
======================================== */

.bntm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e2e8f0;
    gap: 12px;
    flex-wrap: wrap;
}

.bntm-header h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.bntm-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    transition: all 0.15s;
    white-space: nowrap;
}

.bntm-back-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

@media (max-width: 480px) {
    .bntm-header h1 {
        font-size: 21px;
    }
    .bntm-back-btn {
        font-size: 12px;
        padding: 7px 12px;
    }
}

/* ========================================
   CONTENT CARD
======================================== */

.bntm-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--bntm-shadow);
    box-sizing: border-box;
    width: 100%;
}

@media (max-width: 768px) {
    .bntm-content {
        padding: 16px;
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    .bntm-content {
        padding: 12px;
        border-radius: 8px;
    }
}

/* ========================================
   BUTTONS
======================================== */

.bntm-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    background: var(--bntm-primary);
    color: #fff !important;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s;
    border: none;
    cursor: pointer;
    font-family: var(--bntm-font);
    white-space: nowrap;
}

.bntm-btn:hover {
    background: var(--bntm-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

.bntm-btn:active {
    transform: translateY(0);
}

.bntm-btn-primary {
    background: var(--bntm-primary);
    color: white;
    padding: 9px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.15s;
    font-family: var(--bntm-font);
}

.bntm-btn-primary:hover {
    background: var(--bntm-primary-hover);
}

.bntm-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    padding: 9px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.15s;
    font-family: var(--bntm-font);
}

.bntm-btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.bntm-btn-small {
    padding: 5px 12px;
    font-size: 12px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s;
    font-family: var(--bntm-font);
}

.bntm-btn-small:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.bntm-btn-danger {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.bntm-btn-danger:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

/* ========================================
   TABS (horizontal, for modules that use them)
======================================== */

.bntm-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0;
}

.bntm-tabs::-webkit-scrollbar {
    display: none;
}

.bntm-tab {
    padding: 10px 18px;
    text-decoration: none;
    color: #64748b;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bntm-tab:hover {
    color: var(--bntm-primary);
}

.bntm-tab.active {
    color: var(--bntm-primary);
    border-bottom-color: var(--bntm-primary);
    font-weight: 600;
}

/* ========================================
   FORMS
======================================== */

.bntm-form {
    width: 100%;
}

.bntm-form-group {
    margin-bottom: 18px;
    width: 100%;
}

.bntm-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: #374151;
}

.bntm-form-group input,
.bntm-form-group select,
.bntm-form-group textarea {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--bntm-font);
    color: #1e293b;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: white;
    -webkit-appearance: none;
}

.bntm-form-group input:focus,
.bntm-form-group select:focus,
.bntm-form-group textarea:focus {
    outline: none;
    border-color: var(--bntm-primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

.bntm-form-group input[type="color"] {
    width: 56px;
    height: 38px;
    padding: 2px 4px;
    cursor: pointer;
    border-radius: 6px;
}

.bntm-form-group textarea {
    resize: vertical;
    min-height: 90px;
}

.bntm-form-group small {
    display: block;
    margin-top: 4px;
    color: #94a3b8;
    font-size: 12px;
}

.bntm-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

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

.bntm-form-section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    margin-bottom: 18px;
}

.bntm-form-section h3 {
    margin: 0 0 16px;
    font-size: 16px;
    color: #1e293b;
    font-weight: 700;
}

/* ========================================
   TABLES
======================================== */

.bntm-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
}

.bntm-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
    overflow-x: auto;
}

.bntm-table th,
.bntm-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.bntm-table th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.bntm-table tbody tr:hover {
    background: #f8fafc;
}

.bntm-table tbody tr:last-child td {
    border-bottom: none;
}

/* ========================================
   NOTICES
======================================== */

.bntm-notice {
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 14px;
    font-size: 14px;
    font-weight: 500;
}

.bntm-notice-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.bntm-notice-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.bntm-notice-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ========================================
   STATS CARDS
======================================== */

.bntm-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.bntm-stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--bntm-shadow);
    display: flex;
    gap: 14px;
    align-items: flex-start;
    border: 1px solid #f1f5f9;
    transition: box-shadow 0.2s, transform 0.2s;
}

.bntm-stat-card:hover {
    box-shadow: var(--bntm-shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-content h3 {
    margin: 0 0 6px;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.stat-number {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1;
    letter-spacing: -0.5px;
}

@media (max-width: 480px) {
    .bntm-stats-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .stat-number {
        font-size: 22px;
    }
    .bntm-stat-card {
        padding: 14px;
        gap: 10px;
    }
    .stat-icon {
        width: 36px;
        height: 50px;
    }
    
    .bntm-table {
        overflow-y:scroll;
    }
}

/* ========================================
   DASHBOARD GRID (module cards)
======================================== */

.bntm-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.bntm-module-card {
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 22px 16px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    -webkit-tap-highlight-color: rgba(0,0,0,0.04);
}

.bntm-module-card:hover,
.bntm-module-card:active {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.1);
    border-color: var(--bntm-primary);
}

.bntm-module-icon {
    font-size: 42px;
    line-height: 1;
}

.bntm-module-logo-wrapper {
    position: relative;
    display: inline-block;
    width: 70px;
    height: 70px;
    pointer-events: none;
    flex-shrink: 0;
}

.bntm-module-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    mix-blend-mode: multiply;
    display: block;
}

.bntm-module-logo-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--bntm-primary);
    opacity: 1;
    mix-blend-mode: color;
    transition: opacity 0.3s ease;
}

.bntm-module-card:hover .bntm-module-logo-wrapper::after {
    opacity: 0.75;
}

.bntm-module-card:hover .bntm-module-logo {
    transform: scale(1.06);
}

.bntm-module-card h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
    word-break: break-word;
}

@media (max-width: 768px) {
    .bntm-dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .bntm-module-card {
        padding: 18px 12px;
        min-height: 110px;
        gap: 10px;
    }
    .bntm-module-logo-wrapper {
        width: 56px;
        height: 56px;
    }
    .bntm-module-icon {
        font-size: 36px;
    }
}

@media (max-width: 360px) {
    .bntm-dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .bntm-module-card {
        padding: 14px 8px;
        min-height: 95px;
    }
    .bntm-module-logo-wrapper {
        width: 46px;
        height: 46px;
    }
    .bntm-module-card h3 {
        font-size: 12px;
    }
}

/* ========================================
   SIDEBAR MODULE LAYOUT (pawn, PM, etc.)
======================================== */


/* Module inner sidebar — reuse global sidebar styles */
.bntm-module-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: sticky;
    top: calc(var(--bntm-topbar-height) + 24px);
}

.bntm-module-sidebar .bntm-sidebar-link {
    font-size: 13px;
    padding: 9px 11px;
}

.bntm-tab-content {
    flex: 1;
    min-width: 0;
}

@media (max-width: 768px) {

    .bntm-module-sidebar {
        width: 100%;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 8px;
        gap: 4px;
    }
    .bntm-module-sidebar .bntm-sidebar-link {
        flex: 1 1 auto;
        min-width: 0;
        justify-content: center;
        text-align: center;
        font-size: 12px;
        padding: 8px 6px;
        flex-direction: column;
        gap: 4px;
    }
    .bntm-module-sidebar .bntm-sidebar-link svg {
        min-width: 16px;
        width: 16px;
        height: 16px;
    }
    .bntm-module-sidebar .bntm-sidebar-label {
        font-size: 10px;
        white-space: normal;
        text-align: center;
    }
}

/* ========================================
   MODALS
======================================== */

.bntm-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(3px);
}

.bntm-modal.active,
.bntm-modal[style*="flex"] {
    display: flex !important;
}

.bntm-modal-content {
    background: white;
    border-radius: 14px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.bntm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 14px;
    border-bottom: 1px solid #f1f5f9;
}

.bntm-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.bntm-modal-close {
    background: #f1f5f9;
    border: none;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.15s;
    line-height: 1;
}

.bntm-modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.bntm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px 20px;
    border-top: 1px solid #f1f5f9;
    margin-top: 0;
}

@media (max-width: 480px) {
    .bntm-modal-content {
        max-height: 95vh;
        border-radius: 12px;
    }
    .bntm-modal-footer {
        flex-direction: column-reverse;
    }
    .bntm-modal-footer button,
    .bntm-modal-footer a {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

/* ========================================
   LOADING SCREEN (kept compatible)
======================================== */

.bntm-loading-overlay {
    position: fixed;
    inset: 0;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 1;
    transition: opacity 0.35s ease;
    pointer-events: all;
}

.bntm-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.bntm-loading-content {
    text-align: center;
}

.bntm-loading-logo {
    max-width: 120px;
    max-height: 120px;
    width: auto;
    height: auto;
    margin-bottom: 18px;
}

.bntm-loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f1f5f9;
    border-top: 3px solid var(--bntm-primary, #3b82f6);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin: 0 auto;
}

.bntm-loading-text {
    margin-top: 14px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   MODULE PLACEHOLDER
======================================== */

.bntm-module-placeholder {
    padding: 40px;
    text-align: center;
    color: #94a3b8;
    font-size: 15px;
}

/* ========================================
   UTILITY
======================================== */

.bntm-flex { display: flex; }
.bntm-gap-2 { gap: 8px; }
.bntm-gap-3 { gap: 12px; }
.bntm-mt-2 { margin-top: 8px; }
.bntm-mt-4 { margin-top: 16px; }
.bntm-mb-4 { margin-bottom: 16px; }
.bntm-text-sm { font-size: 13px; }
.bntm-text-muted { color: #94a3b8; }
.bntm-fw-600 { font-weight: 600; }
.bntm-w-full { width: 100%; }