/* ================================================================
   DESIGN SYSTEM â€” CSS Custom Properties
   ================================================================ */
:root {
    /* Backgrounds */
    --bg-body: #050505;
    --bg-card: rgba(18, 18, 20, 0.8);
    --bg-card-solid: #121214;
    --bg-input: #1a1a1e;
    --bg-sidebar: #050505;
    --bg-hover: rgba(225, 78, 202, 0.1);
    --bg-active: rgba(225, 78, 202, 0.2);

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-input: rgba(225, 78, 202, 0.3);
    --border-focus: rgba(225, 78, 202, 0.8);
    --border-highlight: rgba(255, 255, 255, 0.15);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #e14eca 0%, #ba20a1 100%);
    --gradient-primary-hover: linear-gradient(135deg, #ba20a1 0%, #871474 100%);
    --gradient-success: linear-gradient(135deg, #00f2c3 0%, #009879 100%);
    --gradient-warning: linear-gradient(135deg, #ff8d72 0%, #d4563a 100%);
    --gradient-danger: linear-gradient(135deg, #fd5d93 0%, #d83068 100%);
    
    /* Accent colors */
    --color-primary: #e14eca;
    --color-primary-light: #f38bee;
    --color-secondary: #ba20a1;
    --color-success: #00f2c3;
    --color-success-bg: rgba(0, 242, 195, 0.1);
    --color-warning: #ff8d72;
    --color-warning-bg: rgba(255, 141, 114, 0.1);
    --color-danger: #fd5d93;
    --color-danger-bg: rgba(253, 93, 147, 0.1);
    --color-info: #1d8cf8;
    --color-info-bg: rgba(29, 140, 248, 0.1);

    /* Text */
    --text-primary: #f9fafb;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --text-inverse: #000000;

    /* Glow Effects */
    --glow-primary: 0 0 12px rgba(225, 78, 202, 0.4);
    --glow-success: 0 0 12px rgba(0, 242, 195, 0.3);
    --glow-danger: 0 0 12px rgba(253, 93, 147, 0.3);

    /* Shadows */
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-modal: 0 10px 40px rgba(0, 0, 0, 0.6);

    /* Layout */
    --sidebar-width: 270px;
    --transition: all 0.2s ease-in-out;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
}

/* Light Mode Overrides */
body.light-mode {
    --bg-body: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-solid: #ffffff;
    --bg-input: rgba(241, 245, 249, 0.8);
    --bg-sidebar: rgba(255, 255, 255, 0.95);
    --bg-hover: rgba(0, 0, 0, 0.05);
    --bg-active: rgba(0, 0, 0, 0.1);

    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-input: rgba(0, 0, 0, 0.15);
    --border-highlight: rgba(0, 0, 0, 0.1);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ================================================================
   RESET & BASE
   ================================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    background-image: url('bg.png'),
        radial-gradient(at 0% 0%, rgba(40, 40, 40, 0.25) 0px, transparent 40%),
        radial-gradient(at 100% 100%, rgba(30, 30, 30, 0.25) 0px, transparent 50%);
    background-size: cover, auto, auto;
    background-position: center, 0% 0%, 100% 100%;
    background-blend-mode: overlay;
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.light-mode {
    background-image: url('bg.png'),
        radial-gradient(at 0% 0%, rgba(200, 200, 220, 0.15) 0px, transparent 40%),
        radial-gradient(at 100% 100%, rgba(200, 210, 230, 0.15) 0px, transparent 50%);
}

body.light-mode .glass-card,
body.light-mode .glass-sidebar {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .sidebar-nav .nav-item {
    color: var(--text-secondary);
}

body.light-mode .sidebar-nav .nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

body.light-mode .sidebar-nav .nav-item.active {
    color: var(--text-primary);
}

body.light-mode .table th {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-secondary);
}

body.light-mode .table td {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.light-mode .table tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

body.light-mode .input,
body.light-mode select.input,
body.light-mode textarea.input {
    background: var(--bg-input);
    border-color: var(--border-input);
    color: var(--text-primary);
}

body.light-mode .login-panel {
    background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 50%, #e2e8f0 100%);
}

body.light-mode .badge {
    border: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .modal-overlay {
    background: rgba(0, 0, 0, 0.3);
}

body.light-mode .btn-ghost {
    color: var(--text-secondary);
}

body.light-mode .btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ================================================================
   BACKGROUND BLOBS
   ================================================================ */
.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.6;
    animation: blob-float 15s infinite ease-in-out alternate;
    pointer-events: none;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: rgba(225, 78, 202, 0.1);
    animation-delay: 0s;
}

.blob-2 {
    bottom: -20%;
    right: -10%;
    width: 700px;
    height: 700px;
    background: rgba(29, 140, 248, 0.08);
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 40%;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.02);
    animation-delay: -10s;
}

@keyframes blob-float {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -60px) scale(1.1); }
    66% { transform: translate(-30px, 30px) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; outline: none; }
input, textarea, select { font-family: inherit; }

.hidden { display: none !important; }

/* ================================================================
   SCROLLBAR
   ================================================================ */
::-webkit-scrollbar { 
    width: 6px; 
    height: 6px; 
}
::-webkit-scrollbar-track { 
    background: transparent; 
}
::-webkit-scrollbar-thumb {
    background: rgba(225, 78, 202, 0.2);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}
::-webkit-scrollbar-thumb:hover { 
    background: rgba(225, 78, 202, 0.4); 
}

/* ================================================================
   GLASS UTILITIES
   ================================================================ */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    pointer-events: none;
}

.glass-sidebar {
    background: var(--bg-sidebar);
    backdrop-filter: blur(35px);
    -webkit-backdrop-filter: blur(35px);
    border-right: 1px solid var(--border-subtle);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}

/* ================================================================
   ANIMATIONS
   ================================================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(50px) scale(0.95); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes cardEntry {
    from { opacity: 0; transform: translateY(16px); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-fade { animation: fadeIn 0.4s ease forwards; }
.animate-slide { animation: slideUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.animate-card { animation: cardEntry 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

/* ================================================================
   INPUT COMPONENTS
   ================================================================ */
.input-group {
    position: relative;
    width: 100%;
}

.input, .textarea, .select {
    width: 100%;
    padding: 13px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
    backdrop-filter: blur(5px);
}

.input:hover, .textarea:hover, .select:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.input:focus, .textarea:focus, .select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(225, 78, 202, 0.18);
    background: rgba(26, 26, 30, 0.95);
}

.input::placeholder, .textarea::placeholder {
    color: var(--text-muted);
}

.textarea {
    resize: vertical;
    min-height: 120px;
    font-family: 'Inter', monospace;
    line-height: 1.6;
}

.select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 44px;
}

.eye-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.25rem;
    opacity: 0.45;
    transition: var(--transition);
    padding: 6px;
}

