/* =====================================================
   GESTPROS ERP — Professional Admin Theme
   ===================================================== */

:root {
    --gp-sidebar-width: 260px;
    --gp-sidebar-collapsed: 0px;
    --gp-header-height: 64px;
    --gp-primary: #0066FF;
    --gp-primary-light: #3388FF;
    --gp-primary-dark: #0052CC;
    --gp-sidebar-bg: #0f172a;
    --gp-sidebar-hover: #1e293b;
    --gp-sidebar-active: rgba(0, 102, 255, 0.15);
    --gp-sidebar-text: #94a3b8;
    --gp-sidebar-text-active: #fff;
    --gp-body-bg: #f1f5f9;
    --gp-card-bg: #fff;
    --gp-header-bg: #fff;
    --gp-border: #e2e8f0;
    --gp-text: #1e293b;
    --gp-text-muted: #64748b;
    --gp-success: #10b981;
    --gp-warning: #f59e0b;
    --gp-danger: #ef4444;
    --gp-info: #06b6d4;
    --gp-radius: 10px;
    --gp-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --gp-shadow-lg: 0 4px 24px rgba(0,0,0,.08);
    --gp-transition: all .2s cubic-bezier(.4,0,.2,1);
}

[data-bs-theme="dark"] {
    --gp-body-bg: #0f172a;
    --gp-card-bg: #1e293b;
    --gp-header-bg: #1e293b;
    --gp-border: #334155;
    --gp-text: #e2e8f0;
    --gp-text-muted: #94a3b8;
    --gp-shadow: 0 1px 3px rgba(0,0,0,.2);
}

* { box-sizing: border-box; }
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gp-body-bg);
    color: var(--gp-text);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* ========== WRAPPER ========== */
.gp-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.gp-sidebar {
    width: var(--gp-sidebar-width);
    background: var(--gp-sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: var(--gp-transition);
    overflow: hidden;
}

.gp-sidebar-header {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gp-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.gp-brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--gp-primary), var(--gp-primary-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}

.gp-brand-text {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.3px;
}

.gp-sidebar-close {
    background: none;
    border: none;
    color: var(--gp-sidebar-text);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}

/* Business Badge */
.gp-business-badge {
    margin: 0 16px 16px;
    padding: 12px;
    background: var(--gp-sidebar-hover);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gp-business-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--gp-primary), var(--gp-primary-light));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.gp-business-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.gp-business-plan {
    font-size: 11px;
    color: var(--gp-sidebar-text);
}

/* Navigation */
.gp-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px 12px;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}

.gp-nav::-webkit-scrollbar { width: 4px; }
.gp-nav::-webkit-scrollbar-track { background: transparent; }
.gp-nav::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }

.gp-nav-section {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #475569;
    padding: 20px 12px 8px;
}

.gp-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--gp-sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: var(--gp-transition);
    position: relative;
}

.gp-nav-link i {
    font-size: 17px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.gp-nav-link:hover {
    background: var(--gp-sidebar-hover);
    color: #cbd5e1;
}

.gp-nav-link.active {
    background: var(--gp-sidebar-active);
    color: var(--gp-sidebar-text-active);
}

.gp-nav-link.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--gp-primary-light);
    border-radius: 0 3px 3px 0;
}

.gp-badge-count {
    margin-left: auto;
    background: var(--gp-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    line-height: 1.4;
}

/* Sidebar Footer */
.gp-sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid #1e293b;
}

.gp-version {
    font-size: 11px;
    color: #475569;
}

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

