/* =====================================================================
   MINT10HOBBY — BACKEND CSS (Admin / Partner / Staff Console)
   =====================================================================
   File: public/css/backend.css
   Loaded on: every backend page (admin, partner storefront, org staff).

   Theming:
     - Bootstrap 5.3+ uses [data-bs-theme="light"|"dark"] on <html>.
     - We piggyback on that AND add a sidebar-collapsed flag on <body>.
     - All custom colors are CSS variables in :root + [data-bs-theme="dark"].

   Naming convention:
     - --m10-*  = brand tokens (always the same in light & dark)
     - --bg-*   = surface tokens (swap in dark mode)
     - --text-* = typography tokens (swap in dark mode)
     - --bd-*   = border / divider tokens (swap in dark mode)
     - --m10-*  prefix on every component class
   ===================================================================== */


/* =====================================================================
   1. BRAND TOKENS  (constant — same across light & dark)
   ===================================================================== */
:root {
    /* Brand colors — driven by the logo */
    --m10-green:        #6BBD4E;
    --m10-green-dark:   #4FA336;
    --m10-green-light:  #E8F8E1;
    --m10-blue:         #2A7DE1;
    --m10-blue-dark:    #1A5FBB;
    --m10-blue-light:   #DEEEFF;
    --m10-cyan:         #3AB2D1;
    --m10-cyan-dark:    #2792B0;
    --m10-cyan-light:   #DBF1F7;

    /* State colors */
    --m10-danger:       #E84141;
    --m10-warning:      #F5A623;
    --m10-info:         #3AB2D1;
    --m10-success:      #6BBD4E;

    /* Gradients */
    --m10-grad-primary: linear-gradient(135deg, #6BBD4E 0%, #3AB2D1 50%, #2A7DE1 100%);
    --m10-grad-mint:    linear-gradient(135deg, #6BBD4E 0%, #4FA336 100%);
    --m10-grad-blue:    linear-gradient(135deg, #2A7DE1 0%, #3AB2D1 100%);
    --m10-grad-holo:    linear-gradient(135deg, #DEEEFF 0%, #E8F8E1 50%, #DBF1F7 100%);

    /* Shadows (light) */
    --m10-shadow-sm:    0 1px 2px rgba(13, 27, 42, 0.05);
    --m10-shadow:       0 2px 8px rgba(13, 27, 42, 0.06);
    --m10-shadow-md:    0 4px 16px rgba(13, 27, 42, 0.08);
    --m10-shadow-lg:    0 8px 28px rgba(13, 27, 42, 0.12);

    /* Layout */
    --m10-sidebar-w:        260px;
    --m10-sidebar-w-mini:   72px;
    --m10-topbar-h:         60px;
    --m10-radius-sm:        6px;
    --m10-radius:           10px;
    --m10-radius-lg:        14px;
    --m10-radius-xl:        20px;

    /* Transitions */
    --m10-t-fast:   .12s ease;
    --m10-t-mid:    .22s ease;
    --m10-t-slow:   .35s ease;

    /* Fonts */
    --m10-font-display: 'Rajdhani', system-ui, -apple-system, sans-serif;
    --m10-font-body:    'Nunito', system-ui, -apple-system, sans-serif;
}


/* =====================================================================
   2. THEME — LIGHT (default)
   ===================================================================== */
:root,
[data-bs-theme="light"] {
    /* Surfaces */
    --bg-app:       #F4F7FB;
    --bg-card:      #FFFFFF;
    --bg-card-alt:  #F9FBFD;
    --bg-input:     #FFFFFF;
    --bg-hover:     #F1F5FA;
    --bg-active:    #E8F1FB;

    /* Sidebar (always dark navy in light mode for contrast) */
    --bg-sidebar:        #0F2540;
    --bg-sidebar-hover:  rgba(255, 255, 255, 0.06);
    --bg-sidebar-active: rgba(58, 178, 209, 0.15);

    /* Topbar */
    --bg-topbar:    rgba(255, 255, 255, 0.85);
    --bd-topbar:    rgba(13, 27, 42, 0.06);

    /* Text */
    --text-primary:   #0D1B2A;
    --text-secondary: #4A5A6E;
    --text-muted:     #8B95A5;
    --text-on-brand:  #FFFFFF;
    --text-sidebar:        rgba(255, 255, 255, 0.78);
    --text-sidebar-active: #FFFFFF;
    --text-sidebar-muted:  rgba(255, 255, 255, 0.45);

    /* Borders */
    --bd-default: rgba(13, 27, 42, 0.08);
    --bd-soft:    rgba(13, 27, 42, 0.04);
    --bd-strong:  rgba(13, 27, 42, 0.16);

    /* Misc */
    --bg-scroll-track: transparent;
    --bg-scroll-thumb: rgba(13, 27, 42, 0.18);
}


/* =====================================================================
   3. THEME — DARK
   ===================================================================== */
[data-bs-theme="dark"] {
    /* Surfaces */
    --bg-app:       #0B121C;
    --bg-card:      #141C2A;
    --bg-card-alt:  #1A2334;
    --bg-input:     #1A2334;
    --bg-hover:     rgba(255, 255, 255, 0.04);
    --bg-active:    rgba(58, 178, 209, 0.10);

    /* Sidebar (slightly different shade in dark for separation) */
    --bg-sidebar:        #0A1119;
    --bg-sidebar-hover:  rgba(255, 255, 255, 0.05);
    --bg-sidebar-active: rgba(58, 178, 209, 0.18);

    /* Topbar */
    --bg-topbar:    rgba(20, 28, 42, 0.85);
    --bd-topbar:    rgba(255, 255, 255, 0.06);

    /* Text */
    --text-primary:   #E8EDF4;
    --text-secondary: #A8B2C0;
    --text-muted:     #6B7585;
    --text-on-brand:  #FFFFFF;
    --text-sidebar:        rgba(255, 255, 255, 0.72);
    --text-sidebar-active: #FFFFFF;
    --text-sidebar-muted:  rgba(255, 255, 255, 0.40);

    /* Borders */
    --bd-default: rgba(255, 255, 255, 0.08);
    --bd-soft:    rgba(255, 255, 255, 0.04);
    --bd-strong:  rgba(255, 255, 255, 0.18);

    /* Brand color softening for dark mode */
    --m10-green-light:  rgba(107, 189, 78, 0.16);
    --m10-blue-light:   rgba(42, 125, 225, 0.18);
    --m10-cyan-light:   rgba(58, 178, 209, 0.18);

    /* Shadows (deeper in dark) */
    --m10-shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.3);
    --m10-shadow:       0 2px 8px rgba(0, 0, 0, 0.4);
    --m10-shadow-md:    0 4px 16px rgba(0, 0, 0, 0.5);
    --m10-shadow-lg:    0 8px 28px rgba(0, 0, 0, 0.6);

    /* Misc */
    --bg-scroll-track: transparent;
    --bg-scroll-thumb: rgba(255, 255, 255, 0.18);
}


/* =====================================================================
   4. RESET / GLOBAL
   ===================================================================== */
* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body.m10-backend {
    font-family: var(--m10-font-body);
    background: var(--bg-app);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background var(--m10-t-mid), color var(--m10-t-mid);
}

body.m10-backend h1, body.m10-backend h2, body.m10-backend h3,
body.m10-backend h4, body.m10-backend h5, body.m10-backend h6 {
    font-family: var(--m10-font-display);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.01em;
    margin-top: 0;
}

a { color: var(--m10-blue); text-decoration: none; transition: color var(--m10-t-fast); }
a:hover { color: var(--m10-blue-dark); }

code, pre {
    font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.85em;
}

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-scroll-track); }
::-webkit-scrollbar-thumb { background: var(--bg-scroll-thumb); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--m10-cyan); }