.eye-toggle:hover { opacity: 0.85; }

.input-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ================================================================
   BUTTON COMPONENTS
   ================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    user-select: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--glow-primary);
}
.btn-primary:hover {
    background: var(--gradient-primary-hover);
    box-shadow: 0 0 32px rgba(225, 78, 202, 0.45);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--gradient-success);
    color: #fff;
}
.btn-success:hover {
    box-shadow: var(--glow-success);
    transform: translateY(-1px);
    opacity: 0.95;
}

.btn-danger {
    background: rgba(253, 93, 147, 0.1);
    color: var(--color-danger);
    border: 1px solid rgba(253, 93, 147, 0.18);
}
.btn-danger:hover {
    background: rgba(253, 93, 147, 0.18);
    border-color: rgba(253, 93, 147, 0.3);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-sm { 
    padding: 7px 14px; 
    font-size: 0.85rem; 
    border-radius: var(--radius-sm); 
}
.btn-block { width: 100%; }

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ================================================================
   APP LAYOUT
   ================================================================ */
.app {
    display: flex;
    min-height: 100vh;
}

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 28px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
    font-size: 2rem;
    line-height: 1;
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.6));
}

.sidebar-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-primary);
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
    letter-spacing: -0.01em;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 8px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    margin: 4px 8px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    border: 1px solid transparent;
    background: none;
    width: calc(100% - 16px);
    text-align: left;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--gradient-primary);
    border-radius: 0 3px 3px 0;
    transition: var(--transition);
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-color: rgba(255, 255, 255, 0.02);
}

.nav-item.active {
    color: var(--text-primary);
    background: var(--bg-active);
    border-color: rgba(225, 78, 202, 0.18);
    box-shadow: inset 0 0 10px rgba(225, 78, 202, 0.05);
}

.nav-item.active::before {
    height: 50%;
}

.nav-icon { 
    font-size: 1.25rem; 
    flex-shrink: 0; 
    width: 24px; 
    text-align: center;
    transition: var(--transition);
}

.nav-item:hover .nav-icon {
    transform: scale(1.1);
}

.nav-label { flex: 1; }

.sidebar-footer {
    padding: 16px 8px;
    border-top: 1px solid var(--border-subtle);
}

.logout-btn:hover { 
    color: var(--color-danger) !important; 
    background: rgba(253, 93, 147, 0.08) !important;
    border-color: rgba(253, 93, 147, 0.15) !important;
}