/* ========== HEADER ========== */
.gp-header {
    height: var(--gp-header-height);
    background: var(--gp-header-bg);
    border-bottom: 1px solid var(--gp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: var(--gp-shadow);
}

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

.gp-toggle-btn {
    background: none;
    border: 1px solid var(--gp-border);
    border-radius: 8px;
    padding: 6px 10px;
    color: var(--gp-text-muted);
    cursor: pointer;
    font-size: 18px;
    transition: var(--gp-transition);
}

.gp-toggle-btn:hover {
    background: var(--gp-body-bg);
    color: var(--gp-text);
}

.gp-page-title h1 {
    font-size: 17px;
    font-weight: 600;
    margin: 0;
    color: var(--gp-text);
}

.gp-page-title .breadcrumb {
    font-size: 12px;
}

.gp-page-title .breadcrumb-item a {
    color: var(--gp-text-muted);
    text-decoration: none;
}

.gp-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gp-header-actions {
    display: flex;
    gap: 4px;
}

.gp-quick-action {
    width: 38px;
    height: 38px;
    border: 1px solid var(--gp-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gp-text-muted);
    background: none;
    cursor: pointer;
    text-decoration: none;
    font-size: 16px;
    transition: var(--gp-transition);
}

.gp-quick-action:hover {
    background: var(--gp-body-bg);
    color: var(--gp-primary);
}

/* User Menu */
.gp-user-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    padding: 4px 8px 4px 4px;
    border-radius: 8px;
    transition: var(--gp-transition);
}

.gp-user-trigger:hover {
    background: var(--gp-body-bg);
}

.gp-user-trigger::after { display: none; }

.gp-user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--gp-primary), var(--gp-primary-light));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.gp-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gp-text);
    line-height: 1.3;
}

.gp-user-role {
    font-size: 11px;
    color: var(--gp-text-muted);
}

.gp-dropdown {
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius);
    box-shadow: var(--gp-shadow-lg);
    padding: 6px;
    min-width: 180px;
}

.gp-dropdown .dropdown-item {
    border-radius: 6px;
    font-size: 13px;
    padding: 8px 12px;
}

.gp-dropdown .dropdown-header {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--gp-text-muted);
    padding: 8px 12px 4px;
}

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

/* ========== STAT CARDS ========== */
.gp-stat-card {
    background: var(--gp-card-bg);
    border-radius: var(--gp-radius);
    padding: 20px;
    box-shadow: var(--gp-shadow);
    border: 1px solid var(--gp-border);
    transition: var(--gp-transition);
    height: 100%;
}

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

.gp-stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.gp-stat-label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--gp-text-muted);
    text-transform: uppercase;
    letter-spacing: .3px;
}

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

.gp-stat-icon.primary { background: rgba(0,102,255,.1); color: var(--gp-primary); }
.gp-stat-icon.success { background: rgba(16,185,129,.1); color: var(--gp-success); }
.gp-stat-icon.warning { background: rgba(245,158,11,.1); color: var(--gp-warning); }
.gp-stat-icon.danger  { background: rgba(239,68,68,.1); color: var(--gp-danger); }
.gp-stat-icon.info    { background: rgba(6,182,212,.1); color: var(--gp-info); }

.gp-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--gp-text);
    line-height: 1.2;
}

.gp-stat-trend {
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
}

.gp-stat-trend.up { color: var(--gp-success); }
.gp-stat-trend.down { color: var(--gp-danger); }

/* ========== CARDS ========== */
.gp-card {
    background: var(--gp-card-bg);
    border-radius: var(--gp-radius);
    box-shadow: var(--gp-shadow);
    border: 1px solid var(--gp-border);
    overflow: hidden;
}

.gp-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gp-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gp-text);
    margin: 0;
}

.gp-card-body {
    padding: 20px;
}

/* ========== TABLES ========== */
.gp-table {
    width: 100%;
    font-size: 13px;
}

.gp-table thead th {
    background: var(--gp-body-bg);
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--gp-text-muted);
    padding: 10px 16px;
    border-bottom: 1px solid var(--gp-border);
}

.gp-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gp-border);
    vertical-align: middle;
}

.gp-table tbody tr:hover {
    background: rgba(0,102,255,.02);
}

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

/* ========== STATUS BADGES ========== */
.gp-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