/* =====================================================================
   5. APP SHELL — sidebar + topbar + content
   ===================================================================== */
.m10-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.m10-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--m10-sidebar-w);
    background: var(--bg-sidebar);
    color: var(--text-sidebar);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: width var(--m10-t-mid), transform var(--m10-t-mid);
    box-shadow: var(--m10-shadow-md);
}

.m10-main {
    margin-left: var(--m10-sidebar-w);
    flex: 1;
    min-width: 0;
    transition: margin-left var(--m10-t-mid);
    display: flex;
    flex-direction: column;
}

/* Collapsed sidebar (desktop) */
body.m10-sidebar-mini .m10-sidebar { width: var(--m10-sidebar-w-mini); }
body.m10-sidebar-mini .m10-main    { margin-left: var(--m10-sidebar-w-mini); }
body.m10-sidebar-mini .m10-sidebar .m10-side-link span,
body.m10-sidebar-mini .m10-sidebar .m10-side-section,
body.m10-sidebar-mini .m10-sidebar .m10-side-brand-text,
body.m10-sidebar-mini .m10-sidebar .m10-side-caret,
body.m10-sidebar-mini .m10-sidebar .m10-side-badge { display: none; }
body.m10-sidebar-mini .m10-sidebar .m10-side-link  { justify-content: center; padding-left: 0; padding-right: 0; }
body.m10-sidebar-mini .m10-sidebar .m10-side-sub  { display: none !important; }