/* ================================================================
   MAIN CONTENT
   ================================================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 40px;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
}

/* ================================================================
   PAGE HEADER
   ================================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.02em;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 6px;
    font-weight: 400;
}

/* ================================================================
   STAT CARDS (Dashboard)
   ================================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    padding: 24px 28px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0.8;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--glow-primary);
    border-color: rgba(225, 78, 202, 0.2);
}

.stat-card-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    display: inline-block;
    transition: var(--transition);
}

.stat-card:hover .stat-card-icon {
    transform: scale(1.15) rotate(5deg);
}

.stat-card-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.stat-card-value {
    font-size: 1.9rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.stat-accent-success::before { background: linear-gradient(135deg, #10b981, #34d399); }
.stat-accent-warning::before { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.stat-accent-info::before { background: linear-gradient(135deg, #3b82f6, #60a5fa); }

/* ================================================================
   TABLES
   ================================================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    padding: 16px 20px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.02);
    white-space: nowrap;
}

.table tbody td {
    padding: 16px 20px;
    font-size: 0.92rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    transition: var(--transition);
}

.table tbody tr { transition: var(--transition); }

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.table tbody tr:hover td { color: var(--text-primary); }
.table tbody tr:last-child td { border-bottom: none; }

/* ================================================================
   BADGES
   ================================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
}

.badge-success { 
    background: rgba(16, 185, 129, 0.08); 
    color: var(--color-success); 
    border-color: rgba(16, 185, 129, 0.15);
}
.badge-warning { 
    background: rgba(245, 158, 11, 0.08); 
    color: var(--color-warning); 
    border-color: rgba(245, 158, 11, 0.15);
}
.badge-danger { 
    background: rgba(239, 68, 68, 0.08); 
    color: var(--color-danger); 
    border-color: rgba(239, 68, 68, 0.15);
}
.badge-info { 
    background: rgba(59, 130, 246, 0.08); 
    color: var(--color-info); 
    border-color: rgba(59, 130, 246, 0.15);
}
.badge-primary { 
    background: rgba(239, 68, 68, 0.08); 
    color: var(--color-primary-light); 
    border-color: rgba(239, 68, 68, 0.15);
}

.badge-bronze { 
    background: rgba(205, 127, 50, 0.08); 
    color: #df914b; 
    border-color: rgba(205, 127, 50, 0.15);
}
.badge-prata { 
    background: rgba(192, 192, 192, 0.08); 
    color: #e2e2e2; 
    border-color: rgba(192, 192, 192, 0.15);
}
.badge-ouro { 
    background: rgba(255, 215, 0, 0.08); 
    color: #ffdf33; 
    border-color: rgba(255, 215, 0, 0.15);
}
.badge-diamante { 
    background: rgba(185, 242, 255, 0.08); 
    color: #b9f2ff; 
    border-color: rgba(185, 242, 255, 0.2);
    box-shadow: 0 0 8px rgba(185, 242, 255, 0.1);
}

/* ================================================================
   PRODUCT TARGET FILTER TABS
   ================================================================ */
.product-filter-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    width: fit-content;
}

.product-filter-tab {
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.product-filter-tab:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.product-filter-tab.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 12px rgba(239, 68, 68, 0.3);
}

.product-filter-tab .tab-count {
    background: rgba(255, 255, 255, 0.15);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.product-filter-tab.active .tab-count {
    background: rgba(255, 255, 255, 0.25);
}

/* Target badge on product cards */
.product-target-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-top: 6px;
}

.product-target-badge.target-site {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.product-target-badge.target-discord {
    background: rgba(88, 101, 242, 0.15);
    color: #818cf8;
    border: 1px solid rgba(88, 101, 242, 0.25);
}

.product-target-badge.target-both {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.product-card {
    padding: 0;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--glow-primary);
    border-color: rgba(239, 68, 68, 0.25);
}

.product-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 24px 0;
}

.product-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    background: rgba(239, 68, 68, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    transition: var(--transition);
}