.gp-badge.active, .gp-badge.paid  { background: rgba(16,185,129,.1); color: var(--gp-success); }
.gp-badge.trial    { background: rgba(6,182,212,.1); color: var(--gp-info); }
.gp-badge.pending  { background: rgba(245,158,11,.1); color: var(--gp-warning); }
.gp-badge.expired, .gp-badge.cancelled { background: rgba(239,68,68,.1); color: var(--gp-danger); }

/* ========== ALERTS ========== */
.gp-alert {
    border: none;
    border-radius: var(--gp-radius);
    margin-bottom: 20px;
}

/* ========== FORMS ========== */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid var(--gp-border);
    font-size: 13.5px;
    padding: 9px 14px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--gp-primary);
    box-shadow: 0 0 0 3px rgba(0,102,255,.12);
}

.btn-primary {
    background: var(--gp-primary);
    border-color: var(--gp-primary);
    border-radius: 8px;
    font-weight: 500;
    font-size: 13.5px;
    padding: 9px 20px;
}

.btn-primary:hover {
    background: var(--gp-primary-dark);
    border-color: var(--gp-primary-dark);
}

/* ========== OVERLAY (mobile) ========== */
.gp-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1035;
    backdrop-filter: blur(2px);
}

.gp-overlay.active { display: block; }

/* ========== RESPONSIVE ========== */
@media (max-width: 991.98px) {
    .gp-sidebar {
        transform: translateX(-100%);
    }
    .gp-sidebar.open {
        transform: translateX(0);
    }
    .gp-main {
        margin-left: 0;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    .gp-content {
        padding: 16px;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    .gp-stat-value {
        font-size: 18px;
    }
}

@media (min-width: 992px) {
    .gp-sidebar-close { display: none; }

    .gp-wrapper.collapsed .gp-sidebar {
        width: 0;
        overflow: hidden;
    }
    .gp-wrapper.collapsed .gp-main {
        margin-left: 0;
    }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.gp-stat-card {
    animation: fadeInUp .4s ease-out both;
}
.gp-stat-card:nth-child(2) { animation-delay: .05s; }
.gp-stat-card:nth-child(3) { animation-delay: .1s; }
.gp-stat-card:nth-child(4) { animation-delay: .15s; }
.gp-stat-card:nth-child(5) { animation-delay: .2s; }
.gp-stat-card:nth-child(6) { animation-delay: .25s; }
.gp-stat-card:nth-child(7) { animation-delay: .3s; }
.gp-stat-card:nth-child(8) { animation-delay: .35s; }

/* ========== BACKWARDS COMPAT (ancien style) ========== */
.stat-card { border: none; border-radius: var(--gp-radius); box-shadow: var(--gp-shadow); }
.stat-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.table-gp { font-size: 13px; }
.table-gp th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .3px; color: var(--gp-text-muted); }

/* =====================================================
   GESTPROS — RESPONSIVE MOBILE ADDITIONS
   Ajouter à la fin de style.css
   ===================================================== */

/* ========== GLOBAL RESPONSIVE ========== */
img, video, svg { max-width: 100%; height: auto; }

.table-responsive { -webkit-overflow-scrolling: touch; }

/* ========== AUTH PAGES (see auth-premium.css) ========== */
.gp-flash-success,
.gp-flash-error { display: none; }

/* ========== HEADER MOBILE ========== */
@media (max-width: 767.98px) {
    .gp-header {
        padding: 0 12px;
        height: 56px;
    }
    .gp-page-title h1 {
        font-size: 14px;
    }
    .gp-page-title .breadcrumb {
        display: none;
    }
    .gp-header-actions {
        display: none;
    }
    .gp-user-info { display: none !important; }
}

/* ========== CONTENT MOBILE ========== */
@media (max-width: 767.98px) {
    .gp-content {
        padding: 12px;
    }
    .gp-stat-card {
        padding: 14px;
    }
    .gp-stat-value {
        font-size: 18px;
    }
    .gp-stat-label {
        font-size: 11px;
    }
    .gp-stat-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    .gp-card-header {
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .gp-card-body {
        padding: 14px;
    }
}

/* ========== TABLES MOBILE ========== */
@media (max-width: 767.98px) {
    .gp-table thead th,
    .gp-table tbody td {
        padding: 8px 10px;
        font-size: 12px;
    }
    /* Cacher colonnes secondaires sur mobile */
    .gp-table .d-mobile-none,
    .table .d-mobile-none {
        display: none;
    }
}

/* ========== POS MOBILE ========== */
@media (max-width: 991.98px) {
    .pos-wrapper {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }
    .pos-cart {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1030;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 24px rgba(0,0,0,.12);
        max-height: 60vh;
        overflow-y: auto;
        transform: translateY(calc(100% - 60px));
        transition: transform .3s cubic-bezier(.4,0,.2,1);
    }
    .pos-cart.expanded {
        transform: translateY(0);
    }
    .pos-cart::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: #cbd5e1;
        border-radius: 2px;
        margin: 8px auto 12px;
    }
}

@media (max-width: 575.98px) {
    .pos-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
        gap: .5rem !important;
    }
    .pos-product {
        padding: .5rem !important;
    }
    .pos-product img {
        width: 60px !important;
        height: 60px !important;
    }
    .pos-product .fw-500 { font-size: 11px !important; }
    #posSearch {
        font-size: 14px;
    }
    #posCatFilter {
        width: 100% !important;
    }
    .pos-wrapper .d-flex.gap-2 {
        flex-direction: column;
    }
}

