/* =========================================================
   Chic Crystals Jewel Admin  |  Nickelfox layout  ·  Black & Green theme
   ========================================================= */

:root {
    --bg: #0B0F0D;
    --card: #151B17;
    --card-2: #1A221D;
    --input: #0F1512;
    --border: #1F2A24;
    --border-2: #27332C;

    --primary: #10B981;
    --primary-dark: #065F46;
    --primary-light: #34D399;
    --primary-glow: rgba(16, 185, 129, 0.35);
    --primary-soft: rgba(16, 185, 129, 0.12);

    --text: #FFFFFF;
    --muted: #9AA3B8;
    --muted-2: #6B7585;

    --danger: #F43F5E;
    --warning: #F59E0B;
    --info: #38BDF8;

    --sidebar-w: 250px;
    --sidebar-w-min: 82px;
    --header-h: 76px;
    --radius: 14px;
    --radius-sm: 10px;

    --ease: cubic-bezier(.22, .61, .36, 1);
    --spring: cubic-bezier(.34, 1.56, .64, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: var(--primary-light); text-decoration: none; transition: color .25s var(--ease); }
a:hover { color: var(--primary); }

h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 600; margin: 0; }
.text-muted { color: var(--muted) !important; }
.text-white { color: var(--text) !important; }
.text-primary { color: var(--primary) !important; }
.text-primary-light { color: var(--primary-light) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }

::selection { background: var(--primary); color: #04110B; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }

/* ---------------------------------------------------------
   Keyframes
   --------------------------------------------------------- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(.96) translateY(-6px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulseDot {
    0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, .6); }
    70%  { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
@keyframes floatBlob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(40px, -30px) scale(1.08); }
    66%      { transform: translate(-30px, 25px) scale(.95); }
}
@keyframes shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position: 600px 0; }
}
@keyframes growBar {
    from { width: 0; }
}
@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}

/* ---------------------------------------------------------
   Page loader
   --------------------------------------------------------- */
.custom_loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(11, 15, 13, .72);
    backdrop-filter: blur(4px);
    opacity: 1;
    transition: opacity .3s var(--ease), visibility .3s;
}
.custom_loader.d-none { display: flex !important; opacity: 0; visibility: hidden; pointer-events: none; }
.loader-ring {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 4px solid rgba(16, 185, 129, .15);
    border-top-color: var(--primary);
    animation: spin .8s linear infinite;
    box-shadow: 0 0 30px var(--primary-glow);
}

/* ---------------------------------------------------------
   Layout
   --------------------------------------------------------- */
.admin-wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: width .35s var(--ease), transform .35s var(--ease);
    overflow: hidden;
}
.sidebar-brand {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 22px;
    flex-shrink: 0;
}
.sidebar-brand .brand-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex; align-items: center; justify-content: center;
    color: #04110B;
    box-shadow: 0 8px 24px var(--primary-glow);
    flex-shrink: 0;
    transition: transform .35s var(--spring);
}
.sidebar-brand:hover .brand-icon { transform: rotate(-8deg) scale(1.06); }
.sidebar-brand .brand-text { line-height: 1.2; white-space: nowrap; min-width: 0; transition: opacity .25s var(--ease), transform .25s var(--ease); }
.sidebar-brand .brand-text strong { display: block; font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: -.1px; overflow: hidden; text-overflow: ellipsis; }
.sidebar-brand .brand-text small { font-size: 9.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--primary-light); font-weight: 600; }

