/* ============================================================
   WHMCS Six — SaaS Sidebar Layout Theme
   Base: Bootstrap 3 (all.min.css)
   ============================================================ */

/* ── Variables ─────────────────────────────────────────── */
:root {
    --primary:       #3b82f6;
    --primary-h:     #2563eb;
    --primary-bg:    #eff6ff;
    --primary-dark:  #1e40af;
    --bg:            #f1f5f9;
    --surface:       #ffffff;
    --border:        #e2e8f0;
    --text:          #1e293b;
    --text-2:        #64748b;
    --text-3:        #94a3b8;
    --green:         #22c55e;
    --yellow:        #f59e0b;
    --red:           #ef4444;
    --purple:        #8b5cf6;
    --sidebar-bg:    #0f172a;
    --sidebar-w:     256px;
    --topbar-h:      58px;
    --sh-xs: 0 1px 2px rgba(0,0,0,.06);
    --sh-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px -1px rgba(0,0,0,.06);
    --sh-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.06);
    --sh-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.06);
    --r:     8px;
    --r-lg:  12px;
    --tr:    all .18s ease;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    margin: 0; padding: 0;
    overflow-x: hidden;
}
a             { color: var(--primary); text-decoration: none; }
a:hover       { color: var(--primary-h); text-decoration: none; }
h1,h2,h3,h4,h5,h6 { font-family: inherit; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-wrap {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   LEFT SIDEBAR
   ============================================================ */
.app-sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0; left: 0;
    z-index: 1050;
    transition: transform .25s ease;
    overflow: hidden;
    border-right: 1px solid rgba(255,255,255,.04);
}

/* Sidebar Head */
.app-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    height: var(--topbar-h);
    border-bottom: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
}
.app-sidebar-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 8px;
    min-width: 0;
}
.app-sidebar-logo img { max-height: 28px; }
.app-sidebar-logo-text {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app-sidebar-logo:hover .app-sidebar-logo-text { color: #93c5fd; }
.app-sidebar-close {
    display: none;
    background: none;
    border: none;
    color: rgba(255,255,255,.4);
    font-size: 14px;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--r);
    flex-shrink: 0;
    line-height: 1;
}
.app-sidebar-close:hover { color: #fff; background: rgba(255,255,255,.1); }

/* Sidebar Nav */
.app-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0 16px;
}
.app-sidebar-nav::-webkit-scrollbar { width: 3px; }
.app-sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); }

.app-nav-list {
    list-style: none;
    margin: 0;
    padding: 0 10px;
}

/* Divider between primary/secondary navbars */
.app-nav-list .divider,
.app-nav-list li.divider {
    height: 1px;
    background: rgba(255,255,255,.07);
    margin: 6px 4px;
    list-style: none;
}

/* Nav items */
.app-nav-list > li > a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    font-size: 13.5px;
    font-weight: 500;
    color: rgba(255,255,255,.62);
    border-radius: var(--r);
    transition: var(--tr);
    text-decoration: none;
    position: relative;
    user-select: none;
}
.app-nav-list > li > a i {
    width: 18px; text-align: center;
    font-size: 14px; flex-shrink: 0;
    opacity: .8;
}
.app-nav-list > li > a .caret {
    margin-left: auto;
    opacity: .4;
    transition: transform .22s ease;
    flex-shrink: 0;
}
.app-nav-list > li > a .badge {
    margin-left: auto;
    background: rgba(59,130,246,.8);
    color: #fff;
    font-size: 10px;
    padding: 1px 7px;
    border-radius: 99px;
}

.app-nav-list > li > a:hover {
    color: #ffffff;
    background: rgba(255,255,255,.08);
    text-decoration: none;
}
.app-nav-list > li > a:hover i { opacity: 1; }