/* ========== FORMS MOBILE ========== */
@media (max-width: 575.98px) {
    .form-control, .form-select {
        font-size: 16px !important; /* évite le zoom iOS */
        padding: 10px 12px;
    }
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    .btn-lg {
        padding: 12px 20px;
        font-size: 16px;
    }
    .modal-dialog {
        margin: 8px;
    }
    .modal-body {
        padding: 16px;
    }
}

/* ========== DASHBOARD MOBILE ========== */
@media (max-width: 575.98px) {
    .row.g-3 > [class*="col-6"] {
        flex: 0 0 50%;
        max-width: 50%;
    }
    canvas {
        max-height: 220px !important;
    }
}

/* ========== STORE PUBLIC MOBILE ========== */
@media (max-width: 767.98px) {
    .store-hero {
        padding: 30px 16px !important;
    }
    .store-hero h1 {
        font-size: 22px !important;
    }
    .store-product-card {
        margin-bottom: 12px;
    }
    .store-product-card img {
        height: 160px !important;
    }
    .store-nav .navbar-brand {
        font-size: 16px;
    }
    .store-nav form input[type="search"] {
        width: 100% !important;
    }
}

/* ========== SIDEBAR MOBILE ENHANCEMENTS ========== */
@media (max-width: 991.98px) {
    .gp-sidebar {
        width: 280px;
        box-shadow: 4px 0 24px rgba(0,0,0,.2);
    }
    .gp-sidebar.open {
        transform: translateX(0);
    }
    .gp-sidebar .gp-nav {
        padding-bottom: 80px; /* espace pour scroll complet */
    }
}

/* ========== ACCOUNTING / REPORTS MOBILE ========== */
@media (max-width: 767.98px) {
    .accounting-entry-form .row > div {
        margin-bottom: 8px;
    }
    .report-filters {
        flex-direction: column;
        gap: 8px;
    }
    .report-filters .form-control,
    .report-filters .form-select,
    .report-filters .btn {
        width: 100%;
    }
}

/* ========== AFFILIATIONS MOBILE ========== */
@media (max-width: 575.98px) {
    .affiliate-tree .level {
        padding-left: 12px;
    }
    .wallet-card {
        padding: 16px;
    }
    .wallet-balance {
        font-size: 24px;
    }
}