/* =====================================================================
   6. SIDEBAR
   ===================================================================== */
.m10-side-brand {
    height: var(--m10-topbar-h);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.m10-side-brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--m10-grad-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: var(--m10-font-display);
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(58, 178, 209, 0.4);
}

.m10-side-brand-text {
    font-family: var(--m10-font-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    color: white;
    white-space: nowrap;
    overflow: hidden;
}

.m10-side-brand-text small {
    display: block;
    font-size: 0.65rem;
    color: var(--text-sidebar-muted);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.m10-side-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 0 24px;
}

.m10-side-section {
    padding: 14px 18px 6px;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-sidebar-muted);
}

.m10-side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 18px;
    color: var(--text-sidebar);
    font-weight: 500;
    font-size: 0.88rem;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background var(--m10-t-fast), color var(--m10-t-fast), border-color var(--m10-t-fast);
    position: relative;
    cursor: pointer;
}

.m10-side-link i,
.m10-side-link .m10-side-icon {
    font-size: 1.05rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    color: var(--text-sidebar-muted);
    transition: color var(--m10-t-fast);
}

.m10-side-link span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.m10-side-link:hover {
    background: var(--bg-sidebar-hover);
    color: var(--text-sidebar-active);
}

.m10-side-link:hover i { color: var(--m10-cyan); }

.m10-side-link.active {
    background: var(--bg-sidebar-active);
    color: var(--text-sidebar-active);
    border-left-color: var(--m10-cyan);
}

.m10-side-link.active i { color: var(--m10-cyan); }

.m10-side-caret {
    margin-left: auto;
    font-size: 0.7rem;
    transition: transform var(--m10-t-fast);
    color: var(--text-sidebar-muted);
}

.m10-side-link[aria-expanded="true"] .m10-side-caret { transform: rotate(90deg); }

.m10-side-badge {
    background: var(--m10-cyan);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: auto;
}

.m10-side-badge.m10-side-badge-danger { background: var(--m10-danger); }
.m10-side-badge.m10-side-badge-warning { background: var(--m10-warning); }

.m10-side-sub {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.18);
}

.m10-side-sub a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 18px 7px 53px;
    color: var(--text-sidebar-muted);
    font-size: 0.83rem;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--m10-t-fast), background var(--m10-t-fast);
}

.m10-side-sub a::before {
    content: '';
    width: 4px; height: 4px; border-radius: 50%;
    background: var(--text-sidebar-muted);
    flex-shrink: 0;
    transition: background var(--m10-t-fast);
}

.m10-side-sub a:hover { color: var(--text-sidebar-active); background: var(--bg-sidebar-hover); }
.m10-side-sub a:hover::before { background: var(--m10-cyan); }
.m10-side-sub a.active { color: var(--m10-cyan); }
.m10-side-sub a.active::before { background: var(--m10-cyan); }

.m10-side-footer {
    padding: 14px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.72rem;
    color: var(--text-sidebar-muted);
    flex-shrink: 0;
}


/* =====================================================================
   7. TOPBAR
   ===================================================================== */
.m10-topbar {
    height: var(--m10-topbar-h);
    background: var(--bg-topbar);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--bd-topbar);
    display: flex;
    align-items: center;
    padding: 0 18px;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 1030;
    flex-shrink: 0;
}

.m10-topbar-toggle {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: var(--m10-radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    transition: background var(--m10-t-fast), color var(--m10-t-fast);
}

.m10-topbar-toggle:hover { background: var(--bg-hover); color: var(--m10-blue); }

.m10-topbar-search {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.m10-topbar-search input {
    width: 100%;
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--bd-default);
    background: var(--bg-input);
    color: var(--text-primary);
    padding: 0 14px 0 38px;
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--m10-t-fast), box-shadow var(--m10-t-fast), background var(--m10-t-fast);
}