/* Active item */
.app-nav-list > li.active > a {
    background: rgba(59,130,246,.2) !important;
    color: #93c5fd !important;
    font-weight: 600;
}
.app-nav-list > li.active > a i { color: #93c5fd; opacity: 1; }
.app-nav-list > li.active > a::before {
    content: '';
    position: absolute;
    left: 0; top: 25%; bottom: 25%;
    width: 3px;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
    margin-left: -10px;
}

/* Open dropdown parent */
.app-nav-list > li.dropdown.open > a {
    color: #fff;
    background: rgba(255,255,255,.08);
}
.app-nav-list > li.dropdown.open > a .caret { transform: rotate(180deg); opacity: .7; }

/* Dropdown submenu (accordion) */
.app-nav-list .dropdown-menu {
    position: static !important;
    float: none !important;
    display: none;
    background: rgba(0,0,0,.18) !important;
    border: none !important;
    border-radius: var(--r) !important;
    box-shadow: none !important;
    padding: 4px 0 4px 16px;
    margin: 2px 0 4px;
    animation: slideDown .18s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.app-nav-list li.open > .dropdown-menu { display: block; }

.app-nav-list .dropdown-menu > li > a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    font-size: 13px;
    color: rgba(255,255,255,.55);
    border-radius: var(--r);
    transition: var(--tr);
    text-decoration: none;
}
.app-nav-list .dropdown-menu > li > a::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,.3);
    flex-shrink: 0;
}
.app-nav-list .dropdown-menu > li > a:hover {
    color: #fff;
    background: rgba(255,255,255,.08);
}
.app-nav-list .dropdown-menu > li > a:hover::before { background: var(--primary); }
.app-nav-list .dropdown-menu > li.active > a { color: #93c5fd; }
.app-nav-list .dropdown-menu .divider { background: rgba(255,255,255,.07); margin: 4px 0; height: 1px; }

/* Sidebar User Footer */
.app-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid rgba(255,255,255,.07);
    flex-shrink: 0;
    background: rgba(0,0,0,.15);
}
.app-sidebar-user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.app-sidebar-user-info { flex: 1; min-width: 0; }
.app-sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.app-sidebar-user-logout {
    font-size: 11.5px;
    color: rgba(255,255,255,.38);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--tr);
    margin-top: 2px;
}
.app-sidebar-user-logout:hover { color: #fca5a5; text-decoration: none; }
.app-sidebar-user-logout i { font-size: 10px; }

/* Mobile overlay */
.app-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1040;
    opacity: 0;
    transition: opacity .25s;
}
.app-overlay.is-visible { display: block; opacity: 1; }

/* ============================================================
   MAIN AREA
   ============================================================ */
.app-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    background: var(--bg);
}

/* ============================================================
   TOP BAR
   ============================================================ */
.app-topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--sh-xs);
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-shrink: 0;
}
.app-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 22px;
    gap: 12px;
}
.app-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.app-topbar-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--r);
    width: 34px; height: 34px;
    align-items: center;
    justify-content: center;
    color: var(--text-2);
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--tr);
    font-size: 14px;
}
.app-topbar-toggle:hover { background: var(--bg); color: var(--text); border-color: var(--primary); }
.app-topbar-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 0 16px !important;
    font-size: 12.5px;
    color: var(--text-3);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    list-style: none;
}
.breadcrumb > li + li::before { content: "/"; padding: 0 4px; color: var(--text-3); }
.breadcrumb > li a { color: var(--text-2); transition: var(--tr); }
.breadcrumb > li a:hover { color: var(--primary); }
.breadcrumb > li.active { color: var(--text-3); }

.app-topbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.topbar-item { position: relative; }

.topbar-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 9px;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--r);
    transition: var(--tr);
    text-decoration: none;
}
.topbar-btn:hover { color: var(--text); background: var(--bg); text-decoration: none; }
.topbar-icon { width: 34px; height: 34px; padding: 0; justify-content: center; }
.topbar-icon i { font-size: 15px; }
.topbar-btn-label { font-size: 12.5px; }

.topbar-notif-dot {
    position: absolute;
    top: 5px; right: 5px;
    width: 8px; height: 8px;
    background: var(--red);
    border-radius: 50%;
    border: 2px solid var(--surface);
}

/* User trigger (topbar) */
.topbar-user-trigger {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 3px 10px 3px 3px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 99px;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    transition: var(--tr);
    cursor: pointer;
    white-space: nowrap;
}
.topbar-user-trigger:hover { border-color: var(--primary); background: var(--surface); color: var(--text); text-decoration: none; }
.topbar-user-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.topbar-user-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
.topbar-user-trigger .caret { opacity: .5; }

/* Topbar dropdowns */
.topbar-user-menu,
.topbar-item .dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 190px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-lg);
    padding: 6px;
    z-index: 1060;
    display: none;
}
.topbar-item.open > .topbar-user-menu,
.topbar-item.open > .dropdown-menu,
.navbar-user-dropdown.open > .topbar-user-menu,
.navbar-user-dropdown.open > .dropdown-menu { display: block; }
.open > .dropdown-menu { display: block; }