.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 16px; }
.sidebar-nav ul { list-style: none; margin: 0; padding: 0; }
.nav-label {
    font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase;
    color: var(--muted-2); padding: 14px 12px 8px; font-weight: 600;
    white-space: nowrap; transition: opacity .25s var(--ease);
}
.nav-item { margin-bottom: 4px; }
.nav-link-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 14px;
    border-radius: 12px;
    color: var(--muted);
    font-weight: 500;
    font-size: 14.5px;
    position: relative;
    white-space: nowrap;
    transition: background .3s var(--ease), color .3s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease);
    overflow: hidden;
}
.nav-link-item i { font-size: 19px; width: 22px; text-align: center; flex-shrink: 0; transition: transform .3s var(--spring), color .3s; }
.nav-link-item span { transition: opacity .25s var(--ease), transform .25s var(--ease); }
.nav-link-item:hover { background: var(--primary-soft); color: var(--text); transform: translateX(4px); }
.nav-link-item:hover i { transform: scale(1.15); color: var(--primary-light); }
.nav-link-item.active {
    background: linear-gradient(135deg, var(--primary), #0E9F6E);
    color: #04110B;
    font-weight: 600;
    box-shadow: 0 10px 24px -6px var(--primary-glow);
}
.nav-link-item.active i { color: #04110B; }
.nav-link-item.active:hover { transform: translateX(0); }
.nav-link-item .badge-count {
    margin-left: auto;
    background: rgba(4, 17, 11, .18);
    color: inherit;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}
.nav-link-item:not(.active) .badge-count { background: var(--primary-soft); color: var(--primary-light); }

.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); flex-shrink: 0; }
.sidebar-user {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 12px;
    background: var(--card-2);
    white-space: nowrap;
    transition: background .3s;
}
.sidebar-user:hover { background: var(--primary-soft); }
.sidebar-user .avatar { flex-shrink: 0; }
.sidebar-user .u-name { color: var(--text); font-weight: 600; font-size: 13px; }
.sidebar-user .u-role { color: var(--muted-2); font-size: 11px; }
.sidebar-user .u-text { transition: opacity .25s var(--ease); min-width: 0; overflow: hidden; }
.sidebar-user .u-text div { overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .logout-btn { margin-left: auto; color: var(--muted); font-size: 18px; transition: color .25s, transform .25s; }
.sidebar-user .logout-btn:hover { color: var(--danger); transform: translateX(2px); }

/* Collapsed sidebar */
body.sidebar-collapsed .sidebar { width: var(--sidebar-w-min); }
body.sidebar-collapsed .sidebar-brand { padding: 0 21px; }
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-link-item span,
body.sidebar-collapsed .nav-link-item .badge-count,
body.sidebar-collapsed .sidebar-user .u-text,
body.sidebar-collapsed .sidebar-user .logout-btn { opacity: 0; transform: translateX(-6px); pointer-events: none; }
body.sidebar-collapsed .nav-link-item { justify-content: center; padding: 13px 0; }
body.sidebar-collapsed .nav-link-item:hover { transform: translateX(0) scale(1.06); }
body.sidebar-collapsed .sidebar-user { justify-content: center; padding: 10px 0; }
body.sidebar-collapsed .nav-label { height: 0; padding: 6px 0; }

/* Main */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .35s var(--ease);
    min-width: 0;
}
body.sidebar-collapsed .main-wrapper { margin-left: var(--sidebar-w-min); }

/* Header */
.topbar {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 1030;
    background: rgba(11, 15, 13, .85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color .3s, box-shadow .3s;
}
.topbar.scrolled { border-bottom-color: var(--border); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6); }
.icon-btn {
    width: 42px; height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--muted);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px;
    cursor: pointer;
    position: relative;
    transition: background .3s, color .3s, transform .3s var(--spring), border-color .3s, box-shadow .3s;
}
.icon-btn:hover { background: var(--primary-soft); color: var(--primary-light); border-color: var(--primary-dark); transform: translateY(-2px); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .dot {
    position: absolute; top: 9px; right: 10px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--primary);
    animation: pulseDot 2s infinite;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-menu { position: relative; }
.user-menu-toggle {
    display: flex; align-items: center; gap: 10px;
    padding: 5px 10px 5px 5px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--card);
    cursor: pointer;
    transition: background .3s, border-color .3s;
}
.user-menu-toggle:hover { background: var(--card-2); border-color: var(--border-2); }
.user-menu-toggle .chev { font-size: 14px; color: var(--muted); transition: transform .3s var(--ease); }
.user-menu.open .user-menu-toggle .chev { transform: rotate(180deg); }
.user-menu-toggle .u-name { color: var(--text); font-size: 13px; font-weight: 600; }
.user-menu-toggle .u-role { color: var(--muted-2); font-size: 11px; display: block; }
.avatar {
    width: 36px; height: 36px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #04110B;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
    flex-shrink: 0;
}
.avatar.lg { width: 84px; height: 84px; border-radius: 24px; font-size: 30px; }
.avatar.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }
.avatar.soft { background: var(--primary-soft); color: var(--primary-light); }