.m10-topbar-search input::placeholder { color: var(--text-muted); }
.m10-topbar-search input:focus {
    border-color: var(--m10-cyan);
    box-shadow: 0 0 0 3px rgba(58, 178, 209, 0.15);
}

.m10-topbar-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
}

.m10-topbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.m10-topbar-btn {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: var(--m10-radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    position: relative;
    transition: background var(--m10-t-fast), color var(--m10-t-fast);
    cursor: pointer;
}

.m10-topbar-btn:hover { background: var(--bg-hover); color: var(--m10-blue); }

.m10-topbar-btn .m10-topbar-dot {
    position: absolute;
    top: 7px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--m10-danger);
    border: 2px solid var(--bg-topbar);
}

.m10-topbar-divider {
    width: 1px;
    height: 24px;
    background: var(--bd-default);
    margin: 0 6px;
}


/* =====================================================================
   8. USER MENU
   ===================================================================== */
.m10-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 0;
    background: transparent;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    cursor: pointer;
    transition: background var(--m10-t-fast);
}

.m10-user-btn:hover { background: var(--bg-hover); }

.m10-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--m10-grad-primary);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--m10-font-display);
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid var(--bg-card);
    box-shadow: var(--m10-shadow-sm);
}

.m10-user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.m10-user-info {
    text-align: left;
    line-height: 1.15;
}

.m10-user-info .name {
    display: block;
    font-family: var(--m10-font-display);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.m10-user-info .role {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}


/* =====================================================================
   9. DROPDOWNS (overrides for our theme)
   ===================================================================== */
.dropdown-menu {
    border: 1px solid var(--bd-default);
    background: var(--bg-card);
    box-shadow: var(--m10-shadow-lg);
    border-radius: var(--m10-radius);
    padding: 6px;
    min-width: 220px;
}

.dropdown-item {
    border-radius: var(--m10-radius-sm);
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 500;
    transition: background var(--m10-t-fast), color var(--m10-t-fast);
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-item:hover, .dropdown-item:focus {
    background: var(--bg-hover);
    color: var(--m10-blue);
}

.dropdown-item i { color: var(--text-muted); width: 18px; text-align: center; }
.dropdown-item:hover i { color: var(--m10-blue); }
.dropdown-item.text-danger { color: var(--m10-danger); }
.dropdown-item.text-danger:hover { background: rgba(232, 65, 65, 0.08); color: var(--m10-danger); }
.dropdown-item.text-danger i { color: var(--m10-danger); }
.dropdown-divider { border-color: var(--bd-default); margin: 4px 0; }

.m10-dropdown-header {
    padding: 10px 12px 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}


/* =====================================================================
   10. CONTENT WRAPPER & PAGE HEADER
   ===================================================================== */
.m10-content {
    flex: 1;
    padding: 22px 24px 40px;
    min-width: 0;
}

.m10-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--bd-default);
}

.m10-page-title {
    font-family: var(--m10-font-display);
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--text-primary);
    margin: 0 0 4px;
    letter-spacing: 0.01em;
}

.m10-page-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0;
}

.m10-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.m10-breadcrumbs a { color: var(--text-muted); }
.m10-breadcrumbs a:hover { color: var(--m10-blue); }
.m10-breadcrumbs .sep { opacity: 0.4; }
.m10-breadcrumbs .current { color: var(--text-secondary); font-weight: 600; }


/* =====================================================================
   11. CARDS
   ===================================================================== */
.m10-card {
    background: var(--bg-card);
    border: 1px solid var(--bd-default);
    border-radius: var(--m10-radius-lg);
    box-shadow: var(--m10-shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--m10-t-fast), transform var(--m10-t-fast);
}

.m10-card:hover { box-shadow: var(--m10-shadow); }

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

.m10-card-header h3 {
    font-family: var(--m10-font-display);
    font-weight: 700;
    font-size: 1rem;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.m10-card-header .m10-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.m10-card-body { padding: 20px; }
.m10-card-body.tight { padding: 12px; }
.m10-card-body.flush { padding: 0; }

.m10-card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--bd-default);
    background: var(--bg-card-alt);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}


/* =====================================================================
   12. STAT CARDS
   ===================================================================== */