.topbar-user-menu li a,
.topbar-item .dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    color: var(--text);
    font-size: 13px;
    border-radius: var(--r);
    transition: var(--tr);
}
.topbar-user-menu li a:hover,
.topbar-item .dropdown-menu li a:hover { background: var(--primary-bg); color: var(--primary); }
.topbar-user-menu .divider,
.topbar-item .dropdown-menu .divider { height: 1px; background: var(--border); margin: 4px 0; }
.dropdown-menu-right { right: 0; left: auto !important; }

/* Admin badge */
.topbar-admin-btn {
    background: #fef3c7 !important;
    border: 1px solid #fcd34d !important;
    color: #92400e !important;
    width: 34px; height: 34px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.topbar-admin-btn:hover { background: #fde68a !important; }

/* ============================================================
   APP CONTENT + FOOTER
   ============================================================ */
.app-content.main-body-wrap {
    flex: 1;
    background: var(--bg);
    padding: 24px 0 48px;
}

/* Container max width */
.app-content .container,
.app-footer .container {
    max-width: 1320px !important;
    width: 100% !important;
}

.app-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 12px 0;
    flex-shrink: 0;
}
.app-footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.app-footer-copy { font-size: 12px; color: var(--text-3); margin: 0; }
.back-to-top {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 99px;
    color: var(--text-2);
    font-size: 11px;
    transition: var(--tr);
}
.back-to-top:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 991px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.is-open { transform: translateX(0); }
    .app-sidebar-close { display: flex !important; align-items: center; justify-content: center; }
    .app-main { margin-left: 0; }
    .app-topbar-toggle { display: flex !important; }
    .topbar-user-name { display: none; }
    body.sidebar-open { overflow: hidden; }
}
@media (max-width: 767px) {
    .app-topbar-title { font-size: 14px; }
    .app-content.main-body-wrap { padding: 16px 0 40px; }
    .main-content.content-card { padding: 16px; border-radius: var(--r); }
    .welcome-banner { padding: 16px 18px; }
    .tiles-grid > .tile { width: 50%; }
    .app-footer-inner { flex-direction: column; gap: 8px; text-align: center; }
}

/* ============================================================
   WHMCS INNER LAYOUT (Primary sidebar + content + secondary sidebar)
   ============================================================ */

/* Base layout row */
.layout-row {
    display: block;
}

/* When primary sidebar exists: sidebar left + content right */
.layout-row.layout-has-sidebar {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}
.layout-sidebar {
    width: 240px;
    flex-shrink: 0;
}
.layout-content {
    flex: 1;
    min-width: 0;
}

/* No sidebar: full width */
.layout-row:not(.layout-has-sidebar) .layout-content {
    width: 100%;
}