.product-card:hover .product-thumb {
    transform: scale(1.05);
    border-color: rgba(239, 68, 68, 0.3);
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info { flex: 1; min-width: 0; }

.product-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.product-price {
    color: var(--color-success);
    font-weight: 700;
    font-size: 1rem;
}

.product-card-body {
    padding: 18px 24px;
}

.product-stock {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.product-stock-count {
    font-weight: 700;
    color: var(--text-primary);
}

.product-card-actions {
    display: flex;
    gap: 8px;
    padding: 0 24px 24px;
    flex-wrap: wrap;
}

.product-card-actions .btn {
    flex: 1;
    min-width: calc(50% - 4px);
}

/* ================================================================
   CHECKER
   ================================================================ */
.checker-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.checker-result {
    padding: 20px 24px;
    border-radius: var(--radius-md);
    margin-top: 16px;
    font-size: 0.95rem;
    animation: slideUp 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.checker-result.approved {
    background: var(--color-success-bg);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--color-success);
    box-shadow: var(--glow-success);
}

.checker-result.declined {
    background: var(--color-danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--color-danger);
    box-shadow: var(--glow-danger);
}

.status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-dot.active { background: var(--color-success); box-shadow: 0 0 8px var(--color-success); }
.status-dot.inactive { background: var(--color-danger); box-shadow: 0 0 8px var(--color-danger); }

/* ================================================================
   CONFIG SECTIONS
   ================================================================ */
.config-section {
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.config-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.config-section-header:hover { 
    background: rgba(255, 255, 255, 0.02); 
}

.config-section-title {
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.01em;
}

.config-section-toggle {
    color: var(--text-muted);
    transition: var(--transition);
    font-size: 1.1rem;
}

.config-section-toggle.open { transform: rotate(180deg); color: var(--text-primary); }

.config-section-body {
    padding: 0 24px 24px;
    display: none;
    animation: fadeIn 0.3s ease;
}

.config-section-body.open { display: block; }

.config-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.config-form-row.single { grid-template-columns: 1fr; }

/* ================================================================
   FILTER TABS
   ================================================================ */
.filter-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.02);
    padding: 5px;
    border-radius: var(--radius-md);
    width: fit-content;
    border: 1px solid var(--border-subtle);
}

.filter-tab {
    padding: 9px 20px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.88rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.filter-tab:hover { color: var(--text-secondary); }

.filter-tab.active {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: var(--glow-primary);
}

/* ================================================================
   TOGGLE SWITCH
   ================================================================ */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
}

.toggle {
    position: relative;
    width: 52px;
    height: 28px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.toggle.active { 
    background: var(--color-primary); 
    border-color: rgba(239, 68, 68, 0.3);
}

.toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.toggle.active::after { left: 27px; }

/* ================================================================
   ADMIN IDS
   ================================================================ */
.admin-id-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.admin-id-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    font-family: 'Inter', monospace;
    font-size: 0.9rem;
}

/* ================================================================
   COUPONS & GIFTS LAYOUT
   ================================================================ */
.coupon-gift-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty-state {
    text-align: center;
    padding: 56px 24px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    display: block;
    opacity: 0.45;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.1));
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 0.9rem;
    max-width: 340px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ================================================================
   LOADING SKELETON
   ================================================================ */
.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.01) 25%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0.01) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite;
    border-radius: var(--radius-sm);
}

.skeleton-line {
    height: 14px;
    margin-bottom: 12px;
    width: 100%;
}

.skeleton-line.short { width: 50%; }
.skeleton-line.medium { width: 75%; }

/* ================================================================
   MODAL
   ================================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 2, 6, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 20px;
    animation: fadeIn 0.25s ease;
}

.modal {
    width: 100%;
    max-width: 540px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 36px;
    position: relative;
    animation: slideUp 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--shadow-modal);
    border: 1px solid var(--border-highlight);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.7rem;
    transition: var(--transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 24px;
    padding-right: 36px;
    letter-spacing: -0.01em;
}

.modal-form .input-group,
.modal-form .form-group {
    margin-bottom: 20px;
}

.form-group { margin-bottom: 20px; }

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 28px;
}

/* ================================================================
   TOAST
   ================================================================ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 600;
    min-width: 250px;
    max-width: 440px;
    pointer-events: auto;
    animation: slideInRight 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid transparent;
}

.toast.toast-exit { animation: slideOutRight 0.3s ease forwards; }

.toast-success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.25);
    color: var(--color-success);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.15);
}

.toast-error {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--color-danger);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.15);
}

.toast-info {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.25);
    color: var(--color-info);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}

.toast-icon { font-size: 1.2rem; flex-shrink: 0; }

/* ================================================================
   DETAIL ROW
   ================================================================ */
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.92rem;
}

.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); }
.detail-value { color: var(--text-primary); font-weight: 600; }

/* ================================================================
   INLINE EDIT
   ================================================================ */
.inline-edit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.inline-edit .input {
    width: 130px;
    padding: 7px 12px;
    font-size: 0.9rem;
}

/* ================================================================
   CARD SECTION
   ================================================================ */
.card-section {
    padding: 24px 28px;
}