.m10-stat {
    background: var(--bg-card);
    border: 1px solid var(--bd-default);
    border-radius: var(--m10-radius-lg);
    padding: 18px 18px 16px;
    position: relative;
    overflow: hidden;
    transition: transform var(--m10-t-fast), box-shadow var(--m10-t-fast);
}

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

.m10-stat::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--m10-grad-primary);
}

.m10-stat.m10-stat-green::before  { background: var(--m10-grad-mint); }
.m10-stat.m10-stat-blue::before   { background: var(--m10-grad-blue); }
.m10-stat.m10-stat-warn::before   { background: linear-gradient(135deg, var(--m10-warning), #FF7A00); }
.m10-stat.m10-stat-danger::before { background: linear-gradient(135deg, var(--m10-danger), #BB1D1D); }

.m10-stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    background: var(--m10-cyan-light);
    color: var(--m10-cyan);
    margin-bottom: 10px;
}

.m10-stat.m10-stat-green .m10-stat-icon  { background: var(--m10-green-light);  color: var(--m10-green-dark); }
.m10-stat.m10-stat-blue .m10-stat-icon   { background: var(--m10-blue-light);   color: var(--m10-blue); }
.m10-stat.m10-stat-warn .m10-stat-icon   { background: rgba(245, 166, 35, 0.15); color: var(--m10-warning); }
.m10-stat.m10-stat-danger .m10-stat-icon { background: rgba(232, 65, 65, 0.12); color: var(--m10-danger); }

.m10-stat-label {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.m10-stat-value {
    font-family: var(--m10-font-display);
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 4px;
}

.m10-stat-delta {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.m10-stat-delta.up   { color: var(--m10-green-dark); }
.m10-stat-delta.down { color: var(--m10-danger); }

[data-bs-theme="dark"] .m10-stat-delta.up { color: var(--m10-green); }


/* =====================================================================
   13. BUTTONS
   ===================================================================== */
.btn {
    font-family: var(--m10-font-display);
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: var(--m10-radius);
    padding: 8px 16px;
    transition: all var(--m10-t-fast);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
}

.btn-sm { padding: 5px 11px; font-size: 0.82rem; border-radius: var(--m10-radius-sm); }
.btn-lg { padding: 11px 22px; font-size: 1rem; }

.btn-m10-primary {
    background: var(--m10-grad-primary);
    color: white;
    border: none;
    box-shadow: 0 4px 14px rgba(58, 178, 209, 0.35);
}
.btn-m10-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(58, 178, 209, 0.5); color: white; }
.btn-m10-primary:active { transform: translateY(0); }

.btn-m10-secondary {
    background: var(--bg-card);
    color: var(--m10-blue);
    border: 1px solid var(--m10-blue);
}
.btn-m10-secondary:hover { background: var(--m10-blue); color: white; }

.btn-m10-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--bd-default);
}
.btn-m10-ghost:hover { background: var(--bg-hover); color: var(--m10-blue); border-color: var(--m10-blue); }

.btn-m10-danger {
    background: var(--m10-danger);
    color: white;
    border: none;
}
.btn-m10-danger:hover { background: #c33333; color: white; }

.btn-m10-success {
    background: var(--m10-green);
    color: white;
    border: none;
}
.btn-m10-success:hover { background: var(--m10-green-dark); color: white; }


/* =====================================================================
   14. FORMS
   ===================================================================== */
.form-label {
    font-family: var(--m10-font-display);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 5px;
    display: block;
}

.form-control, .form-select, .input-group-text {
    background: var(--bg-input);
    border: 1px solid var(--bd-default);
    color: var(--text-primary);
    border-radius: var(--m10-radius);
    padding: 8px 12px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color var(--m10-t-fast), box-shadow var(--m10-t-fast);
}

.form-control:focus, .form-select:focus {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--m10-cyan);
    box-shadow: 0 0 0 3px rgba(58, 178, 209, 0.15);
    outline: none;
}

.form-control:disabled, .form-control[readonly] {
    background: var(--bg-card-alt);
    color: var(--text-muted);
}

.form-control::placeholder { color: var(--text-muted); }

.input-group-text {
    background: var(--bg-card-alt);
    color: var(--text-secondary);
}

.form-check-input {
    background-color: var(--bg-input);
    border-color: var(--bd-strong);
}
.form-check-input:checked {
    background-color: var(--m10-cyan);
    border-color: var(--m10-cyan);
}
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(58, 178, 209, 0.15); }

.form-text { color: var(--text-muted); font-size: 0.78rem; }


/* =====================================================================
   15. TABLES
   ===================================================================== */
.m10-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--bd-default);
    border-radius: var(--m10-radius-lg);
    overflow: hidden;
}