/* Secondary sidebar (İŞLEMLER, SORUMLULAR etc.) — below content card */
.layout-secondary-sidebar {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.layout-secondary-sidebar .panel {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0 !important;
}

@media (max-width: 991px) {
    .layout-row.layout-has-sidebar {
        flex-direction: column;
    }
    .layout-sidebar {
        width: 100%;
    }
    .layout-secondary-sidebar {
        flex-direction: column;
        gap: 12px;
    }
    .layout-secondary-sidebar .panel {
        min-width: 100%;
    }
}

/* ============================================================
   CONTENT CARD
   ============================================================ */
.main-content.content-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    padding: 24px;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header-block {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.page-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 2px;
    letter-spacing: -.3px;
}
.page-title-desc { font-size: 13px; color: var(--text-2); margin: 0; }
/* Hide duplicate on dashboard */
body.tpl-clientareahome .main-content.content-card > .page-header-block:first-child { display: none; }

/* ============================================================
   WELCOME BANNER
   ============================================================ */
.welcome-banner {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    border-radius: var(--r-lg);
    padding: 22px 24px;
    margin-bottom: 18px;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.welcome-banner::after {
    content: '';
    position: absolute;
    right: -60px; top: -60px;
    width: 220px; height: 220px;
    background: rgba(255,255,255,.05);
    border-radius: 50%;
    pointer-events: none;
}
.welcome-inner { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.welcome-avatar {
    width: 46px; height: 46px;
    background: rgba(255,255,255,.18);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; font-weight: 700; color: #fff;
    flex-shrink: 0;
}
.welcome-title { font-size: 1.1rem; font-weight: 600; margin: 0; color: #fff; }
.welcome-desc  { font-size: 13px; opacity: .8; margin: 3px 0 0; color: #fff; }

/* ============================================================
   DASHBOARD TILES
   ============================================================ */
.dashboard-tiles-section { margin-bottom: 20px; }
.tiles {
    background: transparent !important;
    padding: 0 !important; margin: 0 !important;
    border: none !important; box-shadow: none !important;
}
.tiles-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px;
}
.tiles-grid > .tile {
    width: 25%; padding: 0 8px 16px;
}
@media (max-width: 768px) { .tiles-grid > .tile { width: 50%; } }
@media (max-width: 400px) { .tiles-grid > .tile { width: 100%; } }

.tiles-grid > .tile > a {
    display: flex;
    flex-direction: column;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--r-lg) !important;
    padding: 20px !important;
    color: var(--text) !important;
    text-decoration: none !important;
    min-height: 130px;
    transition: var(--tr);
    position: relative;
    overflow: hidden;
}
.tiles-grid > .tile > a::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, #60a5fa 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .22s ease;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.tiles-grid > .tile > a:hover {
    transform: translateY(-3px);
    box-shadow: var(--sh-md) !important;
    border-color: #bfdbfe !important;
    text-decoration: none !important;
}
.tiles-grid > .tile > a:hover::after { transform: scaleX(1); }

/* Icon */
.tiles-grid .icon {
    width: 40px !important; height: 40px !important;
    background: var(--primary-bg) !important; color: var(--primary) !important;
    border-radius: var(--r) !important;
    display: inline-flex !important; align-items: center !important; justify-content: center !important;
    font-size: 15px !important; margin-bottom: 16px !important;
    position: static !important; float: none !important;
    transition: var(--tr);
    flex-shrink: 0;
}
.tiles-grid > .tile > a:hover .icon {
    background: var(--primary) !important; color: #fff !important;
    transform: scale(1.05);
}

/* Stat number */
.tiles-grid .stat {
    font-size: 2rem !important; font-weight: 700 !important;
    line-height: 1 !important; color: var(--text) !important;
    margin: auto 0 0 !important; padding: 0 !important;
    letter-spacing: -.04em;
}

/* Label */
.tiles-grid .title {
    font-size: 11px !important; font-weight: 600 !important;
    text-transform: uppercase !important; letter-spacing: .06em !important;
    color: var(--text-3) !important; margin-top: 6px !important;
}
.tiles-grid .highlight { display: none !important; }

/* ============================================================
   KB SEARCH
   ============================================================ */
.home-kb-section { margin-bottom: 18px; }
.home-kb-search {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-sm);
    padding: 12px 16px;
    display: flex; align-items: center; gap: 10px;
}
.home-kb-search i { color: var(--text-3); font-size: 14px; flex-shrink: 0; }
.home-kb-search .form-control {
    border: none !important; box-shadow: none !important;
    padding: 0 !important; height: auto !important;
    font-size: 14px; flex: 1; background: transparent;
}
.home-kb-search .form-control:focus { outline: none; box-shadow: none !important; }

/* ============================================================
   CLIENT HOME PANELS
   ============================================================ */
.client-home-panels .row { margin: 0 -10px; }
.client-home-panels .row > [class*="col-"] { padding: 0 10px; }

/* ============================================================
   SIDEBAR (WHMCS account sidebar — left or secondary column)
   ============================================================ */
.layout-sidebar .panel,
.layout-secondary-sidebar .panel,
.sidebar .panel,
.sidebar .panel.panel-default,
.sidebar .panel.panel-sidebar {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--r-lg) !important;
    box-shadow: var(--sh-sm) !important;
    margin-bottom: 16px; overflow: hidden;
}
.layout-sidebar .panel-heading,
.layout-secondary-sidebar .panel-heading,
.sidebar .panel-heading {
    background: var(--bg) !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 11px 16px !important;
}

.layout-sidebar .panel-title,
.layout-secondary-sidebar .panel-title,
.sidebar .panel-title {
    font-size: 11px !important; font-weight: 700 !important;
    text-transform: uppercase !important; letter-spacing: .06em !important;
    color: var(--text-3) !important; margin: 0 !important;
    display: flex !important; align-items: center !important; gap: 6px !important;
}
.sidebar .panel-title .panel-minimise { margin-left: auto; font-size: 10px; opacity: .6; }