/* ========== UTILITIES MOBILE ========== */
@media (max-width: 767.98px) {
    .gap-3 { gap: .75rem !important; }
    .mb-4 { margin-bottom: 1rem !important; }
    .p-4 { padding: 1rem !important; }
    .d-mobile-column {
        flex-direction: column !important;
    }
    .d-mobile-none {
        display: none !important;
    }
    .d-mobile-block {
        display: block !important;
    }
    .text-mobile-center {
        text-align: center !important;
    }
    .w-mobile-100 {
        width: 100% !important;
    }
}

/* ========== TOUCH FRIENDLY ========== */
@media (hover: none) and (pointer: coarse) {
    .gp-nav-link {
        padding: 11px 12px;
        min-height: 44px;
    }
    .btn {
        min-height: 44px;
    }
    .form-check-input {
        width: 20px;
        height: 20px;
    }
    .dropdown-item {
        padding: 10px 16px;
    }
    .gp-table tbody td {
        padding: 12px 10px;
    }
}

/* ========== SAFE AREA (iPhone notch) ========== */
@supports (padding-top: env(safe-area-inset-top)) {
    .gp-sidebar {
        padding-top: env(safe-area-inset-top);
    }
    .gp-header {
        padding-top: env(safe-area-inset-top);
    }
    .pos-cart {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ========== PAGE HEADER PRO ========== */
.gp-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.gp-page-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.gp-page-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.gp-page-icon.primary { background: rgba(0,102,255,.1); color: var(--gp-primary); }
.gp-page-icon.success { background: rgba(16,185,129,.1); color: var(--gp-success); }
.gp-page-icon.warning { background: rgba(245,158,11,.1); color: var(--gp-warning); }
.gp-page-icon.danger  { background: rgba(239,68,68,.1); color: var(--gp-danger); }
.gp-page-icon.info    { background: rgba(6,182,212,.1); color: var(--gp-info); }

.gp-page-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 2px;
    color: var(--gp-text);
    line-height: 1.3;
}

.gp-page-header .gp-page-subtitle {
    font-size: 13px;
    color: var(--gp-text-muted);
    margin: 0;
}

.gp-page-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ========== MINI STAT ROW ========== */
.gp-mini-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.gp-mini-stat {
    background: var(--gp-card-bg);
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--gp-shadow);
    transition: var(--gp-transition);
}

.gp-mini-stat:hover {
    transform: translateY(-1px);
    box-shadow: var(--gp-shadow-lg);
}

.gp-mini-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.gp-mini-stat-icon.primary { background: rgba(0,102,255,.1); color: var(--gp-primary); }
.gp-mini-stat-icon.success { background: rgba(16,185,129,.1); color: var(--gp-success); }
.gp-mini-stat-icon.warning { background: rgba(245,158,11,.1); color: var(--gp-warning); }
.gp-mini-stat-icon.danger  { background: rgba(239,68,68,.1); color: var(--gp-danger); }
.gp-mini-stat-icon.info    { background: rgba(6,182,212,.1); color: var(--gp-info); }

.gp-mini-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--gp-text);
    line-height: 1.2;
}

.gp-mini-stat-label {
    font-size: 11.5px;
    color: var(--gp-text-muted);
    font-weight: 500;
}

/* ========== EMPTY STATE ========== */
.gp-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--gp-text-muted);
}

.gp-empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: .4;
    display: block;
}

.gp-empty-state h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--gp-text);
    margin-bottom: 8px;
}

.gp-empty-state p {
    font-size: 13px;
    max-width: 400px;
    margin: 0 auto;
}

/* ========== TABLE ACTIONS ========== */
.gp-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.gp-action-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gp-border);
    background: var(--gp-card-bg);
    color: var(--gp-text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: var(--gp-transition);
    text-decoration: none;
}

.gp-action-btn:hover {
    background: var(--gp-primary);
    border-color: var(--gp-primary);
    color: #fff;
}

.gp-action-btn.danger:hover {
    background: var(--gp-danger);
    border-color: var(--gp-danger);
}

.gp-action-btn.success:hover {
    background: var(--gp-success);
    border-color: var(--gp-success);
}