.m10-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
    margin: 0;
}

.m10-table thead th {
    font-family: var(--m10-font-display);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-card-alt);
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--bd-default);
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.m10-table tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--bd-soft);
    color: var(--text-primary);
    vertical-align: middle;
}

.m10-table tbody tr:hover td { background: var(--bg-hover); }
.m10-table tbody tr:last-child td { border-bottom: 0; }

.m10-table .text-end { text-align: right; }
.m10-table .text-center { text-align: center; }


/* =====================================================================
   16. BADGES
   ===================================================================== */
.m10-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.4;
}

.m10-badge-green   { background: var(--m10-green-light);  color: var(--m10-green-dark); }
.m10-badge-blue    { background: var(--m10-blue-light);   color: var(--m10-blue); }
.m10-badge-cyan    { background: var(--m10-cyan-light);   color: var(--m10-cyan-dark); }
.m10-badge-warning { background: rgba(245, 166, 35, 0.14); color: #B97700; }
.m10-badge-danger  { background: rgba(232, 65, 65, 0.12); color: var(--m10-danger); }
.m10-badge-muted   { background: var(--bg-hover);          color: var(--text-secondary); }

[data-bs-theme="dark"] .m10-badge-green   { color: var(--m10-green); }
[data-bs-theme="dark"] .m10-badge-warning { color: var(--m10-warning); }


/* =====================================================================
   17. STATUS PILLS (with dot indicator)
   ===================================================================== */
.m10-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.m10-status::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
}

.m10-status.live::before    { background: var(--m10-green); animation: m10Pulse 1.4s infinite; }
.m10-status.pending::before { background: var(--m10-warning); }
.m10-status.failed::before  { background: var(--m10-danger); }
.m10-status.draft::before   { background: var(--text-muted); }

@keyframes m10Pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(107, 189, 78, 0.6); }
    50%      { box-shadow: 0 0 0 6px rgba(107, 189, 78, 0); }
}


/* =====================================================================
   18. ALERTS
   ===================================================================== */
.alert {
    border: 1px solid transparent;
    border-radius: var(--m10-radius);
    padding: 12px 16px;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 16px;
}

.alert-success { background: var(--m10-green-light); color: var(--m10-green-dark); border-color: rgba(107, 189, 78, 0.25); }
.alert-info    { background: var(--m10-cyan-light);  color: var(--m10-cyan-dark);  border-color: rgba(58, 178, 209, 0.25); }
.alert-warning { background: rgba(245, 166, 35, 0.12); color: #B97700; border-color: rgba(245, 166, 35, 0.25); }
.alert-danger  { background: rgba(232, 65, 65, 0.10);  color: var(--m10-danger);  border-color: rgba(232, 65, 65, 0.22); }

[data-bs-theme="dark"] .alert-success { color: var(--m10-green); }
[data-bs-theme="dark"] .alert-warning { color: var(--m10-warning); }


/* =====================================================================
   19. MODALS
   ===================================================================== */
.modal-content {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--bd-default);
    border-radius: var(--m10-radius-lg);
    box-shadow: var(--m10-shadow-lg);
}

.modal-header, .modal-footer { border-color: var(--bd-default); }

.modal-header .modal-title {
    font-family: var(--m10-font-display);
    font-weight: 700;
}

.btn-close { filter: var(--m10-btn-close-filter, none); }
[data-bs-theme="dark"] {
    --m10-btn-close-filter: invert(1) grayscale(100%) brightness(2);
}


/* =====================================================================
   20. TOASTS / FLASH MESSAGES
   ===================================================================== */
.m10-toast-stack {
    position: fixed;
    top: 78px;
    right: 18px;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 420px;
}

.m10-toast {
    background: var(--bg-card);
    border: 1px solid var(--bd-default);
    border-left: 4px solid var(--m10-cyan);
    border-radius: var(--m10-radius);
    box-shadow: var(--m10-shadow-lg);
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 280px;
    color: var(--text-primary);
    animation: m10ToastIn .3s cubic-bezier(.2,.7,.3,1);
}