.dropdown-panel {
    position: absolute;
    right: 0; top: calc(100% + 10px);
    min-width: 220px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 24px 50px -12px rgba(0, 0, 0, .7);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(.97);
    transform-origin: top right;
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
    z-index: 1050;
}
.user-menu.open .dropdown-panel { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.dropdown-panel .dp-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown-panel .dp-head b { color: var(--text); display: block; font-size: 14px; }
.dropdown-panel .dp-head small { color: var(--muted-2); font-size: 12px; }
.dropdown-panel a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 10px;
    color: var(--muted); font-size: 13.5px;
    transition: background .25s, color .25s, transform .25s;
}
.dropdown-panel a:hover { background: var(--primary-soft); color: var(--text); transform: translateX(3px); }
.dropdown-panel a.danger:hover { background: rgba(244, 63, 94, .12); color: var(--danger); }
.dropdown-panel a i { font-size: 17px; }

/* Content */
.content { padding: 8px 28px 28px; flex: 1; animation: fadeUp .5s var(--ease) both; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 16px 0 22px; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.4px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.breadcrumb-x { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted-2); margin-bottom: 6px; }
.breadcrumb-x a { color: var(--muted-2); }
.breadcrumb-x a:hover { color: var(--primary-light); }
.breadcrumb-x i { font-size: 10px; }
.breadcrumb-x .current { color: var(--primary-light); }