.gp-action-btn.warning:hover {
    background: var(--gp-warning);
    border-color: var(--gp-warning);
}

/* ========== SEARCH BAR PRO ========== */
.gp-search-bar {
    position: relative;
    max-width: 320px;
    width: 100%;
}

.gp-search-bar input {
    padding-left: 38px;
    border-radius: 8px;
    border: 1px solid var(--gp-border);
    background: var(--gp-body-bg);
    font-size: 13px;
    height: 38px;
    width: 100%;
    transition: var(--gp-transition);
}

.gp-search-bar input:focus {
    background: var(--gp-card-bg);
    border-color: var(--gp-primary);
    box-shadow: 0 0 0 3px rgba(0,102,255,.1);
}

.gp-search-bar i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gp-text-muted);
    font-size: 14px;
    pointer-events: none;
}

/* ========== FILTER PILLS ========== */
.gp-filter-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.gp-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--gp-border);
    background: var(--gp-card-bg);
    color: var(--gp-text-muted);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--gp-transition);
    text-decoration: none;
}

.gp-filter-pill:hover, .gp-filter-pill.active {
    background: var(--gp-primary);
    border-color: var(--gp-primary);
    color: #fff;
}

.gp-filter-pill .count {
    background: rgba(255,255,255,.2);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 11px;
}

.gp-filter-pill:not(.active) .count {
    background: var(--gp-body-bg);
}

/* ========== CARD LIST (mobile alternative to tables) ========== */
.gp-card-list {
    display: none;
}

.gp-card-list-item {
    background: var(--gp-card-bg);
    border: 1px solid var(--gp-border);
    border-radius: var(--gp-radius);
    padding: 14px;
    margin-bottom: 8px;
    box-shadow: var(--gp-shadow);
}

.gp-card-list-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.gp-card-list-item-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 12.5px;
}

.gp-card-list-meta {
    color: var(--gp-text-muted);
}

.gp-card-list-meta strong {
    display: block;
    color: var(--gp-text);
    font-weight: 600;
    font-size: 13px;
}

/* ========== TOOLBAR ========== */
.gp-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 20px;
    border-bottom: 1px solid var(--gp-border);
}

/* ========== MOBILE RESPONSIVE ADMIN PAGES ========== */
@media (max-width: 767.98px) {
    .gp-page-header {
        flex-direction: column;
        gap: 12px;
    }
    .gp-page-header-right {
        width: 100%;
    }
    .gp-page-header-right .btn {
        flex: 1;
    }
    .gp-page-icon {
        width: 42px;
        height: 42px;
        font-size: 18px;
        border-radius: 10px;
    }
    .gp-page-header h2 {
        font-size: 17px;
    }
    .gp-mini-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .gp-mini-stat {
        padding: 12px;
        gap: 10px;
    }
    .gp-mini-stat-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    .gp-mini-stat-value {
        font-size: 17px;
    }
    .gp-mini-stat-label {
        font-size: 10.5px;
    }
    .gp-toolbar {
        padding: 10px 14px;
    }
    .gp-search-bar {
        max-width: 100%;
        order: -1;
    }
    .gp-filter-pills {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }
    .gp-filter-pill {
        flex-shrink: 0;
    }
    .gp-card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .gp-action-btn {
        width: 38px;
        height: 38px;
    }
    .gp-empty-state {
        padding: 32px 16px;
    }
    .gp-empty-state i {
        font-size: 36px;
    }
}

@media (max-width: 575.98px) {
    .gp-mini-stats {
        grid-template-columns: 1fr 1fr;
    }
}

/* ========== PRINT ========== */
@media print {
    .gp-sidebar, .gp-header, .gp-overlay, .gp-toggle-btn { display: none !important; }
    .gp-main { margin-left: 0 !important; }
    .gp-content { padding: 0 !important; }
    .gp-stat-card { break-inside: avoid; box-shadow: none; border: 1px solid #ddd; }
}