.m10-toast.success { border-left-color: var(--m10-green); }
.m10-toast.warning { border-left-color: var(--m10-warning); }
.m10-toast.danger  { border-left-color: var(--m10-danger); }

.m10-toast i:first-child { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.m10-toast.success i:first-child { color: var(--m10-green); }
.m10-toast.warning i:first-child { color: var(--m10-warning); }
.m10-toast.danger  i:first-child { color: var(--m10-danger); }
.m10-toast.info    i:first-child { color: var(--m10-cyan); }

.m10-toast-body { flex: 1; font-size: 0.86rem; line-height: 1.45; }
.m10-toast-body strong { display: block; font-family: var(--m10-font-display); margin-bottom: 1px; }

.m10-toast-close {
    background: transparent;
    border: 0;
    color: var(--text-muted);
    width: 22px; height: 22px;
    border-radius: 6px;
    cursor: pointer;
    line-height: 1;
}
.m10-toast-close:hover { background: var(--bg-hover); color: var(--text-primary); }

@keyframes m10ToastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}


/* =====================================================================
   21. PAGINATION
   ===================================================================== */
.pagination {
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.page-item .page-link {
    border: 1px solid var(--bd-default);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: var(--m10-radius-sm);
    padding: 6px 11px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--m10-t-fast);
}

.page-item .page-link:hover { background: var(--bg-hover); color: var(--m10-blue); border-color: var(--m10-blue); }

.page-item.active .page-link {
    background: var(--m10-grad-primary);
    border-color: transparent;
    color: white;
    box-shadow: 0 2px 8px rgba(58, 178, 209, 0.3);
}

.page-item.disabled .page-link {
    color: var(--text-muted);
    background: var(--bg-card-alt);
    cursor: not-allowed;
    opacity: 0.6;
}


/* =====================================================================
   22. UTILITIES
   ===================================================================== */
.m10-divider {
    height: 1px;
    background: var(--bd-default);
    margin: 16px 0;
    border: 0;
}

.m10-text-muted   { color: var(--text-muted) !important; }
.m10-text-mono    { font-family: 'JetBrains Mono', monospace; font-size: 0.85em; }
.m10-text-display { font-family: var(--m10-font-display); font-weight: 700; letter-spacing: 0.02em; }

.m10-bg-app    { background: var(--bg-app) !important; }
.m10-bg-card   { background: var(--bg-card) !important; }

.m10-soft-card {
    background: var(--bg-card-alt);
    border-radius: var(--m10-radius);
    padding: 14px;
}

.m10-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}
.m10-empty i { font-size: 2.4rem; opacity: 0.4; display: block; margin-bottom: 8px; }


/* =====================================================================
   23. RESPONSIVE
   ===================================================================== */
@media (max-width: 991.98px) {
    .m10-sidebar { transform: translateX(-100%); }
    .m10-main    { margin-left: 0; }
    body.m10-sidebar-open .m10-sidebar { transform: translateX(0); }
    body.m10-sidebar-open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(13, 27, 42, 0.5);
        z-index: 1035;
    }
    .m10-topbar-search { display: none; }
}

@media (max-width: 575.98px) {
    .m10-content { padding: 16px 14px 24px; }
    .m10-page-title { font-size: 1.3rem; }
    .m10-user-info { display: none; }
}


/* =====================================================================
   24. LIVEWIRE FX  (loading states, etc.)
   ===================================================================== */
[wire\:loading], [wire\:loading\.delay] { display: none; }
.wire-loading-flex[wire\:loading] { display: flex !important; }
.wire-loading-inline[wire\:loading] { display: inline-flex !important; }

.m10-wire-overlay {
    position: relative;
}

.m10-wire-overlay[wire\:loading]::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(2px);
    z-index: 5;
    border-radius: inherit;
}

[data-bs-theme="dark"] .m10-wire-overlay[wire\:loading]::after {
    background: rgba(11, 18, 28, 0.55);
}


/* =====================================================================
   25. PRINT
   ===================================================================== */
@media print {
    .m10-sidebar, .m10-topbar, .m10-side-footer { display: none !important; }
    .m10-main { margin-left: 0 !important; }
    body.m10-backend { background: #fff; color: #000; }
    .m10-card { border: 1px solid #ccc; box-shadow: none; }
}