.footer { padding: 18px 28px; color: var(--muted-2); font-size: 12.5px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.footer a { color: var(--primary-light); }

/* ---------------------------------------------------------
   Cards
   --------------------------------------------------------- */
.card-x {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s;
    animation: fadeUp .55s var(--ease) both;
}
.card-x.hover-lift:hover { transform: translateY(-4px); box-shadow: 0 24px 40px -18px rgba(0, 0, 0, .8); border-color: var(--border-2); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head h3 { font-size: 18px; font-weight: 700; letter-spacing: -.3px; }
.card-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

/* Stagger */
.stagger > * { animation: fadeUp .55s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: .05s; }
.stagger > *:nth-child(2) { animation-delay: .12s; }
.stagger > *:nth-child(3) { animation-delay: .19s; }
.stagger > *:nth-child(4) { animation-delay: .26s; }
.stagger > *:nth-child(5) { animation-delay: .33s; }
.stagger > *:nth-child(6) { animation-delay: .40s; }
.stagger > *:nth-child(7) { animation-delay: .47s; }
.stagger > *:nth-child(8) { animation-delay: .54s; }

/* Stat tiles (Today's Sales style) */
.stat-tile {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: transform .35s var(--spring), border-color .35s, box-shadow .35s;
}
.stat-tile::after {
    content: '';
    position: absolute;
    right: -30px; top: -30px;
    width: 110px; height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-glow), transparent 70%);
    opacity: 0;
    transition: opacity .4s;
}
.stat-tile:hover { transform: translateY(-5px); border-color: var(--primary-dark); box-shadow: 0 18px 30px -16px var(--primary-glow); }
.stat-tile:hover::after { opacity: 1; }
.stat-tile .st-icon {
    width: 44px; height: 44px; border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 21px;
    margin-bottom: 16px;
    transition: transform .4s var(--spring), background .3s, color .3s;
}
.stat-tile:hover .st-icon { transform: rotate(-10deg) scale(1.1); background: var(--primary); color: #04110B; }
.stat-tile .st-value { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -.5px; }
.stat-tile .st-label { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.stat-tile .st-trend { font-size: 12px; color: var(--primary-light); margin-top: 8px; font-weight: 600; }
.stat-tile .st-trend.down { color: var(--danger); }
.stat-tile .st-trend i { font-size: 11px; }

/* Hero number (Earnings style) */
.hero-number { font-size: 40px; font-weight: 700; color: var(--primary-light); letter-spacing: -1px; line-height: 1.1; }

/* Progress bars */
.bar-track { height: 6px; border-radius: 10px; background: var(--border); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 10px; background: var(--primary); animation: growBar 1.2s var(--ease) both; }
.bar-fill.warn { background: var(--warning); }
.bar-fill.danger { background: var(--danger); }
.bar-fill.info { background: var(--info); }

/* ---------------------------------------------------------
   Tables
   --------------------------------------------------------- */
.table-x { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-x th {
    text-align: left;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--muted-2);
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table-x td {
    padding: 14px;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-size: 13.5px;
    transition: background .25s;
}
.table-x tbody tr { animation: fadeIn .5s var(--ease) both; transition: background .25s, transform .25s; }
.table-x tbody tr:nth-child(1) { animation-delay: .05s; }
.table-x tbody tr:nth-child(2) { animation-delay: .10s; }
.table-x tbody tr:nth-child(3) { animation-delay: .15s; }
.table-x tbody tr:nth-child(4) { animation-delay: .20s; }
.table-x tbody tr:nth-child(5) { animation-delay: .25s; }
.table-x tbody tr:nth-child(6) { animation-delay: .30s; }
.table-x tbody tr:nth-child(7) { animation-delay: .35s; }
.table-x tbody tr:nth-child(8) { animation-delay: .40s; }
.table-x tbody tr:hover td { background: rgba(16, 185, 129, .05); }
.table-x tbody tr:last-child td { border-bottom: 0; }
.table-x td b, .table-x td strong { color: var(--text); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.table-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 16px; font-size: 13px; color: var(--muted-2); }

.product-cell { display: flex; align-items: center; gap: 12px; }
.product-thumb {
    width: 44px; height: 44px; border-radius: 10px;
    background: var(--card-2);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--primary-light); font-size: 20px;
    flex-shrink: 0;
    transition: transform .3s var(--spring), background .3s;
}
tr:hover .product-thumb { transform: scale(1.08); background: var(--primary-soft); }

/* Pagination */
.pagination-x { display: flex; align-items: center; gap: 6px; }
.pagination-x a, .pagination-x span {
    min-width: 34px; height: 34px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; color: var(--muted); font-size: 13px; font-weight: 600;
    transition: background .25s, color .25s, transform .25s;
}
.pagination-x a:hover { background: var(--primary-soft); color: var(--primary-light); transform: translateY(-2px); }
.pagination-x .active { background: var(--primary); color: #04110B; }

/* Badges */
.badge-x {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 11px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}
.badge-x::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-x.success { background: var(--primary-soft); color: var(--primary-light); border-color: rgba(16, 185, 129, .25); }
.badge-x.warning { background: rgba(245, 158, 11, .12); color: #FBBF24; border-color: rgba(245, 158, 11, .25); }
.badge-x.danger  { background: rgba(244, 63, 94, .12); color: #FB7185; border-color: rgba(244, 63, 94, .25); }
.badge-x.info    { background: rgba(56, 189, 248, .12); color: #7DD3FC; border-color: rgba(56, 189, 248, .25); }
.badge-x.neutral { background: var(--card-2); color: var(--muted); border-color: var(--border-2); }

/* Action buttons */
.action-btns { display: flex; gap: 6px; }
.action-btn {
    width: 34px; height: 34px; border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card-2);
    color: var(--muted);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 15px;
    cursor: pointer;
    transition: all .25s var(--ease);
}
.action-btn:hover { transform: translateY(-2px); color: var(--primary-light); border-color: var(--primary-dark); background: var(--primary-soft); }
.action-btn.del:hover { color: var(--danger); border-color: rgba(244, 63, 94, .4); background: rgba(244, 63, 94, .12); }

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */
.btn-x {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; padding: 0 22px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px; font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform .3s var(--spring), box-shadow .3s, background .3s, color .3s, border-color .3s;
    text-decoration: none;
}
.btn-x:active { transform: scale(.97); }
.btn-x i { font-size: 16px; }
.btn-x.sm { height: 38px; padding: 0 16px; font-size: 13px; }
.btn-primary-x { background: var(--primary); color: #04110B; box-shadow: 0 10px 24px -8px var(--primary-glow); }
.btn-primary-x:hover { background: var(--primary-light); color: #04110B; transform: translateY(-2px); box-shadow: 0 14px 30px -8px var(--primary-glow); }
.btn-outline-x { background: transparent; color: var(--primary-light); border-color: var(--primary); }
.btn-outline-x:hover { background: var(--primary-soft); color: var(--primary-light); transform: translateY(-2px); }
.btn-secondary-x { background: var(--card-2); color: var(--text); border-color: var(--border-2); }
.btn-secondary-x:hover { background: var(--border); color: var(--text); transform: translateY(-2px); }
.btn-danger-x { background: rgba(244, 63, 94, .12); color: #FB7185; border-color: rgba(244, 63, 94, .3); }
.btn-danger-x:hover { background: var(--danger); color: #fff; }
.btn-x .ripple {
    position: absolute; border-radius: 50%;
    width: 20px; height: 20px;
    background: rgba(255, 255, 255, .35);
    transform: scale(0);
    animation: ripple .6s linear;
    pointer-events: none;
}
.btn-x.w-100 { width: 100%; }

/* ---------------------------------------------------------
   Forms
   --------------------------------------------------------- */
.form-group-x { margin-bottom: 20px; }
.form-label-x { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.form-label-x .req { color: var(--danger); margin-left: 2px; }
.form-control-x {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--input);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .3s var(--ease), box-shadow .3s var(--ease), background .3s;
    -webkit-appearance: none;
    appearance: none;
}
.form-control-x::placeholder { color: var(--muted-2); }
.form-control-x:hover { border-color: var(--border-2); }
.form-control-x:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); background: var(--bg); }
textarea.form-control-x { height: auto; min-height: 120px; padding: 14px 16px; resize: vertical; }
select.form-control-x {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%239AA3B8' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}
select.form-control-x option { background: var(--card); color: var(--text); }
.form-control-x.border-danger { border-color: var(--danger) !important; box-shadow: 0 0 0 4px rgba(244, 63, 94, .12); }
.errmsg { display: block; color: #FB7185; font-size: 12px; margin-top: 6px; min-height: 0; transition: all .3s; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 16px; transition: color .3s; pointer-events: none; }
.input-icon .form-control-x { padding-left: 46px; }
.input-icon:focus-within > i { color: var(--primary); }
.input-icon .toggle-pass {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    color: var(--muted-2); cursor: pointer; font-size: 17px; background: none; border: 0;
    transition: color .3s;
}
.input-icon .toggle-pass:hover { color: var(--primary-light); }
.input-group-x { display: flex; }
.input-group-x .addon {
    display: flex; align-items: center; padding: 0 14px;
    background: var(--card-2); border: 1px solid var(--border); border-right: 0;
    border-radius: 12px 0 0 12px; color: var(--muted); font-weight: 600;
}
.input-group-x .form-control-x { border-radius: 0 12px 12px 0; }

/* Switch */
.switch-x { position: relative; display: inline-block; width: 46px; height: 26px; }
.switch-x input { opacity: 0; width: 0; height: 0; }
.switch-x .slider {
    position: absolute; inset: 0; cursor: pointer;
    background: var(--border-2); border-radius: 30px;
    transition: background .3s var(--ease);
}
.switch-x .slider::before {
    content: ''; position: absolute;
    width: 20px; height: 20px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%;
    transition: transform .3s var(--spring);
}
.switch-x input:checked + .slider { background: var(--primary); }
.switch-x input:checked + .slider::before { transform: translateX(20px); }

/* Checkbox */
.check-x { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--muted); font-size: 13.5px; user-select: none; }
.check-x input { display: none; }
.check-x .box {
    width: 20px; height: 20px; border-radius: 6px;
    border: 1.5px solid var(--border-2); background: var(--input);
    display: inline-flex; align-items: center; justify-content: center;
    transition: all .25s var(--ease);
}
.check-x .box i { font-size: 12px; color: #04110B; opacity: 0; transform: scale(.4); transition: all .25s var(--spring); }
.check-x input:checked + .box { background: var(--primary); border-color: var(--primary); }
.check-x input:checked + .box i { opacity: 1; transform: scale(1); }

/* Upload dropzone */
.dropzone-x {
    border: 2px dashed var(--border-2);
    border-radius: 14px;
    padding: 34px 20px;
    text-align: center;
    background: var(--input);
    cursor: pointer;
    transition: border-color .3s, background .3s, transform .3s;
}
.dropzone-x:hover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone-x i { font-size: 36px; color: var(--primary-light); display: block; margin-bottom: 10px; transition: transform .4s var(--spring); }
.dropzone-x:hover i { transform: translateY(-4px) scale(1.1); }
.dropzone-x b { color: var(--text); }
.dropzone-x small { display: block; color: var(--muted-2); margin-top: 4px; }
.preview-grid { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.preview-grid .pv { width: 72px; height: 72px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--muted-2); font-size: 22px; position: relative; }
.preview-grid .pv .rm { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--danger); color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* Filter bar */
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filter-bar .form-control-x { height: 42px; width: auto; min-width: 180px; }
.filter-bar .search { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.filter-bar .search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-2); }
.filter-bar .search .form-control-x { width: 100%; padding-left: 40px; }

/* Tabs */
.tabs-x { display: flex; gap: 6px; background: var(--bg); padding: 5px; border-radius: 12px; border: 1px solid var(--border); width: fit-content; }
.tabs-x a { padding: 8px 16px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); transition: all .25s; }
.tabs-x a:hover { color: var(--text); }
.tabs-x a.active { background: var(--primary); color: #04110B; box-shadow: 0 6px 16px -6px var(--primary-glow); }

/* Timeline */
.timeline-x { list-style: none; margin: 0; padding: 0 0 0 6px; position: relative; }
.timeline-x::before { content: ''; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.timeline-x li { position: relative; padding: 0 0 22px 32px; animation: fadeUp .5s var(--ease) both; }
.timeline-x li:nth-child(2) { animation-delay: .1s; }
.timeline-x li:nth-child(3) { animation-delay: .2s; }
.timeline-x li:nth-child(4) { animation-delay: .3s; }
.timeline-x li::before {
    content: ''; position: absolute; left: 5px; top: 4px;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--card); border: 3px solid var(--border-2);
    transition: all .3s;
}
.timeline-x li.done::before { border-color: var(--primary); background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.timeline-x li.current::before { border-color: var(--primary-light); animation: pulseDot 2s infinite; }
.timeline-x li b { color: var(--text); display: block; font-size: 13.5px; }
.timeline-x li small { color: var(--muted-2); font-size: 12px; }

/* Info list */
.info-list { list-style: none; margin: 0; padding: 0; }
.info-list li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.info-list li:last-child { border-bottom: 0; }
.info-list li span:first-child { color: var(--muted-2); }
.info-list li span:last-child { color: var(--text); font-weight: 600; text-align: right; }

/* Mini list (dashboard) */
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); transition: transform .25s; }
.mini-list li:hover { transform: translateX(4px); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list .ml-text { flex: 1; min-width: 0; }
.mini-list .ml-text b { display: block; color: var(--text); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-list .ml-text small { color: var(--muted-2); font-size: 12px; }

/* Legend */
.legend-x { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend-x span { display: inline-flex; align-items: center; gap: 7px; }
.legend-x i { width: 10px; height: 10px; border-radius: 3px; background: var(--primary); display: inline-block; }
.legend-x i.light { background: var(--primary-light); }
.legend-x i.dark { background: var(--primary-dark); }

/* Toast */
.toast-wrap { position: fixed; right: 24px; top: 24px; z-index: 10000; display: flex; flex-direction: column; gap: 10px; }
.toast-x {
    display: flex; align-items: center; gap: 12px;
    min-width: 280px; max-width: 380px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--card);
    border: 1px solid var(--border-2);
    border-left: 4px solid var(--primary);
    color: var(--text);
    font-size: 13.5px; font-weight: 500;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .8);
    animation: slideInRight .4s var(--spring) both;
}
.toast-x.hide { animation: fadeIn .3s reverse both; }
.toast-x i { font-size: 20px; color: var(--primary-light); }
.toast-x.error { border-left-color: var(--danger); }
.toast-x.error i { color: var(--danger); }
.toast-x.warning { border-left-color: var(--warning); }
.toast-x.warning i { color: var(--warning); }

/* Modal (bootstrap override) */
.modal-content { background: var(--card); border: 1px solid var(--border-2); border-radius: 18px; color: var(--muted); }
.modal-header, .modal-footer { border-color: var(--border); }
.modal-title { color: var(--text); font-weight: 700; }
.modal-backdrop.show { opacity: .7; backdrop-filter: blur(3px); }
.modal.fade .modal-dialog { transition: transform .35s var(--spring), opacity .3s; transform: scale(.94) translateY(-10px); }
.modal.show .modal-dialog { transform: none; }
.btn-close { filter: invert(1) grayscale(1) brightness(1.5); }

/* Empty state */
.empty-x { text-align: center; padding: 50px 20px; }
.empty-x i { font-size: 54px; color: var(--primary-dark); display: block; margin-bottom: 14px; }
.empty-x b { color: var(--text); display: block; font-size: 16px; }
.empty-x p { color: var(--muted-2); margin: 6px 0 0; font-size: 13px; }

/* Skeleton shimmer */
.skeleton { background: linear-gradient(90deg, var(--card-2) 25%, var(--border) 50%, var(--card-2) 75%); background-size: 1200px 100%; animation: shimmer 1.6s infinite linear; border-radius: 8px; }

/* Chart container */
.chart-box { width: 100%; min-height: 240px; }
.apexcharts-tooltip { background: var(--card-2) !important; border: 1px solid var(--border-2) !important; color: var(--text) !important; box-shadow: 0 10px 30px -10px rgba(0,0,0,.8) !important; border-radius: 10px !important; }
.apexcharts-tooltip-title { background: var(--bg) !important; border-color: var(--border) !important; color: var(--muted) !important; }
.apexcharts-xaxistooltip { background: var(--card-2) !important; border-color: var(--border-2) !important; color: var(--text) !important; }
.apexcharts-xaxistooltip::before, .apexcharts-xaxistooltip::after { border-bottom-color: var(--border-2) !important; }

/* ---------------------------------------------------------
   Auth pages
   --------------------------------------------------------- */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; position: relative; overflow: hidden; }
.auth-blob {
    position: absolute; border-radius: 50%; filter: blur(80px); opacity: .35; pointer-events: none;
    animation: floatBlob 14s ease-in-out infinite;
}
.auth-blob.b1 { width: 420px; height: 420px; background: var(--primary); top: -120px; left: -100px; }
.auth-blob.b2 { width: 360px; height: 360px; background: var(--primary-dark); bottom: -120px; right: -80px; animation-delay: -6s; }
.auth-grid {
    position: absolute; inset: 0; pointer-events: none;
    background-image: linear-gradient(rgba(16,185,129,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(16,185,129,.06) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
}
.auth-box { width: 100%; max-width: 480px; position: relative; z-index: 2; animation: fadeUp .7s var(--ease) both; }
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 28px; animation: fadeUp .6s var(--ease) both; }
.auth-logo .brand-icon { width: 54px; height: 54px; border-radius: 16px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); display: flex; align-items: center; justify-content: center; color: #04110B; box-shadow: 0 14px 34px var(--primary-glow); }
.auth-logo .brand-text strong { display: block; font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -.5px; line-height: 1; }
.auth-logo .brand-text small { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--primary-light); font-weight: 600; }
.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 44px 44px 36px;
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(16,185,129,.05);
    animation: fadeUp .7s .1s var(--ease) both;
}
.auth-card h2 { text-align: center; font-size: 28px; font-weight: 700; letter-spacing: -.5px; }
.auth-card .sub { text-align: center; color: var(--muted); margin: 8px 0 30px; font-size: 14px; }
.auth-card .form-group-x { animation: fadeUp .5s var(--ease) both; }
.auth-card .form-group-x:nth-of-type(1) { animation-delay: .25s; }
.auth-card .form-group-x:nth-of-type(2) { animation-delay: .32s; }
.auth-card .form-control-x { height: 52px; }
.auth-card .btn-x { height: 50px; font-size: 15px; }
.auth-foot { text-align: center; color: var(--muted-2); font-size: 12.5px; margin-top: 22px; }

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(2px); z-index: 1035; opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
.mobile-toggle { display: none; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; }
    body.sidebar-open .sidebar { transform: translateX(0); box-shadow: 30px 0 60px rgba(0, 0, 0, .6); }
    body.sidebar-open .sidebar-overlay { opacity: 1; visibility: visible; }
    body.sidebar-collapsed .brand-text, body.sidebar-collapsed .nav-label, body.sidebar-collapsed .nav-link-item span, body.sidebar-collapsed .nav-link-item .badge-count, body.sidebar-collapsed .sidebar-user .u-text, body.sidebar-collapsed .sidebar-user .logout-btn { opacity: 1; transform: none; pointer-events: auto; }
    body.sidebar-collapsed .nav-link-item { justify-content: flex-start; padding: 13px 14px; }
    body.sidebar-collapsed .sidebar-user { justify-content: flex-start; padding: 10px 12px; }
    .main-wrapper, body.sidebar-collapsed .main-wrapper { margin-left: 0; }
    .mobile-toggle { display: inline-flex; }
    .desktop-toggle { display: none; }
    .topbar { padding: 0 16px; }
    .content { padding: 8px 16px 20px; }
    .footer { padding: 16px; }
    .user-menu-toggle .u-text { display: none; }
    .auth-card { padding: 32px 24px 28px; }
}
@media (max-width: 575.98px) {
    .page-head h1 { font-size: 20px; }
    .card-x { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Browser autofill: keep dark inputs */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--input) inset !important;
    -webkit-text-fill-color: var(--text) !important;
    caret-color: var(--text);
    border-color: var(--border);
    transition: background-color 9999s ease-in-out 0s;
}

/* Collapsed sidebar: take hidden text out of the flow so icons stay centred */
@media (min-width: 992px) {
    body.sidebar-collapsed .nav-link-item { gap: 0; }
    body.sidebar-collapsed .nav-link-item span,
    body.sidebar-collapsed .nav-link-item .badge-count,
    body.sidebar-collapsed .brand-text,
    body.sidebar-collapsed .sidebar-user .u-text,
    body.sidebar-collapsed .sidebar-user .logout-btn { width: 0; margin: 0; padding: 0; overflow: hidden; }
    body.sidebar-collapsed .sidebar-brand { gap: 0; }
    body.sidebar-collapsed .sidebar-user { gap: 0; }
}

/* Compact status list on the dashboard */
.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.status-grid .sg {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border);
    transition: transform .25s var(--ease), border-color .25s;
}
.status-grid .sg:hover { transform: translateY(-2px); border-color: var(--border-2); }
.status-grid .sg b { color: var(--text); font-size: 15px; }

/* Login: options row between fields and button */
.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 26px;
    animation: fadeUp .5s .38s var(--ease) both;
}
.auth-card .btn-x { animation: fadeUp .5s .44s var(--ease) both; }
.check-x .box { flex-shrink: 0; }

/* Compact list tables */
.table-x th { padding: 9px 12px; font-size: 12px; }
.table-x td { padding: 8px 12px; font-size: 13px; line-height: 1.35; }
.table-x th:first-child, .table-x td:first-child { padding-left: 8px; width: 44px; }
.product-cell { gap: 10px; }
.product-thumb { width: 36px; height: 36px; border-radius: 9px; font-size: 17px; }
.table-x .avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.table-x .switch-x { width: 40px; height: 22px; vertical-align: middle; }
.table-x .switch-x .slider::before { width: 16px; height: 16px; }
.table-x .switch-x input:checked + .slider::before { transform: translateX(18px); }
.table-x .action-btn { width: 30px; height: 30px; border-radius: 8px; font-size: 14px; }
.table-x .badge-x { padding: 3px 9px; font-size: 11.5px; }
.table-x .bar-track { height: 5px; }
.table-foot { padding-top: 12px; }
.filter-bar { margin-bottom: 14px; }
.filter-bar .form-control-x { height: 40px; }

/* Equal-height cards only when a card is the sole child of a grid column */
.row > [class*="col"] > .card-x:only-child { height: 100%; }