.card-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.01em;
}

/* ================================================================
   FILE INPUT
   ================================================================ */
.file-input-wrapper {
    position: relative;
    display: inline-flex;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* ================================================================
   RESPONSIVE â€” Mobile
   ================================================================ */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 68px;
        flex-direction: row;
        border-right: none;
        border-top: 1px solid var(--border-subtle);
        z-index: 100;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        box-shadow: 0 -8px 24px rgba(0,0,0,0.4);
    }

    .sidebar-header { display: none; }
    .sidebar-footer { display: none; }

    .sidebar-nav {
        display: flex;
        padding: 4px;
        overflow-x: auto;
        gap: 0;
        width: 100%;
        justify-content: space-around;
        align-items: center;
    }

    .nav-item {
        flex-direction: column;
        gap: 4px;
        padding: 6px 8px;
        margin: 0;
        min-width: 52px;
        max-width: 80px;
        align-items: center;
        text-align: center;
        border-radius: var(--radius-sm);
        border: none;
        background: transparent;
        flex: 1;
    }

    .nav-item::before { display: none; }

    .nav-label {
        font-size: 0.65rem;
        white-space: nowrap;
    }

    .nav-icon { font-size: 1.15rem; width: auto; }

    .main-content {
        margin-left: 0;
        margin-bottom: 84px;
        padding: 24px 20px;
        width: 100%;
    }

    .stats-grid { grid-template-columns: 1fr 1fr; }
    .checker-grid { grid-template-columns: 1fr; }
    .coupon-gift-grid { grid-template-columns: 1fr; }
    .config-form-row { grid-template-columns: 1fr; }
    .products-grid { grid-template-columns: 1fr; }

    .page-header { flex-direction: column; align-items: flex-start; gap: 14px; }
    #btn-sync-bot { width: 100%; }

    .modal { padding: 28px 24px; max-width: 100%; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}

/* ================================================================
   UTILITY
   ================================================================ */
.text-success { color: var(--color-success) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-primary-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-sm { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.font-mono { font-family: 'Inter', monospace; letter-spacing: 0.02em; }

/* ================================================================
   REDESIGNED CHECKER PAGE
   ================================================================ */
.checker-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
    margin-bottom: 24px;
}

.checker-header-status {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.checker-header-status span.status-text {
    font-weight: 700;
}

.form-row-flex {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.textarea-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.textarea-counter {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.checker-actions-row {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.btn-check-start {
    flex: 1;
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #fff;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

.btn-check-start:hover {
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%);
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

.btn-check-start:disabled {
    background: rgba(239, 68, 68, 0.4);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-check-clear {
    width: 100px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.btn-check-clear:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Status Cards / Rows */
.status-box-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.status-box-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.status-box-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.status-counter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.status-counter-card {
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.01);
}

.status-counter-card.approved {
    border-color: rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.02);
}

.status-counter-card.declined {
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.02);
}

.status-counter-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.status-counter-card.approved .status-counter-header {
    color: var(--color-success);
}

.status-counter-card.declined .status-counter-header {
    color: var(--color-danger);
}

.status-counter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-counter-card.approved .status-counter-dot {
    background: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
}

.status-counter-card.declined .status-counter-dot {
    background: var(--color-danger);
    box-shadow: 0 0 8px var(--color-danger);
}

.status-counter-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.status-counter-card.approved .status-counter-value {
    color: var(--color-success);
}

.status-counter-card.declined .status-counter-value {
    color: var(--color-danger);
}

/* Monospace terminal style for checker logs */
.checker-logs-card {
    margin-top: 24px;
}

.checker-logs-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.checker-logs-terminal {
    background: rgba(5, 5, 10, 0.8);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    height: 220px;
    overflow-y: auto;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #e2e8f0;
}

.checker-log-line {
    border-bottom: 1px solid rgba(255,255,255,0.02);
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.checker-log-line.approved {
    color: var(--color-success);
}

.checker-log-line.declined {
    color: var(--color-danger);
}

.checker-log-line.info {
    color: var(--text-secondary);
}

.checker-log-time {
    color: var(--text-muted);
    flex-shrink: 0;
}

.checker-log-msg {
    word-break: break-all;
}

@media (max-width: 900px) {
    .checker-layout {
        grid-template-columns: 1fr;
    }
}

/* Analytics Responsive Grid */
@media (max-width: 1100px) {
    .analytics-charts-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ===================== LOGIN PANEL ===================== */
.login-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    background: transparent;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-header {
    text-align: center;
}

.login-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.login-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.login-error {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.hidden {
    display: none !important;
}
