/* =========================================================
   SMART BUSINESS PANEL - MASTER STYLESHEET (DRIBBBLE EDITION)
   Theme: Minimalist Light SaaS / Premium Clean Palette
   Updated: GT Eesti Font Integrated & WP Admin Bar Permanently Hidden
   ========================================================= */

/* --- 1. PREMIUM FONT INTEGRATION --- */
@font-face {
    font-family: 'GT Eesti Text';
    src: url('../fonts/GT-Eesti-Text-Light-Trial.otf') format('opentype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

:root {
    /* --- COLOR PALETTE --- */
    --sb-bg-dark: #eef1f4;       /* Soft Ash Light Background */
    --sb-panel-bg: #ffffff;      /* Pure White for Inner Canvas */
    --sb-border: #e2e8f0;        
    
    /* --- TEXT COLORS --- */
    --sb-text-main: #1a1d20;     /* Deep Charcoal */
    --sb-text-muted: #8a94a6;    /* Light Slate for Muted Texts */
    
    /* --- BRAND COLORS --- */
    --sb-brand: #000000;         /* Minimalist Black Accent */
    --sb-brand-bg-active: #f4f5f7;/* Active item background */
    --sb-success: #2ec4b6;       
    --sb-danger: #e71d36;        

    --font-sm: 13px;
    --font-md: 14px;
}

/* --- 2. GLOBAL RESET & DRIBBBLE CANVAS --- */
body {
    background-color: var(--sb-bg-dark) !important;
    color: var(--sb-text-main);
    font-family: 'GT Eesti Text', 'Inter', system-ui, -apple-system, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    margin: 0; padding: 0;
    overflow-x: hidden;
}

/* WordPress Admin Bar එක සහ ඉහළ අනවශ්‍ය පරතරයන් මුළුමනින්ම ඉවත් කිරීම */
#wpadminbar {
    display: none !important;
}
html, body, html body {
    margin-top: 0px !important;
    padding-top: 0px !important;
}

.sb-dashboard-wrapper {
    display: flex;
    height: 100vh;
    background: var(--sb-bg-dark);
    padding: 20px; /* Gives the floating effect */
    box-sizing: border-box;
    gap: 25px;
}

/* Input, Buttons සහ අනෙකුත් Elements වල Font එකද වෙනස් කිරීම */
input, button, select, textarea {
    font-family: 'GT Eesti Text', sans-serif !important;
}

/* =========================================================
   3. MINIMALIST SIDEBAR STYLE (SEAMLESS ACCORDION)
   ========================================================= */
.sb-sidebar {
    width: 260px;
    background: transparent; /* Seamless blending with background */
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 400;
}

.sb-sidebar-top {
    padding: 10px 15px 25px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sb-sidebar-logo img {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    object-fit: cover;
}

.sb-sidebar-logo span {
    font-size: 16px;
    font-weight: 700;
    color: var(--sb-text-main);
    letter-spacing: -0.02em;
}

/* Custom Profile Switcher Seamless */
.sb-custom-dropdown {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.sb-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sb-dropdown-trigger:hover {
    background: rgba(255, 255, 255, 0.8);
}

.user-info-flex { display: flex; align-items: center; gap: 12px; }
.user-info-flex img { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; }
.user-text-top { display: flex; flex-direction: column; }
.u-name-t { font-weight: 700; font-size: var(--font-md); color: var(--sb-text-main); }
.u-st-t { font-size: 11px; color: var(--sb-text-muted); font-weight: 500; }

.sb-dropdown-menu {
    position: absolute; top: calc(100% + 5px); left: 0; right: 0;
    background: var(--sb-panel-bg); border: 1px solid var(--sb-border);
    border-radius: 16px; padding: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    opacity: 0; visibility: hidden; transform: translateY(-5px);
    transition: all 0.2s ease; z-index: 1050; max-height: 250px; overflow-y: auto;
}
.sb-custom-dropdown.open .sb-dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }

.sb-dropdown-item {
    padding: 10px 12px; border-radius: 10px; color: var(--sb-text-main);
    font-size: var(--font-sm); font-weight: 600; cursor: pointer; transition: 0.2s;
    display: flex; align-items: center; gap: 10px; margin-bottom: 2px;
}
.sb-dropdown-item i { color: var(--sb-text-muted); font-size: 14px; }
.sb-dropdown-item:hover { background: var(--sb-bg-dark); }
.sb-dropdown-item.active { background: var(--sb-text-main); color: #ffffff; }
.sb-dropdown-item.active i { color: #ffffff; }

/* Sidebar Scrollable Navigation */
.sb-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0;
    overflow-y: auto;
    flex: 1;
    padding-bottom: 20px; /* Space at bottom */
}

/* Scrollbar hiding for clean minimal look */
.sb-sidebar-nav::-webkit-scrollbar { width: 4px; }
.sb-sidebar-nav::-webkit-scrollbar-thumb { background: transparent; border-radius: 10px; }
.sb-sidebar-nav:hover::-webkit-scrollbar-thumb { background: #cbd5e1; }

/* Main Navigation Item Trigger */
.sb-nav-item-trigger {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; color: var(--sb-text-muted);
    text-decoration: none; font-size: var(--font-md); font-weight: 600;
    border-radius: 12px; cursor: pointer; transition: all 0.2s ease;
}

.sb-nav-item-trigger .item-link-left { display: flex; align-items: center; gap: 12px; }
.sb-nav-item-trigger i { font-size: 1.1rem; width: 20px; text-align: center; }
.sb-nav-item-trigger .sb-arrow { font-size: 0.75rem; transition: transform 0.2s ease; width: auto; }

.sb-nav-item-trigger:hover { color: var(--sb-text-main); background: rgba(0, 0, 0, 0.03); }

/* Active State for Parent Item */
.sb-nav-item-container.open .sb-nav-item-trigger { color: var(--sb-text-main); }
.sb-nav-item-container.open .sb-arrow { transform: rotate(180deg); }
.sb-nav-item-trigger.active-home { color: var(--sb-text-main); background: #ffffff; box-shadow: 0 4px 12px rgba(0,0,0,0.03); }

/* Submenu Wrapper with Tree Structure */
.sb-sub-menu {
    max-height: 0; overflow: hidden; transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding-left: 24px; position: relative; display: flex; flex-direction: column;
}

/* Vertical Tree Line */
.sb-sub-menu::before {
    content: ''; position: absolute; left: 24px; top: 0; bottom: 15px; width: 1.5px; background: #d1d5db;
}
.sb-nav-item-container.open .sb-sub-menu { max-height: 500px; }

/* Submenu Individual Tabs */
.sb-sub-tab {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px 10px 24px; color: var(--sb-text-muted);
    font-size: var(--font-sm); font-weight: 600; text-decoration: none;
    border-radius: 10px; margin-top: 2px; position: relative; cursor: pointer; transition: all 0.2s ease;
}

/* Horizontal Tree Line Branch */
.sb-sub-tab::before {
    content: ''; position: absolute; left: 0; top: 50%; width: 12px; height: 1.5px; background: #d1d5db;
}

.sb-sub-tab:hover { color: var(--sb-text-main); }

/* White Box Rounded Active Look */
.sb-sub-tab.active {
    background: var(--sb-panel-bg) !important;
    color: var(--sb-text-main) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* Scrollable Logout Button */
.sb-logout-btn {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; color: var(--sb-text-muted);
    text-decoration: none; font-size: var(--font-md); font-weight: 600;
    margin-top: 15px; border-radius: 12px; transition: 0.2s;
}
.sb-logout-btn i { font-size: 1.1rem; width: 20px; text-align: center; }
.sb-logout-btn:hover { color: var(--sb-danger); background: rgba(231, 29, 54, 0.05); }

/* Pills indicators */
.sb-pill { padding: 2px 8px; font-size: 11px; font-weight: 700; border-radius: 8px; }
.sb-pill.orange { background: #ffe6dc; color: #ff6b35; }
.sb-pill.green { background: #e1f7ec; color: #00b159; }

/* =========================================================
   4. MAIN CONTENT CANVAS (ROUNDED WHITE BOX DESIGN)
   ========================================================= */
.sb-main-area {
    flex: 1; display: flex; flex-direction: column; min-width: 0; z-index: 1;
}

/* Rounded White Box Outer Framework */
.sb-content-canvas {
    background: var(--sb-panel-bg) !important;
    border-radius: 28px !important; 
    padding: 40px !important;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.02) !important;
    flex: 1; box-sizing: border-box; overflow-y: auto;
}

/* Custom Scrollbar for Main Canvas */
.sb-content-canvas::-webkit-scrollbar { width: 6px; }
.sb-content-canvas::-webkit-scrollbar-thumb { background-color: #e2e8f0; border-radius: 10px; }

/* HEADER COMPLETELY REMOVED */
.sb-app-header { display: none !important; }

/* =========================================================
   5. MOBILE RESPONSIVENESS
   ========================================================= */
.sb-mobile-top-bar { display: none; }

@media (max-width: 991px) {
    html, body, html body { margin-top: 0px !important; padding-top: 0px !important; }
    .sb-dashboard-wrapper { padding: 0; gap: 0; flex-direction: column; height: 100vh; overflow: hidden; }
    
    .sb-mobile-top-bar {
        display: flex; justify-content: space-between; align-items: center;
        background: var(--sb-bg-dark); padding: 15px 20px; z-index: 1001;
        border-bottom: 1px solid var(--sb-border);
    }
    .sb-mobile-top-bar img { height: 25px; }
    .sb-mobile-toggle { background: transparent; border: none; font-size: 1.5rem; color: var(--sb-text-main); }

    .sb-sidebar {
        position: fixed; top: 60px; left: -100%; bottom: 0; width: 280px;
        background: var(--sb-bg-dark); padding: 20px; z-index: 1005;
        transition: left 0.3s ease; box-shadow: 5px 0 20px rgba(0,0,0,0.05);
    }
    .sb-sidebar.mobile-open { left: 0; }
    
    .sb-main-area { padding: 15px; height: calc(100vh - 60px); }
    .sb-content-canvas { padding: 20px !important; border-radius: 20px !important; }
}

/* Modals Overlay Update */
.sbp-modal-overlay, .modern-modal-overlay, .ssd-form-drawer {
    position: fixed; inset: 0; background: rgba(15, 23, 42, 0.4) !important; 
    backdrop-filter: blur(8px) !important; z-index: 2000 !important; 
    display: none; align-items: center; justify-content: center;
}
.sb-sidebar-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.3); backdrop-filter: blur(2px);
    z-index: 1000; opacity: 0; visibility: hidden; transition: 0.3s;
}
.sb-sidebar-overlay.active { opacity: 1; visibility: visible; }