.layout-sidebar .panel-body,
.layout-secondary-sidebar .panel-body,
.sidebar .panel-body { padding: 14px 16px !important; font-size: 13.5px; }

.layout-sidebar .list-group,
.layout-secondary-sidebar .list-group,
.sidebar .list-group { margin: 0 !important; }

.layout-sidebar .list-group-item,
.layout-secondary-sidebar .list-group-item,
.sidebar .list-group-item {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    border-radius: 0 !important;
    padding: 9px 16px !important;
    font-size: 13.5px; color: var(--text-2);
    display: flex !important; align-items: center; gap: 8px;
    transition: var(--tr);
}
.layout-sidebar .list-group-item:last-child,
.layout-secondary-sidebar .list-group-item:last-child,
.sidebar .list-group-item:last-child { border-bottom: none !important; }

.layout-sidebar .list-group-item:hover,
.layout-secondary-sidebar .list-group-item:hover,
.sidebar .list-group-item:hover { background: var(--primary-bg) !important; color: var(--primary) !important; }

.layout-sidebar .list-group-item.active,
.sidebar .list-group-item.active {
    background: var(--primary-bg) !important;
    color: var(--primary) !important; font-weight: 600;
    border-left: 2px solid var(--primary) !important;
}

.layout-sidebar .list-group-item i,
.layout-secondary-sidebar .list-group-item i,
.sidebar .list-group-item i { width: 16px; flex-shrink: 0; }

.layout-sidebar .list-group-item .badge,
.layout-secondary-sidebar .list-group-item .badge,
.sidebar .list-group-item .badge {
    margin-left: auto;
    background: var(--primary) !important; color: #fff;
    font-size: 10px; padding: 1px 7px; border-radius: 99px;
}

.layout-sidebar .panel-footer,
.layout-secondary-sidebar .panel-footer,
.sidebar .panel-footer {
    background: var(--bg) !important;
    border-top: 1px solid var(--border) !important;
    padding: 10px 16px !important;
}
.layout-secondary-sidebar .panel-footer:empty,
.sidebar .panel-footer:empty { display: none !important; }

.layout-sidebar .btn,
.sidebar .btn { display: block; width: 100%; text-align: center; }

/* Disabled items in secondary sidebar (toggle filters) */
.layout-secondary-sidebar .list-group-item.disabled {
    opacity: .5; pointer-events: none;
}

/* ============================================================
   GENERIC PANELS
   ============================================================ */
.panel {
    background: var(--surface);
    border: 1px solid var(--border) !important;
    border-radius: var(--r-lg) !important;
    box-shadow: var(--sh-sm);
    margin-bottom: 20px; overflow: hidden;
}
.panel-heading {
    background: var(--bg) !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 12px 18px !important;
}
.panel-title { font-size: 14px !important; font-weight: 600 !important; margin: 0 !important; color: var(--text); }
.panel-body  { padding: 18px !important; }
.panel-footer { background: var(--bg) !important; border-top: 1px solid var(--border) !important; padding: 11px 18px !important; }
.panel-footer:empty { display: none; }

.panel-primary .panel-heading { background: var(--primary)  !important; color:#fff; border-color: var(--primary)  !important; }
.panel-success .panel-heading { background: var(--green)    !important; color:#fff; border-color: var(--green)    !important; }
.panel-info    .panel-heading { background: #0ea5e9         !important; color:#fff; border-color: #0ea5e9         !important; }
.panel-warning .panel-heading { background: var(--yellow)   !important; color:#fff; border-color: var(--yellow)   !important; }
.panel-danger  .panel-heading { background: var(--red)      !important; color:#fff; border-color: var(--red)      !important; }

/* Panel accent top border */
.panel-accent-blue   { border-top: 3px solid var(--primary)  !important; }
.panel-accent-green  { border-top: 3px solid var(--green)    !important; }
.panel-accent-red    { border-top: 3px solid var(--red)      !important; }
.panel-accent-orange { border-top: 3px solid var(--yellow)   !important; }
.panel-accent-purple { border-top: 3px solid var(--purple)   !important; }
.panel-accent-teal   { border-top: 3px solid #14b8a6         !important; }

.panel .list-group-item {
    border: none !important; border-bottom: 1px solid var(--border) !important;
    border-radius: 0 !important; padding: 10px 18px !important;
    background: transparent !important; font-size: 13.5px;
}
.panel .list-group-item:last-child { border-bottom: none !important; }
.panel .list-group-item:hover { background: var(--bg) !important; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 16px; }
label { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 4px; display: block; }
.form-control {
    border: 1px solid var(--border) !important;
    border-radius: var(--r) !important;
    padding: 8px 12px !important;
    font-size: 14px; height: auto !important;
    color: var(--text); background: var(--surface);
    transition: var(--tr); box-shadow: none !important;
    width: 100%; display: block;
}
.form-control:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-bg) !important;
    outline: 0;
}
.form-control::placeholder { color: var(--text-3); }
textarea.form-control { min-height: 90px; resize: vertical; }
select.form-control { cursor: pointer; }

.input-group { display: table; width: 100%; }
.input-group .form-control { display: table-cell; border-radius: var(--r) 0 0 var(--r) !important; }
.input-group-btn { display: table-cell; width: 1%; vertical-align: middle; }
.input-group-btn .btn { border-radius: 0 var(--r) var(--r) 0 !important; border-left: 0 !important; }
.input-group-btn:first-child .btn { border-radius: var(--r) 0 0 var(--r) !important; border-left: 1px solid var(--border) !important; border-right: 0 !important; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-block;
    border-radius: var(--r) !important;
    font-weight: 500; font-size: 13.5px;
    padding: 8px 16px; border: 1px solid transparent;
    cursor: pointer; text-align: center;
    transition: var(--tr); line-height: 1.4;
    text-decoration: none; vertical-align: middle;
}
.btn:hover { text-decoration: none; }
.btn-xs  { padding: 3px 8px !important; font-size: 11.5px !important; border-radius: 6px !important; }
.btn-sm  { padding: 6px 12px !important; font-size: 12.5px !important; }
.btn-lg  { padding: 11px 22px !important; font-size: 15px !important; }
.btn-block { display: block; width: 100%; }

.btn-primary { background: var(--primary) !important; border-color: var(--primary) !important; color:#fff !important; }
.btn-primary:hover { background: var(--primary-h) !important; border-color: var(--primary-h) !important; color:#fff !important; }
.btn-success { background: var(--green)  !important; border-color: var(--green)  !important; color:#fff !important; }
.btn-success:hover { filter: brightness(.91); color:#fff !important; }
.btn-danger  { background: var(--red)    !important; border-color: var(--red)    !important; color:#fff !important; }
.btn-danger:hover  { filter: brightness(.91); color:#fff !important; }
.btn-warning { background: var(--yellow) !important; border-color: var(--yellow) !important; color:#fff !important; }
.btn-warning:hover { filter: brightness(.91); color:#fff !important; }
.btn-info    { background: #0ea5e9       !important; border-color: #0ea5e9       !important; color:#fff !important; }
.btn-info:hover    { filter: brightness(.91); color:#fff !important; }
.btn-default { background: var(--surface) !important; border: 1px solid var(--border) !important; color: var(--text) !important; }
.btn-default:hover { background: var(--bg) !important; color: var(--text) !important; }
.btn-link    { background: none !important; border-color: transparent !important; color: var(--primary) !important; padding-left:0; padding-right:0; box-shadow:none !important; }
.btn-link:hover    { color: var(--primary-h) !important; text-decoration: underline; }

.bg-color-blue   { background: var(--primary) !important; border-color: var(--primary) !important; color:#fff !important; }
.bg-color-green  { background: var(--green)   !important; border-color: var(--green)   !important; color:#fff !important; }
.bg-color-red    { background: var(--red)     !important; border-color: var(--red)     !important; color:#fff !important; }
.bg-color-orange { background: var(--yellow)  !important; border-color: var(--yellow)  !important; color:#fff !important; }
.bg-color-purple { background: var(--purple)  !important; border-color: var(--purple)  !important; color:#fff !important; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert { border-radius: var(--r) !important; padding: 12px 16px; font-size: 13.5px; border-width: 1px; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-info    { background: #f0f9ff; border-color: #bae6fd; color: #0369a1; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* ============================================================
   LABELS / BADGES
   ============================================================ */
.label, .badge {
    display: inline-block; padding: 3px 9px;
    font-size: 11px; font-weight: 600;
    border-radius: 99px; letter-spacing: .02em; line-height: 1.4;
}
.label-default { background: var(--text-3); color:#fff; }
.label-primary  { background: var(--primary); color:#fff; }
.label-success  { background: var(--green); color:#fff; }
.label-info     { background: #0ea5e9; color:#fff; }
.label-warning  { background: var(--yellow); color:#fff; }
.label-danger   { background: var(--red); color:#fff; }

/* WHMCS status */
.status-active    { background:#dcfce7 !important; color:#166534 !important; border-radius:99px; padding:2px 9px; font-size:11px; font-weight:600; }
.status-pending   { background:#fef9c3 !important; color:#854d0e !important; border-radius:99px; padding:2px 9px; font-size:11px; font-weight:600; }
.status-suspended,.status-cancelled,.status-terminated,.status-fraud {
    background:#fee2e2 !important; color:#991b1b !important; border-radius:99px; padding:2px 9px; font-size:11px; font-weight:600;
}

/* ============================================================
   TABLES
   ============================================================ */
.table { width:100%; border-collapse:collapse; font-size:13.5px; }
.table th,.table td { padding:11px 14px; border-bottom:1px solid var(--border); text-align:left; vertical-align:middle; }
.table > thead > tr > th {
    background: var(--bg) !important;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em; color: var(--text-3);
    border-bottom: 1px solid var(--border);
}
.table > tbody > tr:hover > td { background: var(--primary-bg); }
.table > tbody > tr:last-child > td { border-bottom: none; }
.table-striped > tbody > tr:nth-child(odd) > td { background: var(--bg); }
.table-bordered,.table-bordered th,.table-bordered td { border:1px solid var(--border) !important; }

/* ============================================================
   TABS
   ============================================================ */
.nav-tabs {
    border-bottom: 2px solid var(--border) !important;
    display: flex; flex-wrap: wrap; gap: 2px;
    margin-bottom: 20px !important; padding:0; list-style:none;
}
.nav-tabs > li { margin-bottom: -2px; float: none !important; }
.nav-tabs > li > a {
    display: block; padding: 8px 14px;
    font-size: 13.5px; font-weight: 500; color: var(--text-2);
    border-bottom: 2px solid transparent;
    border-radius: var(--r) var(--r) 0 0;
    transition: var(--tr); text-decoration: none;
    background: transparent !important;
    border-top:none !important; border-left:none !important; border-right:none !important; margin:0 !important;
}
.nav-tabs > li > a:hover { color: var(--primary); background: var(--primary-bg) !important; }
.nav-tabs > li.active > a {
    color: var(--primary) !important;
    border-bottom: 2px solid var(--primary) !important;
    background: transparent !important;
    font-weight: 600;
}
.tab-content > .tab-pane { display:none; }
.tab-content > .active  { display:block; }

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress { height:7px; border-radius:99px; background:var(--border); overflow:hidden; margin-bottom:10px; box-shadow:none; }
.progress-bar { background:var(--primary); border-radius:99px; transition:width .4s; box-shadow:none; }
.progress-bar-success { background:var(--green); }
.progress-bar-warning { background:var(--yellow); }
.progress-bar-danger  { background:var(--red); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-content { border:1px solid var(--border); border-radius:var(--r-lg) !important; box-shadow:var(--sh-lg); }
.modal-header  { padding:15px 20px; border-bottom:1px solid var(--border); background:var(--bg); border-radius:var(--r-lg) var(--r-lg) 0 0; }
.modal-title   { font-size:1rem; font-weight:600; margin:0; }
.modal-body    { padding:20px; }
.modal-footer  { padding:13px 20px; border-top:1px solid var(--border); background:var(--bg); border-radius:0 0 var(--r-lg) var(--r-lg); text-align:right; }

/* ============================================================
   MISC
   ============================================================ */
.well { background:var(--bg); border:1px solid var(--border); border-radius:var(--r); padding:16px; margin-bottom:16px; box-shadow:none; }
.section-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--r-lg); box-shadow:var(--sh-sm); padding:20px; margin-bottom:20px; }
.text-muted    { color:var(--text-3) !important; }
.text-primary  { color:var(--primary) !important; }
.text-success  { color:var(--green)   !important; }
.text-danger   { color:var(--red)     !important; }
.text-warning  { color:var(--yellow)  !important; }
